Vue中使用ckplayer播放视频

Vue.js中如何使用ckplayer播放视频

1、将文件导入到static目录下,目录结构如下图

Vue中使用ckplayer播放视频_第1张图片

2、在index.html中引入ckplayer.js文件

在这里插入图片描述

3、html代码

<div id="ckplayera" class="video active"></div>

4、js代码

ckplayerb(){
   setTimeout(function(){
      var videoObjects = {
         width:1000,
         height:400,
         container:"#ckplayera",
         variable:"player",
         autoplay:true,
         live:true,
         video:"rtmp://......"
      }
      let player = new ckplayer(videoObjects)
   },2);
}

附带几个rtmp地址可供测试:

  1. rtmp://live.hkstv.hk.lxdns.com/live/hks1
  2. rtmp://live.hkstv.hk.lxdns.com/live/hks2
  3. rtmp://202.69.69.180:443/webcast/bshdlive-pc
  4. rtmp://ns8.indexforce.com/home/mystream
  5. rtmp://media3.sinovision.net:1935/live/livestream

你可能感兴趣的:(Vue中使用ckplayer播放视频)