| | |
| | | this.stopPlayRecord(); |
| | | } |
| | | this.recordPlay = '' |
| | | if (this.broadcastStatus === 1) { |
| | | this.stopBroadcast() |
| | | } |
| | | }, |
| | | |
| | | copySharedInfo: function (data) { |
| | |
| | | } |
| | | }); |
| | | }else if (this.broadcastStatus === 1) { |
| | | this.broadcastRtc.close() |
| | | this.broadcastRtc = null; |
| | | this.broadcastStatus = -1; |
| | | this.stopBroadcast() |
| | | } |
| | | }, |
| | | startBroadcast(url){ |
| | |
| | | }); |
| | | this.broadcastRtc.on(ZLMRTCClient.Events.WEBRTC_ON_CONNECTION_STATE_CHANGE,(e)=>{// offer anwser 交换失败 |
| | | console.log('状态改变',e) |
| | | if (e === "failed") { |
| | | this.broadcastStatus = -1; |
| | | }else if (e === "connecting") { |
| | | if (e === "connecting") { |
| | | this.broadcastStatus = 0; |
| | | }else{ |
| | | }else if (e === "connected") { |
| | | this.broadcastStatus = 1; |
| | | }else { |
| | | this.broadcastStatus = -1; |
| | | } |
| | | }); |
| | | this.broadcastRtc.on(ZLMRTCClient.Events.CAPTURE_STREAM_FAILED,(e)=>{// offer anwser 交换失败 |
| | |
| | | type: 'error' |
| | | }); |
| | | }); |
| | | }, |
| | | stopBroadcast(){ |
| | | this.broadcastRtc.close() |
| | | this.broadcastRtc = null; |
| | | this.$axios({ |
| | | method: 'get', |
| | | url: '/api/play/broadcast/stop/' + this.deviceId + '/' + this.channelId |
| | | }).then( (res)=> { |
| | | if (res.data.code == 0) { |
| | | // this.broadcastStatus = -1; |
| | | |
| | | }else { |
| | | this.$message({ |
| | | showClose: true, |
| | | message: res.data.msg, |
| | | type: "error", |
| | | }); |
| | | } |
| | | }); |
| | | |
| | | } |
| | | } |
| | | }; |