From 44b7f67a2029aafd43d9eb4de7b28561f0f53bcd Mon Sep 17 00:00:00 2001 From: xiaoxie <hotcoffie@163.com> Date: 星期六, 23 四月 2022 23:54:49 +0800 Subject: [PATCH] 在1e2d207aea24b5956d5ece95ed4a9db0f59f34d7这个版本中,作者删除了initData函数,但是忘记删除mounted中的this.mounted() 导致console报错 --- web_src/src/components/dialog/rtcPlayer.vue | 18 +++++++++++------- 1 files changed, 11 insertions(+), 7 deletions(-) diff --git a/web_src/src/components/dialog/rtcPlayer.vue b/web_src/src/components/dialog/rtcPlayer.vue index a7c0212..75c18f3 100644 --- a/web_src/src/components/dialog/rtcPlayer.vue +++ b/web_src/src/components/dialog/rtcPlayer.vue @@ -17,9 +17,13 @@ }, props: ['videoUrl', 'error', 'hasaudio'], mounted () { + let paramUrl = decodeURIComponent(this.$route.params.url) this.$nextTick(() =>{ - console.log("鍒濆鍖栨椂鐨勫湴鍧�涓�: " + this.videoUrl) - this.play(this.videoUrl) + if (typeof (this.videoUrl) == "undefined") { + this.videoUrl = paramUrl; + } + console.log("鍒濆鍖栨椂鐨勫湴鍧�涓�: " + this.videoUrl) + this.play(this.videoUrl) }) }, watch:{ @@ -60,7 +64,7 @@ this.webrtcPlayer.close(); this.play(url) }, 100) - + } }); @@ -69,14 +73,14 @@ // document.getElementById('selfVideo').srcObject=s; this.eventcallbacK("LOCAL STREAM", "鑾峰彇鍒颁簡鏈湴娴�") }); - + }, pause: function () { if (this.webrtcPlayer != null) { this.webrtcPlayer.close(); this.webrtcPlayer = null; } - + }, eventcallbacK: function(type, message) { console.log("player 浜嬩欢鍥炶皟") @@ -106,5 +110,5 @@ /* .iconqingxiLOGO { display: none !important; } */ - -</style> \ No newline at end of file + +</style> -- Gitblit v1.8.0