I use OBS to stream live to my local rtmp server (node-rtsp-rtmp-server) and it works well with the VLC media player. I just want to put it in a webpage and I found videojs. It didn’t work and returns the specified type “rtmp / mp4 attribute” is not supported. It
seems my rtmp server did not give any requests from this web page. So what did I miss? Here is my code:
<head>
<meta charset="utf-8">
<link href="./video-js-6.0.0/video-js.css" rel="stylesheet">
<script src="./video-js-6.0.0/video.js"></script>
<script src="./video-js-6.0.0/videojs-flash.min.js"></script>
<script>
videojs.options.flash.swf = "./video-js-6.0.0/video-js.swf"
</script>
</head>
<body>
<video id='vid' class='video-js' controls height=300 width=600>
<source src="rtmp://127.0.0.1:1935/live/pokemon" type="rtmp/mp4"/>
</video>
<script>
var player = videojs('vid');
</script>
</body>
source
share