1.引入JS和CSS包直接撸!
复制代码
2.在HTML中放入容器,这里选择通过JS控制。
html:
To view this video please enable JavaScript, and consider upgrading to a web browser that s upports HTML5 video
复制代码
JS:
复制代码
3.关于动态设置播放URL:
//视频配置
player = videojs(document.getElementById('myVideo'), {
sources:[ // 视频源
{
src: 'rtmp://192.168.168.10:1935/live/room1226752779',
type: 'rtmp/flv',
}
]
})
var data = {
// src: res.result[1].rtmpUrl,
// src:"rtmp://192.168.168.10:1935/live/room1508839421",
src:res.result[1].rtmpUrl,
type: 'rtmp/flv'
}
player.src(data)
player.load(data)
复制代码
转自:https://segmentfault.com/a/1190000018914486?utm_source=tag-newest
作者: Bill 本文地址: http://biaoblog.cn/info?id=1571103960000
版权声明: 本文为原创文章,版权归 biaoblog 个人博客 所有,欢迎分享本文,转载请保留出处,谢谢!