码迷,mamicode.com
首页 > 其他好文 > 详细

H5浏览器播放RTMP直播流

时间:2018-05-07 17:46:19      阅读:4470      评论:0      收藏:0      [点我收藏+]

标签:doc   data   type   lis   ready   title   浏览器   http   listener   

<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Insert title here</title>
<link href="http://vjs.zencdn.net/5.19/video-js.min.css" rel="stylesheet">
<script src="http://vjs.zencdn.net/5.19/video.min.js"></script>
</head>
<body>
<video
id="my-player"
class="video-js"
controls
preload="auto"
poster="//vjs.zencdn.net/v/oceans.png"
data-setup=‘{}‘>
<source src=‘rtmp://live.hkstv.hk.lxdns.com/live/hks‘ type=‘rtmp/flv‘/>
</p>
</video>
<script type="text/javascript">
var player = videojs(‘my-player‘);
var options = {};

var player = videojs(‘my-player‘, options, function onPlayerReady() {
videojs.log(‘Your player is ready!‘);
// In this context, `this` is the player that was created by Video.js.
this.play();
// How about an event listener?
this.on(‘ended‘, function() {
videojs.log(‘Awww...over so soon?!‘);
});
});

</script>
</body>
</html>

H5浏览器播放RTMP直播流

标签:doc   data   type   lis   ready   title   浏览器   http   listener   

原文地址:https://www.cnblogs.com/lidabo/p/9003697.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!