如何在React.js的video标签中播放RTMP视频?

时间:2019-07-12 12:58:25

标签: reactjs video.js rtmp

我有一个网址rtmp,我想使用video.js在浏览器中播放该视频

代码

function App() {
return (
  <div className="App">       
   <video id='my-video' class='video-js' controls preload='auto' width='640' height='264'
  poster='MY_VIDEO_POSTER.jpg' data-setup='{}'>
  <source src='rtmp://192.168.1.13/live/marvel-avengers' type='video/mp4' />    
<p class='vjs-no-js'>
  To view this video please enable JavaScript, and consider upgrading to a web browser that
  <a href='https://videojs.com/html5-video-support/' target='_blank'>supports HTML5 video</a>
</p>
</video>
</div>
      );
}

index.html中,我放置了此CSS和js链接。

 <link href="https://vjs.zencdn.net/5.11/video-js.min.css" rel="stylesheet" />    
  <script src="https://vjs.zencdn.net/5.11/video.min.js"></script>

Issue

将类型更改为rtmp/mp4后,我在播放器中收到此错误。

Error

0 个答案:

没有答案