【问题标题】:Does react-native-video supports live streaming from hls url?react-native-video 是否支持来自 hls url 的直播?
【发布时间】:2020-09-08 10:46:04
【问题描述】:

我正在使用 react-native-video 来处理 hls 网址。它适用于 box react-native run-android 但在构建 bundleRelease 后,直播视频无法播放

【问题讨论】:

标签: react-native http-live-streaming react-native-video


【解决方案1】:

简单的答案是肯定的! this package will help you ! 首先安装它使用

sudo npm -g i react-hls-player

在您的项目中使用

导入包
import React from 'react';
import ReactDOM from 'react-dom';
import ReactHlsPlayer from 'react-hls-player';

然后渲染它

ReactDOM.render(
  <ReactHlsPlayer
    src="https://bitdash-a.akamaihd.net/content/sintel/hls/playlist.m3u8"
    hlsConfig={{
      maxLoadingDelay: 4,
      minAutoBitrate: 0,
      lowLatencyMode: true,
    }}
  />,
  document.getElementById('app')
);

简单粗暴!

【讨论】:

  • 问题是关于 React-Native。
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 2015-06-05
  • 2020-05-13
  • 1970-01-01
  • 1970-01-01
  • 2018-03-17
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多