react-native - 在 react-native-video selectedVideoTrack 道具中不起作用
问题描述
我正在使用 react-native-video 来显示 hls 视频。
视频链接:- https://test-streams.mux.dev/x36xhzz/x36xhzz.m3u8
由于视频在 hls 中,我需要手动或自动更改视频的质量但我无法使用 react-native-video 来实现这一点。我也使用 reactjs 为网络完成了此操作,并且做得非常成功。我还通过添加 react-native.config.js 文件并粘贴这些代码为 react-native-video 设置了 exoplayer。
module.exports = {
dependencies: {
'react-native-video': {
platforms: {
android: {
sourceDir: '../node_modules/react-native-video/android-exoplayer',
},
},
},
},
};
但我的问题是大多数道具在这个播放器中不起作用。由于 selectedVideoTrack 永远不会工作。
视频组件代码:
<Video
ref={videoRef}
source={{
uri: 'https://test-streams.mux.dev/x36xhzz/x36xhzz.m3u8',
}}
resizeMode={'contain'}
style={styles.fullscreenVideo}
fullscreen={true}
hls={true}
rate={1.0}
volume={1}
muted={false}
repeat={false}
playInBackground={false}
playWhenInactive={false}
minLoadRetryCount={5}
selectedVideoTrack={{
type: 'resolution',
value: 240,
}}
onError={(err) => {
console.error(err);
}}
onSeek={(data) => {
console.log(`seeked data `, data);
}}
onBuffer={(data) => {
console.log('buffer data is ', data);
}}
reportBandwidth={true}
onBandwidthUpdate={(data) => console.log('bandwidth updated', data)}
selectedVideoTrack={{
type: 'resolution',
value: 360,
}}
/>
如果有人可以建议我其他一些方法来实现这一点,请
解决方案
推荐阅读
- android - 为什么升级到 jetpack compose 1.0.0-beta01 后没有隐式导入 kotlin.collections?
- python - 正则表达式捕获每行引号内的第一个文本组
- c++ - Qt 创建者 Xbox One 控制器输入
- visual-studio - Visual Studio 在停靠窗口上崩溃
- python - 在同一轴上绘制 Matplotlib 中的两个图像
- vue.js - 客户端渲染的虚拟 DOM 树与服务器渲染的内容不匹配
- r - 如何结合两个因素使过滤更快?
- java - 如何通过外键找到数据集表中条目数量较少的行?
- qt - QTCreator 4.14.1 (Python) 中的错误:找不到匹配“ui_form.h”的文档
- java - 在java中将字符串转换为long