web
7 天以前 57a0e64f1617aabcad385b67cc6fc9fee8062a4b
src/components/VideoPlayer/VideoPlayer.vue
@@ -18,6 +18,10 @@
    item: {
      type: Object,
      default: {}
    },
    autoPlay: {
        type: Boolean,
        default: false
    }
});
@@ -67,7 +71,8 @@
    showPause.value = false;
}
const init = () => {
// 实例化dom节点
const initDom = async () => {
   videojsb.value = new window.Jessibuca(
      Object.assign({
         container: videoRef.value,
@@ -93,6 +98,15 @@
            heartTimeoutReplay:false,
      })
   );
}
// 初始化
const init = async () => {
    await initDom()
    // 自动播放
    if(props.autoPlay && props.item.deviceId && props.item.channelId) {
        handlePlayer()
    }
};
onMounted(() => {