首页 > 解决方案 > 下载整个视频文件后,带有远程 url 播放的 react-native-video

问题描述

远程 url 文件越大,播放前的加载时间就越长。

像 html5 视频标签一样,我希望它与下载的部分一起立即播放。(流媒体)

任何可能的解决方案?

<Video
    ignoreSilentSwitch={'ignore'}
    style={[{ height: 211 }, props.style ? props.style : styles.video]}
    source={{ uri }}
    onEnd={onEnd}
    onLoad={onLoad}
    onLoadStart={onLoadStart}
    onProgress={onProgress}
    onSeek={onSeekVideo}
    paused={paused}
    ref={(ref) =>  videoPlayer.current = ref}
    resizeMode={'contain'}
  />
  <MediaControls
    duration={duration}
    isLoading={isLoading}
    mainColor="rgba(255, 255, 255, 0.5)"
    onFullScreen={noop}
    onPaused={onPaused}
    onReplay={onReplay}
    onSeek={onSeek}
    onSeeking={onSeeking}
    playerState={playerState}
    progress={currentTime}
    showOnStart={false}
    fadeOutDelay={10000}
    isFullScreen={isFullScreen}
    onDoubleTab={onDoubleTab}
  >

标签: react-nativereact-native-video

解决方案


推荐阅读