【问题标题】:Show Timer while playing video using react-native-video使用 react-native-video 播放视频时显示计时器
【发布时间】:2018-05-26 10:50:36
【问题描述】:

我的项目要求在播放视频时显示计时器。我知道 React Native 中有可用的库,但我的要求是在视频播放器下方显示计时器。随着视频的进行,时间应该会减少,直到视频完成。请帮帮我。

提前致谢:)

【问题讨论】:

    标签: react-native duration react-native-video


    【解决方案1】:

    最后我自己解决了。

    我只是使用了以下方法:

    <Video
              resizeMode={'contain'}
              style={{ height: 312 }}
              url={url}
              placeholder={"https://baconmockup.com/300/200/"}
              onProgress={e => this.progress(e)}
              ref={(ref) => { this.video = ref }}
            />
    
    progress(e) {
        console.warn('Time' + parseInt(e.currentTime))
      }
    

    我正在使用 react-native-af-video-player 并且 onProgress 解决了我由 react-native-video 提供的目的。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2020-01-28
      • 1970-01-01
      • 2019-12-16
      • 2019-05-24
      • 1970-01-01
      • 2022-12-15
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多