From 9e5fc93acf25800c8a989aaa86358bc86ba00cb1 Mon Sep 17 00:00:00 2001 From: "@fawn-nine" <1271023382@qq.com> Date: Wed, 16 Oct 2024 11:52:33 +0800 Subject: [PATCH] =?UTF-8?q?=E6=92=AD=E6=94=BE=E5=99=A8=E5=BE=AE=E8=B0=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../commonComponents/video/index.vue | 44 ++++++------------- 1 file changed, 13 insertions(+), 31 deletions(-) diff --git a/pages/component/commonComponents/video/index.vue b/pages/component/commonComponents/video/index.vue index 4cf207c..e8ab36c 100644 --- a/pages/component/commonComponents/video/index.vue +++ b/pages/component/commonComponents/video/index.vue @@ -579,7 +579,7 @@ }, // renderjs阿里云播放器引入与配置 getLive() { - console.log('这是这只只是666666:', this.firstTime, this.videoData) + console.log('阿里云播放器引入与配置:', this.firstTime, videoData) $('#url-player-test').empty(); @@ -715,18 +715,17 @@ } - if (this.videoData.type == 1) { - if (this.videoData.m3u8Url == null || this.videoData.m3u8Url == '') { + if (videoData.type == 1) { + if (videoData.m3u8Url == null || videoData.m3u8Url == '') { console.log('这是私有加密的视频'); if (this.$platform == 'ios') { this.$refs.videoContent5.click() } else { playerOptions = { ...playerOptions, - "vid": this.videoData - .videoId, // 必选参数,可以通过点播控制台(路径:媒资库>音/视频)查询。示例:1e067a2831b641db90d570b6480f****。 + "vid": videoData.videoId, // 必选参数,可以通过点播控制台(路径:媒资库>音/视频)查询。示例:1e067a2831b641db90d570b6480f****。 - "playauth": this.videoData.playAuth, // 必选参数,参数值可通过调用GetVideoPlayAuth接口获取。 + "playauth": videoData.playAuth, // 必选参数,参数值可通过调用GetVideoPlayAuth接口获取。 "encryptType": 1, // 必选参数,当播放私有加密流时需要设置本参数值为1。其它情况无需设置。 "playConfig": { "EncryptType": 'AliyunVoDEncryption' @@ -734,19 +733,19 @@ } console.log('这是私有加密的视频'); } - } else if (this.videoData.m3u8Url != null || this.videoData.m3u8Url != '') { + } else if (videoData.m3u8Url != null || videoData.m3u8Url != '') { playerOptions = { ...playerOptions, - source: this.videoData.m3u8Url, + source: videoData.m3u8Url, // "playConfig": {"EncryptType": "HLSEncryption"} } - console.log('这是标准加密的视频', this.videoData.id, this.videoData.m3u8Url); + console.log('这是标准加密的视频', videoData.id, videoData.m3u8Url); } } else { playerOptions = { ...playerOptions, - source: this.videoData.videoUrl + source: videoData.videoUrl } console.log('这是没有加密的视频'); } @@ -874,25 +873,8 @@ // 监听视频参数变化,并赋值给常量 receiveMsg(newValue, oldValue, ownerVm, vm) { //数据变化 - videoData = newValue - if (videoData) { - return - console.log('切换后的播放数据videoData', videoData.type); - if (videoData.type == 1) { - if (videoData.m3u8Url != '' && videoData.m3u8Url != null) { - // myplayer.source(videoData.m3u8Url) - myplayer.loadByUrl(videoData.m3u8Url) - console.log('切换走了吗?m3u8'); - } else { - myplayer.replayByVidAndPlayAuth(videoData.videoId, videoData.playAuth) - console.log('切换走了吗?私有加密'); - } - } else { - myplayer.loadByUrl(videoData.videoUrl) - console.log('切换常规视频'); - } - } - // console.log('可能是切换视频', videoData, ); + videoData = newValue + }, receiveWinWidth(newValue, oldValue, ownerVm, vm) { //数据变化 @@ -904,8 +886,8 @@ }, // 检测是否传入播放参数 checkValue() { - console.log(this.videoId, this.authId, this.videoData, "1111888888") - if ((!this.videoData.playAuth || !this.currentVideoList)) { + console.log(this.videoId, this.authId, videoData, "1111888888") + if ((!videoData.playAuth || !this.currentVideoList)) { setTimeout(() => { this.checkValue(); }, 1000);