【发布时间】:2018-11-30 10:08:04
【问题描述】:
使用 videojs 播放 rtmp 视频花了我几个小时。谁能给出一个可以运行的例子吗?
我正在使用铬。 Flash 已启用。
下面是我的代码。视频网址有效。谁能让它运行?
<html>
<head>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/video.js@7.3.0/dist/video-js.min.css">
<script src="https://cdn.jsdelivr.net/npm/video.js@7.3.0/dist/video.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/videojs-flash@2.1.2/dist/videojs-flash.min.js"></script>
</head>
<body>
<video width="600"
height="400"
id="example"
class="video-js vjs-default-skin vjs-big-play-centered"
controls
autoplay
preload="auto"
data-setup='{"techorder" : ["flash","html5"] }'>
<source src="rtmp://rtmp.open.ys7.com/openlive/f01018a141094b7fa138b9d0b856507b.hd" type="rtmp/mp4">
</video>
</body>
<script>
var player = videojs('example');
player.play();
</script>
</html>
【问题讨论】:
标签: javascript video streaming video.js rtmp