<template>
<div id="id_test_video" style="width:100%; height:auto;"></div>
</template>
<script> export default { data() { return { } }, mounted(){ this.play(); }, methods: { play(){ var player = new TcPlayer("id_test_video", { "m3u8":"http://weblive.hebtv.com/live/hbws_bq/index.m3u8", "autoplay" :true, "poster": '', // 封面
"width" : "1280",//視頻的顯示寬度,請盡量使用視頻分辨率寬度
"height" : "720"//視頻的顯示高度,請盡量使用視頻分辨率高度
}); } } }; </script>
<style>
</style>
// 如果需要清除dom 可以在div上加ref處理;this.$refs.xx.innerHtml = '';多次調用在paly()方法下面寫上這句;
文檔地址參考:https://cloud.tencent.com/document/product/454/7503;
引入方式 https://www.npmjs.com/package/tcplayer;或index.html引入
<script src="http://imgcache.qq.com/open/qcloud/video/vcplayer/TcPlayer.js" charset="utf-8"></script>