iOS视频播放器需要5到10秒的时间来播放远程.mp3

时间:2019-04-28 10:49:32

标签: react-native react-native-video

当播放远程uri媒体文件(.mp3)时,IOS播放器会在2-3秒内加载它,但此后需要10秒钟才能开始播放。

以下是触发侦听器时的日志: https://imgur.com/txmaR4P

如您所见,首先是onLoadStart触发器,然后是onLoad,这意味着文件已经加载并且应该立即播放(在Exoplayer上发生)。但是在IOS上,我们可以看到播放加载文件之前的延迟。

有趣的是,如果加载了.mp4,它的播放速度会更快。 也许这是IOS视频播放器的预期行为?

<Video
  repeat
  ignoreSilentSwitch={"ignore"}
  progressUpdateInterval={50}
  playInBackground={false}
  playWhenInactive={false}
  resizeMode="cover"
  source={{ uri: `http://file-examples.com/wp-content/uploads/2017/11/file_example_MP3_5MG.mp3` }}
  ref={ref => (this.player = ref)}
  onLoad={this.onVideoLoad}
  onLoadStart={this.onLoadStart}
  onProgress={this.onPlayerProgress}
  onEnd={this.onPlaybackEnd}
  onError={this.onVideoLoadError}
  onBuffer={this.onVideoBuffer}
  style={{ flex: 1 }}
  controls={false}
  paused={playerPause}
/>

0 个答案:

没有答案
相关问题