【问题标题】:react-hls-player streaming videoreact-hls-player 流媒体视频
【发布时间】:2022-08-09 15:52:21
【问题描述】:

我在我的项目中使用 react-hls-player。这是我的示例代码

 const playerRef = useRef();
    return (
      <ReactHlsPlayer
          playerRef={playerRef}
          src=\"http://sample.vodobox.com/planete_interdite/planete_interdite_alternate.m3u8\"
          autoPlay={false}
          controls={true}
          width=\"100%\"
          height=\"auto\"
         
      />
  );

我想知道有什么办法可以改变 hls 的视频质量吗?

    标签: reactjs


    【解决方案1】:

    react-hls-player 在后台使用 hls.js。您可以使用ref 获取 HLS 播放器实例。

    您可以通过在hls.js 中设置currentLevel 来更改级别(视频质量)

    请参阅documentation 了解更多信息。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2012-11-20
      • 2020-07-06
      • 1970-01-01
      • 1970-01-01
      • 2016-08-30
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多