Browse Source

update:同步2个之前的修正

adam 3 years ago
parent
commit
b3d71a97bd
1 changed files with 11 additions and 1 deletions
  1. 11
    1
      AgoraRTCSDK.min.js

+ 11
- 1
AgoraRTCSDK.min.js View File

@@ -5028,7 +5028,8 @@ function(e, t) {
5028 5028
             !0 === a.muted && (t.audio.muted = !0),
5029 5029
             a.playsinline && t.audio.setAttribute("playsinline", ""),
5030 5030
             Number.isFinite(a.volume) && (t.audio.volume = a.volume),
5031
-            void 0 !== t.elementID ? (document.getElementById(t.elementID).appendChild(t.div), t.container = document.getElementById(t.elementID)) : (document.body.appendChild(t.div), t.container = document.body),
5031
+            // fix by Adam 修正由于dom速度原因导致的可能play的时候document还未创建的报错
5032
+            void 0 !== t.elementID && document.getElementById(t.elementID) !== null ? (document.getElementById(t.elementID).appendChild(t.div), t.container = document.getElementById(t.elementID)) : (document.body.appendChild(t.div), t.container = document.body),
5032 5033
             t.parentNode = t.div.parentNode;
5033 5034
             var i = {
5034 5035
                 video: {
@@ -13187,6 +13188,15 @@ function(e, t) {
13187 13188
                 default.debug("[".concat(R.clientId, "] quit gateway")), R.state = S, R.socket.close(), O()) : "recover" === e && y()
13188 13189
                 },
13189 13190
                 R.socket.on("on_notification", (function(e) {
13191
+                    // Fix by Adam 修正官方没有正确发起client-banned事件
13192
+                    if(e.detail === "ERR_REPEAT_JOIN") {
13193
+                        var t = l({
13194
+                          type: "client-banned",
13195
+                          uid: e.uid,
13196
+                          attr: "onMultiIP"
13197
+                        });
13198
+                        R.dispatchEvent(t)
13199
+                    }
13190 13200
                     if (r.
13191 13201
                 default.debug("[".concat(R.clientId, "] Receive notification: "), e), "ERR_JOIN_BY_MULTI_IP" === I.GatewayErrorCode[e.code]) return R.dispatchEvent({
13192 13202
                         type: "onMultiIP",