|  |  | 
 |  |  |     name: 'rtcPlayer', | 
 |  |  |     data() { | 
 |  |  |         return { | 
 |  |  |             webrtcPlayer: null | 
 |  |  |             webrtcPlayer: null, | 
 |  |  |             timer: null | 
 |  |  |         }; | 
 |  |  |     }, | 
 |  |  |     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:{ | 
 |  |  | 
 |  |  |                 this.eventcallbacK("OFFER ANSWER ERROR ", "offer anwser 交换失败") | 
 |  |  |                 if (e.code ==-400 && e.msg=="流不存在"){ | 
 |  |  |                     console.log("111111") | 
 |  |  |                     setTimeout(()=>{ | 
 |  |  |                     this.timer = setTimeout(()=>{ | 
 |  |  |                         this.webrtcPlayer.close(); | 
 |  |  |                         this.play(url) | 
 |  |  |                     }, 100) | 
 |  |  |                      | 
 |  |  |  | 
 |  |  |                 } | 
 |  |  |             }); | 
 |  |  |  | 
 |  |  | 
 |  |  |                 // 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 事件回调") | 
 |  |  |             console.log(type) | 
 |  |  |             console.log(message) | 
 |  |  |         } | 
 |  |  |     }, | 
 |  |  |     destroyed() { | 
 |  |  |         clearTimeout(this.timer); | 
 |  |  |     }, | 
 |  |  | } | 
 |  |  | </script> | 
 |  |  | 
 |  |  |     /* .iconqingxiLOGO { | 
 |  |  |         display: none !important; | 
 |  |  |     } */ | 
 |  |  |      | 
 |  |  | </style> | 
 |  |  |  | 
 |  |  | </style> |