我正在React Native中构建一个项目,我使用了react-native-video依赖项来播放视频流,但是当文件为m3u8时它什么都不会播放。会是文件编解码器吗?
以其他格式可以成功播放视频,但是无法输入此网址。
这是我在“视频”组件中的配置:
版本:4.3.1
<Video source={{uri:
"https://s3.amazonaws.com/yojma/hls/movie/yvZmxnCwaHGSLUpKFzoTlYrOXRdWQgePIqihbfcs/main.m3u8",
type:"m3u8"} }/>
这在app / build.gradle中:
dependencies { compile project(':react-native-video-exoplayer')
implementation "com.facebook.react:react-native:+" // From node_modules
implementation fileTree(dir: "libs", include: ["*.jar"]) implementation
"com.android.support:appcompat-v7:${rootProject.ext.supportLibVersion}"
}
此设置等级:
rootProject.name = 'Yojma' include ':react-native-video-exoplayer'
project(':react-native-video-exoplayer').projectDir = new
File(rootProject.projectDir, '../node_modules/react-native-
video/android-exoplayer') include ':app'
答案 0 :(得分:-1)
某些工作,例如我没有使用,它对我有用
<Video
source={{ uri: 'http://qthttp.apple.com.edgesuite.net/1010qwoeiuryfg/sl.m3u8' }}
rate={1.0}
volume={1.0}
isMuted={false}
resizeMode="cover"
shouldPlay={false}
useNativeControls={true}
isLooping
style={{ width: 300, height: 300 }}
/>
</View>