[英]I can not play video with m3u8 format
我正在用 React Native 构建一个项目,我使用 react-native-video 依赖来播放视频流,但是当文件是 m3u8 时它不播放任何内容。 它会是文件编解码器吗?
其他格式的视频播放成功,但是输入这个url不行。
这是我在 Video 组件中的配置:
版本: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}"
}
而这个 settings.gradle:
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'
一些工作和其他人不是例如我使用这个并且它对我有用
<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>
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.