Far*_*eed 4 android video-streaming http-live-streaming m3u8 react-native
我正在搜索文档,但尚未成功找到示例代码.我需要从我的流服务器播放视频.有什么办法吗?或者可能是react-js不支持Android上的视频.
小智 7
是的.我花了一段时间才弄明白,但解决方案很简单.
使用跨平台iOS和Android的react-native-video组件.
实施: 不能简单......
<Video source={{ uri: 'http://STREAM_URL/playlist.m3u8' }} />
Run Code Online (Sandbox Code Playgroud)
在iOS和Android上播放实时HLS .m3u8流的提示:
在iOS上: 确保在info.plist上的App Transport Security Settings上允许流的源域作为例外域.在测试时,我将"允许任意负载"设置为YES.在我这样做之前,流根本没有通过.
在Android上: 使用react-native-video 1.0中引入的新exoplayer变体.以下是如何启用:#426(评论)
| 归档时间: |
|
| 查看次数: |
5666 次 |
| 最近记录: |