diff --git a/src/utils/inject.js b/src/utils/inject.js index 9715ecb..a39ce2e 100644 --- a/src/utils/inject.js +++ b/src/utils/inject.js @@ -78,7 +78,7 @@ Vue.prototype.$storeBoard = Vue.observable({ search: {} }) Vue.component("HlsPlayer", { - render: (h) => h('div', {style: {width: '100%', height: '100%'}}), + render: (h) => h('div', {style: {width: '100%', height: '100%'}, on: {dbclick: () => this.player.play()}}), props: { id: {default: ""}, url: {default: "https://open.ys7.com/v3/openlive/155715496_1_1.m3u8?expire=1747359002&id=712960386311127040&t=c9c6ad362940b1fb4ea7a736cec78980aa9ad1d27d6e3eddf75788c0564e9d7b&ev=100"} @@ -89,7 +89,7 @@ Vue.component("HlsPlayer", { } }, mounted() { - const {Clappr, EzuikitFlv, EZUIKit} = window + const {EzuikitFlv} = window if (EzuikitFlv && this.url) { const {id} = this.$props this.$el.id = id @@ -99,36 +99,10 @@ Vue.component("HlsPlayer", { decoder: "/presource/datascreen/js/ezuikit-flv/decoder.js" }) this.player.play() + this.$el.addEventListener('dblclick', () => { + this.player.fullScreen() + }) } - // if (EZUIKit && this.url) { - // const {id} = this.$props - // this.$el.id = id - // this.player = new EZUIKit.EZUIKitPlayer({ - // id, // 视频容器ID - // width: '100%', // 播放器宽度,播放器高度会按比例缩放 - // height: '100%', - // accessToken: 'at.c1lrqlq7ae1hj18tbpe9q8ip4hhrbfcw-7ax2lsg0rz-06anrcm-tcd5wjaz9', - // url: 'ezopen://open.ys7.com/BA9983755/1.live', - // }) - // this.player.play() - // } - - // if (Clappr && this.url) { - // this.player = new Clappr.Player({ - // mute: true, //静音为true - // width: '100%', - // height: '100%', - // source: this.url, - // autoPlay: true, - // disableCanAutoPlay: true, //禁用检测浏览器是否可以自动播放视频 - // hideMediaControl: true, //禁用媒体控制自动隐藏 - // hideMediaControlDelay: 100, //更改默认的媒体控件自动隐藏超时值 - // hideVolumeBar: true, //当嵌入的宽度小于320时,音量条将被隐藏 - // exitFullscreenOnEnd: false, //禁用播放器将在媒体结束时自动退出全屏显示,即播放结束后不会退出全屏 - // mediacontrol: {seekbar: "#000", buttons: "#FFF"}, //定义进度条和底部暂停等图标的颜色 - // }) - // this.player.attachTo(this.$el) - // } }, beforeDestroy() { this.player?.destroy()