2 Revize 23f1588273 ... 83e91119a9

Autor SHA1 Zpráva Datum
  kindring 83e91119a9 style: webrtc事件增加 před 1 týdnem
  kindring 4e56997cb3 fix: 修复不自动切换播放器的异常问题 před 1 týdnem

+ 2 - 0
web_src/public/static/js/ZLMRTCClient.js

@@ -7537,10 +7537,12 @@ var ZLMRTCClient = (function (exports) {
 	  }
 
 	  _onIceCandidateError(event) {
+		log('onIceCandidateError:', event);
 	    this.dispatch(Events$1.WEBRTC_ICE_CANDIDATE_ERROR, event);
 	  }
 
 	  _onconnectionstatechange(event) {
+		log(this.TAG, 'connectionstatechange:', event);
 	    this.dispatch(Events$1.WEBRTC_ON_CONNECTION_STATE_CHANGE, this.pc.connectionState);
 	  }
 

+ 10 - 3
web_src/src/assets/ZLMRTCClient.js

@@ -2604,10 +2604,17 @@ let ZLMRTCClient = (function (exports) {
 	  RTCPeerConnection.prototype.onicecandidate = null;
 	  RTCPeerConnection.prototype.onaddstream = null;
 	  RTCPeerConnection.prototype.ontrack = null;
-	  RTCPeerConnection.prototype.onremovestream = null;
+	  RTCPeerConnection.prototype.onremovestream = function() {
+		  console.log("onremovestream");
+	  };
 	  RTCPeerConnection.prototype.onsignalingstatechange = null;
-	  RTCPeerConnection.prototype.oniceconnectionstatechange = null;
-	  RTCPeerConnection.prototype.onconnectionstatechange = null;
+	  RTCPeerConnection.prototype.oniceconnectionstatechange = function() {
+		  console.log("oniceconnectionstatechange");
+		  
+	  };
+	  RTCPeerConnection.prototype.onconnectionstatechange = function() {
+		  console.log("onconnectionstatechange");
+	  };
 	  RTCPeerConnection.prototype.onicegatheringstatechange = null;
 	  RTCPeerConnection.prototype.onnegotiationneeded = null;
 	  RTCPeerConnection.prototype.ondatachannel = null;

+ 14 - 9
web_src/src/components/com/livePlayBox.vue

@@ -17,7 +17,7 @@ const playList = [
     key: "webrtc",
     text: "webrtc 播放器",
     description: "延迟较低的播放器,需要浏览器支持",
-    support: ['h264'],
+    support: ['h264', 'h265'],
     disable: false
   },
   {
@@ -142,17 +142,18 @@ export default {
     },
     findPlayer(videoType, audioType)
     {
+      console.log(`search player ${videoType}, ${audioType}`)
       return playList.find(item => {
         // 判断播放器是否同时支持 视频与音频
         if (item.support.includes(videoType) &&
             item.support.includes(audioType))
         {
           return true;
-        } else if (item.support.includes(videoType))
+        }
+        else if (item.support.includes(videoType))
         {
           return true;
         }
-
       })
     },
 
@@ -260,13 +261,17 @@ export default {
           this.fps = fps;
           if (isFirst) {
             if (isH265) {
-              let h265Player = this.findPlayer();
-              console.log("265视频流,切换为默认播放器");
-              this.activePlayer = h265Player.key;
-            } else {
-              console.log("使用默认播放器");
-              this.activePlayer = playList[0].key;
+              // 判断是否为
+              let h265Player = this.findPlayer(isH265?'h265':'h264');
+              if (h265Player)
+              {
+                console.log("265视频流,切换为默认播放器");
+                this.activePlayer = h265Player.key;
+                return;
+              }
             }
+            console.log("使用默认播放器");
+            this.activePlayer = playList[0].key;
           }
         }
       } else {

+ 1 - 0
web_src/src/components/dialog/newPlay.vue

@@ -56,6 +56,7 @@ export default {
       height="80%"
       :close-on-click-modal="false"
       :visible.sync="dialogShow"
+      v-if="dialogShow"
       v-loading="isLoading"
     >
       <!--      标题-->