From 027912863785e73e9b00915cedf5be492fcecd40 Mon Sep 17 00:00:00 2001 From: luyuan <1162963624@qq.com> Date: Sat, 8 Aug 2020 18:34:43 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A7=A3=E5=86=B3=E4=BA=86=E4=B8=8D=E5=87=BA?= =?UTF-8?q?=E7=8E=B0=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- App.vue | 2 ++ pages/release/zhibo.nvue | 34 +++++++++++++++++++++++----------- 2 files changed, 25 insertions(+), 11 deletions(-) diff --git a/App.vue b/App.vue index 01c3563..3bfc11b 100644 --- a/App.vue +++ b/App.vue @@ -18,5 +18,7 @@ export default { diff --git a/pages/release/zhibo.nvue b/pages/release/zhibo.nvue index ef4504d..21097e3 100644 --- a/pages/release/zhibo.nvue +++ b/pages/release/zhibo.nvue @@ -5,7 +5,7 @@ aspect="9:16" @statechange="statechange" @netstatus="netstatus" @error = "error" :style="{'height':height + 'px'}" > -
+
@@ -319,17 +319,27 @@ }, onReady() { // 注意:需要在onReady中 或 onLoad 延时 - this.context = uni.createLivePusherContext("livePusher", this); - this.startPreview() let that = this - uni.getSystemInfo({ - success(a){ - console.log(a.windowHeight) - that.height = a.windowHeight - // that.start() - - } - }) + setTimeout(()=>{ + uni.getSystemInfo({ + success(a){ + console.log(a.windowHeight,1212) + that.height = a.windowHeight + // that.start() + setTimeout(()=>{ + that.context = uni.createLivePusherContext("livePusher", that); + that.startPreview() + + + + },500) + + } + }) + + + },500) + }, onLoad(a){ @@ -519,6 +529,7 @@ }, statechange(e) { console.log("statechange:" + JSON.stringify(e)); + console.log(e) }, netstatus(e) { // console.log("netstatus:" + JSON.stringify(e)); @@ -527,6 +538,7 @@ console.log("error:" + JSON.stringify(e)); }, start: function() { + console.log("开始") console.log(this.url) this.context.start({ success: (a) => {