react-native-video:如何手动选择视频质量

时间:2021-05-30 18:59:26

I am building an app for video streaming using HLS from s3.

我正在使用来自s3的HLS构建用于视频流的应用程序。

I want to support the functionality to select Video Quality.

我想支持选择视频质量的功能。

Still unable to find how to select the desired quality.

仍然无法找到如何选择所需的质量。

Can any one please help me in this issue. If some one knows some react-native api or some other solution, please help.

任何人都可以帮我解决这个问题。如果有人知道某些反应原生api或其他解决方案,请帮助。

Thanks

1 个解决方案

#1


0  

If you have multiple quality renditions in your HLS video, you could use hls.js for the playback component. Normally this will just switch playback for you, but you can control this manually with the Quality Switch API.

如果您的HLS视频中有多个质量再现,则可以将hls.js用于播放组件。通常这只会为您切换播放,但您可以使用Quality Switch API手动控制播放。

I.e. you would get the available qualities using hls.levels and then iterate through them. Then set hls.currentLevel tot he desired quality.

即你将使用hls.levels获得可用的质量,然后迭代它们。然后设置hls.currentLevel tot他想要的质量。

#1


0  

If you have multiple quality renditions in your HLS video, you could use hls.js for the playback component. Normally this will just switch playback for you, but you can control this manually with the Quality Switch API.

如果您的HLS视频中有多个质量再现,则可以将hls.js用于播放组件。通常这只会为您切换播放,但您可以使用Quality Switch API手动控制播放。

I.e. you would get the available qualities using hls.levels and then iterate through them. Then set hls.currentLevel tot he desired quality.

即你将使用hls.levels获得可用的质量,然后迭代它们。然后设置hls.currentLevel tot他想要的质量。