ckplayer---vue

1、下载ckplayer.zip包

http://www.ckplayer.com/down/

2、解压把ckplayer放进vue的static下

3、index.html引入ckplayer.js

<script src="static/ckplayer/ckplayer.js"></script>

4、组件简单页面使用

html:

<div class="video active" style="width: 300px;height: 300px" id="ckplayera"></div>
<div class="video active" style="width: 300px;height: 300px" id="ckplayerb"></div>

script: 

methods:
ckplayera () {
setTimeout(function () {
var videoObject = {
container: '#ckplayera', // 容器的ID或className
variable: 'player1', // 播放函数名称 与下面一致
autoplay: true, // 是否自动播放
live: true, // 是否是直播视频 true = 直播,false = 点播
mobileCkControls: false, // 是否在移动端(包括ios)环境中显示控制
video: 'http://hls01open.ys7.com/openlive/3c417b6d4.m3u8' // hls地址
}
let player1 = new ckplayer(videoObject)
}, 2)
},
ckplayerb () {
console.log('rtmp')
setTimeout(function () {
var videoObjects = {
container: '#ckplayerb',
variable: 'player2',
autoplay: true,
live: true,
mobileCkControls: false,
video: 'rtmp://rtmp01open.ys7.com/openlive/3c417bd16df54d26bb77240b04b8e6d4' // trmp
}
let player2 = new ckplayer(videoObjects)
}, 2)
}

 

created () {
this.ckplayera()
this.ckplayerb()
}

 

转载于:https://www.cnblogs.com/luckyShuang/p/11394893.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值