Skip to content

Instantly share code, notes, and snippets.

@jbis9051
Created April 3, 2020 15:31
Show Gist options
  • Save jbis9051/9abf9b3e3608b2e077b5c471fc6cd8eb to your computer and use it in GitHub Desktop.
Save jbis9051/9abf9b3e3608b2e077b5c471fc6cd8eb to your computer and use it in GitHub Desktop.
! function (e, t) {
"object" == typeof exports && "object" == typeof module ? module.exports = t() : "function" == typeof define && define.amd ? define([], t) : "object" == typeof exports ? exports.JsMediaSDK_Instance = t() : e.JsMediaSDK_Instance = t()
}(window, function () {
return function (e) {
var t = {};
function n(i) {
if (t[i]) return t[i].exports;
var r = t[i] = {
i: i,
l: !1,
exports: {}
};
return e[i].call(r.exports, r, r.exports, n), r.l = !0, r.exports
}
return n.m = e, n.c = t, n.d = function (e, t, i) {
n.o(e, t) || Object.defineProperty(e, t, {
enumerable: !0,
get: i
})
}, n.r = function (e) {
"undefined" != typeof Symbol && Symbol.toStringTag && Object.defineProperty(e, Symbol.toStringTag, {
value: "Module"
}), Object.defineProperty(e, "__esModule", {
value: !0
})
}, n.t = function (e, t) {
if (1 & t && (e = n(e)), 8 & t) return e;
if (4 & t && "object" == typeof e && e && e.__esModule) return e;
var i = Object.create(null);
if (n.r(i), Object.defineProperty(i, "default", {
enumerable: !0,
value: e
}), 2 & t && "string" != typeof e)
for (var r in e) n.d(i, r, function (t) {
return e[t]
}.bind(null, r));
return i
}, n.n = function (e) {
var t = e && e.__esModule ? function () {
return e.default
} : function () {
return e
};
return n.d(t, "a", t), t
}, n.o = function (e, t) {
return Object.prototype.hasOwnProperty.call(e, t)
}, n.p = "", n(n.s = 198)
}([function (e, t) {
var n = e.exports = {
version: "2.5.7"
};
"number" == typeof __e && (__e = n)
}, function (e, t) {
e.exports = function (e) {
return e && e.__esModule ? e : {
default: e
}
}
}, function (e, t) {
var n = e.exports = "undefined" != typeof window && window.Math == Math ? window : "undefined" != typeof self && self.Math == Math ? self : Function("return this")();
"number" == typeof __g && (__g = n)
}, function (e, t, n) {
var i = n(2),
r = n(0),
o = n(9),
a = n(11),
u = n(13),
s = function (e, t, n) {
var d, c, l, f = e & s.F,
h = e & s.G,
_ = e & s.S,
E = e & s.P,
p = e & s.B,
S = e & s.W,
v = h ? r : r[t] || (r[t] = {}),
A = v.prototype,
I = h ? i : _ ? i[t] : (i[t] || {}).prototype;
for (d in h && (n = t), n)(c = !f && I && void 0 !== I[d]) && u(v, d) || (l = c ? I[d] : n[d], v[d] = h && "function" != typeof I[d] ? n[d] : p && c ? o(l, i) : S && I[d] == l ? function (e) {
var t = function (t, n, i) {
if (this instanceof e) {
switch (arguments.length) {
case 0:
return new e;
case 1:
return new e(t);
case 2:
return new e(t, n)
}
return new e(t, n, i)
}
return e.apply(this, arguments)
};
return t.prototype = e.prototype, t
}(l) : E && "function" == typeof l ? o(Function.call, l) : l, E && ((v.virtual || (v.virtual = {}))[d] = l, e & s.R && A && !A[d] && a(A, d, l)))
};
s.F = 1, s.G = 2, s.S = 4, s.P = 8, s.B = 16, s.W = 32, s.U = 64, s.R = 128, e.exports = s
}, function (e, t, n) {
var i = n(57)("wks"),
r = n(40),
o = n(2).Symbol,
a = "function" == typeof o;
(e.exports = function (e) {
return i[e] || (i[e] = a && o[e] || (a ? o : r)("Symbol." + e))
}).store = i
}, function (e, t) {
e.exports = function (e) {
return "object" == typeof e ? null !== e : "function" == typeof e
}
}, function (e, t, n) {
var i = n(8),
r = n(76),
o = n(50),
a = Object.defineProperty;
t.f = n(7) ? Object.defineProperty : function (e, t, n) {
if (i(e), t = o(t, !0), i(n), r) try {
return a(e, t, n)
} catch (e) {}
if ("get" in n || "set" in n) throw TypeError("Accessors not supported!");
return "value" in n && (e[t] = n.value), e
}
}, function (e, t, n) {
e.exports = !n(14)(function () {
return 7 != Object.defineProperty({}, "a", {
get: function () {
return 7
}
}).a
})
}, function (e, t, n) {
var i = n(5);
e.exports = function (e) {
if (!i(e)) throw TypeError(e + " is not an object!");
return e
}
}, function (e, t, n) {
var i = n(24);
e.exports = function (e, t, n) {
if (i(e), void 0 === t) return e;
switch (n) {
case 1:
return function (n) {
return e.call(t, n)
};
case 2:
return function (n, i) {
return e.call(t, n, i)
};
case 3:
return function (n, i, r) {
return e.call(t, n, i, r)
}
}
return function () {
return e.apply(t, arguments)
}
}
}, function (e, t, n) {
e.exports = n(112)
}, function (e, t, n) {
var i = n(6),
r = n(23);
e.exports = n(7) ? function (e, t, n) {
return i.f(e, t, r(1, n))
} : function (e, t, n) {
return e[t] = n, e
}
}, function (e, t, n) {
var i = n(47),
r = n(48);
e.exports = function (e) {
return i(r(e))
}
}, function (e, t) {
var n = {}.hasOwnProperty;
e.exports = function (e, t) {
return n.call(e, t)
}
}, function (e, t) {
e.exports = function (e) {
try {
return !!e()
} catch (e) {
return !0
}
}
}, function (e, t) {
e.exports = {}
}, function (e, t, n) {
var i = n(48);
e.exports = function (e) {
return Object(i(e))
}
}, function (e, t, n) {
"use strict";
var i = n(1);
Object.defineProperty(t, "__esModule", {
value: !0
}), t.default = void 0;
var r = i(n(153)),
o = function () {};
o.prototype = {
publish: function () {
return r.default.publish.apply(this, arguments)
},
trigger: function () {
return this.publish.apply(this, arguments)
},
emit: function () {
return this.publish.apply(this, arguments)
},
subscribe: function () {
return r.default.subscribe.apply(this, arguments)
},
on: function () {
return this.subscribe.apply(this, arguments)
},
unsubscribe: function () {
return r.default.unsubscribe.apply(this, arguments)
},
clearAllSubscriptions: function () {
r.default.clearAllSubscriptions()
}
};
var a = new o;
t.default = a
}, function (e, t, n) {
"use strict";
var i = n(113)(!0);
n(55)(String, "String", function (e) {
this._t = String(e), this._i = 0
}, function () {
var e, t = this._t,
n = this._i;
return n >= t.length ? {
value: void 0,
done: !0
} : (e = i(t, n), this._i += e.length, {
value: e,
done: !1
})
})
}, function (e, t) {
e.exports = function (e, t) {
if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function")
}
}, function (e, t, n) {
var i = n(77);
function r(e, t) {
for (var n = 0; n < t.length; n++) {
var r = t[n];
r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0), i(e, r.key, r)
}
}
e.exports = function (e, t, n) {
return t && r(e.prototype, t), n && r(e, n), e
}
}, function (e, t, n) {
"use strict";
var i = n(1);
Object.defineProperty(t, "__esModule", {
value: !0
}), t.default = void 0;
var r = i(n(155)),
o = i(n(63)),
a = {},
u = [],
s = 1e3,
d = 1,
c = "object" === ("undefined" == typeof localStorage ? "undefined" : (0, o.default)(localStorage)) && localStorage.__islogdebug,
l = "object" === ("undefined" == typeof localStorage ? "undefined" : (0, o.default)(localStorage)) && localStorage.__islogdebug;
var h = function (e, t) {
function n() {
var t = [],
n = "log-".concat(e, "-").concat(d);
return t.push.apply(t, arguments), t.push({
fn: function (e) {
return function () {
return a[e]
}
}(n)
}),
function (e, t) {
if (c && (u.push(e), a[e] = t, u.length > s)) {
var n = u.shift();
delete a[n]
}
}(n, (new Error).stack), d++, t
}
!0 === t && (c = !0, l = !0);
var i = function () {
var t;
l && (t = console).log.apply(t, [e].concat((0, r.default)(n(arguments))))
};
return ["log", "info", "warn", "error"].forEach(function (t) {
i[t] = function () {
var i;
l && (i = console)[t].apply(i, [e].concat((0, r.default)(n(arguments))))
}
}), i.isEnable = function () {
return l
}, i
};
h.isEnable = function () {
return l
};
var _ = h;
t.default = _
}, function (e, t) {
var n = {}.toString;
e.exports = function (e) {
return n.call(e).slice(8, -1)
}
}, function (e, t) {
e.exports = function (e, t) {
return {
enumerable: !(1 & e),
configurable: !(2 & e),
writable: !(4 & e),
value: t
}
}
}, function (e, t) {
e.exports = function (e) {
if ("function" != typeof e) throw TypeError(e + " is not a function!");
return e
}
}, function (e, t) {
e.exports = !0
}, function (e, t, n) {
var i = n(79),
r = n(58);
e.exports = Object.keys || function (e) {
return i(e, r)
}
}, function (e, t, n) {
var i = n(6).f,
r = n(13),
o = n(4)("toStringTag");
e.exports = function (e, t, n) {
e && !r(e = n ? e : e.prototype, o) && i(e, o, {
configurable: !0,
value: t
})
}
}, function (e, t, n) {
var i = n(9),
r = n(83),
o = n(84),
a = n(8),
u = n(39),
s = n(72),
d = {},
c = {};
(t = e.exports = function (e, t, n, l, f) {
var h, _, E, p, S = f ? function () {
return e
} : s(e),
v = i(n, l, t ? 2 : 1),
A = 0;
if ("function" != typeof S) throw TypeError(e + " is not iterable!");
if (o(S)) {
for (h = u(e.length); h > A; A++)
if ((p = t ? v(a(_ = e[A])[0], _[1]) : v(e[A])) === d || p === c) return p
} else
for (E = S.call(e); !(_ = E.next()).done;)
if ((p = r(E, v, _.value, t)) === d || p === c) return p
}).BREAK = d, t.RETURN = c
}, function (e, t, n) {
"use strict";
var i = n(1);
Object.defineProperty(t, "__esModule", {
value: !0
}), t.default = void 0;
var r = i(n(94)),
o = i(n(35)),
a = n(67),
u = n(73),
s = n(74),
d = (0, i(n(21)).default)("sdk.variables");
function c() {}
c.prototype.initDB = function () {
var e, t = {},
n = this;
t.init = function (i) {
if (this.db_name = i.db_name, this.db_version = i.db_version, this.db_store_name = i.db_store_name, indexedDB) {
try {
e = indexedDB.open(this.db_name, this.db_version)
} catch (e) {
return d(e), void(n.indexDbObject = null)
}
e.onerror = function (e) {
n.indexDbObject = null
}, e.onupgradeneeded = function (e) {
this.db = e.target.result, this.db.createObjectStore(t.db_store_name)
}, e.onsuccess = function (e) {
t.db = e.target.result, n.openIndexFlag = !0, n.indexDbObject.select("delay")
}
} else n.indexDbObject = null
}, t.put = function (e, n) {
try {
var i = t.db.transaction(t.db_store_name, "readwrite").objectStore(t.db_store_name).put(e, n);
i.onsuccess = function () {}, i.onerror = function (e) {
d("Set Delay failed!")
}
} catch (e) {
d("IndexDb put Failed!")
}
}, t.delete = function (n) {
(e = t.db.transaction(t.db_store_name, "readwrite").objectStore(t.db_store_name).delete(n)).onsuccess = function () {
d("Delete the key:" + n)
}
}, t.select = function (e) {
try {
var i = t.db.transaction(t.db_store_name, "readwrite").objectStore(t.db_store_name);
if (e) var r = i.get(e);
else r = i.getAll();
r.onsuccess = function () {
n.audioDelay = r.result
}, r.onerror = function () {
n.audioDelay = 0
}
} catch (e) {
d("IndexDb Select Failed")
}
}, t.clear = function () {
t.db.transaction(t.db_store_name, "readwrite").objectStore(t.db_store_name).clear().onsuccess = function () {
d("Clear the IndexDb Successfully")
}
}, t.close = function () {
t.db && t.db.close()
}, this.indexDbObject = t, this.indexDbObject.init({
db_name: "AEC",
db_version: 1,
db_store_name: "delay"
})
}, c.prototype.Notify_APPUI_SAFE = function () {
this.Notify_APPUI && this.Notify_APPUI.apply(this, arguments)
}, c.prototype.reinit = function () {
this.SPECIAL_ID = 0, this.Notify_APPUI = null, this.localAudioDecMGR = null, this.localVideoDecMGR = null, this.localAudioEncMGR = null, this.localVideoEncMGR = null, this.localSharingDecMGR = null, this.localMouseDecMGR = null, this.localSharingEncMGR = null, this.localAudioPara = null, this.localVideoPara = null, this.localSharingPara = null, this.Audio_WebSocket_Ip_Address = null, this.Video_WebSocket_Ip_Address = null, this.Sharing_WebSocket_Ip_Address = null, this.mediaSDKHandle = null, this.audio_pcm_queue = new r.default, this.int16Array = null, this.isInitialFailed = !1, this.isAudioEncodeWASMOK = !1, this.isAudioDecodeWASMOK = !1, this.isVideoEncodeWASMOK = !1, this.isVideoDecodeWASMOK = !1, this.isSharingDecodeWASMOK = !1, this.isSharingEncodeWASMOK = !1, this.audioEncWorkerPath = "", this.audioDecWorkerPath = "", this.videoDecWorkerPath = "", this.videoEncWorkerPath = "", this.sharingDecWorkerPath = "", this.sharingEncWorkerPath = "", this.isAudioEncodePostStart = !1, this.isAudioDecodePostStart = !1, this.isVideoDecodePostStart = !1, this.isVideoEncodePostStart = !1, this.isSharingDecodePostStart = !1, this.isSharingEncodePostStart = !1, this.isAudioEncodeThreadStart = !1, this.isAudioDecodeThreadStart = !1, this.isVideoDecodeThreadStart = !1, this.isSharingDecodeThreadStart = !1, this.isVideoEncodeThreadStart = !1, this.isSharingEncodeThreadStart = !1, this.isAudioPlayWork = !1, this.isVideoPlayWork = !1, this.isSharingPlayWork = !1, this.shareBufferSampleNumb = 30, this.initialSuccessNumb = 0, this.TotalWaitEvent = 0, this.audioPostInterval = null, this.sharedBuffer = null, this.indexDbObject = null, this.audioDelay = 0, this.openIndexFlag = !1, this.audioBufferSize = o.default.browser.isEdge || o.default.browser.isFirefox ? 30 : 15, this.monitorEncodeVideo = null, this.monitorDecodeVideo = null, this.monitorEncodeSharing = null, this.monitorEncodeAudio = null, this.monitorDecodeAudio = null, this.monitorVideoCapture = null, this.monitorAudioCapture = null, this.monitorIntervalHandle = null, this.monitorVideoUserID = null, this.monitorAudioUserID = null, this.monitorSharingUserID = null, this.monitorSharingEncodeAPPInfo = null, this.monitorVideoDecodeAPPInfo = null, this.monitorVideoEncodeAPPInfo = null, this.monitorCid = null, this.e2eencrypt = !1, this.AudioNode = null, this.CurrentSSRC = 0, this.CurrentSSRCTime = 0, this.videoDecResponseText = null, this.videoEncResponseText = null, this.sharingDecodeResponse = null, this.sharingEncodeResponse = null, this.sharingDecInitInstance = new a.SharingInit, this.sharingEncInitInstance = new a.SharingInit, this.videoInitInstance = new u.VideoInit, this.audioDecInitInstance = new s.AudioInit, this.audioEncodeInitInstance = new s.AudioInit, this.videoDecInitInstance = new u.VideoInit, this.audioDecodeResponse = null, this.audioEncodeResponse = null, this.initDB()
};
var l = new c;
t.default = l
}, function (e, t, n) {
var i = n(107),
r = n(77);
e.exports = function (e) {
if (e && e.__esModule) return e;
var t = {};
if (null != e)
for (var n in e)
if (Object.prototype.hasOwnProperty.call(e, n)) {
var o = r && i ? i(e, n) : {};
o.get || o.set ? r(t, n, o) : t[n] = e[n]
}
return t.default = e, t
}
}, function (e, t, n) {
n(118);
for (var i = n(2), r = n(11), o = n(15), a = n(4)("toStringTag"), u = "CSSRuleList,CSSStyleDeclaration,CSSValueList,ClientRectList,DOMRectList,DOMStringList,DOMTokenList,DataTransferItemList,FileList,HTMLAllCollection,HTMLCollection,HTMLFormElement,HTMLSelectElement,MediaList,MimeTypeArray,NamedNodeMap,NodeList,PaintRequestList,Plugin,PluginArray,SVGLengthList,SVGNumberList,SVGPathSegList,SVGPointList,SVGStringList,SVGTransformList,SourceBufferList,StyleSheetList,TextTrackCueList,TextTrackList,TouchList".split(","), s = 0; s < u.length; s++) {
var d = u[s],
c = i[d],
l = c && c.prototype;
l && !l[a] && r(l, a, d), o[d] = o.Array
}
}, function (e, t, n) {
e.exports = n(128)
}, function (e, t, n) {
var i = n(10);
function r(e, t, n, r, o, a, u) {
try {
var s = e[a](u),
d = s.value
} catch (e) {
return void n(e)
}
s.done ? t(d) : i.resolve(d).then(r, o)
}
e.exports = function (e) {
return function () {
var t = this,
n = arguments;
return new i(function (i, o) {
var a = e.apply(t, n);
function u(e) {
r(a, i, o, u, s, "next", e)
}
function s(e) {
r(a, i, o, u, s, "throw", e)
}
u(void 0)
})
}
}
}, function (e, t, n) {
"use strict";
Object.defineProperty(t, "__esModule", {
value: !0
}), t.START_REMOTE_CONTROL_SUCCESS = t.STOP_VIDEO_CAPTURE_SUCCESS = t.START_VIDEO_CAPTURE_SUCCESS = t.CURRENT_CAPTURE_VIDEO_WIDTH_HEIGHT = t.SHARING_DECODE_MAX_SIZE = t.VIDEO_DECODE_MAX_SIZE = t.SHARING_PARA = t.SHARING_DATA = t.SHARING_DEC_THREAD_OK = t.CURRENT_VIDEO_RESOLUTION = t.USER_GRANT_CAPTURE_AUDIO = t.INIT_SUCCESS_SHARING = t.INIT_SUCCESS_AUDIO = t.INIT_SUCCESS_VIDEO = t.INIT_SUCCESS = t.Video_Enc_WebSocket_FAILED = t.Sharing_Dec_WebSocket_FAILED = t.Sharing_Handle_FAILED = t.Audio_Mute = t.Sharing_Dec_WASM_FAILED = t.Video_Enc_Handle_FAILED = t.Video_Enc_WASM_FAILED = t.Video_Dec_WebSocket_FAILED = t.Video_Dec_Handle_FAILED = t.Video_Dec_WASM_FAILED = t.Audio_Enc_Handle_FAILED = t.Audio_Enc_WASM_FAILED = t.Audio_Dec_WebSocket_FAILED = t.Audio_Dec_Handle_FAILED = t.Audio_Dec_WASM_FAILED = t.AUDIO_ENCODED_DATA = t.VIDEO_DATA_DROP_RATIO = t.VIDEO_DROP_RATIO_FROM_WCL = t.VIDEO_ENCODED_DATA = t.SHARING_DECODE_MESSAGE = t.MOUSE_DATA_VIDEO_MODE = t.SHARING_DATA_VIDEO_MODE = t.WCL_TROUBLESHOOTING_INFO = t.DELTA_S = t.DELTA_C = t.DELTA_D = t.APP_TROUBLESHOOTING_INFO = t.DOWNLOAD_WASM_FROM_MAIN_THREAD = t.MONITOR_MESSAGE = t.Video_Capture_Tick = t.Video_Enc_WebSocket_OK = t.DECODE_MESSAGE = t.Sharing_Data = t.Sharing_Handle_OK = t.Sharing_Dec_WebSocket_OK = t.AUDIO_DELAY = t.Sharing_Dec_PICTURE = t.Sharing_Dec_WASM_OK = t.Video_Enc_Handle_OK = t.Video_Enc_WASM_OK = t.Video_Dec_WebSocket_OK = t.Video_Dec_Handle_OK = t.Video_Dec_WASM_OK = t.Audio_Enc_Handle_OK = t.Audio_Enc_WASM_OK = t.Audio_Dec_WebSocket_OK = t.Audio_Dec_Handle_OK = t.Audio_Dec_WASM_OK = t.COMMAND_SOCKET_MESSAGE_NOTIFY = t.SWITCH_CANVAS_FOR_SHARING_CAPTURE = t.CHECK_CHROME_SHARING_EXTENSION = t.RESUME_DESKTOP_SHARING = t.PAUSE_DESKTOP_SHARING = t.STOP_DESKTOP_SHARING = t.START_DESKTOP_SHARING = t.UPDATE_SUBSCRIBE_VIDEO = t.CANCEL_REMOTE_CONTROL = t.UPDATE_REMOTE_CONTROL_PROPERTIES = t.START_REMOTE_CONTROL = t.SWITCH_CANVAS_FOR_VIDEO_CAPTURE = t.STOP_SHARING = t.START_SHARING = t.JOIN_COMPUTER_AUDIO = t.LEAVE_COMPUTER_AUDIO = t.REMOVE_RENDER_AUDIO = t.WEBRTC_RESTART = t.CHANGE_AUDIO_MIC = t.END_MEDIA = t.MEETING_FAIL_OVER = t.LEAVE_MEETING = t.REMOVE_AUDIO_CAPTURE = t.CHANGE_CURRENT_ACTIVE_SSRC = t.CHANGE_VIDEO_CAPTURE_DEVICE = t.CHANGE_AUDIO_SPEAKER = t.CHANGE_VIDEO_RESOLUTION = t.CHANGE_FRAME_RATE = t.MUTE_AUDIO = t.UNMUTE_AUDIO = t.STOP_RENDER_AUDIO = t.ADD_RENDER_AUDIO = t.STOP_CAPTURE_VIDEO = t.START_CAPTURE_VIDEO = t.STOP_RENDER_VIDEO = t.ADD_RENDER_VIDEO = t.START_MEDIA = void 0, t.MEDIA_VIDEO_REPORT_RTT = t.MEDIA_VIDEO_REPORT_DROP_RATIO = t.PUBSUB_EVT = t.ZOOM_CONNECTION_AUDIO_OFFER_RESPONSE_EVT = t.ZOOM_CONNECTION_VIDEO_OFFER_RESPONSE_EVT = t.ZOOM_CONNECTION_VIDEO_OFFER_EVT = t.VIDEO_ENCODE_DATA_FROM_WORKER = t.AUDIO_DATA_FROM_WORKER = t.VIDEO_DATA_FROM_WORKER = t.SHARING_PARAM_INFO_FROM_SOCKET = t.AUDIO_ILLEGAL = t.AUDIO_REMOVE = t.AUDIO_START = t.AUDIO_STOP = t.DESKTOP_SHARING_ERROR = t.DESKTOP_SHARING_TIME_OUT = t.DESKTOP_SHARING_PERMISSION_DENIED = t.DESKTOP_SHARING_CHROME_EXTENSION_UNINSTALLED = t.USER_CANCEL_PERMISSION_REQUEST = t.USER_STOP_DESKTOP_SHARING = t.REMOTE_CONTROL_PASTE_TEXT_LENGTH_OVERFLOW = t.CANCEL_REMOTE_CONTROL_FAILED = t.START_REMOTE_CONTROL_FAILED = t.STOP_VIDEO_CAPTURE_FAILED = t.USER_CAMERA_IS_TAKEN_BY_OTHER_PROGRAMS = t.USER_FORBIDDED_CAPTURE_VIDEO = t.AUDIO_CTX_SAMPLERATE = t.AUDIO_ZERO_DATA = t.SHARING_DEC_THREAD_FAILED = t.VIDEO_WEBSOCKET_BROKEN = t.AUDIO_WEBSOCKET_BROKEN = t.USER_FORBIDDED_CAPTURE_AUDIO = t.INIT_FAILED_SHARING = t.INIT_FAILED_AUDIO = t.INIT_FAILED_VIDEO = t.INIT_FAILED = t.SEND_MESSAGE_TO_RWG = t.CHECK_CHROME_SHARING_EXTENSION_RESPONSE = t.DESKTOP_SHARING_CAPTURE_SUCCESS = t.CURRENT_DESKTOP_SHARING_WIDTH_HEIGHT = t.MONITOR_LOG = t.REMOTE_CONTROL_COPIED_TEXT_NOTIFY = t.CANCEL_REMOTE_CONTROL_SUCCESS = void 0, t.START_MEDIA = 0, t.ADD_RENDER_VIDEO = 1, t.STOP_RENDER_VIDEO = 2, t.START_CAPTURE_VIDEO = 3, t.STOP_CAPTURE_VIDEO = 4, t.ADD_RENDER_AUDIO = 5, t.STOP_RENDER_AUDIO = 6, t.UNMUTE_AUDIO = 7, t.MUTE_AUDIO = 8, t.CHANGE_FRAME_RATE = 9, t.CHANGE_VIDEO_RESOLUTION = 10, t.CHANGE_AUDIO_SPEAKER = 11, t.CHANGE_VIDEO_CAPTURE_DEVICE = 12, t.CHANGE_CURRENT_ACTIVE_SSRC = 13, t.REMOVE_AUDIO_CAPTURE = 14, t.LEAVE_MEETING = 15, t.MEETING_FAIL_OVER = 16, t.END_MEDIA = 17, t.CHANGE_AUDIO_MIC = 18, t.WEBRTC_RESTART = 19, t.REMOVE_RENDER_AUDIO = 20, t.LEAVE_COMPUTER_AUDIO = 21, t.JOIN_COMPUTER_AUDIO = 22, t.START_SHARING = 23, t.STOP_SHARING = 24, t.SWITCH_CANVAS_FOR_VIDEO_CAPTURE = 25, t.START_REMOTE_CONTROL = 26, t.UPDATE_REMOTE_CONTROL_PROPERTIES = 27, t.CANCEL_REMOTE_CONTROL = 28, t.UPDATE_SUBSCRIBE_VIDEO = 29, t.START_DESKTOP_SHARING = 30, t.STOP_DESKTOP_SHARING = 31, t.PAUSE_DESKTOP_SHARING = 32, t.RESUME_DESKTOP_SHARING = 33, t.CHECK_CHROME_SHARING_EXTENSION = 34, t.SWITCH_CANVAS_FOR_SHARING_CAPTURE = 35, t.COMMAND_SOCKET_MESSAGE_NOTIFY = 40, t.Audio_Dec_WASM_OK = 1, t.Audio_Dec_Handle_OK = 2, t.Audio_Dec_WebSocket_OK = 3, t.Audio_Enc_WASM_OK = 4, t.Audio_Enc_Handle_OK = 5, t.Video_Dec_WASM_OK = 7, t.Video_Dec_Handle_OK = 8, t.Video_Dec_WebSocket_OK = 9, t.Video_Enc_WASM_OK = 10, t.Video_Enc_Handle_OK = 11, t.Sharing_Dec_WASM_OK = 12, t.Sharing_Dec_PICTURE = 13, t.AUDIO_DELAY = 14, t.Sharing_Dec_WebSocket_OK = 15, t.Sharing_Handle_OK = 16, t.Sharing_Data = 17, t.DECODE_MESSAGE = 18, t.Video_Enc_WebSocket_OK = 19, t.Video_Capture_Tick = 20, t.MONITOR_MESSAGE = 21, t.DOWNLOAD_WASM_FROM_MAIN_THREAD = 30, t.APP_TROUBLESHOOTING_INFO = 31, t.DELTA_D = 32, t.DELTA_C = 33, t.DELTA_S = 34, t.WCL_TROUBLESHOOTING_INFO = 35, t.SHARING_DATA_VIDEO_MODE = 36, t.MOUSE_DATA_VIDEO_MODE = 37, t.SHARING_DECODE_MESSAGE = 38, t.VIDEO_ENCODED_DATA = 39, t.VIDEO_DROP_RATIO_FROM_WCL = 40, t.VIDEO_DATA_DROP_RATIO = 41, t.AUDIO_ENCODED_DATA = 42, t.Audio_Dec_WASM_FAILED = -1, t.Audio_Dec_Handle_FAILED = -2, t.Audio_Dec_WebSocket_FAILED = -3, t.Audio_Enc_WASM_FAILED = -4, t.Audio_Enc_Handle_FAILED = -5, t.Video_Dec_WASM_FAILED = -7, t.Video_Dec_Handle_FAILED = -8, t.Video_Dec_WebSocket_FAILED = -9, t.Video_Enc_WASM_FAILED = -10, t.Video_Enc_Handle_FAILED = -11, t.Sharing_Dec_WASM_FAILED = -12, t.Audio_Mute = -13, t.Sharing_Handle_FAILED = -14, t.Sharing_Dec_WebSocket_FAILED = -15, t.Video_Enc_WebSocket_FAILED = -16, t.INIT_SUCCESS = 1, t.INIT_SUCCESS_VIDEO = 1.1, t.INIT_SUCCESS_AUDIO = 1.2, t.INIT_SUCCESS_SHARING = 1.3, t.USER_GRANT_CAPTURE_AUDIO = 2, t.CURRENT_VIDEO_RESOLUTION = 3, t.SHARING_DEC_THREAD_OK = 4, t.SHARING_DATA = 5, t.SHARING_PARA = 6, t.VIDEO_DECODE_MAX_SIZE = 7, t.SHARING_DECODE_MAX_SIZE = 18, t.CURRENT_CAPTURE_VIDEO_WIDTH_HEIGHT = 8, t.START_VIDEO_CAPTURE_SUCCESS = 9, t.STOP_VIDEO_CAPTURE_SUCCESS = 10, t.START_REMOTE_CONTROL_SUCCESS = 11, t.CANCEL_REMOTE_CONTROL_SUCCESS = 12, t.REMOTE_CONTROL_COPIED_TEXT_NOTIFY = 13, t.MONITOR_LOG = 14, t.CURRENT_DESKTOP_SHARING_WIDTH_HEIGHT = 15, t.DESKTOP_SHARING_CAPTURE_SUCCESS = 16, t.CHECK_CHROME_SHARING_EXTENSION_RESPONSE = 17, t.SEND_MESSAGE_TO_RWG = 20, t.INIT_FAILED = -1, t.INIT_FAILED_VIDEO = -1.1, t.INIT_FAILED_AUDIO = -1.2, t.INIT_FAILED_SHARING = -1.3, t.USER_FORBIDDED_CAPTURE_AUDIO = -2, t.AUDIO_WEBSOCKET_BROKEN = -3, t.VIDEO_WEBSOCKET_BROKEN = -4, t.SHARING_DEC_THREAD_FAILED = -5, t.AUDIO_ZERO_DATA = -6, t.AUDIO_CTX_SAMPLERATE = -7, t.USER_FORBIDDED_CAPTURE_VIDEO = -8, t.USER_CAMERA_IS_TAKEN_BY_OTHER_PROGRAMS = -9, t.STOP_VIDEO_CAPTURE_FAILED = -10, t.START_REMOTE_CONTROL_FAILED = -11, t.CANCEL_REMOTE_CONTROL_FAILED = -12, t.REMOTE_CONTROL_PASTE_TEXT_LENGTH_OVERFLOW = -14, t.USER_STOP_DESKTOP_SHARING = -15, t.USER_CANCEL_PERMISSION_REQUEST = -16, t.DESKTOP_SHARING_CHROME_EXTENSION_UNINSTALLED = -17, t.DESKTOP_SHARING_PERMISSION_DENIED = -18, t.DESKTOP_SHARING_TIME_OUT = -19, t.DESKTOP_SHARING_ERROR = -20, t.AUDIO_STOP = 0, t.AUDIO_START = 1, t.AUDIO_REMOVE = 2, t.AUDIO_ILLEGAL = -1, t.SHARING_PARAM_INFO_FROM_SOCKET = "SHARING_PARAM_INFO_FROM_SOCKET", t.VIDEO_DATA_FROM_WORKER = "VIDEO_DATA_FROM_WORKER", t.AUDIO_DATA_FROM_WORKER = "AUDIO_DATA_FROM_WORKER", t.VIDEO_ENCODE_DATA_FROM_WORKER = "VIDEO_ENCODE_DATA_FROM_WORKER", t.ZOOM_CONNECTION_VIDEO_OFFER_EVT = 24321, t.ZOOM_CONNECTION_VIDEO_OFFER_RESPONSE_EVT = 24322, t.ZOOM_CONNECTION_AUDIO_OFFER_RESPONSE_EVT = 24322, t.PUBSUB_EVT = {
ZOOM_CONNECTION_VIDEO_OFFER_RESPONSE_EVT: "ZOOM_CONNECTION_VIDEO_OFFER_RESPONSE_EVT",
ZOOM_CONNECTION_AUDIO_OFFER_RESPONSE_EVT: "ZOOM_CONNECTION_AUDIO_OFFER_RESPONSE_EVT",
END_MEDIA: "END_MEDIA",
DESTROY: "DESTROY",
VIDEO_DATACHANNEL_SPEED: "VIDEO_DATACHANNEL_SPEED",
DC_COMING_MESSAGE: "DC_COMING_MESSAGE"
}, t.MEDIA_VIDEO_REPORT_DROP_RATIO = 100, t.MEDIA_VIDEO_REPORT_RTT = 101
}, function (e, t, n) {
"use strict";
var i = n(1);
Object.defineProperty(t, "__esModule", {
value: !0
}), t.default = void 0;
var r = i(n(10)),
o = {};
function a(e, t, n) {
var i = e.match(t);
return i && i.length >= n && parseInt(i[n], 10)
}
var u = function () {
var e = window.navigator,
t = {
browser: null,
version: null
};
if ("undefined" == typeof window || !window.navigator) return t.browser = "Not a browser.", t;
if (e.mozGetUserMedia) t.browser = "firefox", t.version = a(e.userAgent, /Firefox\/(\d+)\./, 1);
else if (e.webkitGetUserMedia) t.browser = "chrome", t.version = a(e.userAgent, /Chrom(e|ium)\/(\d+)\./, 2);
else if (e.mediaDevices && e.userAgent.match(/Edge\/(\d+).(\d+)$/)) t.browser = "edge", t.version = a(e.userAgent, /Edge\/(\d+).(\d+)$/, 2);
else {
if (!window.RTCPeerConnection || !e.userAgent.match(/AppleWebKit\/(\d+)\./)) return t.browser = "Not a supported browser.", t;
t.browser = "safari", t.version = a(e.userAgent, /AppleWebKit\/(\d+)\./, 1)
}
return t
}(),
s = {
getDocumentHandle: function (e) {
return document.getElementById(e)
},
browserType: u,
browser: {
isFirefox: "firefox" === u.browser,
isChrome: "chrome" === u.browser,
isEdge: "edge" === u.browser,
isSafari: "safari" === u.browser
},
download: function (e) {
if (o[e]) return o[e];
var t = new r.default(function (t, n) {
var i = new XMLHttpRequest;
i.addEventListener("load", function () {
t(this.responseText)
}, i), i.onerror = function (e) {
n(e)
}, i.open("get", e, !0), i.send()
});
return o[e] = t, t
},
downloadBinary: function (e) {
if (o[e]) return o[e];
var t = new r.default(function (t, n) {
var i = new XMLHttpRequest;
i.responseType = "arraybuffer", i.addEventListener("load", function () {
t(this.response)
}, i), i.onerror = function (e) {
n(e)
}, i.open("get", e, !0), i.send()
});
return o[e] = t, t
},
readBlob: function (e) {
return new r.default(function (t, n) {
var i = new FileReader;
i.onload = function () {
t(i.result)
}, i.readAsText(e)
})
},
readBlobAsBuffer: function (e) {
return new r.default(function (t, n) {
var i = new FileReader;
i.onload = function (e) {
t(e.target.result)
}, i.readAsArrayBuffer(e)
})
},
lengthInUtf8Bytes: function (e) {
var t = encodeURIComponent(e).match(/%[89ABab]/g);
return e.length + (t ? t.length : 0)
},
isLittleEndian: function () {
var e = new ArrayBuffer(2),
t = new Uint8Array(e),
n = new Uint16Array(e);
return t[0] = 170, t[1] = 187, 48042 === n[0]
},
sleep: function (e) {
return new r.default(function (t, n) {
setTimeout(function () {
t(!0)
}, e)
})
}
};
t.default = s
}, function (e, t, n) {
var i = n(100),
r = n(187),
o = n(188),
s = i ? i.toStringTag : void 0;
e.exports = function (e) {
return null == e ? void 0 === e ? "[object Undefined]" : "[object Null]" : s && s in Object(e) ? r(e) : o(e)
}
}, function (e, t) {
t.f = {}.propertyIsEnumerable
}, function (e, t, n) {
var i = n(8),
r = n(115),
o = n(58),
a = n(56)("IE_PROTO"),
u = function () {},
s = function () {
var e, t = n(51)("iframe"),
i = o.length;
for (t.style.display = "none", n(80).appendChild(t), t.src = "javascript:", (e = t.contentWindow.document).open(), e.write("<script>document.F=Object<\/script>"), e.close(), s = e.F; i--;) delete s.prototype[o[i]];
return s()
};
e.exports = Object.create || function (e, t) {
var n;
return null !== e ? (u.prototype = i(e), n = new u, u.prototype = null, n[a] = e) : n = s(), void 0 === t ? n : r(n, t)
}
}, function (e, t, n) {
var i = n(54),
r = Math.min;
e.exports = function (e) {
return e > 0 ? r(i(e), 9007199254740991) : 0
}
}, function (e, t) {
var n = 0,
i = Math.random();
e.exports = function (e) {
return "Symbol(".concat(void 0 === e ? "" : e, ")_", (++n + i).toString(36))
}
}, function (e, t, n) {
var i = n(22),
r = n(4)("toStringTag"),
o = "Arguments" == i(function () {
return arguments
}());
e.exports = function (e) {
var t, n, a;
return void 0 === e ? "Undefined" : null === e ? "Null" : "string" == typeof (n = function (e, t) {
try {
return e[t]
} catch (e) {}
}(t = Object(e), r)) ? n : o ? i(t) : "Object" == (a = i(t)) && "function" == typeof t.callee ? "Arguments" : a
}
}, function (e, t) {
e.exports = function (e) {
var t = typeof e;
return null != e && ("object" == t || "function" == t)
}
}, function (e, t, n) {
e.exports = n(130)
}, function (e, t, n) {
"use strict";
var i = n(30),
r = n(1);
Object.defineProperty(t, "__esModule", {
value: !0
}), t.default = void 0;
var o = r(n(45)),
a = i(n(34)),
u = r(n(29)),
s = function () {
function e() {
this.base_time = null, this.monitor = "", this.last_get_monitor_time = 0
}
return e.prototype = {
init: function () {
this.base_time = (new Date).getTime() / 1e3
},
add_monitor: function (e) {
if (e) try {
var t = !1;
"F" != e[e.length - 1] && "f" != e[e.length - 1] || (t = !0);
var n = (new Date).getTime() / 1e3 - this.base_time;
this.monitor ? this.monitor = this.monitor + e + "(" + Math.ceil(n) + ")" : this.monitor = e + "(" + Math.ceil(n) + ")", t && this.send_instant_monitor()
} catch (e) {}
},
get_monitor: function () {
var e = this.monitor,
t = (new Date).getTime() / 1e3;
return null != e && (e.length > 80 || t - this.last_get_monitor_time > 180) ? (this.last_get_monitor_time = t, this.monitor = null, "WCL_M, " + e) : ""
},
get_instant_monitor: function () {
var e = this.monitor;
return this.monitor = null, "WCL_M, " + e
},
send_instant_monitor: function () {
var e = this.get_instant_monitor();
e && u.default.Notify_APPUI(a.MONITOR_LOG, (0, o.default)({
evt: 4167,
seq: 1,
body: {
data: e
}
}))
},
add_monitor2: function (e) {
e && (this.monitor ? this.monitor = this.monitor + e + "()" : this.monitor = e + "()")
}
}, new e
}();
t.default = s
}, function (e, t, n) {
e.exports = n(141)
}, function (e, t) {
e.exports = function (e) {
return null != e && "object" == typeof e
}
}, function (e, t, n) {
var i = n(22);
e.exports = Object("z").propertyIsEnumerable(0) ? Object : function (e) {
return "String" == i(e) ? e.split("") : Object(e)
}
}, function (e, t) {
e.exports = function (e) {
if (null == e) throw TypeError("Can't call method on " + e);
return e
}
}, function (e, t, n) {
var i = n(37),
r = n(23),
o = n(12),
a = n(50),
u = n(13),
s = n(76),
d = Object.getOwnPropertyDescriptor;
t.f = n(7) ? d : function (e, t) {
if (e = o(e), t = a(t, !0), s) try {
return d(e, t)
} catch (e) {}
if (u(e, t)) return r(!i.f.call(e, t), e[t])
}
}, function (e, t, n) {
var i = n(5);
e.exports = function (e, t) {
if (!i(e)) return e;
var n, r;
if (t && "function" == typeof (n = e.toString) && !i(r = n.call(e))) return r;
if ("function" == typeof (n = e.valueOf) && !i(r = n.call(e))) return r;
if (!t && "function" == typeof (n = e.toString) && !i(r = n.call(e))) return r;
throw TypeError("Can't convert object to primitive value")
}
}, function (e, t, n) {
var i = n(5),
r = n(2).document,
o = i(r) && i(r.createElement);
e.exports = function (e) {
return o ? r.createElement(e) : {}
}
}, function (e, t, n) {
var i = n(3),
r = n(0),
o = n(14);
e.exports = function (e, t) {
var n = (r.Object || {})[e] || Object[e],
a = {};
a[e] = t(n), i(i.S + i.F * o(function () {
n(1)
}), "Object", a)
}
}, function (e, t) {}, function (e, t) {
var n = Math.ceil,
i = Math.floor;
e.exports = function (e) {
return isNaN(e = +e) ? 0 : (e > 0 ? i : n)(e)
}
}, function (e, t, n) {
"use strict";
var i = n(25),
r = n(3),
o = n(78),
a = n(11),
u = n(15),
s = n(114),
d = n(27),
c = n(81),
l = n(4)("iterator"),
f = !([].keys && "next" in [].keys()),
h = function () {
return this
};
e.exports = function (e, t, n, _, E, p, S) {
s(n, t, _);
var v, A, I, D = function (e) {
if (!f && e in C) return C[e];
switch (e) {
case "keys":
case "values":
return function () {
return new n(this, e)
}
}
return function () {
return new n(this, e)
}
},
g = t + " Iterator",
O = "values" == E,
m = !1,
C = e.prototype,
R = C[l] || C["@@iterator"] || E && C[E],
y = R || D(E),
T = E ? O ? D("entries") : y : void 0,
M = "Array" == t && C.entries || R;
if (M && (I = c(M.call(new e))) !== Object.prototype && I.next && (d(I, g, !0), i || "function" == typeof I[l] || a(I, l, h)), O && R && "values" !== R.name && (m = !0, y = function () {
return R.call(this)
}), i && !S || !f && !m && C[l] || a(C, l, y), u[t] = y, u[g] = h, E)
if (v = {
values: O ? y : D("values"),
keys: p ? y : D("keys"),
entries: T
}, S)
for (A in v) A in C || o(C, A, v[A]);
else r(r.P + r.F * (f || m), t, v);
return v
}
}, function (e, t, n) {
var i = n(57)("keys"),
r = n(40);
e.exports = function (e) {
return i[e] || (i[e] = r(e))
}
}, function (e, t, n) {
var i = n(0),
r = n(2),
o = r["__core-js_shared__"] || (r["__core-js_shared__"] = {});
(e.exports = function (e, t) {
return o[e] || (o[e] = void 0 !== t ? t : {})
})("versions", []).push({
version: i.version,
mode: n(25) ? "pure" : "global",
copyright: "© 2018 Denis Pushkarev (zloirock.ru)"
})
}, function (e, t) {
e.exports = "constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(",")
}, function (e, t) {
e.exports = function (e, t, n, i) {
if (!(e instanceof t) || void 0 !== i && i in e) throw TypeError(n + ": incorrect invocation!");
return e
}
}, function (e, t, n) {
"use strict";
var i = n(24);
e.exports.f = function (e) {
return new function (e) {
var t, n;
this.promise = new e(function (e, i) {
if (void 0 !== t || void 0 !== n) throw TypeError("Bad Promise constructor");
t = e, n = i
}), this.resolve = i(t), this.reject = i(n)
}(e)
}
}, function (e, t, n) {
var i = n(11);
e.exports = function (e, t, n) {
for (var r in t) n && e[r] ? e[r] = t[r] : i(e, r, t[r]);
return e
}
}, function (e, t) {
t.f = Object.getOwnPropertySymbols
}, function (e, t, n) {
var i = n(133),
r = n(91);
function o(e) {
return (o = "function" == typeof r && "symbol" == typeof i ? function (e) {
return typeof e
} : function (e) {
return e && "function" == typeof r && e.constructor === r && e !== r.prototype ? "symbol" : typeof e
})(e)
}
function a(t) {
return "function" == typeof r && "symbol" === o(i) ? e.exports = a = function (e) {
return o(e)
} : e.exports = a = function (e) {
return e && "function" == typeof r && e.constructor === r && e !== r.prototype ? "symbol" : o(e)
}, a(t)
}
e.exports = a
}, function (e, t, n) {
t.f = n(4)
}, function (e, t, n) {
var i = n(40)("meta"),
r = n(5),
o = n(13),
a = n(6).f,
u = 0,
s = Object.isExtensible || function () {
return !0
},
d = !n(14)(function () {
return s(Object.preventExtensions({}))
}),
c = function (e) {
a(e, i, {
value: {
i: "O" + ++u,
w: {}
}
})
},
l = e.exports = {
KEY: i,
NEED: !1,
fastKey: function (e, t) {
if (!r(e)) return "symbol" == typeof e ? e : ("string" == typeof e ? "S" : "P") + e;
if (!o(e, i)) {
if (!s(e)) return "F";
if (!t) return "E";
c(e)
}
return e[i].i
},
getWeak: function (e, t) {
if (!o(e, i)) {
if (!s(e)) return !0;
if (!t) return !1;
c(e)
}
return e[i].w
},
onFreeze: function (e) {
return d && l.NEED && s(e) && !o(e, i) && c(e), e
}
}
}, function (e, t, n) {
var i = n(2),
r = n(0),
o = n(25),
a = n(64),
u = n(6).f;
e.exports = function (e) {
var t = r.Symbol || (r.Symbol = o ? {} : i.Symbol || {});
"_" == e.charAt(0) || e in t || u(t, e, {
value: a.f(e)
})
}
}, function (e, t, n) {
"use strict";
var i = n(1);
Object.defineProperty(t, "__esModule", {
value: !0
}), t.Sharing = t.SHARING_INIT_EVENT = t.SharingInit = void 0;
var r = i(n(10)),
o = i(n(19)),
a = i(n(20)),
u = i(n(68)),
s = i(n(69)),
d = i(n(70)),
c = i(n(71)),
l = i(n(17)),
f = {
SHARING_DECODE_SUCCESS: "SHARING_DECODE_INIT_SUCCESS",
SHARING_DECODE_FAILED: "SHARING_DECODE__INIT_FAILED",
SHARING_ENCODE_SUCCESS: "SHARING_ENCODE_INIT_SUCCESS",
SHARING_ENCODE_FAILED: "SHARING_ENCODE__INIT_FAILED"
};
t.SHARING_INIT_EVENT = f;
var h = function (e) {
function t() {
return (0, o.default)(this, t), (0, u.default)(this, (0, s.default)(t).call(this))
}
return (0, d.default)(t, e), (0, a.default)(t, null, [{
key: "publishSharingDecodeSuccessEvent",
value: function () {
l.default.trigger(f.SHARING_DECODE_SUCCESS)
}
}, {
key: "publishSharingDecodeFailedEvent",
value: function () {
l.default.trigger(f.SHARING_DECODE_FAILED)
}
}, {
key: "publishSharingEncodeSuccessEvent",
value: function () {
l.default.trigger(f.SHARING_ENCODE_SUCCESS)
}
}, {
key: "publishSharingEncodeFailedEvent",
value: function () {
l.default.trigger(f.SHARING_ENCODE_FAILED)
}
}]), t
}(c.default);
t.SharingInit = h;
var _ = function () {
function e() {
(0, o.default)(this, e)
}
return (0, a.default)(e, null, [{
key: "onSharingDecodeSuccess",
value: function () {
return new r.default(function (e, t) {
l.default.on(f.SHARING_DECODE_SUCCESS, function () {
e(!0)
})
})
}
}, {
key: "waitSharingDecodeResult",
value: function () {
return new r.default(function (e, t) {
l.default.on(f.SHARING_DECODE_SUCCESS, function () {
e(!0)
}), l.default.on(f.SHARING_DECODE_FAILED, function () {
e(!1)
})
})
}
}, {
key: "waitSharingEncodeResult",
value: function () {
return new r.default(function (e, t) {
l.default.on(f.SHARING_ENCODE_SUCCESS, function () {
e(!0)
}), l.default.on(f.SHARING_ENCODE_FAILED, function () {
e(!1)
})
})
}
}]), e
}();
t.Sharing = _
}, function (e, t, n) {
var i = n(63),
r = n(142);
e.exports = function (e, t) {
return !t || "object" !== i(t) && "function" != typeof t ? r(e) : t
}
}, function (e, t, n) {
var i = n(143),
r = n(95);
function o(t) {
return e.exports = o = r ? i : function (e) {
return e.__proto__ || i(e)
}, o(t)
}
e.exports = o
}, function (e, t, n) {
var i = n(149),
r = n(152);
e.exports = function (e, t) {
if ("function" != typeof t && null !== t) throw new TypeError("Super expression must either be null or a function");
e.prototype = i(t && t.prototype, {
constructor: {
value: e,
writable: !0,
configurable: !0
}
}), t && r(e, t)
}
}, function (e, t, n) {
"use strict";
var i = n(1);
Object.defineProperty(t, "__esModule", {
value: !0
}), t.default = void 0;
var r = i(n(19)),
o = i(n(20)),
a = function () {
function e() {
(0, r.default)(this, e), this.handler = !1, this.wasm = !1, this.socket = !1
}
return (0, o.default)(e, [{
key: "setHanderSuccess",
value: function () {
this.handler = !0
}
}, {
key: "setWasmSuccess",
value: function () {
this.wasm = !0
}
}, {
key: "setSocketSuccess",
value: function () {
this.socket = !0
}
}, {
key: "checkInitSuccess",
value: function () {
return this.handler && this.wasm && this.socket
}
}, {
key: "isSocketInitSuccess",
value: function () {
return this.socket
}
}]), e
}();
t.default = a
}, function (e, t, n) {
var i = n(41),
r = n(4)("iterator"),
o = n(15);
e.exports = n(0).getIteratorMethod = function (e) {
if (null != e) return e[r] || e["@@iterator"] || o[i(e)]
}
}, function (e, t, n) {
"use strict";
var i = n(1);
Object.defineProperty(t, "__esModule", {
value: !0
}), t.Video = t.VIDEO_EVENT = t.VideoInit = void 0;
var r = i(n(68)),
o = i(n(69)),
a = i(n(70)),
u = i(n(10)),
s = i(n(19)),
d = i(n(20)),
c = i(n(17)),
l = i(n(71)),
f = {
VIDEO_ENCODE_INIT_SUCCESS: "VIDEO_ENCODE_INIT_SUCCESS",
VIDEO_DECODE_INIT_SUCCESS: "VIDEO_DECODE_INIT_SUCCESS",
VIDEO_ENCODE_INIT_FAILED: "VIDEO_ENCODE_INIT_FAILED",
VIDEO_DECODE_INIT_FAILED: "VIDEO_DECODE_INIT_FAILED"
};
t.VIDEO_EVENT = f;
var h = function () {
function e() {
(0, s.default)(this, e)
}
return (0, d.default)(e, null, [{
key: "onVideoEncodeInitSuccess",
value: function () {
return new u.default(function (e, t) {
c.default.on(f.VIDEO_ENCODE_INIT_SUCCESS, function () {
return e(!0)
})
})
}
}, {
key: "onVideoDecodeInitSuccess",
value: function () {
return new u.default(function (e, t) {
c.default.on(f.VIDEO_DECODE_INIT_SUCCESS, function () {
return e(!0)
})
})
}
}, {
key: "waitVideoEncodeInitResult",
value: function () {
return new u.default(function (e, t) {
c.default.on(f.VIDEO_ENCODE_INIT_SUCCESS, function () {
return e(!0)
}), c.default.on(f.VIDEO_ENCODE_INIT_FAILED, function () {
return e(!1)
})
})
}
}, {
key: "waitVideoDecodeInitResult",
value: function () {
return new u.default(function (e, t) {
c.default.on(f.VIDEO_DECODE_INIT_SUCCESS, function () {
return e(!0)
}), c.default.on(f.VIDEO_DECODE_INIT_FAILED, function () {
return e(!1)
})
})
}
}, {
key: "onVideoSuccess",
value: function () {
return u.default.all([e.onVideoEncodeInitSuccess(), e.onVideoDecodeInitSuccess()])
}
}]), e
}();
t.Video = h;
var _ = function (e) {
function t() {
return (0, s.default)(this, t), (0, r.default)(this, (0, o.default)(t).call(this))
}
return (0, a.default)(t, e), (0, d.default)(t, null, [{
key: "publishEncodeInitSuccessEvent",
value: function () {
c.default.publish(f.VIDEO_ENCODE_INIT_SUCCESS)
}
}, {
key: "publishDecodeInitSuccessEvent",
value: function () {
c.default.publish(f.VIDEO_DECODE_INIT_SUCCESS)
}
}, {
key: "publishEncodeInitFAILEDEvent",
value: function () {
c.default.publish(f.VIDEO_ENCODE_INIT_FAILED)
}
}, {
key: "publishDecodeInitFAILEDEvent",
value: function () {
c.default.publish(f.VIDEO_DECODE_INIT_FAILED)
}
}]), t
}(l.default);
t.VideoInit = _
}, function (e, t, n) {
"use strict";
var i = n(1);
Object.defineProperty(t, "__esModule", {
value: !0
}), t.AudioService = t.AUDIO_INIT_EVENT = t.AudioInit = void 0;
var r = i(n(10)),
o = i(n(19)),
a = i(n(20)),
u = i(n(68)),
s = i(n(69)),
d = i(n(70)),
c = i(n(71)),
l = i(n(17)),
f = {
AUDIO_ENCODE_SUCCESS: "AUDIO_ENCODE_INIT_SUCCESS",
AUDIO_DECODE_SUCCESS: "AUDIO_DECODE_INIT_SUCCESS",
AUDIO_ENCODE_FAILED: "AUDIO_ENCODE_INIT_FAILED",
AUDIO_DECODE_FAILED: "AUDIO_DECODE_INIT_FAILED"
};
t.AUDIO_INIT_EVENT = f;
var h = function (e) {
function t() {
return (0, o.default)(this, t), (0, u.default)(this, (0, s.default)(t).call(this))
}
return (0, d.default)(t, e), (0, a.default)(t, null, [{
key: "publishAudioEncodeSuccessEvent",
value: function () {
l.default.trigger(f.AUDIO_ENCODE_SUCCESS)
}
}, {
key: "publishAudioDecodeSuccessEvent",
value: function () {
l.default.trigger(f.AUDIO_DECODE_SUCCESS)
}
}, {
key: "publishAudioEncodeFAILEDEvent",
value: function () {
l.default.trigger(f.AUDIO_ENCODE_FAILED)
}
}, {
key: "publishAudioDecodeFAILEDEvent",
value: function () {
l.default.trigger(f.AUDIO_DECODE_FAILED)
}
}]), t
}(c.default);
t.AudioInit = h;
var _ = function () {
function e() {
(0, o.default)(this, e)
}
return (0, a.default)(e, null, [{
key: "onAudioEncodeInitSuccess",
value: function () {
return new r.default(function (e, t) {
l.default.on(f.AUDIO_ENCODE_SUCCESS, function () {
e(!0)
})
})
}
}, {
key: "onAudioDecodeInitSuccess",
value: function () {
return new r.default(function (e, t) {
l.default.on(f.AUDIO_DECODE_SUCCESS, function () {
e(!0)
})
})
}
}, {
key: "waitAudioEncodeInitResult",
value: function () {
return new r.default(function (e, t) {
l.default.on(f.AUDIO_ENCODE_SUCCESS, function () {
e(!0)
}), l.default.on(f.AUDIO_ENCODE_FAILED, function () {
e(!1)
})
})
}
}, {
key: "waitAudioDecodeInitResult",
value: function () {
return new r.default(function (e, t) {
l.default.on(f.AUDIO_DECODE_SUCCESS, function () {
e(!0)
}), l.default.on(f.AUDIO_DECODE_FAILED, function () {
e(!1)
})
})
}
}]), e
}();
t.AudioService = _
}, function (e, t, n) {
"use strict";
var i = n(1);
Object.defineProperty(t, "__esModule", {
value: !0
}), t.WORKER_TYPE = t.workerStartTypeEnum = t.OS_ENUM = t.EncodeDecodeEnum = t.ZOOM_CONNECTION_TYPE = void 0;
var r = i(n(91));
t.ZOOM_CONNECTION_TYPE = {
ZOOM_CONNECTION_COMMAND: 0,
ZOOM_CONNECTION_AUDIO: 1,
ZOOM_CONNECTION_VIDEO: 2,
ZOOM_CONNECTION_SHARING_JPEG: 3,
ZOOM_CONNECTION_SHARING_VIDEO: 4,
ZOOM_CONNECTION_MEDIA_LOG: 5,
ZOOM_CONNECTION_SHARING_REMOTE_CONTROL: 6,
ZOOM_CONNECTION_UNKNOW: 7
}, t.EncodeDecodeEnum = {
encode: 1,
decode: 2
}, t.OS_ENUM = {
UNKNOWN: 0,
WIN: 1,
MAC: 2,
PAD: 3,
MOBILE: 4,
CALL_IN: 5,
LINUX: 6,
WEB: 7,
CHROME: 8
};
var o = {
videoEnc: (0, r.default)(),
videoDec: (0, r.default)(),
audioEnc: (0, r.default)(),
audioDec: (0, r.default)(),
sharingEnc: (0, r.default)(),
sharingDec: (0, r.default)()
};
t.workerStartTypeEnum = o, t.WORKER_TYPE = {
VIDEO_ENCODE: 0,
VIDEO_DECODE: 1,
AUDIO_ENCODE: 2,
AUDIO_DECODE: 3,
SHARING_ENCODE: 4,
SHARING_DECODE: 5
}
}, function (e, t, n) {
e.exports = !n(7) && !n(14)(function () {
return 7 != Object.defineProperty(n(51)("div"), "a", {
get: function () {
return 7
}
}).a
})
}, function (e, t, n) {
e.exports = n(110)
}, function (e, t, n) {
e.exports = n(11)
}, function (e, t, n) {
var i = n(13),
r = n(12),
o = n(116)(!1),
a = n(56)("IE_PROTO");
e.exports = function (e, t) {
var n, u = r(e),
s = 0,
d = [];
for (n in u) n != a && i(u, n) && d.push(n);
for (; t.length > s;) i(u, n = t[s++]) && (~o(d, n) || d.push(n));
return d
}
}, function (e, t, n) {
var i = n(2).document;
e.exports = i && i.documentElement
}, function (e, t, n) {
var i = n(13),
r = n(16),
o = n(56)("IE_PROTO"),
a = Object.prototype;
e.exports = Object.getPrototypeOf || function (e) {
return e = r(e), i(e, o) ? e[o] : "function" == typeof e.constructor && e instanceof e.constructor ? e.constructor.prototype : e instanceof Object ? a : null
}
}, function (e, t) {
e.exports = function (e, t) {
return {
value: t,
done: !!e
}
}
}, function (e, t, n) {
var i = n(8);
e.exports = function (e, t, n, r) {
try {
return r ? t(i(n)[0], n[1]) : t(n)
} catch (t) {
var o = e.return;
throw void 0 !== o && i(o.call(e)), t
}
}
}, function (e, t, n) {
var i = n(15),
r = n(4)("iterator"),
o = Array.prototype;
e.exports = function (e) {
return void 0 !== e && (i.Array === e || o[r] === e)
}
}, function (e, t, n) {
var i = n(8),
r = n(24),
o = n(4)("species");
e.exports = function (e, t) {
var n, a = i(e).constructor;
return void 0 === a || null == (n = i(a)[o]) ? t : r(n)
}
}, function (e, t, n) {
var i, r, o, a = n(9),
u = n(121),
s = n(80),
d = n(51),
c = n(2),
l = c.process,
f = c.setImmediate,
h = c.clearImmediate,
_ = c.MessageChannel,
E = c.Dispatch,
p = 0,
S = {},
v = function () {
var e = +this;
if (S.hasOwnProperty(e)) {
var t = S[e];
delete S[e], t()
}
},
A = function (e) {
v.call(e.data)
};
f && h || (f = function (e) {
for (var t = [], n = 1; arguments.length > n;) t.push(arguments[n++]);
return S[++p] = function () {
u("function" == typeof e ? e : Function(e), t)
}, i(p), p
}, h = function (e) {
delete S[e]
}, "process" == n(22)(l) ? i = function (e) {
l.nextTick(a(v, e, 1))
} : E && E.now ? i = function (e) {
E.now(a(v, e, 1))
} : _ ? (o = (r = new _).port2, r.port1.onmessage = A, i = a(o.postMessage, o, 1)) : c.addEventListener && "function" == typeof postMessage && !c.importScripts ? (i = function (e) {
c.postMessage(e + "", "*")
}, c.addEventListener("message", A, !1)) : i = "onreadystatechange" in d("script") ? function (e) {
s.appendChild(d("script")).onreadystatechange = function () {
s.removeChild(this), v.call(e)
}
} : function (e) {
setTimeout(a(v, e, 1), 0)
}), e.exports = {
set: f,
clear: h
}
}, function (e, t) {
e.exports = function (e) {
try {
return {
e: !1,
v: e()
}
} catch (e) {
return {
e: !0,
v: e
}
}
}
}, function (e, t, n) {
var i = n(8),
r = n(5),
o = n(60);
e.exports = function (e, t) {
if (i(e), r(t) && t.constructor === e) return t;
var n = o.f(e);
return (0, n.resolve)(t), n.promise
}
}, function (e, t, n) {
"use strict";
var i = n(2),
r = n(0),
o = n(6),
a = n(7),
u = n(4)("species");
e.exports = function (e) {
var t = "function" == typeof r[e] ? r[e] : i[e];
a && t && !t[u] && o.f(t, u, {
configurable: !0,
get: function () {
return this
}
})
}
}, function (e, t, n) {
var i = n(4)("iterator"),
r = !1;
try {
var o = [7][i]();
o.return = function () {
r = !0
}, Array.from(o, function () {
throw 2
})
} catch (e) {}
e.exports = function (e, t) {
if (!t && !r) return !1;
var n = !1;
try {
var o = [7],
a = o[i]();
a.next = function () {
return {
done: n = !0
}
}, o[i] = function () {
return a
}, e(o)
} catch (e) {}
return n
}
}, function (e, t, n) {
e.exports = n(135)
}, function (e, t, n) {
var i = n(22);
e.exports = Array.isArray || function (e) {
return "Array" == i(e)
}
}, function (e, t, n) {
var i = n(79),
r = n(58).concat("length", "prototype");
t.f = Object.getOwnPropertyNames || function (e) {
return i(e, r)
}
}, function (e, t, n) {
"use strict";
function i() {
this.a = [], this.b = 0, this.residue = null
}
Object.defineProperty(t, "__esModule", {
value: !0
}), t.default = void 0, i.prototype.getLength = function () {
return this.a.length - this.b
}, i.prototype.isEmpty = function () {
return 0 == this.a.length
}, i.prototype.enqueue = function (e) {
this.a.push(e)
}, i.prototype.dequeue = function () {
if (0 != this.a.length) {
var e = this.a[this.b];
return 2 * ++this.b >= this.a.length && (this.a = this.a.slice(this.b), this.b = 0), e
}
return null
}, i.prototype.peek = function () {
return 0 < this.a.length ? this.a[this.b] : void 0
};
var r = i;
t.default = r
}, function (e, t, n) {
e.exports = n(146)
}, function (e, t, n) {
e.exports = n(166)
}, function (e, t, n) {
var i = n(5);
e.exports = function (e, t) {
if (!i(e) || e._t !== t) throw TypeError("Incompatible receiver, " + t + " required!");
return e
}
}, function (e, t, n) {
var i = n(182);
e.exports = function (e) {
return i(2, e)
}
}, function (e, t, n) {
var i = n(42),
r = n(185),
a = /^\s+|\s+$/g,
u = /^[-+]0x[0-9a-f]+$/i,
s = /^0b[01]+$/i,
d = /^0o[0-7]+$/i,
c = parseInt;
e.exports = function (e) {
if ("number" == typeof e) return e;
if (r(e)) return NaN;
if (i(e)) {
var t = "function" == typeof e.valueOf ? e.valueOf() : e;
e = i(t) ? t + "" : t
}
if ("string" != typeof e) return 0 === e ? e : +e;
e = e.replace(a, "");
var n = s.test(e);
return n || d.test(e) ? c(e.slice(2), n ? 2 : 8) : u.test(e) ? NaN : +e
}
}, function (e, t, n) {
var i = n(101).Symbol;
e.exports = i
}, function (e, t, n) {
var i = n(186),
r = "object" == typeof self && self && self.Object === Object && self,
o = i || r || Function("return this")();
e.exports = o
}, function (e, t) {
var n;
n = function () {
return this
}();
try {
n = n || new Function("return this")()
} catch (e) {
"object" == typeof window && (n = window)
}
e.exports = n
}, function (e, t, n) {
var i = n(192),
r = n(42);
e.exports = function (e, t, n) {
var a = !0,
u = !0;
if ("function" != typeof e) throw new TypeError("Expected a function");
return r(n) && (a = "leading" in n ? !!n.leading : a, u = "trailing" in n ? !!n.trailing : u), i(e, t, {
leading: a,
maxWait: t,
trailing: u
})
}
}, function (e, t, n) {
var i = n(36),
r = n(46);
e.exports = function (e) {
return "number" == typeof e || r(e) && "[object Number]" == i(e)
}
}, function (e, t, n) {
"use strict";
var i = n(30),
r = n(1);
Object.defineProperty(t, "__esModule", {
value: !0
}), t.UpdateAudioPlayStatus = function (e) {
O.default.isAudioPlayWork = e
}, t.UpdateVideoPlayStatus = function (e) {
O.default.isVideoPlayWork = e
}, t.UpdateSharingPlayStatus = function (e) {
O.default.isSharingPlayWork = e
}, t.ClearSharingBuffer = function () {
O.default.localSharingDecMGR && O.default.localSharingDecMGR.ClearBuffer()
}, t.SetLocalAudioPara = function (e) {
O.default.localAudioPara = e
}, t.JsVideoEngine_PreInit = function (e) {
return function () {
return (0, c.default)(o.default.mark(function e(t) {
var n, i;
return o.default.wrap(function (e) {
for (;;) switch (e.prev = e.next) {
case 0:
if (m("video pre init", t), O.default.localVideoDecMGR || (O.default.localVideoDecMGR = new f.VideoMGR), O.default.localVideoEncMGR || (O.default.localVideoEncMGR = new f.VideoMGR), O.default.videoDecWorkerPath = t.videoDecWorkerPath, O.default.videoEncWorkerPath = t.videoEncWorkerPath, t.videoDecWorkerPath !== t.videoEncWorkerPath) {
e.next = 13;
break
}
return e.next = 8, R(t.videoDecWorkerPath);
case 8:
n = e.sent, O.default.videoDecResponseText = n, O.default.videoEncResponseText = n, e.next = 18;
break;
case 13:
return e.next = 15, d.default.all([R(t.videoDecWorkerPath), R(t.videoEncWorkerPath)]);
case 15:
i = e.sent, O.default.videoDecResponseText = i[0], O.default.videoEncResponseText = i[1];
case 18:
O.default.mediaSDKHandle = t.handle, pe(0, null);
case 20:
case "end":
return e.stop()
}
}, e, this)
})).apply(this, arguments)
}.apply(this, arguments)
}, t.initVideoEncode = function (e) {
return function () {
return (0, c.default)(o.default.mark(function e(t) {
var n;
return o.default.wrap(function (e) {
for (;;) switch (e.prev = e.next) {
case 0:
return O.default.localVideoEncMGR || (O.default.localVideoEncMGR = new f.VideoMGR), O.default.videoEncWorkerPath = t, e.next = 4, R(t);
case 4:
return n = e.sent, O.default.videoEncResponseText = n, pe(0, null), e.next = 9, N();
case 9:
Ee();
case 10:
case "end":
return e.stop()
}
}, e, this)
})).apply(this, arguments)
}.apply(this, arguments)
}, t.initVideoDecode = function (e) {
return function () {
return (0, c.default)(o.default.mark(function e(t) {
var n;
return o.default.wrap(function (e) {
for (;;) switch (e.prev = e.next) {
case 0:
return O.default.localVideoDecMGR || (O.default.localVideoDecMGR = new f.VideoMGR), O.default.videoDecWorkerPath = t, e.next = 4, R(t);
case 4:
return n = e.sent, O.default.videoDecResponseText = n, _e(0, null), e.next = 9, N();
case 9:
he();
case 10:
case "end":
return e.stop()
}
}, e, this)
})).apply(this, arguments)
}.apply(this, arguments)
}, t.initAudioEncode = function (e) {
return function () {
return (0, c.default)(o.default.mark(function e(t) {
return o.default.wrap(function (e) {
for (;;) switch (e.prev = e.next) {
case 0:
return z(), O.default.localAudioEncMGR || (O.default.localAudioEncMGR = new f.AudioMGR), O.default.audioEncWorkerPath = t, e.next = 5, R(t);
case 5:
O.default.audioEncodeResponse = e.sent, Ie(0), k().then(function () {
Ae()
});
case 8:
case "end":
return e.stop()
}
}, e, this)
})).apply(this, arguments)
}.apply(this, arguments)
}, t.initAudioDecode = function (e) {
return function () {
return (0, c.default)(o.default.mark(function e(t) {
return o.default.wrap(function (e) {
for (;;) switch (e.prev = e.next) {
case 0:
return z(), O.default.localAudioDecMGR || (O.default.localAudioDecMGR = new f.AudioMGR), O.default.audioDecWorkerPath = t, e.next = 5, R(t);
case 5:
O.default.audioDecodeResponse = e.sent, ve(0, null), L().then(function () {
Se()
});
case 8:
case "end":
return e.stop()
}
}, e, this)
})).apply(this, arguments)
}.apply(this, arguments)
}, t.initSharingDecode = function (e) {
return function () {
return (0, c.default)(o.default.mark(function e(t) {
return o.default.wrap(function (e) {
for (;;) switch (e.prev = e.next) {
case 0:
return O.default.localSharingDecMGR || (O.default.localSharingDecMGR = new f.SharingMGR), O.default.localMouseDecMGR || (O.default.localMouseDecMGR = new f.SharingMGR), O.default.sharingDecWorkerPath = t, e.next = 5, R(t);
case 5:
O.default.sharingDecodeResponse = e.sent, Z(), new d.default(function (e, t) {
var n = setInterval(function () {
var t = O.default.localSharingDecMGR.Get(O.default.SPECIAL_ID);
t && O.default.isSharingDecodeWASMOK && O.default.localSharingPara && (clearInterval(n), e(!0))
}, 1e3 / 24)
}).then(function () {
W()
});
case 8:
case "end":
return e.stop()
}
}, e, this)
})).apply(this, arguments)
}.apply(this, arguments)
}, t.initSharingEncode = function (e) {
return function () {
return (0, c.default)(o.default.mark(function e(t) {
return o.default.wrap(function (e) {
for (;;) switch (e.prev = e.next) {
case 0:
return O.default.localSharingEncMGR || (O.default.localSharingEncMGR = new f.SharingMGR), O.default.sharingEncWorkerPath = t, e.next = 4, R(t);
case 4:
O.default.sharingEncodeResponse = e.sent, q(), new d.default(function (e, t) {
var n = setInterval(function () {
var t = O.default.localSharingEncMGR.Get(O.default.SPECIAL_ID);
t && O.default.isSharingEncodeWASMOK && O.default.localSharingPara && (clearInterval(n), e(!0))
}, 1e3 / 24)
}).then(function () {
H()
});
case 7:
case "end":
return e.stop()
}
}, e, this)
})).apply(this, arguments)
}.apply(this, arguments)
}, t.SetTotalEvent = function (e) {
e.videoDecWorkerPath && (O.default.TotalWaitEvent += 6), e.audioDecWorkerPath && (O.default.TotalWaitEvent += 6), e.imageDecWorkerPath && (O.default.TotalWaitEvent += 3)
}, t.JsSharingEngine_PreInit = function (e) {
O.default.localSharingDecMGR || (O.default.localSharingDecMGR = new f.SharingMGR), O.default.localMouseDecMGR || (O.default.localMouseDecMGR = new f.SharingMGR), O.default.sharingDecWorkerPath = e.imageDecWorkerPath, Z()
}, t.Sharing_Decode_Post_message = W, t.Sharing_Encode_Post_message = H, t.JsAudioEngine_PreInit = function (e) {
return function () {
return (0, c.default)(o.default.mark(function e(t) {
var n;
return o.default.wrap(function (e) {
for (;;) switch (e.prev = e.next) {
case 0:
if (z(), O.default.localAudioDecMGR || (O.default.localAudioDecMGR = new f.AudioMGR), O.default.localAudioEncMGR || (O.default.localAudioEncMGR = new f.AudioMGR), O.default.audioDecWorkerPath = t.audioDecWorkerPath, O.default.audioEncWorkerPath = t.audioEncWorkerPath, t.audioDecWorkerPath !== t.audioEncWorkerPath) {
e.next = 13;
break
}
return e.next = 8, R(t.audioDecWorkerPath);
case 8:
n = e.sent, O.default.audioEncodeResponse = n, O.default.audioDecodeResponse = n, e.next = 15;
break;
case 13:
return e.next = 15, d.default.all([R(t.audioEncWorkerPath), R(t.audioDecWorkerPath)]).then(function (e) {
O.default.audioEncodeResponse = e[0], O.default.audioDecodeResponse = e[1]
});
case 15:
Ie(0);
case 16:
case "end":
return e.stop()
}
}, e, this)
})).apply(this, arguments)
}.apply(this, arguments)
}, t.JsSharingEngine_Init = function (e, t) {
O.default.localSharingPara || (O.default.localSharingPara = t), O.default.localSharingDecMGR || (O.default.localSharingDecMGR = new f.SharingMGR), O.default.localMouseDecMGR || (O.default.localMouseDecMGR = new f.SharingMGR), te(e), Z()
}, t.setSharingEngineInitProperties = function (e, t) {
O.default.localSharingPara ? (0, u.default)(O.default.localSharingPara, t) : O.default.localSharingPara = t, te(e)
}, t.JsAudioEngine_Init = function (e, t) {
O.default.localAudioPara || (O.default.localAudioPara = t), O.default.localAudioDecMGR || (O.default.localAudioDecMGR = new f.AudioMGR), O.default.localAudioEncMGR || (O.default.localAudioEncMGR = new f.AudioMGR), ee(e), Ie(0)
}, t.setAudioEngineInitProperties = function (e, t) {
O.default.localAudioPara ? (0, u.default)(O.default.localAudioPara, t) : O.default.localAudioPara = t, ee(e)
}, t.JsVideoEngine_Init = function (e, t) {
O.default.localVideoPara || (O.default.localVideoPara = t), O.default.localVideoDecMGR || (O.default.localVideoDecMGR = new f.VideoMGR), pe(0, null), ne(e)
}, t.setVideoEngineInitProperties = function (e, t) {
O.default.localVideoPara ? (0, u.default)(O.default.localVideoPara, t) : O.default.localVideoPara = t, ne(e)
}, t.JsAudioEngine_UnInit = function () {
(function (e) {
if (e = O.default.SPECIAL_ID, O.default.localAudioEncMGR) {
var t = O.default.localAudioEncMGR.map.get(e);
t && (t.postMessage({
command: "closeMedia"
}), O.default.localAudioEncMGR.map.delete(e)), O.default.isAudioEncodePostStart = !1
}
})(O.default.SPECIAL_ID),
function (e) {
if (e = O.default.SPECIAL_ID, O.default.localAudioDecMGR) {
var t = O.default.localAudioDecMGR.map.get(O.default.SPECIAL_ID);
t && (t.postMessage({
command: "closeMedia"
}), O.default.localAudioDecMGR.map.delete(e)), O.default.isAudioDecodePostStart = !1
}
}(O.default.SPECIAL_ID), O.default.localAudioDecMGR = null, O.default.localAudioEncMGR = null
}, t.JsVideoEngine_UnInit = function () {
(function (e) {
if (e = O.default.SPECIAL_ID, O.default.localVideoDecMGR) {
var t = O.default.localVideoDecMGR.map.get(e);
t && (t.postMessage({
command: "closeMedia"
}), O.default.localVideoDecMGR.map.delete(e)), O.default.isVideoDecodePostStart = !1
}
})(O.default.SPECIAL_ID), O.default.localVideoDecMGR = null, O.default.localVideoEncMGR = null
}, t.JsSharingEngine_UnInit = function () {
! function () {
var e = O.default.SPECIAL_ID;
if (O.default.localSharingDecMGR) {
var t = O.default.localSharingDecMGR.Get(e);
t && (t.postMessage({
command: "closeMedia"
}), O.default.localSharingDecMGR = null), O.default.isSharingDecodeThreadStart = !1
}
}()
}, t.Uint8ToString = function (e) {
for (var t = [], n = 0; n < e.length; n += 32768) t.push(String.fromCharCode.apply(null, e.subarray(n, n + 32768)));
return t.join("")
}, t.Audio_Encode_Frame = function (e, t, n, i) {
if (e = O.default.SPECIAL_ID, O.default.localAudioEncMGR) {
var r = O.default.localAudioEncMGR.map.get(e);
if (r) {
var o = {
command: "EncodeAudioFrame",
data: t
};
r.postMessage(o, [o.data.buffer])
}
}
}, t.Video_Encode_Frame = function (e, t, n, i) {
if (O.default.localVideoEncMGR) {
var r = O.default.localVideoEncMGR.map.get(e);
if (r) {
var o = {
command: "encodeVideoFrame",
data: t
};
r.postMessage(o, [o.data.buffer])
}
}
}, t.Sharing_Encode_Frame = function (e, t, n, i, r, o) {
if (O.default.localSharingEncMGR) {
var a = O.default.localSharingEncMGR.map.get(e);
if (a) {
var u = {
command: "encodeSharingFrame",
data: t,
width: r,
height: o
};
a.postMessage(u, [u.data.buffer])
}
}
}, t.Get_Decoded_Video_Frame = ae, t.Get_Decoded_Sharing_Frame = ue, t.Get_Decoded_Mouse_Frame = function (e, t) {
if (O.default.localMouseDecMGR) {
var n = O.default.localMouseDecMGR.SharingQueueMGR.GetQueue(e);
return n ? n.dequeue() : null
}
}, t.Delete_Decoded_Mouse_Frame = se, t.Clear_Decoded_Sharing_Frame = function () {
return O.default.localSharingDecMGR ? O.default.localSharingDecMGR.SharingQueueMGR.ClearQueue() : O.default.localMouseDecMGR ? O.default.localMouseDecMGR.SharingQueueMGR.ClearQueue() : 0
}, t.Clear_Decoded_Video_Frame = function () {
return O.default.localVideoDecMGR ? O.default.localVideoDecMGR.VideoQueueMGR.ClearQueue() : 0
}, t.Get_SSRC_VIDEO_FPS = function (e) {
if (e >>= 10, O.default.localVideoDecMGR.VideoQueueMGR && O.default.localVideoDecMGR.VideoQueueMGR.ssrcInfo) {
var t = O.default.localVideoDecMGR.VideoQueueMGR.ssrcInfo.GetSSRCFpsInfo(e);
if (t) return Math.round(t)
}
return 0
}, t.Get_Decoded_Video_Buffer_Length = de, t.Get_Decoded_Audio_Buffer_Length = ce, t.Get_Decoded_Audio_Frame = function (e, t, n) {
if (O.default.localAudioDecMGR) {
e = O.default.SPECIAL_ID;
var i = n,
r = O.default.localAudioDecMGR.AudioQueueMGR.GetQueue(e),
o = null;
if (r) {
if (r.residue) {
if (r.residue.buffer.length > n) return o = r.residue.buffer.slice(0, n), r.residue.buffer = r.residue.buffer.slice(n), le(r.residue.ntptime), o;
if (r.residue.buffer.length === n) return o = r.residue.buffer, le(r.residue.ntptime), r.residue = null, o;
o = r.residue.buffer, le(r.residue.ntptime), r.residue = null, n -= o.length
}
for (var a = r.dequeue(); a && a.buffer.length < n;) le(a.ntptime), o = T(o, a.buffer), n -= a.buffer.length, a = r.dequeue();
if (a && (le(a.ntptime), 0 !== n && a.buffer.length === n ? o = T(o, a.buffer) : 0 !== n && a.buffer.length > n && (o = T(o, a.buffer.slice(0, n)), r.residue = {
buffer: a.buffer.slice(n),
ntptime: a.ntptime
})), o) {
if (o.length < i) return r.residue = {
buffer: o,
ntptime: null
}, null;
if (o.length == i) return o
}
}
return null
}
}, t.Add_Video_Decode_Thread = _e, t.Clear_Audio_Interval = function () {
(function () {
var e = O.default.SPECIAL_ID;
if (O.default.localAudioEncMGR)
for (var t = O.default.audio_pcm_queue.dequeue(); t;) {
var n = O.default.localAudioEncMGR.map.get(e);
O.default.isAudioEncodeWASMOK && n && n.postMessage(t, [t.data.buffer]), t = O.default.audio_pcm_queue.dequeue()
}
})(), clearInterval(O.default.audioPostInterval), O.default.audioPostInterval = null
}, t.Add_Audio_Decode_Thread = ve, t.Get_SSRC_Latest_Time = function (e) {
if (e >>= 10, O.default.localAudioDecMGR) {
var t = O.default.localAudioDecMGR.GetSSRCTimeMap(e);
return null === t ? 0 : t
}
}, t.Meeting_Fail_Over = function (e, t) {
var n = O.default.SPECIAL_ID,
i = O.default.localVideoDecMGR.map.get(n);
i.postMessage({
command: "failover",
websocket_ip_address: t
}), (i = O.default.localAudioDecMGR.map.get(n)).postMessage({
command: "failover",
websocket_ip_address: e
})
}, t.Modify_Audio_SampleRate = function (e) {
for (var t, n = O.default.SPECIAL_ID, i = O.default.audio_pcm_queue.dequeue(); i;) i = O.default.audio_pcm_queue.dequeue();
O.default.localAudioEncMGR && (t = O.default.localAudioEncMGR.map.get(n)) && O.default.isAudioEncodePostStart && t.postMessage({
command: "modifySampleRate",
sampleRate: e
}), O.default.localAudioDecMGR && (t = O.default.localAudioDecMGR.map.get(n)) && O.default.isAudioDecodePostStart && t.postMessage({
command: "modifySampleRate",
sampleRate: e
})
}, t.Notify_Audio_Thread_Status = function (e, t) {
var n;
(e = O.default.SPECIAL_ID, O.default.localAudioDecMGR) && ((n = O.default.localAudioDecMGR.map.get(e)) && n.postMessage({
command: "mute",
bOn: t
}));
O.default.localAudioEncMGR && ((n = O.default.localAudioEncMGR.map.get(e)) && n.postMessage({
command: "mute",
bOn: t
}))
}, t.Notify_Audio_Thread_Msg_Channel = function (e, t) {
var i, n = O.default.SPECIAL_ID;
O.default.localAudioDecMGR && ((i = O.default.localAudioDecMGR.map.get(n)) && i.postMessage({
command: "decodeAudioPort"
}, [e.port2]));
O.default.localAudioEncMGR && ((i = O.default.localAudioEncMGR.map.get(n)) && i.postMessage({
command: "encodeAudioPort"
}, [t.port1]))
}, t.Notify_Video_Encode_Thread = function (e) {
var t = O.default.SPECIAL_ID;
if (O.default.localVideoEncMGR) {
var n = O.default.localVideoEncMGR.map.get(t);
n && n.postMessage(e)
}
}, t.Notify_Audio_Thread_CurrentSSRC = function (e) {
var t = O.default.SPECIAL_ID;
if (O.default.localAudioDecMGR) {
var n = O.default.localAudioDecMGR.map.get(t);
n && n.postMessage({
command: "updateCurrentSSRC",
SSRC: e
})
}
}, t.Reset_Aec = function () {
var e = O.default.SPECIAL_ID;
if (O.default.localAudioEncMGR) {
var t = O.default.localAudioEncMGR.map.get(e);
t && t.postMessage({
command: "resetAec"
})
}
}, t.Set_Aec_Delay = function () {
var e = O.default.SPECIAL_ID,
t = 50;
if (O.default.audioDelay && (t = O.default.audioDelay), O.default.localAudioEncMGR) {
var n = O.default.localAudioEncMGR.map.get(e);
n && n.postMessage({
command: "SetAECDelay",
delay: t
})
}
}, t.Start_Monitor = function () {
D.default.init(), window.addEventListener("error", ge),
function () {
try {
D.default.add_monitor(["BSAGT:", navigator.userAgent].join("")), D.default.add_monitor("BSLITEND:" + (h.default.isLittleEndian() ? 1 : 0)), window.navigator.hardwareConcurrency && D.default.add_monitor("OSCPUS:" + window.navigator.hardwareConcurrency)
} catch (e) {}
}(), O.default.monitorIntervalHandle = setInterval(function () {
var e, t = D.default.get_monitor();
t && O.default.Notify_APPUI(l.MONITOR_LOG, (0, s.default)({
evt: 4167,
seq: 1,
body: {
data: t
}
})), (null != O.default.monitorAudioCapture || null != O.default.monitorEncodeVideo || null != O.default.monitorDecodeVideo || null != O.default.monitorVideoCapture || null != O.default.monitorEncodeSharing || null != O.default.monitorSharingEncodeAPPInfo || null != O.default.monitorVideoDecodeAPPInfo || null != O.default.monitorVideoEncodeAPPInfo) && (null != O.default.monitorVideoCapture && (e = De(e = "CAMERA," + O.default.monitorVideoUserID + ",0,webcam," + O.default.monitorVideoCapture, 7), e += ",{[END]}", O.default.Notify_APPUI(l.MONITOR_LOG, (0, s.default)({
evt: 4167,
seq: 1,
body: {
data: e
}
})), O.default.monitorVideoCapture = null), null != O.default.monitorAudioCapture && (e = "AUDIOD," + O.default.monitorAudioUserID + ",1,0,wclaudi,0," + O.default.monitorAudioCapture + ",0", e += ",{[END]}", O.default.Notify_APPUI(l.MONITOR_LOG, (0, s.default)({
evt: 4167,
seq: 1,
body: {
data: e
}
})), O.default.monitorAudioCapture = null), null == O.default.monitorEncodeVideo && null == O.default.monitorDecodeVideo || null == O.default.monitorVideoUserID || (e = "MCM_VIDEO," + O.default.monitorVideoUserID + ",0,0,0", e = null != O.default.monitorEncodeVideo ? (e = De(e = e + ",{[SEND]}," + O.default.monitorEncodeVideo.monitor_video_max_sub_for_me + "," + O.default.monitorEncodeVideo.video_width + "," + O.default.monitorEncodeVideo.video_height + "," + O.default.monitorEncodeVideo.max_fps + "," + O.default.monitorEncodeVideo.min_fps + "," + O.default.monitorEncodeVideo.avg_fps, 12)) + "," + O.default.monitorEncodeVideo.video_encoded_max_fps + "," + O.default.monitorEncodeVideo.video_encoded_min_fps + "," + O.default.monitorEncodeVideo.video_encoded_avg_fps + "," + O.default.monitorEncodeVideo.video_encoded_width + "," + O.default.monitorEncodeVideo.video_encoded_heigth + "," + O.default.monitorEncodeVideo.video_total_encoded_frames + "," + O.default.monitorEncodeVideo.video_send_buffer : De(e += ",{[SEND]}", 25), e = De(e += ",{[RTS]}", 5), e = De(e += ",{[VC]}", 12), null != O.default.monitorEncodeVideo ? e += ",{[ENCO]}," + O.default.monitorEncodeVideo.monitor_video_max_encode_time + "," + O.default.monitorEncodeVideo.monitor_video_min_encode_time + "," + O.default.monitorEncodeVideo.monitor_video_avg_encode_time + "," + O.default.monitorEncodeVideo.monitor_video_sdev_encode_time : e = De(e += ",{[ENCO]}", 4), null != O.default.monitorDecodeVideo ? e = (e = De(e = (e = De(e += ",{[RECV]}", 16)) + "," + O.default.monitorDecodeVideo.max_fps + "," + O.default.monitorDecodeVideo.min_fps + "," + O.default.monitorDecodeVideo.avg_fps + "," + O.default.monitorDecodeVideo.video_width + "," + O.default.monitorDecodeVideo.video_height + "," + O.default.monitorDecodeVideo.monitor_video_max_size, 5)) + "," + O.default.monitorDecodeVideo.monitor_video_max_size : e = De(e += ",{[RECV]}", 28), e = De(e += ",{[VQ]}", 13), null != O.default.monitorDecodeVideo ? e += ",{[DECO]}," + O.default.monitorDecodeVideo.monitor_video_max_decoding_time + "," + O.default.monitorDecodeVideo.monitor_video_min_decoding_time + "," + O.default.monitorDecodeVideo.monitor_video_avg_decoding_time + "," + O.default.monitorDecodeVideo.monitor_video_sdev_decoding_time : e = De(e += ",{[DECO]}", 4), O.default.monitorDecodeVideo = null, O.default.monitorEncodeVideo = null, e += ",{[END]}", O.default.Notify_APPUI(l.MONITOR_LOG, (0, s.default)({
evt: 4167,
seq: 1,
body: {
data: e
}
}))), null != O.default.monitorEncodeSharing && null != O.default.monitorSharingUserID && (e = "MCM_AS," + O.default.monitorSharingUserID + ",,", O.default.monitorEncodeSharing && (e = (e = e + ",{[SEND]}," + O.default.monitorEncodeSharing.sharing_max_sub_for_me + "," + O.default.monitorEncodeSharing.sharing_width + "," + O.default.monitorEncodeSharing.sharing_height + "," + O.default.monitorEncodeSharing.max_fps + "," + O.default.monitorEncodeSharing.min_fps + "," + O.default.monitorEncodeSharing.avg_fps + ",,,," + O.default.monitorEncodeSharing.sharing_encoded_max_fps + "," + O.default.monitorEncodeSharing.sharing_encoded_min_fps + "," + O.default.monitorEncodeSharing.sharing_encoded_avg_fps + ",,,,,,,,," + O.default.monitorEncodeSharing.sharing_encode_total_frames + ",,," + O.default.monitorEncodeSharing.monitor_stream_index) + ",{[ENCO]}," + O.default.monitorEncodeSharing.sharing_max_encoding_time + "," + O.default.monitorEncodeSharing.sharing_min_encoding_time + "," + O.default.monitorEncodeSharing.sharing_avg_encoding_time + "," + O.default.monitorEncodeSharing.sharing_sdev_encoding_time, e += ",{[END]}", O.default.Notify_APPUI(l.MONITOR_LOG, (0, s.default)({
evt: 4167,
seq: 1,
body: {
data: e
}
})))), null != O.default.monitorSharingEncodeAPPInfo && (O.default.Notify_APPUI(l.MONITOR_LOG, (0, s.default)({
evt: 4167,
seq: 1,
body: {
data: O.default.monitorSharingEncodeAPPInfo.data
}
})), O.default.monitorSharingEncodeAPPInfo = null), null != O.default.monitorVideoDecodeAPPInfo && (O.default.Notify_APPUI(l.MONITOR_LOG, (0, s.default)({
evt: 4167,
seq: 1,
body: {
data: O.default.monitorVideoDecodeAPPInfo.data
}
})), O.default.monitorVideoDecodeAPPInfo = null), null != O.default.monitorVideoEncodeAPPInfo && (O.default.Notify_APPUI(l.MONITOR_LOG, (0, s.default)({
evt: 4167,
seq: 1,
body: {
data: O.default.monitorVideoEncodeAPPInfo.data
}
})), O.default.monitorVideoEncodeAPPInfo = null))
}, 1e4)
}, t.Stop_Monitor = function () {
window.removeEventListener("error", ge), clearInterval(O.default.monitorIntervalHandle), D.default.send_instant_monitor()
}, t.Update_Video_Encrpt = function (e) {
var t = O.default.SPECIAL_ID;
if (O.default.localVideoEncMGR) {
var n = O.default.localVideoEncMGR.map.get(t);
n && n.postMessage({
command: "ENCRYPT",
encrypt: e
})
}
}, t.Update_Sharing_Encrpt = function (e) {
var t = O.default.SPECIAL_ID;
if (O.default.localSharingEncMGR) {
var n = O.default.localSharingEncMGR.Get(t);
n && n.postMessage({
command: "ENCRYPT",
encrypt: e
})
}
}, t.Update_Sharing_Encode_Status = function (e) {
if (O.default.localSharingEncMGR) {
var t = O.default.localSharingEncMGR.Get(O.default.SPECIAL_ID);
t && t.postMessage(e)
}
}, t.Notify_Sharing_Encode_Thread = function (e) {
if (O.default.localSharingEncMGR) {
var t = O.default.localSharingEncMGR.Get(O.default.SPECIAL_ID);
t && t.postMessage(e)
}
}, t.Update_Audio_Encrpt = function (e) {
var t = O.default.SPECIAL_ID;
if (O.default.localAudioEncMGR) {
var n = O.default.localAudioEncMGR.map.get(t);
n && n.postMessage({
command: "ENCRYPT",
encrypt: e
})
}
}, t.disableSocketReconnect = function () {
var e = O.default.SPECIAL_ID;
[O.default.localAudioDecMGR, O.default.localAudioEncMGR, O.default.localVideoDecMGR, O.default.localVideoEncMGR, O.default.localSharingDecMGR, O.default.localSharingEncMGR].forEach(function (t) {
t && t.map.get(e) && t.map.get(e).postMessage({
command: "SOCKET_RECONNECT",
disable: !0
})
})
}, t.destroyAllWorkers = function () {
var e = O.default.SPECIAL_ID;
[O.default.localAudioDecMGR, O.default.localAudioEncMGR, O.default.localVideoDecMGR, O.default.localVideoEncMGR, O.default.localSharingDecMGR, O.default.localSharingEncMGR].forEach(function (t) {
t && t.map.get(e) && t.map.get(e).terminate()
})
}, t.pushMessageToWorker = function (e, t) {
return function () {
return (0, c.default)(o.default.mark(function e(t, n) {
var i, r, a, u, s = arguments;
return o.default.wrap(function (e) {
for (;;) switch (e.prev = e.next) {
case 0:
if (i = s.length > 2 && void 0 !== s[2] ? s[2] : "PUSH_MESSAGE_FROM_MAIN_TO_WORKER", r = s.length > 3 && void 0 !== s[3] && s[3], a = s.length > 4 && void 0 !== s[4] && s[4], e.prev = 3, u = me(t)) {
e.next = 15;
break
}
if (a) {
e.next = 11;
break
}
return m("worker handle not ready, drop!", t, n, i), e.abrupt("return");
case 11:
return m.warn("worker handle not ready, waiting!", t, n, i), e.next = 14, Oe(t);
case 14:
u = e.sent;
case 15:
r ? u.postMessage({
command: i,
data: n
}, [n]) : u.postMessage({
command: i,
data: n
}), e.next = 22;
break;
case 18:
e.prev = 18, e.t0 = e.catch(3), m.warn("try to push message to workerType:".concat(t, ", but it does not exist. Command: ").concat(i, "; Message: ").concat(n)), m.warn(e.t0);
case 22:
case "end":
return e.stop()
}
}, e, this, [
[3, 18]
])
})).apply(this, arguments)
}.apply(this, arguments)
}, t.isVideoEncodeHandleReady = function () {
return null !== me(E.WORKER_TYPE.VIDEO_ENCODE)
};
var o = r(n(32)),
a = r(n(96)),
u = r(n(43)),
s = r(n(45)),
d = r(n(10)),
c = r(n(33)),
l = i(n(34)),
f = i(n(180)),
h = r(n(35)),
_ = (n(181), r(n(21))),
E = n(75),
p = n(73),
S = n(74),
v = n(67),
A = r(n(98)),
I = r(n(17)),
D = r(n(44)),
g = n(189),
O = r(n(29)),
m = (0, _.default)("sdk.engine");
function C() {
return (C = (0, c.default)(o.default.mark(function e(t, n, i, r) {
var a, u, s, d;
return o.default.wrap(function (e) {
for (;;) switch (e.prev = e.next) {
case 0:
e.t0 = r, e.next = e.t0 === E.workerStartTypeEnum.videoEnc ? 3 : e.t0 === E.workerStartTypeEnum.videoDec ? 5 : e.t0 === E.workerStartTypeEnum.audioEnc ? 7 : e.t0 === E.workerStartTypeEnum.audioDec ? 9 : e.t0 === E.workerStartTypeEnum.sharingDec ? 11 : e.t0 === E.workerStartTypeEnum.sharingEnc ? 13 : 15;
break;
case 3:
return a = O.default.videoEncResponseText, e.abrupt("break", 15);
case 5:
return a = O.default.videoDecResponseText, e.abrupt("break", 15);
case 7:
return a = O.default.audioEncodeResponse, e.abrupt("break", 15);
case 9:
return a = O.default.audioDecodeResponse, e.abrupt("break", 15);
case 11:
return a = O.default.sharingDecodeResponse, e.abrupt("break", 15);
case 13:
return a = O.default.sharingEncodeResponse, e.abrupt("break", 15);
case 15:
if (a) {
e.next = 19;
break
}
return e.next = 18, R(t);
case 18:
a = e.sent;
case 19:
u = t.slice(0, t.lastIndexOf("/")), s = "wasmUrl = '" + u + "/';" + a, d = new Worker(window.URL.createObjectURL(new Blob([s]))), n && n.call(i, d);
case 23:
case "end":
return e.stop()
}
}, e, this)
}))).apply(this, arguments)
}
function R(e) {
return h.default.download(e)
}
function y(e, t, n, i) {
! function (e, t, n, i) {
C.apply(this, arguments)
}(e, function (e) {
var i = O.default.SPECIAL_ID;
t && t.Add(i, e), e.onmessage = n
}, this, i)
}
function T(e, t) {
var n = 0;
if (null !== e) {
n = e.length;
var i = new Float32Array(n + t.length);
return i.set(e), i.set(t, n), i
}
return t
}
function N() {
return new d.default(function (e, t) {
var n = setInterval(function () {
O.default.Video_WebSocket_Ip_Address && O.default.localVideoPara && O.default.localVideoPara.confId && (e(O.default.Video_WebSocket_Ip_Address), clearInterval(n))
}, 1e3 / 24)
})
}
function k() {
return function () {
return (0, c.default)(o.default.mark(function e() {
return o.default.wrap(function (e) {
for (;;) switch (e.prev = e.next) {
case 0:
return e.abrupt("return", new d.default(function (e, t) {
var n = setInterval(function () {
var t = O.default.localAudioEncMGR.map.get(O.default.SPECIAL_ID);
O.default.localAudioPara && t && O.default.isAudioEncodeWASMOK && (clearInterval(n), e(!0))
}, 1e3 / 24)
}));
case 1:
case "end":
return e.stop()
}
}, e, this)
})).apply(this, arguments)
}.apply(this, arguments)
}
function L() {
return function () {
return (0, c.default)(o.default.mark(function e() {
return o.default.wrap(function (e) {
for (;;) switch (e.prev = e.next) {
case 0:
return e.abrupt("return", new d.default(function (e, t) {
var n = setInterval(function () {
var t = O.default.localAudioDecMGR.map.get(O.default.SPECIAL_ID);
O.default.localAudioPara && t && O.default.isAudioDecodeWASMOK && (clearInterval(n), e(!0))
}, 1e3 / 24)
}));
case 1:
case "end":
return e.stop()
}
}, e, this)
})).apply(this, arguments)
}.apply(this, arguments)
}
function W() {
if (O.default.localSharingDecMGR) {
var e = O.default.localSharingDecMGR.Get(O.default.SPECIAL_ID);
e && O.default.isSharingDecodeWASMOK && !O.default.isSharingDecodePostStart ? (e.postMessage({
command: "startMedia",
websocket_ip_address: O.default.Sharing_WebSocket_Ip_Address,
confId: O.default.localSharingPara.userid,
confKey: "",
logon: O.default.localSharingPara.logon,
meetingid: O.default.localSharingPara.meetingid,
meetingnumb: O.default.localSharingPara.meetingnumb
}), O.default.isSharingDecodePostStart = !0) : O.default.isSharingDecodePostStart || setTimeout(W, 100)
}
}
function H() {
if (O.default.localSharingEncMGR) {
var e = O.default.localSharingEncMGR.Get(O.default.SPECIAL_ID);
e && O.default.isSharingEncodeWASMOK && !O.default.isSharingEncodePostStart ? (e.postMessage({
command: "startMedia",
encode: !0,
websocket_ip_address: O.default.Sharing_WebSocket_Ip_Address,
confId: O.default.localSharingPara.userid,
confKey: "",
logon: O.default.localSharingPara.logon,
isChromeOrEdge: h.default.browser.isChrome || h.default.browser.isEdge,
meetingid: O.default.localSharingPara.meetingid,
meetingnumb: O.default.localSharingPara.meetingnumb
}), O.default.isSharingEncodePostStart = !0) : O.default.isSharingEncodePostStart || setTimeout(H, 100)
}
}
function K(e) {
var t = e.data;
O.default.SPECIAL_ID;
try {
! function () {
if (t.status === l.Sharing_Data)(function (e) {
try {
var t = e.ssrcFromPDU;
return null == t || (4294966272 & O.default.localSharingPara.userid) != (4294966272 & t)
} catch (e) {
return !0
}
})(t.data) && re(t.data);
else if (t.status === l.SHARING_DATA_VIDEO_MODE) ! function (e, t, n, i, r, o, a, u, s, d, c, f) {
if (O.default.mediaSDKHandle.currentSharingHeight == s && O.default.mediaSDKHandle.currentSharingWidth == u && O.default.mediaSDKHandle.currentSharingLogicHeight == c && O.default.mediaSDKHandle.currentSharingLogicWidth == d || O.default.Notify_APPUI(l.SHARING_PARA, {
body: {
height: c,
width: d,
logicHeight: c,
logicWidth: d
}
}), O.default.isSharingPlayWork && (O.default.mediaSDKHandle.currentSharingHeight = s, O.default.mediaSDKHandle.currentSharingWidth = u, O.default.mediaSDKHandle.currentSharingLogicHeight = c, O.default.mediaSDKHandle.currentSharingLogicWidth = d, O.default.localSharingDecMGR)) {
var h = O.default.localSharingDecMGR.SharingQueueMGR.GetQueue(e);
h || (h = O.default.localSharingDecMGR.SharingQueueMGR.AddQueue(e));
var _ = {
type: "sharing_data",
yuvdata: t,
ntptime: n,
ssrc: e,
width: i,
height: r,
r_x: o,
r_y: a,
r_w: u,
r_h: s,
logic_w: d,
logic_h: c,
yuv_limited: f
};
h.enqueue(_), O.default.localSharingDecMGR.SharingQueueMGR && O.default.localSharingDecMGR.SharingQueueMGR.ssrcInfo && O.default.localSharingDecMGR.SharingQueueMGR.ssrcInfo.UpdateSSRCInfo(_.ssrc, _.ntptime);
for (var p = O.default.localSharingDecMGR.SharingQueueMGR.GetQueueLength(e) - 10; p >= 0;) ue(e, 0), p--
}
}(t.sharing_ssrc, t.data, t.sharing_timestamp, t.sharing_width, t.sharing_height, t.rendering_x, t.rendering_y, t.rendering_w, t.rendering_h, t.logic_w, t.logic_h, t.yuv_limited);
else if (t.status === l.MOUSE_DATA_VIDEO_MODE) ! function (e, t, n, i, r, o, a, u, s, d) {
if (O.default.localMouseDecMGR) {
var c = O.default.localMouseDecMGR.SharingQueueMGR.GetQueue(e);
c || (c = O.default.localMouseDecMGR.SharingQueueMGR.AddQueue(e));
var l = {
type: "mouse_data",
buffer: t,
ntptime: n,
ssrc: e,
width: i,
height: r,
r_x: o,
r_y: a,
mLogic_w: u,
mLogic_h: s,
sync_id: d
};
c.enqueue(l);
for (var h = O.default.localMouseDecMGR.SharingQueueMGR.GetQueueLength(e) - 10; h >= 0;) se(e, 0), h--
}
}(t.mouse_ssrc, t.data, t.mouse_timestamp, t.mouse_width, t.mouse_height, t.mouse_x, t.mouse_y, t.mLogic_w, t.mLogic_h, t.sync_id);
else if (t.status === l.SHARING_DECODE_MESSAGE) O.default.Notify_APPUI(l.SHARING_DECODE_MAX_SIZE, {
ssrc: t.ssrc,
size: t.size
});
else if (t.status === l.Sharing_Dec_WASM_OK) D.default.add_monitor("SDWS"), O.default.isSharingDecodeWASMOK = !0, O.default.sharingDecInitInstance.setWasmSuccess();
else if (t.status === l.Sharing_Dec_WASM_FAILED) D.default.add_monitor("SDWF"), O.default.isInitialFailed || (O.default.Notify_APPUI && O.default.Notify_APPUI(l.INIT_FAILED, null), O.default.isInitialFailed = !0), v.SharingInit.publishSharingDecodeFailedEvent();
else if (t.status === l.Sharing_Handle_OK) D.default.add_monitor("SDHS"), O.default.sharingDecInitInstance.setHanderSuccess();
else if (t.status === l.Sharing_Handle_FAILED) D.default.add_monitor("SHHF"), O.default.isInitialFailed || (O.default.Notify_APPUI && O.default.Notify_APPUI(l.INIT_FAILED, null), O.default.isInitialFailed = !0), v.SharingInit.publishSharingDecodeFailedEvent();
else if (t.status === l.Sharing_Dec_WebSocket_OK) D.default.add_monitor("SDSS"), O.default.sharingDecInitInstance.setSocketSuccess();
else if (t.status === l.Sharing_Dec_WebSocket_FAILED) D.default.add_monitor("SDSF"), O.default.isInitialFailed || (O.default.sharingDecInitInstance.isSocketInitSuccess() ? O.default.Notify_APPUI_SAFE(l.VIDEO_WEBSOCKET_BROKEN, null) : (O.default.Notify_APPUI_SAFE(l.INIT_FAILED, null), O.default.isInitialFailed = !0)), v.SharingInit.publishSharingDecodeFailedEvent();
else if (t.status === l.DOWNLOAD_WASM_FROM_MAIN_THREAD) {
var e = O.default.localSharingDecMGR.map.get(O.default.SPECIAL_ID);
X(t.url, e)
} else t.status == l.APP_TROUBLESHOOTING_INFO ? (O.default.monitorSharingDecodeAPPInfo = t, O.default.Notify_APPUI(l.MONITOR_LOG, (0, s.default)({
evt: 4167,
seq: 1,
body: {
data: O.default.monitorSharingDecodeAPPInfo.data
}
})), O.default.monitorSharingDecodeAPPInfo = null) : t.status == l.WCL_TROUBLESHOOTING_INFO && D.default.add_monitor("SD" + t.data)
}()
} catch (e) {
m.error(e)
}
O.default.sharingDecInitInstance.checkInitSuccess() && v.SharingInit.publishSharingDecodeSuccessEvent()
}
function B(e) {
var t = e.data;
O.default.SPECIAL_ID;
try {
! function () {
if (t.status === l.Sharing_Data) re(t.data);
else if (t.status === l.Sharing_Dec_WASM_OK) D.default.add_monitor("SEWS"), O.default.isSharingEncodeWASMOK = !0, O.default.sharingEncInitInstance.setWasmSuccess();
else if (t.status === l.Sharing_Dec_WASM_FAILED) D.default.add_monitor("SEWF"), O.default.isInitialFailed || (O.default.Notify_APPUI && O.default.Notify_APPUI(l.INIT_FAILED, null), O.default.isInitialFailed = !0), v.SharingInit.publishSharingEncodeFailedEvent();
else if (t.status === l.Sharing_Handle_OK) D.default.add_monitor("SEHS"), O.default.sharingEncInitInstance.setHanderSuccess();
else if (t.status === l.Sharing_Handle_FAILED) D.default.add_monitor("SEHF"), O.default.isInitialFailed || (O.default.Notify_APPUI && O.default.Notify_APPUI(l.INIT_FAILED, null), O.default.isInitialFailed = !0), v.SharingInit.publishSharingEncodeFailedEvent();
else if (t.status === l.Sharing_Dec_WebSocket_OK) D.default.add_monitor("SESS"), O.default.sharingEncInitInstance.setSocketSuccess();
else if (t.status === l.Sharing_Dec_WebSocket_FAILED) D.default.add_monitor("SEWF"), O.default.isInitialFailed || (O.default.sharingEncInitInstance.isSocketInitSuccess() ? O.default.Notify_APPUI_SAFE(l.VIDEO_WEBSOCKET_BROKEN, null) : (O.default.Notify_APPUI_SAFE(l.INIT_FAILED, null), O.default.isInitialFailed = !0)), v.SharingInit.publishSharingEncodeFailedEvent();
else if (t.status == l.Video_Capture_Tick) O.default.mediaSDKHandle.Process_Sharing();
else if (t.status == l.MONITOR_MESSAGE) O.default.monitorEncodeSharing = t;
else if (t.status == l.DOWNLOAD_WASM_FROM_MAIN_THREAD) {
var e = O.default.localSharingEncMGR.map.get(O.default.SPECIAL_ID);
X(t.url, e)
} else t.status == l.APP_TROUBLESHOOTING_INFO ? (O.default.monitorSharingEncodeAPPInfo = t, O.default.Notify_APPUI(l.MONITOR_LOG, (0, s.default)({
evt: 4167,
seq: 1,
body: {
data: O.default.monitorSharingEncodeAPPInfo.data
}
})), O.default.monitorSharingEncodeAPPInfo = null) : t.status == l.WCL_TROUBLESHOOTING_INFO && D.default.add_monitor("SE" + t.data)
}()
} catch (e) {
m.error(e)
}
O.default.sharingEncInitInstance.checkInitSuccess() && v.SharingInit.publishSharingEncodeSuccessEvent()
}
function j(e) {
var t = e.data;
O.default.SPECIAL_ID;
try {
! function () {
if (t.status === l.VIDEO_DATA_DROP_RATIO);
else if (t.status === l.VIDEO_DROP_RATIO_FROM_WCL) {
var e = t.data;
I.default.trigger(l.VIDEO_DATA_FROM_WORKER, e)
} else if (0 === t.status) ! function (e, t, n, i, r, o, a, u, s, d, c) {
if (O.default.isVideoPlayWork && O.default.localVideoDecMGR) {
var l = O.default.localVideoDecMGR.VideoQueueMGR.GetQueue(e);
l || (l = O.default.localVideoDecMGR.VideoQueueMGR.AddQueue(e));
var f = {
yuvdata: t,
ntptime: n,
ssrc: e,
width: i,
height: r,
r_x: o,
r_y: a,
r_w: u,
r_h: s,
rotation: d,
yuv_limited: c
};
l.enqueue(f), O.default.localVideoDecMGR.VideoQueueMGR && O.default.localVideoDecMGR.VideoQueueMGR.ssrcInfo && O.default.localVideoDecMGR.VideoQueueMGR.ssrcInfo.UpdateSSRCInfo(f.ssrc >> 10, f.ntptime);
for (var _ = de(e) - 30; _ >= 0;) ae(e, 0), _--
}
}(t.video_ssrc, t.data, t.video_timestamp, t.video_width, t.video_height, t.rendering_x, t.rendering_y, t.rendering_w, t.rendering_h, t.rotation, t.yuv_limited);
else if (t.status === l.Video_Dec_WASM_OK) D.default.add_monitor("VDWS"), O.default.isVideoDecodeWASMOK = !0, O.default.videoDecInitInstance.setWasmSuccess();
else if (t.status === l.DECODE_MESSAGE) O.default.Notify_APPUI(l.VIDEO_DECODE_MAX_SIZE, {
ssrc: t.ssrc,
size: t.size
});
else if (t.status === l.Video_Dec_WASM_FAILED) D.default.add_monitor("VDWF"), O.default.isInitialFailed || (O.default.Notify_APPUI && O.default.Notify_APPUI(l.INIT_FAILED, null), O.default.isInitialFailed = !0), p.VideoInit.publishDecodeInitFAILEDEvent();
else if (t.status === l.Video_Dec_Handle_OK) D.default.add_monitor("VDHS"), O.default.videoDecInitInstance.setHanderSuccess();
else if (t.status === l.Video_Dec_Handle_FAILED) D.default.add_monitor("VDHF"), O.default.isInitialFailed || (O.default.Notify_APPUI && O.default.Notify_APPUI(l.INIT_FAILED, null), O.default.isInitialFailed = !0), p.VideoInit.publishDecodeInitFAILEDEvent();
else if (t.status === l.Video_Dec_WebSocket_OK) D.default.add_monitor("VDSS"), O.default.videoDecInitInstance.setSocketSuccess();
else if (t.status === l.Video_Dec_WebSocket_FAILED) D.default.add_monitor("VDSF"), O.default.isInitialFailed || (O.default.videoDecInitInstance.isSocketInitSuccess() ? O.default.Notify_APPUI_SAFE(l.VIDEO_WEBSOCKET_BROKEN, null) : (O.default.Notify_APPUI_SAFE(l.INIT_FAILED, null), O.default.isInitialFailed = !0)), p.VideoInit.publishDecodeInitFAILEDEvent();
else if (t.status == l.MONITOR_MESSAGE) O.default.monitorDecodeVideo = t;
else if (t.status == l.APP_TROUBLESHOOTING_INFO) O.default.monitorVideoDecodeAPPInfo = t, O.default.Notify_APPUI(l.MONITOR_LOG, (0, s.default)({
evt: 4167,
seq: 1,
body: {
data: O.default.monitorVideoDecodeAPPInfo.data
}
})), O.default.monitorVideoDecodeAPPInfo = null;
else if (t.status == l.DOWNLOAD_WASM_FROM_MAIN_THREAD) {
var n = O.default.localVideoDecMGR.map.get(O.default.SPECIAL_ID);
X(t.url, n)
} else t.status == l.WCL_TROUBLESHOOTING_INFO && D.default.add_monitor("VD" + t.data)
}()
} catch (e) {
m.error(e)
}
O.default.videoDecInitInstance.checkInitSuccess() && p.VideoInit.publishDecodeInitSuccessEvent()
}
function Q(e) {
var t = e.data;
O.default.SPECIAL_ID;
try {
! function () {
if (t.status === l.VIDEO_DATA_DROP_RATIO);
else if (t.status === l.VIDEO_ENCODED_DATA) {
var e = t.data;
I.default.trigger(l.VIDEO_DATA_FROM_WORKER, e)
} else if (0 === t.status);
else if (t.status === l.Video_Enc_WASM_OK || t.status === l.Video_Dec_WASM_OK) D.default.add_monitor("VEWS"), _e(0, null), O.default.isVideoEncodeWASMOK = !0, O.default.videoInitInstance.setWasmSuccess();
else if (t.status === l.Video_Enc_WASM_FAILED) D.default.add_monitor("VEWF"), O.default.isInitialFailed || (O.default.Notify_APPUI && O.default.Notify_APPUI(l.INIT_FAILED, null), O.default.isInitialFailed = !0), p.VideoInit.publishEncodeInitFAILEDEvent();
else if (t.status === l.Video_Enc_Handle_OK || l.Video_Dec_Handle_OK === t.status) D.default.add_monitor("VEHS"), O.default.videoInitInstance.setHanderSuccess();
else if (t.status === l.Video_Enc_Handle_FAILED || l.Video_Dec_Handle_FAILED === t.status) D.default.add_monitor("VEHF"), O.default.isInitialFailed || (O.default.Notify_APPUI && O.default.Notify_APPUI(l.INIT_FAILED, null), O.default.isInitialFailed = !0), p.VideoInit.publishEncodeInitFAILEDEvent();
else if (t.status === l.Video_Enc_WebSocket_OK || l.Video_Dec_WebSocket_OK === t.status) D.default.add_monitor("VESS"), O.default.videoInitInstance.setSocketSuccess();
else if (t.status === l.Video_Enc_WebSocket_FAILED || t.status === l.Video_Dec_WebSocket_FAILED) D.default.add_monitor("VESF"), O.default.isInitialFailed || (O.default.videoInitInstance.isSocketInitSuccess() ? O.default.Notify_APPUI_SAFE(l.VIDEO_WEBSOCKET_BROKEN, null) : (O.default.Notify_APPUI_SAFE(l.INIT_FAILED, null), O.default.isInitialFailed = !0)), p.VideoInit.publishEncodeInitFAILEDEvent(), I.default.trigger(p.VideoInit.publishEncodeInitFAILEDEvent());
else if (t.status === l.Video_Capture_Tick) O.default.mediaSDKHandle.Process_Video();
else if (t.status == l.MONITOR_MESSAGE) O.default.monitorEncodeVideo = t;
else if (t.status == l.APP_TROUBLESHOOTING_INFO) O.default.monitorVideoEncodeAPPInfo = t, O.default.Notify_APPUI(l.MONITOR_LOG, (0, s.default)({
evt: 4167,
seq: 1,
body: {
data: O.default.monitorVideoEncodeAPPInfo.data
}
})), O.default.monitorVideoEncodeAPPInfo = null;
else if (t.status === l.DOWNLOAD_WASM_FROM_MAIN_THREAD) {
var n = O.default.localVideoEncMGR.map.get(O.default.SPECIAL_ID);
X(t.url, n)
} else t.status == l.WCL_TROUBLESHOOTING_INFO && D.default.add_monitor("VE" + t.data)
}()
} catch (e) {
m.error(e)
}
O.default.videoInitInstance.checkInitSuccess() && p.VideoInit.publishEncodeInitSuccessEvent()
}
function X(e, t) {
h.default.downloadBinary(e).then(function (e) {
t.postMessage({
command: "DOWNLOAD_WASM_FROM_MAIN_THREAD_OK",
data: e
})
}).catch(function (e) {
t.postMessage({
command: "DOWNLOAD_WASM_FROM_MAIN_THREAD_FAILED",
data: e.message
})
})
}
function Y(e) {
var t = e.data,
n = O.default.SPECIAL_ID;
try {
! function () {
if (0 === t.status) {
if (t.time ? O.default.AudioNode ? O.default.AudioNode.postData("data", {
ssrc: O.default.CurrentSSRC,
data: t.data,
time: t.time
}) : oe(n, t.data, t.time) : O.default.AudioNode ? O.default.AudioNode.postData("data", {
ssrc: O.default.CurrentSSRC,
data: t.data,
time: null
}) : oe(n, t.data, null), O.default.localAudioEncMGR && !O.default.sharedBuffer) {
var e = O.default.localAudioEncMGR.map.get(n);
if (e && t.aec.length) {
var i = {
command: "EchoCancel",
data: t.aec,
channels: t.channels,
sampleHz: t.sampleHz
};
e.postMessage(i, [i.data.buffer])
}
}
} else if (t.status === l.Audio_Enc_WASM_OK || t.status === l.Audio_Dec_WASM_OK) D.default.add_monitor("ADWS"), O.default.isAudioDecodeWASMOK = !0, O.default.audioDecInitInstance.setWasmSuccess();
else if (t.status === l.Audio_Dec_WASM_FAILED) D.default.add_monitor("ADWF"), O.default.isInitialFailed || O.default.Notify_APPUI && (O.default.Notify_APPUI(l.INIT_FAILED, null), O.default.isInitialFailed = !0), S.AudioInit.publishAudioDecodeFAILEDEvent();
else if (t.status === l.Audio_Dec_Handle_OK) D.default.add_monitor("ADHS"), O.default.audioDecInitInstance.setHanderSuccess();
else if (t.status === l.Audio_Dec_Handle_FAILED) D.default.add_monitor("ADHF"), O.default.isInitialFailed || O.default.Notify_APPUI && (O.default.Notify_APPUI(l.INIT_FAILED, null), O.default.isInitialFailed = !0), S.AudioInit.publishAudioDecodeFAILEDEvent();
else if (t.status === l.Audio_Dec_WebSocket_OK) D.default.add_monitor("ADSS"), O.default.audioDecInitInstance.setSocketSuccess();
else if (t.status === l.Audio_Dec_WebSocket_FAILED) D.default.add_monitor("ADSF"), O.default.isInitialFailed || (O.default.audioDecInitInstance.isSocketInitSuccess() ? O.default.Notify_APPUI_SAFE(l.AUDIO_WEBSOCKET_BROKEN, null) : (O.default.Notify_APPUI_SAFE(l.INIT_FAILED, null), O.default.isInitialFailed = !0)), S.AudioInit.publishAudioDecodeFAILEDEvent();
else if (6 === t.status);
else if (-6 === t.status) O.default.isInitialFailed || O.default.Notify_APPUI && (O.default.Notify_APPUI(l.INIT_FAILED, null), O.default.isInitialFailed = !0), S.AudioInit.publishAudioDecodeFAILEDEvent();
else if (t.status == l.MONITOR_MESSAGE) O.default.monitorDecodeAudio = t;
else if (t.status === l.DOWNLOAD_WASM_FROM_MAIN_THREAD) {
var r = O.default.localAudioDecMGR.map.get(O.default.SPECIAL_ID);
X(t.url, r)
} else t.status == l.WCL_TROUBLESHOOTING_INFO && D.default.add_monitor("AD" + t.data)
}()
} catch (e) {
m.error(e)
}
O.default.audioDecInitInstance.checkInitSuccess() && S.AudioInit.publishAudioDecodeSuccessEvent()
}
function X(e, t) {
h.default.downloadBinary(e).then(function (e) {
t.postMessage({
command: "DOWNLOAD_WASM_FROM_MAIN_THREAD_OK",
data: e
})
}).catch(function (e) {
t.postMessage({
command: "DOWNLOAD_WASM_FROM_MAIN_THREAD_FAILED",
data: e.message
})
})
}
function J(e) {
if (O.default.localAudioDecMGR) {
try {
! function () {
var t = O.default.SPECIAL_ID,
n = e.data,
i = O.default.localAudioDecMGR.map.get(t);
if (0 == n.status) i && i.postMessage({
command: "EncodedAudioFrame",
data: n.data
}, [n.data.buffer]);
else if (n.status == l.AUDIO_ENCODED_DATA) I.default.trigger(l.AUDIO_DATA_FROM_WORKER, n.data);
else if (n.status === l.Audio_Enc_WASM_OK || n.status === l.Audio_Dec_WASM_OK) D.default.add_monitor("AEWS"), ve(0, null), O.default.isAudioEncodeWASMOK = !0, O.default.audioEncodeInitInstance.setWasmSuccess();
else if (n.status === l.Audio_Enc_WASM_FAILED || n.status === l.Audio_Dec_WASM_FAILED) D.default.add_monitor("AEWF"), O.default.isInitialFailed || O.default.Notify_APPUI && (O.default.Notify_APPUI(l.INIT_FAILED, null), O.default.isInitialFailed = !0), S.AudioInit.publishAudioEncodeFAILEDEvent();
else if (n.status === l.Audio_Dec_Handle_OK) D.default.add_monitor("AEHS"), O.default.audioEncodeInitInstance.setHanderSuccess();
else if (n.status === l.Audio_Dec_WebSocket_OK) D.default.add_monitor("AESS"), O.default.audioEncodeInitInstance.setSocketSuccess();
else if (n.status === l.Audio_Dec_WebSocket_FAILED) D.default.add_monitor("AESF"), O.default.isInitialFailed || (O.default.audioEncodeInitInstance.isSocketInitSuccess() ? O.default.Notify_APPUI_SAFE(l.AUDIO_WEBSOCKET_BROKEN, null) : (O.default.Notify_APPUI_SAFE(l.INIT_FAILED, null), O.default.isInitialFailed = !0)), S.AudioInit.publishAudioEncodeFAILEDEvent();
else if (n.status === l.Audio_Enc_Handle_FAILED || n.status === l.Audio_Dec_Handle_FAILED) D.default.add_monitor("AEHF"), O.default.isInitialFailed || O.default.Notify_APPUI && (O.default.Notify_APPUI(l.INIT_FAILED, null), O.default.isInitialFailed = !0), S.AudioInit.publishAudioEncodeFAILEDEvent();
else if (n.status === l.Audio_Mute) O.default.Notify_APPUI && O.default.Notify_APPUI(l.AUDIO_ZERO_DATA, null);
else if (n.status === l.AUDIO_DELAY) O.default.indexDbObject.put(n.delay, "delay"), O.default.openIndexFlag && O.default.indexDbObject.select("delay");
else if (n.status === l.DOWNLOAD_WASM_FROM_MAIN_THREAD) {
var r = O.default.localAudioEncMGR.map.get(O.default.SPECIAL_ID);
X(n.url, r)
} else n.status == l.WCL_TROUBLESHOOTING_INFO && D.default.add_monitor("AE" + n.data)
}()
} catch (e) {
m.error(e)
}
O.default.audioEncodeInitInstance.checkInitSuccess() && S.AudioInit.publishAudioEncodeSuccessEvent()
}
}
function q() {
if (O.default.localSharingEncMGR)
if (O.default.isSharingEncodeThreadStart) setTimeout(H, 100);
else {
if (O.default.isSharingEncodeThreadStart = !0, "" == O.default.sharingEncWorkerPath) return;
y(O.default.sharingEncWorkerPath, O.default.localSharingEncMGR, B)
}
}
function Z() {
if (O.default.localSharingDecMGR)
if (O.default.isSharingDecodeThreadStart) setTimeout(W, 100);
else {
if (O.default.isSharingDecodeThreadStart = !0, "" == O.default.sharingDecWorkerPath) return;
y(O.default.sharingDecWorkerPath, O.default.localSharingDecMGR, K)
}
}
var z = (0, A.default)(function () {
try {
O.default.sharedBuffer = new SharedArrayBuffer(480 * O.default.shareBufferSampleNumb * Int32Array.BYTES_PER_ELEMENT + 12 * O.default.shareBufferSampleNumb);
var e = new Int32Array(O.default.sharedBuffer);
g.Lock.initialize(e, 0)
} catch (e) {
O.default.sharedBuffer = null
}
});
function ee(e) {
O.default.Audio_WebSocket_Ip_Address || (O.default.Audio_WebSocket_Ip_Address = e)
}
function te(e) {
O.default.Sharing_WebSocket_Ip_Address || (O.default.Sharing_WebSocket_Ip_Address = e)
}
function ne(e) {
O.default.Video_WebSocket_Ip_Address || (O.default.Video_WebSocket_Ip_Address = e)
}
function re(e) {
O.default.localSharingDecMGR && ("sharingPara" == e.type && (D.default.add_monitor("SHPA"), I.default.publish(l.SHARING_PARAM_INFO_FROM_SOCKET, e.data), O.default.Notify_APPUI(l.SHARING_PARA, e.data)), O.default.isSharingPlayWork && O.default.localSharingDecMGR.PutData(e))
}
function oe(e, t, n) {
if (e = O.default.SPECIAL_ID, O.default.isAudioPlayWork && O.default.localAudioDecMGR) {
var i = O.default.localAudioDecMGR.AudioQueueMGR.GetQueue(e);
if (i || (i = O.default.localAudioDecMGR.AudioQueueMGR.AddQueue(e)), t = function (e) {
for (var t = new Int16Array(e.length / 2), n = 0; n < t.length; n++) t[n] = (255 & e[2 * n]) + ((255 & e[2 * n + 1]) << 8);
return function (e, t, n) {
for (var i = new Float32Array(e.length - 0), r = 0; r < n; r++) {
var o = e[r] / 32768;
o > 1 && (o = 1), o < -1 && (o = -1), i[r] = o
}
return i
}(t, 0, t.length)
}(t), n) {
var r = new a.default,
o = n.length / 12,
u = 0,
s = 0;
for (u = 0; u < o; u++) {
for (e = 0, s = 12 * u + 0; s < 12 * u + 4; s++) e += n[s] * Math.pow(256, s - 12 * u);
e >>= 10;
var d = 0;
for (s = 12 * u + 4; s < 12 * u + 12; s++) d += n[s] * Math.pow(256, s - 12 * u - 4);
r.set(e, d)
}
var c = {
buffer: t,
ntptime: r
}
} else c = {
buffer: t,
ntptime: null
};
i.enqueue(c);
var l = ce(e);
if (l > O.default.audioBufferSize + 2 && m("the length is " + l), l > 50)
for (var f = l - O.default.audioBufferSize; f >= 0;) fe(e), f--;
else if (l > O.default.audioBufferSize) {
var h = O.default.localAudioDecMGR.map.get(O.default.SPECIAL_ID);
h && h.postMessage({
command: "delay"
})
}
}
}
function ae(e, t) {
if (O.default.localVideoDecMGR) {
var n = O.default.localVideoDecMGR.VideoQueueMGR.GetQueue(e);
return n ? n.dequeue() : null
}
}
function ue(e, t) {
if (O.default.localSharingDecMGR) {
var n = O.default.localSharingDecMGR.SharingQueueMGR.GetQueue(e);
return n ? n.dequeue() : null
}
}
function se(e, t) {
if (O.default.localMouseDecMGR) {
var n = O.default.localMouseDecMGR.SharingQueueMGR.GetQueue(e);
return n ? n.dequeue() : null
}
}
function de(e) {
return O.default.localVideoDecMGR ? O.default.localVideoDecMGR.VideoQueueMGR.GetQueueLength(e) : 0
}
function ce(e) {
return e = O.default.SPECIAL_ID, O.default.localAudioDecMGR ? O.default.localAudioDecMGR.AudioQueueMGR.GetQueueLength(e) : 0
}
function le(e) {
O.default.localAudioDecMGR && O.default.localAudioDecMGR.UpdateSSRCTimeMap(e)
}
function fe(e) {
if (e = O.default.SPECIAL_ID, O.default.localAudioDecMGR) {
var t = O.default.localAudioDecMGR.AudioQueueMGR.GetQueue(e);
return t ? t.dequeue() : null
}
}
function he() {
if (O.default.localVideoDecMGR) {
var e = O.default.localVideoDecMGR.map.get(O.default.SPECIAL_ID);
e && O.default.isVideoDecodeWASMOK && !O.default.isVideoDecodePostStart && O.default.localVideoPara ? (e.postMessage({
command: "startMedia",
websocket_ip_address: O.default.Video_WebSocket_Ip_Address + "&mode=5",
confId: O.default.localVideoPara.confId,
confKey: "",
logon: O.default.localVideoPara.logon,
mtu_size: 0,
meetingid: O.default.localVideoPara.meetingid,
meetingnumb: O.default.localVideoPara.meetingnumb
}), O.default.isVideoDecodePostStart = !0) : O.default.isVideoDecodePostStart || setTimeout(he, 100)
}
}
function _e(e, t) {
if (O.default.SPECIAL_ID, O.default.localVideoDecMGR)
if (O.default.isVideoDecodeThreadStart) setTimeout(he, 100);
else {
if (O.default.isVideoDecodeThreadStart = !0, "" == O.default.videoDecWorkerPath) return;
y(O.default.videoDecWorkerPath, O.default.localVideoDecMGR, j, E.workerStartTypeEnum.videoDec)
}
}
function Ee() {
if (O.default.localVideoEncMGR) {
var e = O.default.localVideoEncMGR.map.get(O.default.SPECIAL_ID);
if (e && O.default.isVideoEncodeWASMOK && !O.default.isVideoEncodePostStart && O.default.localVideoPara) {
var t;
t = "firefox" === h.default.browserType.browser ? 1080 : 1070, O.default.mediaSDKHandle.mtu_size = t, e.postMessage({
command: "startMedia",
websocket_ip_address: O.default.Video_WebSocket_Ip_Address + "&mode=2",
confId: O.default.localVideoPara.confId,
confKey: "",
logon: O.default.localVideoPara.logon,
sendvideo: !0,
isChromeOrEdge: h.default.browser.isEdge || h.default.browser.isChrome,
mtu_size: t,
meetingid: O.default.localVideoPara.meetingid,
meetingnumb: O.default.localVideoPara.meetingnumb
}), O.default.isVideoEncodePostStart = !0
} else O.default.isVideoEncodePostStart || setTimeout(Ee, 100)
}
}
function pe(e, t) {
O.default.SPECIAL_ID, O.default.localVideoEncMGR && (O.default.isVideoEncodeThreadStart || (O.default.isVideoEncodeThreadStart = !0, y(O.default.videoEncWorkerPath, O.default.localVideoEncMGR, Q, E.workerStartTypeEnum.videoEnc)))
}
function Se() {
if (O.default.localAudioDecMGR) {
var e = O.default.localAudioDecMGR.map.get(O.default.SPECIAL_ID);
if (O.default.localAudioPara && e && O.default.isAudioDecodeWASMOK && !O.default.isAudioDecodePostStart) {
if (e.postMessage({
command: "startMedia",
websocket_ip_address: O.default.Audio_WebSocket_Ip_Address + "&mode=5",
sampleRate: O.default.localAudioPara.sampleRate,
userid: O.default.localAudioPara.userid,
logon: O.default.localAudioPara.logon,
isEdge: h.default.browser.isEdge,
decode: 1,
meetingid: O.default.localAudioPara.meetingid,
meetingnumb: O.default.localAudioPara.meetingnumb
}), O.default.sharedBuffer) try {
e.postMessage({
command: "sharedBuffer",
data: O.default.sharedBuffer
})
} catch (t) {
e.postMessage({
command: "sharedBuffer",
data: O.default.sharedBuffer
}, [O.default.sharedBuffer])
}
O.default.isAudioDecodePostStart = !0
} else O.default.isAudioDecodePostStart || setTimeout(Se, 100)
}
}
function ve(e, t) {
O.default.SPECIAL_ID, O.default.localAudioDecMGR && (O.default.isAudioDecodeThreadStart || (O.default.isAudioDecodeThreadStart = !0, y(O.default.audioDecWorkerPath, O.default.localAudioDecMGR, Y, E.workerStartTypeEnum.audioDec)))
}
function Ae() {
if (O.default.localAudioEncMGR) var e = O.default.localAudioEncMGR.map.get(O.default.SPECIAL_ID);
if (O.default.localAudioPara && e && O.default.isAudioEncodeWASMOK && !O.default.isAudioEncodePostStart) {
if (e.postMessage({
command: "startMedia",
websocket_ip_address: O.default.Audio_WebSocket_Ip_Address + "&mode=2",
sampleRate: O.default.localAudioPara.sampleRate,
userid: O.default.localAudioPara.userid,
encode: 1,
meetingid: O.default.localAudioPara.meetingid,
meetingnumb: O.default.localAudioPara.meetingnumb
}), O.default.sharedBuffer) try {
e.postMessage({
command: "sharedBuffer",
data: O.default.sharedBuffer
})
} catch (t) {
e.postMessage({
command: "sharedBuffer",
data: O.default.sharedBuffer
}, [O.default.sharedBuffer])
}
O.default.isAudioEncodePostStart = !0
} else setTimeout(Ae, 100)
}
function Ie(e) {
O.default.SPECIAL_ID, O.default.isAudioEncodeThreadStart || (O.default.isAudioEncodeThreadStart = !0, y(O.default.audioEncWorkerPath, O.default.localAudioEncMGR, J, E.workerStartTypeEnum.audioEnc))
}
function De(e, t) {
if (t <= 0) return e;
for (var n = 0; n < t - 1; n++) e += ",";
return e + ",0"
}
function ge(e) {
D.default && e && (m("error", e.message), D.default.add_monitor(["ERR:", e.message, "f"].join("")))
}
function Oe(e) {
return new d.default(function (t, n) {
var o = 0;
! function a() {
if (++o >= 40) return n("Timeout. wait for worker ".concat(e, " to be ready."));
me(e) ? t(me(e)) : setTimeout(a, 500)
}()
})
}
function me(e) {
var t = new a.default;
t.set(E.WORKER_TYPE.AUDIO_DECODE, O.default.localAudioDecMGR), t.set(E.WORKER_TYPE.AUDIO_ENCODE, O.default.localAudioEncMGR), t.set(E.WORKER_TYPE.VIDEO_DECODE, O.default.localVideoDecMGR), t.set(E.WORKER_TYPE.VIDEO_ENCODE, O.default.localVideoEncMGR), t.set(E.WORKER_TYPE.SHARING_DECODE, O.default.localSharingDecMGR), t.set(E.WORKER_TYPE.SHARING_ENCODE, O.default.localSharingEncMGR);
var n = O.default.SPECIAL_ID,
i = t.get(e);
return i && i.map.get(n) ? i.map.get(n) : null
}
}, function (e, t, n) {
e.exports = n(126)
}, function (e, t, n) {
e.exports = n(108)
}, function (e, t, n) {
n(109);
var i = n(0).Object;
e.exports = function (e, t) {
return i.getOwnPropertyDescriptor(e, t)
}
}, function (e, t, n) {
var i = n(12),
r = n(49).f;
n(52)("getOwnPropertyDescriptor", function () {
return function (e, t) {
return r(i(e), t)
}
})
}, function (e, t, n) {
n(111);
var i = n(0).Object;
e.exports = function (e, t, n) {
return i.defineProperty(e, t, n)
}
}, function (e, t, n) {
var i = n(3);
i(i.S + i.F * !n(7), "Object", {
defineProperty: n(6).f
})
}, function (e, t, n) {
n(53), n(18), n(31), n(120), n(124), n(125), e.exports = n(0).Promise
}, function (e, t, n) {
var i = n(54),
r = n(48);
e.exports = function (e) {
return function (t, n) {
var o, a, u = String(r(t)),
s = i(n),
d = u.length;
return s < 0 || s >= d ? e ? "" : void 0 : (o = u.charCodeAt(s)) < 55296 || o > 56319 || s + 1 === d || (a = u.charCodeAt(s + 1)) < 56320 || a > 57343 ? e ? u.charAt(s) : o : e ? u.slice(s, s + 2) : a - 56320 + (o - 55296 << 10) + 65536
}
}
}, function (e, t, n) {
"use strict";
var i = n(38),
r = n(23),
o = n(27),
a = {};
n(11)(a, n(4)("iterator"), function () {
return this
}), e.exports = function (e, t, n) {
e.prototype = i(a, {
next: r(1, n)
}), o(e, t + " Iterator")
}
}, function (e, t, n) {
var i = n(6),
r = n(8),
o = n(26);
e.exports = n(7) ? Object.defineProperties : function (e, t) {
r(e);
for (var n, a = o(t), u = a.length, s = 0; u > s;) i.f(e, n = a[s++], t[n]);
return e
}
}, function (e, t, n) {
var i = n(12),
r = n(39),
o = n(117);
e.exports = function (e) {
return function (t, n, a) {
var u, s = i(t),
d = r(s.length),
c = o(a, d);
if (e && n != n) {
for (; d > c;)
if ((u = s[c++]) != u) return !0
} else
for (; d > c; c++)
if ((e || c in s) && s[c] === n) return e || c || 0;
return !e && -1
}
}
}, function (e, t, n) {
var i = n(54),
r = Math.max,
o = Math.min;
e.exports = function (e, t) {
return (e = i(e)) < 0 ? r(e + t, 0) : o(e, t)
}
}, function (e, t, n) {
"use strict";
var i = n(119),
r = n(82),
o = n(15),
a = n(12);
e.exports = n(55)(Array, "Array", function (e, t) {
this._t = a(e), this._i = 0, this._k = t
}, function () {
var e = this._t,
t = this._k,
n = this._i++;
return !e || n >= e.length ? (this._t = void 0, r(1)) : r(0, "keys" == t ? n : "values" == t ? e[n] : [n, e[n]])
}, "values"), o.Arguments = o.Array, i("keys"), i("values"), i("entries")
}, function (e, t) {
e.exports = function () {}
}, function (e, t, n) {
"use strict";
var i, r, o, a, u = n(25),
s = n(2),
d = n(9),
c = n(41),
l = n(3),
f = n(5),
h = n(24),
_ = n(59),
E = n(28),
p = n(85),
S = n(86).set,
v = n(122)(),
A = n(60),
I = n(87),
D = n(123),
g = n(88),
O = s.TypeError,
m = s.process,
C = m && m.versions,
R = C && C.v8 || "",
y = s.Promise,
T = "process" == c(m),
M = function () {},
P = r = A.f,
N = !! function () {
try {
var e = y.resolve(1),
t = (e.constructor = {})[n(4)("species")] = function (e) {
e(M, M)
};
return (T || "function" == typeof PromiseRejectionEvent) && e.then(M) instanceof t && 0 !== R.indexOf("6.6") && -1 === D.indexOf("Chrome/66")
} catch (e) {}
}(),
b = function (e) {
var t;
return !(!f(e) || "function" != typeof (t = e.then)) && t
},
w = function (e, t) {
if (!e._n) {
e._n = !0;
var n = e._c;
v(function () {
for (var i = e._v, r = 1 == e._s, o = 0, a = function (t) {
var n, o, a, u = r ? t.ok : t.fail,
s = t.resolve,
d = t.reject,
c = t.domain;
try {
u ? (r || (2 == e._h && L(e), e._h = 1), !0 === u ? n = i : (c && c.enter(), n = u(i), c && (c.exit(), a = !0)), n === t.promise ? d(O("Promise-chain cycle")) : (o = b(n)) ? o.call(n, s, d) : s(n)) : d(i)
} catch (e) {
c && !a && c.exit(), d(e)
}
}; n.length > o;) a(n[o++]);
e._c = [], e._n = !1, t && !e._h && k(e)
})
}
},
k = function (e) {
S.call(s, function () {
var t, n, i, r = e._v,
o = V(e);
if (o && (t = I(function () {
T ? m.emit("unhandledRejection", r, e) : (n = s.onunhandledrejection) ? n({
promise: e,
reason: r
}) : (i = s.console) && i.error && i.error("Unhandled promise rejection", r)
}), e._h = T || V(e) ? 2 : 1), e._a = void 0, o && t.e) throw t.v
})
},
V = function (e) {
return 1 !== e._h && 0 === (e._a || e._c).length
},
L = function (e) {
S.call(s, function () {
var t;
T ? m.emit("rejectionHandled", e) : (t = s.onrejectionhandled) && t({
promise: e,
reason: e._v
})
})
},
U = function (e) {
var t = this;
t._d || (t._d = !0, (t = t._w || t)._v = e, t._s = 2, t._a || (t._a = t._c.slice()), w(t, !0))
},
x = function (e) {
var t, n = this;
if (!n._d) {
n._d = !0, n = n._w || n;
try {
if (n === e) throw O("Promise can't be resolved itself");
(t = b(e)) ? v(function () {
var i = {
_w: n,
_d: !1
};
try {
t.call(e, d(x, i, 1), d(U, i, 1))
} catch (e) {
U.call(i, e)
}
}): (n._v = e, n._s = 1, w(n, !1))
} catch (e) {
U.call({
_w: n,
_d: !1
}, e)
}
}
};
N || (y = function (e) {
_(this, y, "Promise", "_h"), h(e), i.call(this);
try {
e(d(x, this, 1), d(U, this, 1))
} catch (e) {
U.call(this, e)
}
}, (i = function (e) {
this._c = [], this._a = void 0, this._s = 0, this._d = !1, this._v = void 0, this._h = 0, this._n = !1
}).prototype = n(61)(y.prototype, {
then: function (e, t) {
var n = P(p(this, y));
return n.ok = "function" != typeof e || e, n.fail = "function" == typeof t && t, n.domain = T ? m.domain : void 0, this._c.push(n), this._a && this._a.push(n), this._s && w(this, !1), n.promise
},
catch: function (e) {
return this.then(void 0, e)
}
}), o = function () {
var e = new i;
this.promise = e, this.resolve = d(x, e, 1), this.reject = d(U, e, 1)
}, A.f = P = function (e) {
return e === y || e === a ? new o(e) : r(e)
}), l(l.G + l.W + l.F * !N, {
Promise: y
}), n(27)(y, "Promise"), n(89)("Promise"), a = n(0).Promise, l(l.S + l.F * !N, "Promise", {
reject: function (e) {
var t = P(this);
return (0, t.reject)(e), t.promise
}
}), l(l.S + l.F * (u || !N), "Promise", {
resolve: function (e) {
return g(u && this === a ? y : this, e)
}
}), l(l.S + l.F * !(N && n(90)(function (e) {
y.all(e).catch(M)
})), "Promise", {
all: function (e) {
var t = this,
n = P(t),
i = n.resolve,
r = n.reject,
o = I(function () {
var n = [],
o = 0,
a = 1;
E(e, !1, function (e) {
var u = o++,
s = !1;
n.push(void 0), a++, t.resolve(e).then(function (e) {
s || (s = !0, n[u] = e, --a || i(n))
}, r)
}), --a || i(n)
});
return o.e && r(o.v), n.promise
},
race: function (e) {
var t = this,
n = P(t),
i = n.reject,
r = I(function () {
E(e, !1, function (e) {
t.resolve(e).then(n.resolve, i)
})
});
return r.e && i(r.v), n.promise
}
})
}, function (e, t) {
e.exports = function (e, t, n) {
var i = void 0 === n;
switch (t.length) {
case 0:
return i ? e() : e.call(n);
case 1:
return i ? e(t[0]) : e.call(n, t[0]);
case 2:
return i ? e(t[0], t[1]) : e.call(n, t[0], t[1]);
case 3:
return i ? e(t[0], t[1], t[2]) : e.call(n, t[0], t[1], t[2]);
case 4:
return i ? e(t[0], t[1], t[2], t[3]) : e.call(n, t[0], t[1], t[2], t[3])
}
return e.apply(n, t)
}
}, function (e, t, n) {
var i = n(2),
r = n(86).set,
o = i.MutationObserver || i.WebKitMutationObserver,
a = i.process,
u = i.Promise,
s = "process" == n(22)(a);
e.exports = function () {
var e, t, n, d = function () {
var i, r;
for (s && (i = a.domain) && i.exit(); e;) {
r = e.fn, e = e.next;
try {
r()
} catch (i) {
throw e ? n() : t = void 0, i
}
}
t = void 0, i && i.enter()
};
if (s) n = function () {
a.nextTick(d)
};
else if (!o || i.navigator && i.navigator.standalone)
if (u && u.resolve) {
var c = u.resolve(void 0);
n = function () {
c.then(d)
}
} else n = function () {
r.call(i, d)
};
else {
var l = !0,
f = document.createTextNode("");
new o(d).observe(f, {
characterData: !0
}), n = function () {
f.data = l = !l
}
}
return function (i) {
var r = {
fn: i,
next: void 0
};
t && (t.next = r), e || (e = r, n()), t = r
}
}
}, function (e, t, n) {
var i = n(2).navigator;
e.exports = i && i.userAgent || ""
}, function (e, t, n) {
"use strict";
var i = n(3),
r = n(0),
o = n(2),
a = n(85),
u = n(88);
i(i.P + i.R, "Promise", {
finally: function (e) {
var t = a(this, r.Promise || o.Promise),
n = "function" == typeof e;
return this.then(n ? function (n) {
return u(t, e()).then(function () {
return n
})
} : e, n ? function (n) {
return u(t, e()).then(function () {
throw n
})
} : e)
}
})
}, function (e, t, n) {
"use strict";
var i = n(3),
r = n(60),
o = n(87);
i(i.S, "Promise", {
try: function (e) {
var t = r.f(this),
n = o(e);
return (n.e ? t.reject : t.resolve)(n.v), t.promise
}
})
}, function (e, t, n) {
n(127), e.exports = n(0).Object.keys
}, function (e, t, n) {
var i = n(16),
r = n(26);
n(52)("keys", function () {
return function (e) {
return r(i(e))
}
})
}, function (e, t, n) {
var i = function () {
return this
}() || Function("return this")(),
r = i.regeneratorRuntime && Object.getOwnPropertyNames(i).indexOf("regeneratorRuntime") >= 0,
o = r && i.regeneratorRuntime;
if (i.regeneratorRuntime = void 0, e.exports = n(129), r) i.regeneratorRuntime = o;
else try {
delete i.regeneratorRuntime
} catch (e) {
i.regeneratorRuntime = void 0
}
}, function (e, t) {
! function (t) {
"use strict";
var n, i = Object.prototype,
r = i.hasOwnProperty,
o = "function" == typeof Symbol ? Symbol : {},
a = o.iterator || "@@iterator",
u = o.asyncIterator || "@@asyncIterator",
s = o.toStringTag || "@@toStringTag",
d = "object" == typeof e,
c = t.regeneratorRuntime;
if (c) d && (e.exports = c);
else {
(c = t.regeneratorRuntime = d ? e.exports : {}).wrap = I;
var l = "suspendedStart",
f = "suspendedYield",
h = "executing",
_ = "completed",
E = {},
p = {};
p[a] = function () {
return this
};
var S = Object.getPrototypeOf,
v = S && S(S(N([])));
v && v !== i && r.call(v, a) && (p = v);
var A = m.prototype = g.prototype = Object.create(p);
O.prototype = A.constructor = m, m.constructor = O, m[s] = O.displayName = "GeneratorFunction", c.isGeneratorFunction = function (e) {
var t = "function" == typeof e && e.constructor;
return !!t && (t === O || "GeneratorFunction" === (t.displayName || t.name))
}, c.mark = function (e) {
return Object.setPrototypeOf ? Object.setPrototypeOf(e, m) : (e.__proto__ = m, s in e || (e[s] = "GeneratorFunction")), e.prototype = Object.create(A), e
}, c.awrap = function (e) {
return {
__await: e
}
}, C(R.prototype), R.prototype[u] = function () {
return this
}, c.AsyncIterator = R, c.async = function (e, t, n, i) {
var r = new R(I(e, t, n, i));
return c.isGeneratorFunction(t) ? r : r.next().then(function (e) {
return e.done ? e.value : r.next()
})
}, C(A), A[s] = "Generator", A[a] = function () {
return this
}, A.toString = function () {
return "[object Generator]"
}, c.keys = function (e) {
var t = [];
for (var n in e) t.push(n);
return t.reverse(),
function n() {
for (; t.length;) {
var i = t.pop();
if (i in e) return n.value = i, n.done = !1, n
}
return n.done = !0, n
}
}, c.values = N, P.prototype = {
constructor: P,
reset: function (e) {
if (this.prev = 0, this.next = 0, this.sent = this._sent = n, this.done = !1, this.delegate = null, this.method = "next", this.arg = n, this.tryEntries.forEach(M), !e)
for (var t in this) "t" === t.charAt(0) && r.call(this, t) && !isNaN(+t.slice(1)) && (this[t] = n)
},
stop: function () {
this.done = !0;
var e = this.tryEntries[0].completion;
if ("throw" === e.type) throw e.arg;
return this.rval
},
dispatchException: function (e) {
if (this.done) throw e;
var t = this;
function i(i, r) {
return u.type = "throw", u.arg = e, t.next = i, r && (t.method = "next", t.arg = n), !!r
}
for (var o = this.tryEntries.length - 1; o >= 0; --o) {
var a = this.tryEntries[o],
u = a.completion;
if ("root" === a.tryLoc) return i("end");
if (a.tryLoc <= this.prev) {
var s = r.call(a, "catchLoc"),
d = r.call(a, "finallyLoc");
if (s && d) {
if (this.prev < a.catchLoc) return i(a.catchLoc, !0);
if (this.prev < a.finallyLoc) return i(a.finallyLoc)
} else if (s) {
if (this.prev < a.catchLoc) return i(a.catchLoc, !0)
} else {
if (!d) throw new Error("try statement without catch or finally");
if (this.prev < a.finallyLoc) return i(a.finallyLoc)
}
}
}
},
abrupt: function (e, t) {
for (var n = this.tryEntries.length - 1; n >= 0; --n) {
var i = this.tryEntries[n];
if (i.tryLoc <= this.prev && r.call(i, "finallyLoc") && this.prev < i.finallyLoc) {
var o = i;
break
}
}
o && ("break" === e || "continue" === e) && o.tryLoc <= t && t <= o.finallyLoc && (o = null);
var a = o ? o.completion : {};
return a.type = e, a.arg = t, o ? (this.method = "next", this.next = o.finallyLoc, E) : this.complete(a)
},
complete: function (e, t) {
if ("throw" === e.type) throw e.arg;
return "break" === e.type || "continue" === e.type ? this.next = e.arg : "return" === e.type ? (this.rval = this.arg = e.arg, this.method = "return", this.next = "end") : "normal" === e.type && t && (this.next = t), E
},
finish: function (e) {
for (var t = this.tryEntries.length - 1; t >= 0; --t) {
var n = this.tryEntries[t];
if (n.finallyLoc === e) return this.complete(n.completion, n.afterLoc), M(n), E
}
},
catch: function (e) {
for (var t = this.tryEntries.length - 1; t >= 0; --t) {
var n = this.tryEntries[t];
if (n.tryLoc === e) {
var i = n.completion;
if ("throw" === i.type) {
var r = i.arg;
M(n)
}
return r
}
}
throw new Error("illegal catch attempt")
},
delegateYield: function (e, t, i) {
return this.delegate = {
iterator: N(e),
resultName: t,
nextLoc: i
}, "next" === this.method && (this.arg = n), E
}
}
}
function I(e, t, n, i) {
var r = t && t.prototype instanceof g ? t : g,
o = Object.create(r.prototype),
a = new P(i || []);
return o._invoke = function (e, t, n) {
var i = l;
return function (r, o) {
if (i === h) throw new Error("Generator is already running");
if (i === _) {
if ("throw" === r) throw o;
return b()
}
for (n.method = r, n.arg = o;;) {
var a = n.delegate;
if (a) {
var u = y(a, n);
if (u) {
if (u === E) continue;
return u
}
}
if ("next" === n.method) n.sent = n._sent = n.arg;
else if ("throw" === n.method) {
if (i === l) throw i = _, n.arg;
n.dispatchException(n.arg)
} else "return" === n.method && n.abrupt("return", n.arg);
i = h;
var s = D(e, t, n);
if ("normal" === s.type) {
if (i = n.done ? _ : f, s.arg === E) continue;
return {
value: s.arg,
done: n.done
}
}
"throw" === s.type && (i = _, n.method = "throw", n.arg = s.arg)
}
}
}(e, n, a), o
}
function D(e, t, n) {
try {
return {
type: "normal",
arg: e.call(t, n)
}
} catch (e) {
return {
type: "throw",
arg: e
}
}
}
function g() {}
function O() {}
function m() {}
function C(e) {
["next", "throw", "return"].forEach(function (t) {
e[t] = function (e) {
return this._invoke(t, e)
}
})
}
function R(e) {
var t;
this._invoke = function (n, i) {
function o() {
return new Promise(function (t, o) {
! function t(n, i, o, a) {
var u = D(e[n], e, i);
if ("throw" !== u.type) {
var s = u.arg,
d = s.value;
return d && "object" == typeof d && r.call(d, "__await") ? Promise.resolve(d.__await).then(function (e) {
t("next", e, o, a)
}, function (e) {
t("throw", e, o, a)
}) : Promise.resolve(d).then(function (e) {
s.value = e, o(s)
}, function (e) {
return t("throw", e, o, a)
})
}
a(u.arg)
}(n, i, t, o)
})
}
return t = t ? t.then(o, o) : o()
}
}
function y(e, t) {
var i = e.iterator[t.method];
if (i === n) {
if (t.delegate = null, "throw" === t.method) {
if (e.iterator.return && (t.method = "return", t.arg = n, y(e, t), "throw" === t.method)) return E;
t.method = "throw", t.arg = new TypeError("The iterator does not provide a 'throw' method")
}
return E
}
var r = D(i, e.iterator, t.arg);
if ("throw" === r.type) return t.method = "throw", t.arg = r.arg, t.delegate = null, E;
var o = r.arg;
return o ? o.done ? (t[e.resultName] = o.value, t.next = e.nextLoc, "return" !== t.method && (t.method = "next", t.arg = n), t.delegate = null, E) : o : (t.method = "throw", t.arg = new TypeError("iterator result is not an object"), t.delegate = null, E)
}
function T(e) {
var t = {
tryLoc: e[0]
};
1 in e && (t.catchLoc = e[1]), 2 in e && (t.finallyLoc = e[2], t.afterLoc = e[3]), this.tryEntries.push(t)
}
function M(e) {
var t = e.completion || {};
t.type = "normal", delete t.arg, e.completion = t
}
function P(e) {
this.tryEntries = [{
tryLoc: "root"
}], e.forEach(T, this), this.reset(!0)
}
function N(e) {
if (e) {
var t = e[a];
if (t) return t.call(e);
if ("function" == typeof e.next) return e;
if (!isNaN(e.length)) {
var i = -1,
o = function t() {
for (; ++i < e.length;)
if (r.call(e, i)) return t.value = e[i], t.done = !1, t;
return t.value = n, t.done = !0, t
};
return o.next = o
}
}
return {
next: b
}
}
function b() {
return {
value: n,
done: !0
}
}
}(function () {
return this
}() || Function("return this")())
}, function (e, t, n) {
n(131), e.exports = n(0).Object.assign
}, function (e, t, n) {
var i = n(3);
i(i.S + i.F, "Object", {
assign: n(132)
})
}, function (e, t, n) {
"use strict";
var i = n(26),
r = n(62),
o = n(37),
a = n(16),
u = n(47),
s = Object.assign;
e.exports = !s || n(14)(function () {
var e = {},
t = {},
n = Symbol(),
i = "abcdefghijklmnopqrst";
return e[n] = 7, i.split("").forEach(function (e) {
t[e] = e
}), 7 != s({}, e)[n] || Object.keys(s({}, t)).join("") != i
}) ? function (e, t) {
for (var n = a(e), s = arguments.length, d = 1, c = r.f, l = o.f; s > d;)
for (var f, h = u(arguments[d++]), _ = c ? i(h).concat(c(h)) : i(h), E = _.length, p = 0; E > p;) l.call(h, f = _[p++]) && (n[f] = h[f]);
return n
} : s
}, function (e, t, n) {
e.exports = n(134)
}, function (e, t, n) {
n(18), n(31), e.exports = n(64).f("iterator")
}, function (e, t, n) {
n(136), n(53), n(139), n(140), e.exports = n(0).Symbol
}, function (e, t, n) {
"use strict";
var i = n(2),
r = n(13),
o = n(7),
a = n(3),
u = n(78),
s = n(65).KEY,
d = n(14),
c = n(57),
l = n(27),
f = n(40),
h = n(4),
_ = n(64),
E = n(66),
p = n(137),
S = n(92),
v = n(8),
A = n(5),
I = n(12),
D = n(50),
g = n(23),
O = n(38),
m = n(138),
C = n(49),
R = n(6),
y = n(26),
T = C.f,
M = R.f,
P = m.f,
N = i.Symbol,
b = i.JSON,
w = b && b.stringify,
k = h("_hidden"),
V = h("toPrimitive"),
L = {}.propertyIsEnumerable,
U = c("symbol-registry"),
x = c("symbols"),
G = c("op-symbols"),
F = Object.prototype,
W = "function" == typeof N,
H = i.QObject,
K = !H || !H.prototype || !H.prototype.findChild,
B = o && d(function () {
return 7 != O(M({}, "a", {
get: function () {
return M(this, "a", {
value: 7
}).a
}
})).a
}) ? function (e, t, n) {
var i = T(F, t);
i && delete F[t], M(e, t, n), i && e !== F && M(F, t, i)
} : M,
j = function (e) {
var t = x[e] = O(N.prototype);
return t._k = e, t
},
Q = W && "symbol" == typeof N.iterator ? function (e) {
return "symbol" == typeof e
} : function (e) {
return e instanceof N
},
X = function (e, t, n) {
return e === F && X(G, t, n), v(e), t = D(t, !0), v(n), r(x, t) ? (n.enumerable ? (r(e, k) && e[k][t] && (e[k][t] = !1), n = O(n, {
enumerable: g(0, !1)
})) : (r(e, k) || M(e, k, g(1, {})), e[k][t] = !0), B(e, t, n)) : M(e, t, n)
},
Y = function (e, t) {
v(e);
for (var n, i = p(t = I(t)), r = 0, o = i.length; o > r;) X(e, n = i[r++], t[n]);
return e
},
J = function (e) {
var t = L.call(this, e = D(e, !0));
return !(this === F && r(x, e) && !r(G, e)) && (!(t || !r(this, e) || !r(x, e) || r(this, k) && this[k][e]) || t)
},
q = function (e, t) {
if (e = I(e), t = D(t, !0), e !== F || !r(x, t) || r(G, t)) {
var n = T(e, t);
return !n || !r(x, t) || r(e, k) && e[k][t] || (n.enumerable = !0), n
}
},
Z = function (e) {
for (var t, n = P(I(e)), i = [], o = 0; n.length > o;) r(x, t = n[o++]) || t == k || t == s || i.push(t);
return i
},
z = function (e) {
for (var t, n = e === F, i = P(n ? G : I(e)), o = [], a = 0; i.length > a;) !r(x, t = i[a++]) || n && !r(F, t) || o.push(x[t]);
return o
};
W || (u((N = function () {
if (this instanceof N) throw TypeError("Symbol is not a constructor!");
var e = f(arguments.length > 0 ? arguments[0] : void 0),
t = function (n) {
this === F && t.call(G, n), r(this, k) && r(this[k], e) && (this[k][e] = !1), B(this, e, g(1, n))
};
return o && K && B(F, e, {
configurable: !0,
set: t
}), j(e)
}).prototype, "toString", function () {
return this._k
}), C.f = q, R.f = X, n(93).f = m.f = Z, n(37).f = J, n(62).f = z, o && !n(25) && u(F, "propertyIsEnumerable", J, !0), _.f = function (e) {
return j(h(e))
}), a(a.G + a.W + a.F * !W, {
Symbol: N
});
for (var $ = "hasInstance,isConcatSpreadable,iterator,match,replace,search,species,split,toPrimitive,toStringTag,unscopables".split(","), ee = 0; $.length > ee;) h($[ee++]);
for (var te = y(h.store), ne = 0; te.length > ne;) E(te[ne++]);
a(a.S + a.F * !W, "Symbol", {
for: function (e) {
return r(U, e += "") ? U[e] : U[e] = N(e)
},
keyFor: function (e) {
if (!Q(e)) throw TypeError(e + " is not a symbol!");
for (var t in U)
if (U[t] === e) return t
},
useSetter: function () {
K = !0
},
useSimple: function () {
K = !1
}
}), a(a.S + a.F * !W, "Object", {
create: function (e, t) {
return void 0 === t ? O(e) : Y(O(e), t)
},
defineProperty: X,
defineProperties: Y,
getOwnPropertyDescriptor: q,
getOwnPropertyNames: Z,
getOwnPropertySymbols: z
}), b && a(a.S + a.F * (!W || d(function () {
var e = N();
return "[null]" != w([e]) || "{}" != w({
a: e
}) || "{}" != w(Object(e))
})), "JSON", {
stringify: function (e) {
for (var t, n, i = [e], r = 1; arguments.length > r;) i.push(arguments[r++]);
if (n = t = i[1], (A(t) || void 0 !== e) && !Q(e)) return S(t) || (t = function (e, t) {
if ("function" == typeof n && (t = n.call(this, e, t)), !Q(t)) return t
}), i[1] = t, w.apply(b, i)
}
}), N.prototype[V] || n(11)(N.prototype, V, N.prototype.valueOf), l(N, "Symbol"), l(Math, "Math", !0), l(i.JSON, "JSON", !0)
}, function (e, t, n) {
var i = n(26),
r = n(62),
o = n(37);
e.exports = function (e) {
var t = i(e),
n = r.f;
if (n)
for (var a, u = n(e), s = o.f, d = 0; u.length > d;) s.call(e, a = u[d++]) && t.push(a);
return t
}
}, function (e, t, n) {
var i = n(12),
r = n(93).f,
o = {}.toString,
a = "object" == typeof window && window && Object.getOwnPropertyNames ? Object.getOwnPropertyNames(window) : [];
e.exports.f = function (e) {
return a && "[object Window]" == o.call(e) ? function (e) {
try {
return r(e)
} catch (e) {
return a.slice()
}
}(e) : r(i(e))
}
}, function (e, t, n) {
n(66)("asyncIterator")
}, function (e, t, n) {
n(66)("observable")
}, function (e, t, n) {
var i = n(0),
r = i.JSON || (i.JSON = {
stringify: JSON.stringify
});
e.exports = function (e) {
return r.stringify.apply(r, arguments)
}
}, function (e, t) {
e.exports = function (e) {
if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
return e
}
}, function (e, t, n) {
e.exports = n(144)
}, function (e, t, n) {
n(145), e.exports = n(0).Object.getPrototypeOf
}, function (e, t, n) {
var i = n(16),
r = n(81);
n(52)("getPrototypeOf", function () {
return function (e) {
return r(i(e))
}
})
}, function (e, t, n) {
n(147), e.exports = n(0).Object.setPrototypeOf
}, function (e, t, n) {
var i = n(3);
i(i.S, "Object", {
setPrototypeOf: n(148).set
})
}, function (e, t, n) {
var i = n(5),
r = n(8),
o = function (e, t) {
if (r(e), !i(t) && null !== t) throw TypeError(t + ": can't set as prototype!")
};
e.exports = {
set: Object.setPrototypeOf || ("__proto__" in {} ? function (e, t, i) {
try {
(i = n(9)(Function.call, n(49).f(Object.prototype, "__proto__").set, 2))(e, []), t = !(e instanceof Array)
} catch (e) {
t = !0
}
return function (e, n) {
return o(e, n), t ? e.__proto__ = n : i(e, n), e
}
}({}, !1) : void 0),
check: o
}
}, function (e, t, n) {
e.exports = n(150)
}, function (e, t, n) {
n(151);
var i = n(0).Object;
e.exports = function (e, t) {
return i.create(e, t)
}
}, function (e, t, n) {
var i = n(3);
i(i.S, "Object", {
create: n(38)
})
}, function (e, t, n) {
var i = n(95);
function r(t, n) {
return e.exports = r = i || function (e, t) {
return e.__proto__ = t, e
}, r(t, n)
}
e.exports = r
}, function (e, t, n) {
(function (e) {
! function (n, i) {
"use strict";
var r = {};
n.PubSub = r;
var o = n.define;
! function (e) {
var t = {},
n = -1;
function i(e) {
var t;
for (t in e)
if (e.hasOwnProperty(t)) return !0;
return !1
}
function r(e, t, n) {
try {
e(t, n)
} catch (e) {
setTimeout(function (e) {
return function () {
throw e
}
}(e), 0)
}
}
function o(e, t, n) {
e(t, n)
}
function a(e, n, i, a) {
var u, s = t[n],
d = a ? o : r;
if (t.hasOwnProperty(n))
for (u in s) s.hasOwnProperty(u) && d(s[u], e, i)
}
function u(e, n, r, o) {
var u = function (e, t, n) {
return function () {
var i = String(e),
r = i.lastIndexOf(".");
for (a(e, e, t, n); - 1 !== r;) r = (i = i.substr(0, r)).lastIndexOf("."), a(e, i, t, n)
}
}(e, n, o);
return !! function (e) {
for (var n = String(e), r = Boolean(t.hasOwnProperty(n) && i(t[n])), o = n.lastIndexOf("."); !r && -1 !== o;) o = (n = n.substr(0, o)).lastIndexOf("."), r = Boolean(t.hasOwnProperty(n) && i(t[n]));
return r
}(e) && (!0 === r ? u() : setTimeout(u, 0), !0)
}
e.publish = function (t, n) {
return u(t, n, !1, e.immediateExceptions)
}, e.publishSync = function (t, n) {
return u(t, n, !0, e.immediateExceptions)
}, e.subscribe = function (e, i) {
if ("function" != typeof i) return !1;
t.hasOwnProperty(e) || (t[e] = {});
var r = "uid_" + String(++n);
return t[e][r] = i, r
}, e.subscribeOnce = function (t, n) {
var i = e.subscribe(t, function () {
e.unsubscribe(i), n.apply(this, arguments)
});
return e
}, e.clearAllSubscriptions = function () {
t = {}
}, e.clearSubscriptions = function (e) {
var n;
for (n in t) t.hasOwnProperty(n) && 0 === n.indexOf(e) && delete t[n]
}, e.unsubscribe = function (n) {
var i, r, o, a = "string" == typeof n && (t.hasOwnProperty(n) || function (e) {
var n;
for (n in t)
if (t.hasOwnProperty(n) && 0 === n.indexOf(e)) return !0;
return !1
}(n)),
u = !a && "string" == typeof n,
s = "function" == typeof n,
d = !1;
if (!a) {
for (i in t)
if (t.hasOwnProperty(i)) {
if (r = t[i], u && r[n]) {
delete r[n], d = n;
break
}
if (s)
for (o in r) r.hasOwnProperty(o) && r[o] === n && (delete r[o], d = !0)
}
return d
}
e.clearSubscriptions(n)
}
}(r), "function" == typeof o && o.amd ? o(function () {
return r
}) : (void 0 !== e && e.exports && (t = e.exports = r), t.PubSub = r, e.exports = t = r)
}("object" == typeof window && window || this)
}).call(this, n(154)(e))
}, function (e, t) {
e.exports = function (e) {
return e.webpackPolyfill || (e.deprecate = function () {}, e.paths = [], e.children || (e.children = []), Object.defineProperty(e, "loaded", {
enumerable: !0,
get: function () {
return e.l
}
}), Object.defineProperty(e, "id", {
enumerable: !0,
get: function () {
return e.i
}
}), e.webpackPolyfill = 1), e
}
}, function (e, t, n) {
var i = n(156),
r = n(157),
o = n(165);
e.exports = function (e) {
return i(e) || r(e) || o()
}
}, function (e, t) {
e.exports = function (e) {
if (Array.isArray(e)) {
for (var t = 0, n = new Array(e.length); t < e.length; t++) n[t] = e[t];
return n
}
}
}, function (e, t, n) {
var i = n(158),
r = n(162);
e.exports = function (e) {
if (r(Object(e)) || "[object Arguments]" === Object.prototype.toString.call(e)) return i(e)
}
}, function (e, t, n) {
e.exports = n(159)
}, function (e, t, n) {
n(18), n(160), e.exports = n(0).Array.from
}, function (e, t, n) {
"use strict";
var i = n(9),
r = n(3),
o = n(16),
a = n(83),
u = n(84),
s = n(39),
d = n(161),
c = n(72);
r(r.S + r.F * !n(90)(function (e) {
Array.from(e)
}), "Array", {
from: function (e) {
var t, n, r, l, f = o(e),
h = "function" == typeof this ? this : Array,
_ = arguments.length,
E = _ > 1 ? arguments[1] : void 0,
p = void 0 !== E,
S = 0,
v = c(f);
if (p && (E = i(E, _ > 2 ? arguments[2] : void 0, 2)), null == v || h == Array && u(v))
for (n = new h(t = s(f.length)); t > S; S++) d(n, S, p ? E(f[S], S) : f[S]);
else
for (l = v.call(f), n = new h; !(r = l.next()).done; S++) d(n, S, p ? a(l, E, [r.value, S], !0) : r.value);
return n.length = S, n
}
})
}, function (e, t, n) {
"use strict";
var i = n(6),
r = n(23);
e.exports = function (e, t, n) {
t in e ? i.f(e, t, r(0, n)) : e[t] = n
}
}, function (e, t, n) {
e.exports = n(163)
}, function (e, t, n) {
n(31), n(18), e.exports = n(164)
}, function (e, t, n) {
var i = n(41),
r = n(4)("iterator"),
o = n(15);
e.exports = n(0).isIterable = function (e) {
var t = Object(e);
return void 0 !== t[r] || "@@iterator" in t || o.hasOwnProperty(i(t))
}
}, function (e, t) {
e.exports = function () {
throw new TypeError("Invalid attempt to spread non-iterable instance")
}
}, function (e, t, n) {
n(53), n(18), n(31), n(167), n(173), n(176), n(178), e.exports = n(0).Map
}, function (e, t, n) {
"use strict";
var i = n(168),
r = n(97);
e.exports = n(169)("Map", function (e) {
return function () {
return e(this, arguments.length > 0 ? arguments[0] : void 0)
}
}, {
get: function (e) {
var t = i.getEntry(r(this, "Map"), e);
return t && t.v
},
set: function (e, t) {
return i.def(r(this, "Map"), 0 === e ? 0 : e, t)
}
}, i, !0)
}, function (e, t, n) {
"use strict";
var i = n(6).f,
r = n(38),
o = n(61),
a = n(9),
u = n(59),
s = n(28),
d = n(55),
c = n(82),
l = n(89),
f = n(7),
h = n(65).fastKey,
_ = n(97),
E = f ? "_s" : "size",
p = function (e, t) {
var n, i = h(t);
if ("F" !== i) return e._i[i];
for (n = e._f; n; n = n.n)
if (n.k == t) return n
};
e.exports = {
getConstructor: function (e, t, n, d) {
var c = e(function (e, i) {
u(e, c, t, "_i"), e._t = t, e._i = r(null), e._f = void 0, e._l = void 0, e[E] = 0, null != i && s(i, n, e[d], e)
});
return o(c.prototype, {
clear: function () {
for (var e = _(this, t), n = e._i, i = e._f; i; i = i.n) i.r = !0, i.p && (i.p = i.p.n = void 0), delete n[i.i];
e._f = e._l = void 0, e[E] = 0
},
delete: function (e) {
var n = _(this, t),
i = p(n, e);
if (i) {
var r = i.n,
o = i.p;
delete n._i[i.i], i.r = !0, o && (o.n = r), r && (r.p = o), n._f == i && (n._f = r), n._l == i && (n._l = o), n[E]--
}
return !!i
},
forEach: function (e) {
_(this, t);
for (var n, i = a(e, arguments.length > 1 ? arguments[1] : void 0, 3); n = n ? n.n : this._f;)
for (i(n.v, n.k, this); n && n.r;) n = n.p
},
has: function (e) {
return !!p(_(this, t), e)
}
}), f && i(c.prototype, "size", {
get: function () {
return _(this, t)[E]
}
}), c
},
def: function (e, t, n) {
var i, r, o = p(e, t);
return o ? o.v = n : (e._l = o = {
i: r = h(t, !0),
k: t,
v: n,
p: i = e._l,
n: void 0,
r: !1
}, e._f || (e._f = o), i && (i.n = o), e[E]++, "F" !== r && (e._i[r] = o)), e
},
getEntry: p,
setStrong: function (e, t, n) {
d(e, t, function (e, n) {
this._t = _(e, t), this._k = n, this._l = void 0
}, function () {
for (var e = this._k, t = this._l; t && t.r;) t = t.p;
return this._t && (this._l = t = t ? t.n : this._t._f) ? c(0, "keys" == e ? t.k : "values" == e ? t.v : [t.k, t.v]) : (this._t = void 0, c(1))
}, n ? "entries" : "values", !n, !0), l(t)
}
}
}, function (e, t, n) {
"use strict";
var i = n(2),
r = n(3),
o = n(65),
a = n(14),
u = n(11),
s = n(61),
d = n(28),
c = n(59),
l = n(5),
f = n(27),
h = n(6).f,
_ = n(170)(0),
E = n(7);
e.exports = function (e, t, n, p, S, v) {
var A = i[e],
I = A,
D = S ? "set" : "add",
g = I && I.prototype,
O = {};
return E && "function" == typeof I && (v || g.forEach && !a(function () {
(new I).entries().next()
})) ? (I = t(function (t, n) {
c(t, I, e, "_c"), t._c = new A, null != n && d(n, S, t[D], t)
}), _("add,clear,delete,forEach,get,has,set,keys,values,entries,toJSON".split(","), function (e) {
var t = "add" == e || "set" == e;
e in g && (!v || "clear" != e) && u(I.prototype, e, function (n, i) {
if (c(this, I, e), !t && v && !l(n)) return "get" == e && void 0;
var r = this._c[e](0 === n ? 0 : n, i);
return t ? this : r
})
}), v || h(I.prototype, "size", {
get: function () {
return this._c.size
}
})) : (I = p.getConstructor(t, e, S, D), s(I.prototype, n), o.NEED = !0), f(I, e), O[e] = I, r(r.G + r.W + r.F, O), v || p.setStrong(I, e, S), I
}
}, function (e, t, n) {
var i = n(9),
r = n(47),
o = n(16),
a = n(39),
u = n(171);
e.exports = function (e, t) {
var n = 1 == e,
s = 2 == e,
d = 3 == e,
c = 4 == e,
l = 6 == e,
f = 5 == e || l,
h = t || u;
return function (t, u, _) {
for (var E, p, S = o(t), v = r(S), A = i(u, _, 3), I = a(v.length), D = 0, g = n ? h(t, I) : s ? h(t, 0) : void 0; I > D; D++)
if ((f || D in v) && (p = A(E = v[D], D, S), e))
if (n) g[D] = p;
else if (p) switch (e) {
case 3:
return !0;
case 5:
return E;
case 6:
return D;
case 2:
g.push(E)
} else if (c) return !1;
return l ? -1 : d || c ? c : g
}
}
}, function (e, t, n) {
var i = n(172);
e.exports = function (e, t) {
return new(i(e))(t)
}
}, function (e, t, n) {
var i = n(5),
r = n(92),
o = n(4)("species");
e.exports = function (e) {
var t;
return r(e) && ("function" != typeof (t = e.constructor) || t !== Array && !r(t.prototype) || (t = void 0), i(t) && null === (t = t[o]) && (t = void 0)), void 0 === t ? Array : t
}
}, function (e, t, n) {
var i = n(3);
i(i.P + i.R, "Map", {
toJSON: n(174)("Map")
})
}, function (e, t, n) {
var i = n(41),
r = n(175);
e.exports = function (e) {
return function () {
if (i(this) != e) throw TypeError(e + "#toJSON isn't generic");
return r(this)
}
}
}, function (e, t, n) {
var i = n(28);
e.exports = function (e, t) {
var n = [];
return i(e, !1, n.push, n, t), n
}
}, function (e, t, n) {
n(177)("Map")
}, function (e, t, n) {
"use strict";
var i = n(3);
e.exports = function (e) {
i(i.S, e, {
of: function () {
for (var e = arguments.length, t = new Array(e); e--;) t[e] = arguments[e];
return new this(t)
}
})
}
}, function (e, t, n) {
n(179)("Map")
}, function (e, t, n) {
"use strict";
var i = n(3),
r = n(24),
o = n(9),
a = n(28);
e.exports = function (e) {
i(i.S, e, {
from: function (e) {
var t, n, i, u, s = arguments[1];
return r(this), (t = void 0 !== s) && r(s), null == e ? new this : (n = [], t ? (i = 0, u = o(s, arguments[2], 2), a(e, !1, function (e) {
n.push(u(e, i++))
})) : a(e, !1, n.push, n), new this(n))
}
})
}
}, function (e, t, n) {
"use strict";
var i = n(1);
Object.defineProperty(t, "__esModule", {
value: !0
}), t.AudioQueueMGR = s, t.VideoQueueMGR = l, t.SharingQueueMGR = p, t.VideoMGR = h, t.SharingMGR = S, t.AudioMGR = t.SharingInfoMGR = t.SharingInfo = t.VideoInfoMGR = t.VideoInfo = t.VideoData = t.AudioData = void 0;
var r = i(n(96)),
o = i(n(94)),
a = function (e, t) {
this.timeStamp = t, this.buf = e
};
t.AudioData = a;
var u = function (e, t) {
this.timeStamp = t, this.buf = e
};
function s() {
this.ssrcQueueMap = new r.default, s.prototype.AddQueue = function (e) {
var t = new o.default;
return this.ssrcQueueMap.set(e, t), t
}, s.prototype.DeleteQueue = function (e) {
this.ssrcQueueMap.delete(e)
}, s.prototype.GetQueue = function (e) {
return this.ssrcQueueMap.get(e)
}, s.prototype.GetQueueData = function (e) {
return this.ssrcQueueMap.get(e).dequeue()
}, s.prototype.PutQueueData = function (e, t) {
this.ssrcQueueMap.get(e).enqueue(t)
}, s.prototype.GetQueueLength = function (e) {
var t = this.ssrcQueueMap.get(e);
return null !== t ? t.getLength() : 0
}
}
t.VideoData = u;
var d = function () {
this.frames = 0, this.ntp = new o.default
};
t.VideoInfo = d, d.prototype = {
UpdateVideoInfo: function (e) {
frames++, this.ntp.getLength() > 30 && this.ntp.dequeue(), this.ntp.enqueue(e)
},
GetVideoFpsInfo: function () {
var e = this.ntp.getLength();
if (!(e < 5)) {
for (var t = 0, n = 0, i = 0, r = 0, o = 0; o < e; o++) {
var a = this.ntp.dequeue();
0 == a && 0 == i ? n++ : 0 != a ? (r = 0, 0 == i && (i = a), t = a) : 0 != i && t != i && 0 == a && r++
}
return 0 == t || t == i ? 0 : e - n - r - 1 != 0 ? (t - i) / (e - n - r - 1) : 0
}
}
};
var c = function () {
this.ssrcInfoMap = new r.default
};
function l() {
this.ssrcQueueMap = new r.default, this.ssrcInfo = new c, l.prototype.AddQueue = function (e) {
var t = new o.default;
return this.ssrcQueueMap.set(e, t), t
}, l.prototype.DeleteQueue = function (e) {
this.ssrcQueueMap.delete(e)
}, l.prototype.GetQueue = function (e) {
return this.ssrcQueueMap.get(e)
}, l.prototype.ClearQueue = function () {
this.ssrcQueueMap.clear()
}, l.prototype.GetQueueData = function (e) {
return this.ssrcQueueMap.get(e).dequeue()
}, l.prototype.PutQueueData = function (e, t) {
this.ssrcQueueMap.get(e).enqueue(t)
}, l.prototype.GetQueueLength = function (e) {
var t = this.ssrcQueueMap.get(e);
return t ? t.getLength() : 0
}, l.prototype.UpdateInfo = function (e, t) {
this.ssrcInfo.UpdateSSRCInfo(e, t)
}, l.prototype.GetFpsInfo = function (e) {
return this.ssrcInfo.GetSSRCFpsInfo(e)
}
}
t.VideoInfoMGR = c, c.prototype = {
UpdateSSRCInfo: function (e, t) {
var n = this.ssrcInfoMap.get(e);
n ? n.UpdateVideoInfo(t) : (n = new d, this.ssrcInfoMap.set(e, n), n.UpdateVideoInfo(t))
},
GetSSRCFpsInfo: function (e) {
var t = this.ssrcInfoMap.get(e);
return t ? t.GetVideoFpsInfo() : 0
}
};
var f = function () {
function e() {
this.map = new r.default, this.AudioQueueMGR = new s, this.timemap = new r.default
}
return e.prototype.Add = function (e, t) {
this.map.set(e, t), this.AudioQueueMGR.AddQueue(e)
}, e.prototype.Clear = function () {
this.map.clear()
}, e.prototype.Keys = function () {
return this.map.keys()
}, e.prototype.UpdateSSRCTimeMap = function (e) {
this.timemap = e
}, e.prototype.GetSSRCTimeMap = function (e) {
return this.timemap ? this.timemap.get(e) : null
}, e
}();
function h() {
this.map = new r.default, this.VideoQueueMGR = new l
}
t.AudioMGR = f, h.prototype.Add = function (e, t) {
this.map.set(e, t)
}, h.prototype.Clear = function () {
this.map.clear()
}, h.prototype.Keys = function () {
return this.map.keys()
};
var _ = function () {
this.frames = 0, this.ntp = new o.default
};
t.SharingInfo = _, _.prototype = {
UpdateSharingInfo: function (e) {
frames++, this.ntp.getLength() > 30 && this.ntp.dequeue(), this.ntp.enqueue(e)
},
GetSharingFpsInfo: function () {
var e = this.ntp.getLength();
if (!(e < 5)) {
for (var t = 0, n = 0, i = 0, r = 0, o = 0; o < e; o++) {
var a = this.ntp.dequeue();
0 == a && 0 == i ? n++ : 0 != a ? (r = 0, 0 == i && (i = a), t = a) : 0 != i && t != i && 0 == a && r++
}
return 0 == t || t == i ? 0 : e - n - r - 1 != 0 ? (t - i) / (e - n - r - 1) : 0
}
}
};
var E = function () {
this.ssrcInfoMap = new r.default
};
function p() {
this.ssrcQueueMap = new r.default, this.ssrcInfo = new E, p.prototype.AddQueue = function (e) {
var t = new o.default;
return this.ssrcQueueMap.set(e, t), t
}, p.prototype.DeleteQueue = function (e) {
this.ssrcQueueMap.delete(e)
}, p.prototype.GetQueue = function (e) {
return this.ssrcQueueMap.get(e)
}, p.prototype.ClearQueue = function () {
this.ssrcQueueMap.clear()
}, p.prototype.GetQueueData = function (e) {
return this.ssrcQueueMap.get(e).dequeue()
}, p.prototype.PutQueueData = function (e, t) {
this.ssrcQueueMap.get(e).enqueue(t)
}, p.prototype.GetQueueLength = function (e) {
var t = this.ssrcQueueMap.get(e);
return t ? t.getLength() : 0
}, p.prototype.UpdateInfo = function (e, t) {
this.ssrcInfo.UpdateSSRCInfo(e, t)
}, p.prototype.GetFpsInfo = function (e) {
return this.ssrcInfo.GetSSRCFpsInfo(e)
}
}
function S() {
this.map = new r.default, this.sQueue = new o.default, this.SharingQueueMGR = new p
}
t.SharingInfoMGR = E, E.prototype = {
UpdateSSRCInfo: function (e, t) {
var n = this.ssrcInfoMap.get(e);
n ? n.UpdateSharingInfo(t) : (n = new _, this.ssrcInfoMap.set(e, n), n.UpdateSharingInfo(t))
},
GetSSRCFpsInfo: function (e) {
var t = this.ssrcInfoMap.get(e);
return t ? t.GetSharingFpsInfo() : 0
}
}, S.prototype.Clear = function () {
this.map.clear()
}, S.prototype.Keys = function () {
return this.map.keys()
}, S.prototype.Add = function (e, t) {
this.map.set(e, t)
}, S.prototype.Get = function (e) {
return this.map.get(e)
}, S.prototype.PutData = function (e) {
e && this.sQueue && this.sQueue.enqueue(e)
}, S.prototype.GetData = function () {
if (this.sQueue) return this.sQueue.dequeue()
}, S.prototype.ClearBuffer = function () {
this.sQueue && (this.sQueue = new o.default)
}
}, function (e, t, n) {
"use strict";
Object.defineProperty(t, "__esModule", {
value: !0
}), t.SOCKET_STATE = void 0, t.SOCKET_STATE = {
audio: {
decode: !1,
encode: !1
},
video: {
decode: !1,
encode: !1
}
}
}, function (e, t, n) {
var i = n(183);
e.exports = function (e, t) {
var n;
if ("function" != typeof t) throw new TypeError("Expected a function");
return e = i(e),
function () {
return --e > 0 && (n = t.apply(this, arguments)), e <= 1 && (t = void 0), n
}
}
}, function (e, t, n) {
var i = n(184);
e.exports = function (e) {
var t = i(e),
n = t % 1;
return t == t ? n ? t - n : t : 0
}
}, function (e, t, n) {
var i = n(99);
e.exports = function (e) {
return e ? (e = i(e)) === 1 / 0 || e === -1 / 0 ? 1.7976931348623157e308 * (e < 0 ? -1 : 1) : e == e ? e : 0 : 0 === e ? e : 0
}
}, function (e, t, n) {
var i = n(36),
r = n(46);
e.exports = function (e) {
return "symbol" == typeof e || r(e) && "[object Symbol]" == i(e)
}
}, function (e, t, n) {
(function (t) {
var n = "object" == typeof t && t && t.Object === Object && t;
e.exports = n
}).call(this, n(102))
}, function (e, t, n) {
var i = n(100),
r = Object.prototype,
o = r.hasOwnProperty,
a = r.toString,
u = i ? i.toStringTag : void 0;
e.exports = function (e) {
var t = o.call(e, u),
n = e[u];
try {
e[u] = void 0;
var i = !0
} catch (e) {}
var r = a.call(e);
return i && (t ? e[u] = n : delete e[u]), r
}
}, function (e, t) {
var n = Object.prototype.toString;
e.exports = function (e) {
return n.call(e)
}
}, function (e, t, n) {
"use strict";
var i = n(1);
Object.defineProperty(t, "__esModule", {
value: !0
}), t.Lock = void 0;
var r = i(n(19)),
o = i(n(20)),
a = 1,
u = function () {
function e(t, n) {
if ((0, r.default)(this, e), !(t instanceof Int32Array && n | 0 === n && n >= 0 && n + a <= t.length)) throw new Error("Bad arguments to Lock constructor: ".concat(t, " ").concat(n));
this.iab = t, this.ibase = n
}
return (0, o.default)(e, [{
key: "lock",
value: function () {
var e, t = this.iab,
n = this.ibase;
if (0 !== (e = Atomics.compareExchange(t, n, 0, 1)))
do {
2 !== e && 0 === Atomics.compareExchange(t, n, 1, 2) || Atomics.wait(t, n, 2, Number.POSITIVE_INFINITY)
} while (0 !== (e = Atomics.compareExchange(t, n, 0, 2)))
}
}, {
key: "tryLock",
value: function () {
var e = this.iab,
t = this.ibase;
return 0 === Atomics.compareExchange(e, t, 0, 1)
}
}, {
key: "unlock",
value: function () {
var e = this.iab,
t = this.ibase;
1 !== Atomics.sub(e, t, 1) && (Atomics.store(e, t, 0), Atomics.wake(e, t, 1))
}
}, {
key: "toString",
value: function () {
return "Lock:{ibase:" + this.ibase + "}"
}
}], [{
key: "initialize",
value: function (e, t) {
if (!(e instanceof Int32Array && t | 0 === t && t >= 0 && t + a <= e.length)) throw new Error("Bad arguments to Lock constructor: ".concat(e, " ").concat(t));
return Atomics.store(e, t, 0), t
}
}]), e
}();
t.Lock = u
}, function (e, t, n) {
var i = n(36),
r = n(42);
e.exports = function (e) {
if (!r(e)) return !1;
var t = i(e);
return "[object Function]" == t || "[object GeneratorFunction]" == t || "[object AsyncFunction]" == t || "[object Proxy]" == t
}
}, function (e, t, n) {
"use strict";
(function (e) {
var i = n(30),
r = n(1);
Object.defineProperty(t, "__esModule", {
value: !0
}), t.default = void 0;
var o, a, u, s, d, c = r(n(45)),
l = r(n(106)),
f = r(n(43)),
h = r(n(32)),
_ = r(n(33)),
E = r(n(10)),
p = r(n(103)),
S = r(n(21)),
v = r(n(17)),
A = i(n(34)),
I = r(n(104)),
D = r(n(194)),
g = r(n(35)),
O = n(75),
m = (0, S.default)("sdk.remoteControl");
function w(e) {
var t = this;
this.dom = e.dom, this.socketURL = e.socketURL, this.meetingID = e.meetingID, this.condID = e.condID, this.blobSocket = null;
var n = this._keyMouseEventHandler.bind(this);
this.keyMouseEventHandler = function (e) {
t.keyMouseFilters(e).then(function (e) {
n(e)
})
}, this.keyMouseEventHandlerThrottle = (0, p.default)(function (e) {
t.keyMouseEventHandler(e)
}, 1e3 / 24), this.pasteOnDocument = this._pasteOnDocument.bind(this), this.copyOnDocument = this._copyOnDocument.bind(this), this.cutOnDocument = this._cutOnDocument.bind(this), this.focus = this._focus.bind(this), this.PUBSUB_SHARING_PARAM_INFO_TOKEN = null, this.preventDefault = this._preventDefault.bind(this), this.positionMap = {
canvas: {
offsetX: 0,
offsetY: 0
},
src: {
x: 0,
y: 0,
w: 0,
h: 0,
scaleWidth: 0,
scaleHeight: 0
},
dst: {
x: 0,
y: 0,
w: 0,
h: 0
}
}, this.blockedKeyboardEventOfPaste = [], this.keydownupMergeRemoveMap = {}, this.keyMouseEventHandlerFilter_every_keyup_must_have_keydown_before_Map = {}, this.PASTE_MAX_BYTE_LENGTH = 64e3, this.currentMousePositionProps = {
clientX: 0,
clientY: 0,
x2video: 0,
y2video: 0
}, this.isControllerNow = !0, this.remoteOS = O.OS_ENUM.UNKNOWN, this.localOS = this.getLocalOS(), this._blockedCopyKeyboardList = []
}
w.prototype = {
start: function () {
var t, e = this;
return new E.default((t = (0, _.default)(h.default.mark(function t(n, i) {
return h.default.wrap(function (t) {
for (;;) switch (t.prev = t.next) {
case 0:
return t.prev = 0, m("remote control start"), e.modifyDom(), e.bindEvent(), e.subscribeSharingWidthOrHeightChange(), e.checkAndClearKeydownupMergeRemoveMap(), t.next = 8, e.connectSocket();
case 8:
e.sendPostionPDU(), e.socketBlobMessageHandler(), n(!0), t.next = 16;
break;
case 13:
t.prev = 13, t.t0 = t.catch(0), i(t.t0);
case 16:
case "end":
return t.stop()
}
}, t, this, [
[0, 13]
])
})), function (e, n) {
return t.apply(this, arguments)
}))
},
destroy: function () {
var e = this;
return new E.default(function (t, n) {
try {
m("destroy remote control"), e.unbindEvent(), e.uncheckAndClearKeydownupMergeRemoveMap(), e.destroySocket(), v.default.unsubscribe(e.PUBSUB_SHARING_PARAM_INFO_TOKEN), t(!0)
} catch (e) {
m(e), t(!1)
}
})
},
modifyDom: function () {
try {
this.dom.setAttribute("tabindex", "0"), this.dom.focus()
} catch (e) {}
},
_focus: function () {
this.dom.focus()
},
getLocalOS: function () {
var t = e.navigator.platform;
return /win/i.test(t) ? O.OS_ENUM.WIN : /mac/i.test(t) ? O.OS_ENUM.MAC : O.OS_ENUM.UNKNOWN
},
setIsControlerNow: function (e) {
this.isControllerNow = e
},
blobSocketCheckAndSend: function (e) {
this.isControllerNow && this.blobSocket.send(e)
},
isKeyboardEvent: function (e) {
return !!e && e.type && -1 !== ["keydown", "keyup"].indexOf(e.type.toLowerCase())
},
isThisKeyIgnoreCase: function (e, t) {
return e.key && e.key.toLowerCase() == t.toLowerCase()
},
_copyOnDocument: (d = (0, _.default)(h.default.mark(function e(t) {
var n;
return h.default.wrap(function (e) {
for (;;) switch (e.prev = e.next) {
case 0:
if (this.isFocusNow()) {
e.next = 2;
break
}
return e.abrupt("return");
case 2:
if ("done" != (n = this._blockedCopyKeyboardList)[n.length - 1]) {
e.next = 8;
break
}
return e.abrupt("return");
case 8:
this._blockedCopyKeyboardList = [], this._blockedCopyKeyboardList.push("done");
case 10:
m("copyOnDocument", t), this.processMonitorCtrlMetaWithKey("c");
case 12:
case "end":
return e.stop()
}
}, e, this)
})), function (e) {
return d.apply(this, arguments)
}),
_cutOnDocument: (s = (0, _.default)(h.default.mark(function e(t) {
return h.default.wrap(function (e) {
for (;;) switch (e.prev = e.next) {
case 0:
if (this.isFocusNow()) {
e.next = 2;
break
}
return e.abrupt("return");
case 2:
m("_cutOnDocument", t), this.processMonitorCtrlMetaWithKey("x");
case 4:
case "end":
return e.stop()
}
}, e, this)
})), function (e) {
return s.apply(this, arguments)
}),
processMonitorCtrlMetaWithKey: function (e) {
var t = this,
o = this.remoteOS === O.OS_ENUM.MAC,
a = {
t: "keydown",
event_type: 1,
repeat: !1,
alt: !1,
shift: !1,
capslock: !1,
numlock: !0,
pduType: 85,
ctrl: !o,
super: o
},
u = (0, f.default)({}, a, {
charCode: 0,
keyCode: o ? 91 : 17,
key: o ? "Meta" : "Control"
}),
s = (0, f.default)({}, a, {
charCode: e.charCodeAt(0),
keyCode: e.toUpperCase().charCodeAt(0),
key: e
}),
d = (0, f.default)({}, u, {
input_event_type: 0
}),
c = (0, f.default)({}, u, {
input_event_type: 2
}),
l = (0, f.default)({}, s, {
input_event_type: 0
}),
h = (0, f.default)({}, s, {
input_event_type: 2
}),
_ = (0, f.default)({}, u, {
t: "keyup",
ctrl: !1,
super: !1,
input_event_type: 1
}),
E = (0, f.default)({}, s, {
t: "keyup",
ctrl: !1,
super: o,
input_event_type: 1
});
(o ? [d, c, l, h, E, _] : [d, c, l, h, _, E]).forEach(function (e) {
t.processEvent(e)
})
},
isFocusNow: function () {
return this.dom === document.activeElement
},
_pasteOnDocument: (u = (0, _.default)(h.default.mark(function e(t) {
var n, i, r, o, a, u, s, d, c, l, f;
return h.default.wrap(function (e) {
for (;;) switch (e.prev = e.next) {
case 0:
if (this.isFocusNow()) {
for (n = (t.clipboardData || window.clipboardData).getData("text"), m("_pasteOnDocument", n), i = [], r = 0; r < n.length; r++)
for (o = n[r], a = D.default.encode(o), u = 0; u < a.length; u++) i.push(a.charCodeAt(u));
for (s = new ArrayBuffer(8 + i.length), d = new Uint8Array(s), c = new DataView(s, 4, 4), l = new Uint8Array(s, 8), d[0] = 87, c.setUint32(0, i.length, !0), f = 0; f < i.length; f++) l[f] = i[f];
i.length > this.PASTE_MAX_BYTE_LENGTH ? (this.triggerPasteTextLengthOverflow(), this.dropAllEventFromBlockedKeyboardEventOfPaste()) : (this.blobSocketCheckAndSend(s), this.processMonitorCtrlMetaWithKey("v"))
}
case 1:
case "end":
return e.stop()
}
}, e, this)
})), function (e) {
return u.apply(this, arguments)
}),
onReturnCopiedText: function (e) {
!this._onReturnCopiedText_list && (this._onReturnCopiedText_list = []), this._onReturnCopiedText_list.push(e)
},
triggerReturnCopiedText: function (e) {
this._onReturnCopiedText_list && this._onReturnCopiedText_list.forEach(function (t) {
return t(e)
})
},
onPasteTextLengthOverflow: function (e) {
!this._onPasteTextLengthOverflow_list && (this._onPasteTextLengthOverflow_list = []), this._onPasteTextLengthOverflow_list.push(e)
},
triggerPasteTextLengthOverflow: function () {
this._onPasteTextLengthOverflow_list && this._onPasteTextLengthOverflow_list.forEach(function (e) {
return e()
})
},
dropAllEventFromBlockedKeyboardEventOfPaste: function () {
this.blockedKeyboardEventOfPaste = []
},
createParamsFromKeyboardEvent: function (e) {
return {
key: e.key,
code: e.code,
shiftKey: e.shiftKey,
altKey: e.altKey,
repeat: e.repeat,
charCode: e.charCode,
keyCode: e.keyCode,
which: e.which,
ctrlKey: e.ctrlKey,
metaKey: e.metaKey
}
},
sendAllEventFromBlockedKeyboardEventOfPaste: function () {
for (m("blockedKeyboardEventOfPaste.length", this.blockedKeyboardEventOfPaste.length); this.blockedKeyboardEventOfPaste.length > 0;) {
var e = this.blockedKeyboardEventOfPaste.shift();
this._keyMouseEventHandler(e)
}
},
_preventDefault: function (e) {
if (-1 !== ["keydown", "keyup"].indexOf(e.type))
for (var t = ["v", "c", "x"], n = 0; n < t.length; n++)
if (e.ctrlKey ^ e.metaKey && this.isThisKeyIgnoreCase(e, t[n])) return;
e.preventDefault()
},
subscribeSharingWidthOrHeightChange: function () {
var e = this;
this.PUBSUB_SHARING_PARAM_INFO_TOKEN = v.default.on(A.SHARING_PARAM_INFO_FROM_SOCKET, function (t, n) {
m("subscribeSharingWidthOrHeightChange", n.body), e.positionMap.dst.w = n.body.logicWidth, e.positionMap.dst.h = n.body.logicHeight, e.positionMap.src.w = n.body.logicWidth, e.positionMap.src.h = n.body.logicHeight, e.sendPostionPDU()
})
},
setDstWidthAndHeight: function (e, t) {
if (!e || !t) throw new Error("the value of destination sharing video width/height are not correct");
this.positionMap.dst.w = e, this.positionMap.dst.h = t
},
setSrcWidthAndHeight: function (e, t) {
if (!e || !t) throw new Error("the value of source sharing video width/height are not correct");
this.positionMap.src.w = e, this.positionMap.src.h = t
},
setSrcWidthAndHeightAndSendPDU: function (e, t) {
if (!e || !t) throw new Error("the value of source sharing video width/height are not correct");
this.positionMap.src.w !== e && this.positionMap.src.h !== t && (this.setSrcWidthAndHeight(e, t), this.sendPostionPDU())
},
setSrcOffsetXYAndSendPDU: function (e, t) {
e = Math.floor(e), t = Math.floor(t), this.positionMap.canvas.offsetX === e && this.positionMap.canvas.offsetY === t || (this.setSrcOffsetXY(e, t), this.sendPostionPDU())
},
setSrcScaleWidthAndHeight: function (e, t) {
if (!e || !t) throw new Error("the value of source sharing video scaleWidth/scaleHeight are not correct");
this.positionMap.src.scaleWidth = e, this.positionMap.src.scaleHeight = t
},
setSrcOffsetXY: function () {
var e = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : 0,
t = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : 0,
n = Math.floor(e),
i = Math.floor(t);
if (!(0, I.default)(n) && !(0, I.default)(i)) throw new Error("the value of source offset x or y is not correct");
this.positionMap.canvas.offsetX = n, this.positionMap.canvas.offsetY = i
},
sendPostionPDU: function () {
var e = new ArrayBuffer(36),
t = new Uint8Array(e),
n = new DataView(e, 4),
i = new DataView(e, 20);
t[0] = 82, n.setInt32(0, this.positionMap.src.x, !0), n.setInt32(4, this.positionMap.src.y, !0), n.setInt32(8, this.positionMap.src.w, !0), n.setInt32(12, this.positionMap.src.h, !0), i.setInt32(0, this.positionMap.dst.x, !0), i.setInt32(4, this.positionMap.dst.y, !0), i.setInt32(8, this.positionMap.dst.w, !0), i.setInt32(12, this.positionMap.dst.h, !0), m("send position pdu");
try {
this.blobSocket.send(e)
} catch (e) {}
},
unbindEvent: function () {
var e = this.dom;
e.removeEventListener("click", this.focus), e.removeEventListener("keydown", this.keyMouseEventHandler), e.removeEventListener("keyup", this.keyMouseEventHandler), document.removeEventListener("paste", this.pasteOnDocument), document.removeEventListener("copy", this.copyOnDocument), document.removeEventListener("cut", this.cutOnDocument), e.removeEventListener("contextmenu", this.preventDefault), e.removeEventListener("wheel", this.preventDefault), e.removeEventListener("dblclick", this.preventDefault), e.removeEventListener("keydown", this.preventDefault), e.removeEventListener("keyup", this.preventDefault), e.removeEventListener("dblclick", this.keyMouseEventHandler), e.removeEventListener("mousedown", this.keyMouseEventHandler), e.removeEventListener("mouseup", this.keyMouseEventHandler), e.removeEventListener("mousemove", this.keyMouseEventHandlerThrottle), e.removeEventListener("wheel", this.keyMouseEventHandler)
},
bindEvent: function () {
var e = this.dom;
m("dom", e), e.addEventListener("click", this.focus), e.addEventListener("keydown", this.keyMouseEventHandler), e.addEventListener("keyup", this.keyMouseEventHandler), document.addEventListener("paste", this.pasteOnDocument), document.addEventListener("copy", this.copyOnDocument), document.addEventListener("cut", this.cutOnDocument), e.addEventListener("contextmenu", this.preventDefault), e.addEventListener("wheel", this.preventDefault), e.addEventListener("dblclick", this.preventDefault), e.addEventListener("keydown", this.preventDefault), e.addEventListener("keyup", this.preventDefault), e.addEventListener("dblclick", this.keyMouseEventHandler), e.addEventListener("mousedown", this.keyMouseEventHandler), e.addEventListener("mouseup", this.keyMouseEventHandler), e.addEventListener("mousemove", this.keyMouseEventHandlerThrottle), e.addEventListener("wheel", this.keyMouseEventHandler)
},
recordCurrentMousePosition: function (e) {
try {
var t = this.positionMap,
n = e.clientX,
i = e.clientY;
(0, f.default)(this.currentMousePositionProps, {
clientX: n,
clientY: i,
x2video: n - t.canvas.offsetX,
y2video: i - t.canvas.offsetY
})
} catch (e) {}
},
resolvePosition: function (e) {
var t = e.clientX,
n = e.clientY,
i = this.positionMap;
return t -= i.canvas.offsetX, n -= i.canvas.offsetY, t *= i.dst.w / i.src.scaleWidth, n *= i.dst.h / i.src.scaleHeight, {
x: t = Math.floor(t),
y: n = Math.floor(n)
}
},
generateBuffer: function (e) {
if (void 0 !== e.key && !/^[\x00-\x7F]*$/.test(e.key)) throw new Error("params.key must only contain ascii character");
var t = 8;
84 === (e = (0, f.default)({
v: 0,
x: 0,
y: 0,
dx: 0,
dy: 0,
repeat: 0
}, e)).pduType && (t += 4);
var n = new ArrayBuffer(t),
i = new Uint8Array(n),
r = new DataView(n, 4),
o = new DataView(n, 4);
if (i[0] = e.pduType, i[1] = 63 & e.input_event_type, 83 === e.pduType) r.setUint16(0, e.x, !0), r.setUint16(2, e.y, !0);
else if (84 === e.pduType) o.setInt16(0, e.x, !0), o.setInt16(2, e.y, !0), o.setInt16(4, e.dx, !0), o.setInt16(6, e.dy, !0);
else if (85 === e.pduType) {
var a = new DataView(n, 4),
u = new DataView(n, 6),
s = new Uint8Array(n, 2);
a.setUint16(0, e.keyCode, !0), u.setUint16(0, e.charCode, !0);
var d = {
shift: 1,
capslock: 2,
ctrl: 4,
alt: 8,
numlock: 16,
super: 32
},
c = 0;
(0, l.default)(d).forEach(function (t) {
!0 === e[t] && (c += d[t])
}), s[0] = c, e.repeat && (i[1] = 32 | i[1])
}
return n
},
processEvent: function (e) {
this.blobSocket && this.blobSocketCheckAndSend(this.generateBuffer(e))
},
debug: function (e) {
var t = {};
(85 === e.pduType ? ["t", "keyCode", "charCode", "key"] : ["t", "x", "y", "dx", "dy", "input_event_type"]).forEach(function (n) {
t[n] = e[n]
}), m("debug", (0, c.default)(t))
},
blockedPasteKeyboard: function (e) {
var t = this;
return new E.default(function (n, i) {
t.isKeyboardEvent(e) && t.isPasteEvent(e) ? t.blockedKeyboardEventOfPaste.push(e) : n(e)
})
},
isPasteEvent: function (e) {
var t = this.isThisKeyIgnoreCase(e, "v");
return !!(e.ctrlKey ^ e.metaKey && t)
},
isCopyEvent: function (e) {
var t = this.isThisKeyIgnoreCase(e, "c");
return !!(e.ctrlKey ^ e.metaKey && t)
},
isCutEvent: function (e) {
var t = this.isThisKeyIgnoreCase(e, "x");
return !!(e.ctrlKey ^ e.metaKey && t)
},
returnNewEventByTransformCtrlKeyOrCommandKey: function (e) {
var t = this.createParamsFromKeyboardEvent(e);
switch (this.remoteOS) {
case O.OS_ENUM.WIN:
(0, f.default)(t, {
ctrlKey: !0,
metaKey: !1
});
break;
case O.OS_ENUM.MAC:
(0, f.default)(t, {
ctrlKey: !1,
metaKey: !0
});
break;
case O.OS_ENUM.UNKNOWN:
}
return new e.constructor(e.type, t)
},
transformCtrlCAndCommandC: function (e) {
var t = this,
n = this;
return new E.default(function (i, r) {
t.isKeyboardEvent(e) && (e.ctrlKey || e.metaKey) && n.isThisKeyIgnoreCase(e, "c") ? (n.createParamsFromKeyboardEvent(e), i(n.returnNewEventByTransformCtrlKeyOrCommandKey(e))) : i(e)
})
},
keyMouseEventHandlerFilter_MatainKeyDownUpMergeMap: function (e) {
var t = this;
return new E.default(function (n, i) {
try {
t.isKeyboardEvent(e) && e.key && ("keydown" !== e.type || e.repeat || (t.keydownupMergeRemoveMap[e.key] = {
t: +new Date,
e: e
}), "keydown" === e.type && e.repeat && delete t.keydownupMergeRemoveMap[e.key], "keyup" === e.type && delete t.keydownupMergeRemoveMap[e.key])
} catch (e) {
m.error(e)
}
n(e)
})
},
checkAndClearKeydownupMergeRemoveMap: function () {
var e = this;
this.checkAndClearKeydownupMergeRemoveMapInterval = setInterval(function () {
e._checkAndClearKeydownupMergeRemoveMap(500)
}, 100)
},
_checkAndClearKeydownupMergeRemoveMap: function (e) {
var t = this,
n = this.keydownupMergeRemoveMap;
(0, l.default)(n).forEach(function (i) {
var r = n[i];
if (+new Date - r.t >= e) {
var o = new r.e.constructor("keyup", r.e);
try {
t._keyMouseEventHandler(o)
} catch (e) {}
delete t.keydownupMergeRemoveMap[i]
}
})
},
uncheckAndClearKeydownupMergeRemoveMap: function () {
this._checkAndClearKeydownupMergeRemoveMap(0), clearInterval(this.checkAndClearKeydownupMergeRemoveMapInterval)
},
keyMouseFilters: function (e) {
var t = this;
return new E.default(function (t, n) {
t(e)
}).then(function (e) {
return t.blockedPasteKeyboard(e)
}).then(function (e) {
return t.blockedSingleMetaKey(e)
}).then(function (e) {
return t.blockedCopyKeyboard(e)
}).then(function (e) {
return t.blockedCutKeyboard(e)
}).then(function (e) {
return t.keyMouseEventHandlerFilter_MatainKeyDownUpMergeMap(e)
}).then(function (e) {
return t.blockedSomeKeyboardEventNotHaveKeydownBefore(e)
}).then(function (e) {
return t.keyMouseEventHandlerFilter_EVERY_KEYUP_MUST_HAVE_KEYDOWN_BEFORE(e)
})
},
blockedSingleMetaKey: function (e) {
var t = this;
return new E.default(function (n, i) {
t.isKeyboardEvent(e) && e.key && (/command/i.test(e.key) || /meta/i.test(e.key) || /control/i.test(e.key)) && !e.shiftKey && !e.altKey && e.ctrlKey ^ e.metaKey || n(e)
})
},
blockedCutKeyboard: function (e) {
var t = this;
return new E.default(function (n, i) {
t.isKeyboardEvent(e) && t.isCutEvent(e) || n(e)
})
},
blockedCopyKeyboard: function (e) {
var t = this;
return new E.default(function (n, i) {
t.isKeyboardEvent(e) && t.isCopyEvent(e) ? t._blockedCopyKeyboardList.push(e) : n(e)
})
},
blockedSomeKeyboardEventNotHaveKeydownBefore: function (e) {
var t = this;
return new E.default(function (n, i) {
if (t.isKeyboardEvent(e) && e.key) {
var r = !1;
if (["x", "c", "v"].forEach(function (n) {
t.isThisKeyIgnoreCase(e, n) && (r = !0)
}), "keyup" === e.type && r && !t.keyMouseEventHandlerFilter_every_keyup_must_have_keydown_before_Map[e.key]) return
}
n(e)
})
},
keyMouseEventHandlerFilter_EVERY_KEYUP_MUST_HAVE_KEYDOWN_BEFORE: function (e) {
var t = this;
return new E.default(function (n, i) {
try {
if (t.isKeyboardEvent(e) && e.key && ("keydown" === e.type && (t.keyMouseEventHandlerFilter_every_keyup_must_have_keydown_before_Map[e.key] = e), "keyup" === e.type)) {
var r = !!t.keyMouseEventHandlerFilter_every_keyup_must_have_keydown_before_Map[e.key];
delete t.keyMouseEventHandlerFilter_every_keyup_must_have_keydown_before_Map[e.key];
var o = !1;
if (["meta"].forEach(function (n) {
t.isThisKeyIgnoreCase(e, n) && (o = !0)
}), !r && !o) {
m.warn("keyup trigger, but no keydown before");
var a = new e.constructor("keydown", e);
t._keyMouseEventHandler(a)
}
}
} catch (e) {
m.error(e)
}
n(e)
})
},
_keyMouseEventHandler: function (e) {
this.isKeyboardEvent(e) && m("_keyMouseEventHandler keyboard", e);
var t = {},
n = {
keydown: 0,
keyup: 1,
keychar: 2
},
i = {
mousemove: 0,
mousedown: {
left: 1,
right: 4,
middle: 7
},
mouseup: {
left: 2,
right: 5,
middle: 8
},
mouseleftdbldown: 3,
mouserightdbldown: 6,
wheel: 10
},
r = e.getModifierState ? function (t) {
return e.getModifierState(t)
} : function (e, t) {
return t
},
o = 0,
a = e.key && 1 === e.key.length;
if (-1 !== ["keydown", "keyup"].indexOf(e.type)) t.event_type = 1, o = 85, void 0 !== n[e.type] && (t.input_event_type = n[e.type]);
else {
if (-1 === ["mousedown", "mouseup", "mousemove", "wheel", "click", "dblclick", "contextmenu"].indexOf(e.type)) return void m.warn("the event type cannot be handled");
t.event_type = 0, this.recordCurrentMousePosition(e);
var u = this.resolvePosition(e);
if ((0, f.default)(t, {
x: u.x,
y: u.y
}), o = "wheel" === e.type ? 84 : 83, void 0 !== i[e.type] && (t.input_event_type = i[e.type]), -1 !== ["mousedown", "mouseup"].indexOf(e.type)) {
var s;
switch (e.button) {
case 0:
s = "left";
break;
case 1:
s = "middle";
break;
case 2:
s = "right";
break;
default:
s = "left"
}
t.input_event_type = i[e.type][s]
} - 1 !== ["dblclick"].indexOf(e.type) && (t.input_event_type = i.mouseleftdbldown)
}
if ("wheel" === e.type) {
var d = {
deltaX: "dx",
deltaY: "dy"
};
(0, l.default)(d).forEach(function (n) {
e[n] && (t[d[n]] = e[n] > 0 ? -100 : 100)
})
}
if ((0, f.default)(t, {
t: e.type,
pduType: o,
keyCode: e.keyCode,
charCode: a ? e.key.charCodeAt(0) : 0,
key: e.key,
repeat: e.repeat,
ctrl: e.ctrlKey,
alt: e.altKey,
super: e.metaKey,
shift: e.shiftKey,
capslock: r("CapsLock", !1),
numlock: r("NumLock", !1)
}), this.isKeyboardEvent(e) && m("processEvent", (0, c.default)(t)), this.processEvent(t), "keydown" === e.type) {
var h = (0, f.default)({}, t, {
input_event_type: n.keychar
});
this.processEvent(h)
}
},
isCapslock: function (e) {
var t = e.keyCode,
n = e.key,
i = e.shiftKey;
return !!/[a-zA-Z]/.test(n) && (n.charCodeAt(0) !== t ? !i : i)
},
stop: (a = (0, _.default)(h.default.mark(function e() {
return h.default.wrap(function (e) {
for (;;) switch (e.prev = e.next) {
case 0:
this.blobSocket && this.blobSocket.close(), this.blobSocket = null;
case 2:
case "end":
return e.stop()
}
}, e, this)
})), function () {
return a.apply(this, arguments)
}),
connectSocket: (o = (0, _.default)(h.default.mark(function e() {
var t;
return h.default.wrap(function (e) {
for (;;) switch (e.prev = e.next) {
case 0:
return e.next = 2, this.createBlobSocket("".concat(this.socketURL, "/wc/media/").concat(this.meetingID, "?type=r&mode=2&cid=").concat(this.condID));
case 2:
return (t = e.sent).binaryType = "blob", this.blobSocket = t, e.abrupt("return", !0);
case 6:
case "end":
return e.stop()
}
}, e, this)
})), function () {
return o.apply(this, arguments)
}),
socketBlobMessageHandler: function () {
if (this.blobSocket) {
var e = this;
this.blobSocket.addEventListener("message", (t = (0, _.default)(h.default.mark(function t(n) {
var i, r, o, a, u, s, d;
return h.default.wrap(function (t) {
for (;;) switch (t.prev = t.next) {
case 0:
return i = n.data, t.next = 3, g.default.readBlobAsBuffer(i, i.size);
case 3:
if (r = t.sent, o = new Int8Array(r), 88 !== (a = o[0])) {
t.next = 14;
break
}
return u = i.slice(8), t.next = 10, g.default.readBlob(u);
case 10:
s = t.sent, d = o[4], m("COPY_TEXT_FROM_RWG", s, d), e.triggerReturnCopiedText({
data: s,
x: e.currentMousePositionProps.x2video,
y: e.currentMousePositionProps.y2video
});
case 14:
0 === a && e.blobSocket.send(r);
case 15:
case "end":
return t.stop()
}
}, t, this)
})), function (e) {
return t.apply(this, arguments)
}))
}
var t
},
destroySocket: function () {
try {
this.blobSocket.close(), this.blobSocket = null
} catch (e) {
m("destroySocket", e)
}
},
createBlobSocket: function (e) {
return new E.default(function (t, n) {
var i = new WebSocket(e);
i.addEventListener("open", function () {}), i.addEventListener("message", function (e) {
try {
var n = JSON.parse(e.data);
0 === n.evt && n.body && t(i)
} catch (e) {}
}), i.addEventListener("error", function (e) {
n(e)
}), i.addEventListener("close", function () {
n(new Error("socket close"))
})
})
},
setRemoteOS: function (e) {
void 0 !== e && (this.remoteOS = e)
}
};
var k = w;
t.default = k
}).call(this, n(102))
}, function (e, t, n) {
var i = n(42),
r = n(193),
o = n(99),
u = Math.max,
s = Math.min;
e.exports = function (e, t, n) {
var d, c, l, f, h, _, E = 0,
p = !1,
S = !1,
v = !0;
if ("function" != typeof e) throw new TypeError("Expected a function");
function A(t) {
var n = d,
i = c;
return d = c = void 0, E = t, f = e.apply(i, n)
}
function I(e) {
var n = e - _;
return void 0 === _ || n >= t || n < 0 || S && e - E >= l
}
function D() {
var e = r();
if (I(e)) return g(e);
h = setTimeout(D, function (e) {
var n = t - (e - _);
return S ? s(n, l - (e - E)) : n
}(e))
}
function g(e) {
return h = void 0, v && d ? A(e) : (d = c = void 0, f)
}
function O() {
var e = r(),
n = I(e);
if (d = arguments, c = this, _ = e, n) {
if (void 0 === h) return function (e) {
return E = e, h = setTimeout(D, t), p ? A(e) : f
}(_);
if (S) return h = setTimeout(D, t), A(_)
}
return void 0 === h && (h = setTimeout(D, t)), f
}
return t = o(t) || 0, i(n) && (p = !!n.leading, l = (S = "maxWait" in n) ? u(o(n.maxWait) || 0, t) : l, v = "trailing" in n ? !!n.trailing : v), O.cancel = function () {
void 0 !== h && clearTimeout(h), E = 0, d = _ = c = h = void 0
}, O.flush = function () {
return void 0 === h ? f : g(r())
}, O
}
}, function (e, t, n) {
var i = n(101);
e.exports = function () {
return i.Date.now()
}
}, function (e, t, n) {
! function (e) {
var t, n, i, r = String.fromCharCode;
function o(e) {
for (var t, n, i = [], r = 0, o = e.length; r < o;)(t = e.charCodeAt(r++)) >= 55296 && t <= 56319 && r < o ? 56320 == (64512 & (n = e.charCodeAt(r++))) ? i.push(((1023 & t) << 10) + (1023 & n) + 65536) : (i.push(t), r--) : i.push(t);
return i
}
function a(e) {
if (e >= 55296 && e <= 57343) throw Error("Lone surrogate U+" + e.toString(16).toUpperCase() + " is not a scalar value")
}
function u(e, t) {
return r(e >> t & 63 | 128)
}
function s(e) {
if (0 == (4294967168 & e)) return r(e);
var t = "";
return 0 == (4294965248 & e) ? t = r(e >> 6 & 31 | 192) : 0 == (4294901760 & e) ? (a(e), t = r(e >> 12 & 15 | 224), t += u(e, 6)) : 0 == (4292870144 & e) && (t = r(e >> 18 & 7 | 240), t += u(e, 12), t += u(e, 6)), t + r(63 & e | 128)
}
function d() {
if (i >= n) throw Error("Invalid byte index");
var e = 255 & t[i];
if (i++, 128 == (192 & e)) return 63 & e;
throw Error("Invalid continuation byte")
}
function c() {
var e, r;
if (i > n) throw Error("Invalid byte index");
if (i == n) return !1;
if (e = 255 & t[i], i++, 0 == (128 & e)) return e;
if (192 == (224 & e)) {
if ((r = (31 & e) << 6 | d()) >= 128) return r;
throw Error("Invalid continuation byte")
}
if (224 == (240 & e)) {
if ((r = (15 & e) << 12 | d() << 6 | d()) >= 2048) return a(r), r;
throw Error("Invalid continuation byte")
}
if (240 == (248 & e) && (r = (7 & e) << 18 | d() << 12 | d() << 6 | d()) >= 65536 && r <= 1114111) return r;
throw Error("Invalid UTF-8 detected")
}
e.version = "3.0.0", e.encode = function (e) {
for (var t = o(e), n = t.length, i = -1, r = ""; ++i < n;) r += s(t[i]);
return r
}, e.decode = function (e) {
t = o(e), n = t.length, i = 0;
for (var a, u = []; !1 !== (a = c());) u.push(a);
return function (e) {
for (var t, n = e.length, i = -1, o = ""; ++i < n;)(t = e[i]) > 65535 && (o += r((t -= 65536) >>> 10 & 1023 | 55296), t = 56320 | 1023 & t), o += r(t);
return o
}(u)
}
}(t)
}, function (e, t, n) {
var i = n(36),
r = n(46);
e.exports = function (e) {
return !0 === e || !1 === e || r(e) && "[object Boolean]" == i(e)
}
}, function (e) {
e.exports = {
name: "webclient-sdk",
version: "1.2.1",
"version-ie": "1.0.1",
description: "zoom webclient sdk",
private: !0,
main: "dist/js_media.js",
"main-ie": "dist/js_media_ie.js",
scripts: {
build: "webpack --config webpack.prod.js",
dev: "webpack-dev-server --config webpack.dev.js",
watch: "webpack --watch --config webpack.dev.js",
compare: "node comparePackage.js"
},
author: "",
license: "ISC",
browser: {
ws: !1
},
devDependencies: {
"@babel/plugin-transform-runtime": "^7.0.0-beta.54",
"babel-plugin-transform-runtime": "^6.23.0",
"babel-preset-env": "^1.7.0",
"case-sensitive-paths-webpack-plugin": "^2.2.0",
"clean-webpack-plugin": "^1.0.0",
"copy-webpack-plugin": "^5.0.3",
"fs-extra": "^8.1.0",
"sanitize-filename": "^1.6.2",
tar: "^4.4.10",
"uglify-js": "^3.6.0",
webpack: "^4.32.2",
"webpack-cli": "^3.0.8",
"webpack-dev-server": "^3.1.4",
"webpack-merge": "^4.1.3"
},
dependencies: {
"@babel/core": "^7.0.0-beta.51",
"@babel/preset-env": "^7.0.0-beta.51",
"@babel/runtime": "^7.0.0-beta.54",
"babel-loader": "^8.0.0-beta.0",
"babel-polyfill": "^6.26.0",
"babel-runtime": "^6.26.0",
lodash: "^4.17.10",
"pubsub-js": "^1.6.1",
utf8: "^3.0.0"
}
}
}, , function (e, t, n) {
"use strict";
var i = n(199);
e.exports = i
}, function (e, t, n) {
"use strict";
var i = n(30),
r = n(1),
o = r(n(10)),
a = r(n(106)),
u = r(n(32)),
s = r(n(33)),
d = r(n(43)),
c = r(n(63)),
l = r(n(200)),
f = r(n(201)),
h = r(n(35)),
_ = i(n(34)),
E = r(n(29)),
p = i(n(105)),
S = n(202),
v = r(n(21)),
A = r(n(17)),
I = n(73),
D = n(74),
g = n(67),
O = r(n(190)),
m = r(n(191)),
C = n(75),
R = r(n(98)),
y = r(n(195)),
T = r(n(104)),
M = r(n(103));
n(203);
var P, N, b, w, k, V, L, U, x, G, F, W, H = r(n(44)),
K = n(204),
B = n(196),
j = (0, v.default)("sdk"),
Q = function () {
if (this.isSupportThread = "object" === ("undefined" == typeof WebAssembly ? "undefined" : (0, c.default)(WebAssembly)) && "function" == typeof Worker, !this.isSupportThread) throw new Error("Webassemly or worker is not supported on this browser");
E.default.reinit(), this.audioCtx = new(window.AudioContext || window.webkitAudioContext), this.audioPlayNode = null, this.audioRecordNode = null, this.webrtcAudioNode = null, this.videoRenderArray = [], this.videoCaptureValue = null, this.audioRenderArray = [], this.audioCapture = null, this.display = [], this.AudioMediaStream = null, this.VideoMediaStram = null, this.isMediaStart = !1, this.sampleRate = this.audioCtx.sampleRate, this.videoRenderIntervalHandle = null, this.audionodebuffersize = this.sampleRate <= 32e3 || h.default.browser.isSafari ? 2048 : 1024, this.audionoderecordbuffersize = 2048, this.lastresidual = null, this.currentactive = 0, this.currentVideoWidth = 0, this.currentVideoHeight = 0, this.audioPlay = !1, this.sharingInterval = null, this.sharingIntervalTime = 100, this.sharingDisplay = null, this.currentshareactive = 0, this.currentSharingHeight = 0, this.currentSharingWidth = 0, this.currentSharingLogicHeight = 0, this.currentSharingLogicWidth = 0, this.videorenderinterval = 10, this.videoRenderLevel = 10, this.videoRenderLevelCount = 1, this.renderPeriodTotal = 100, this.renderPeriodCount = 0, this.renderPeriodTotalFps = 0, this.renderPeriodFpsCount = 0, this.videoBeforeAudioCount = 0, this.videoAfterAudioCount = 0, this.lastRenderAudioTimeStamp = 0, this.videoBufEmptyCount = 0, this.videoBufCount = 0, this.videoRenderMaxLevel = 15, this.cursorCanvas = document.createElement("canvas"), this.waterMarkCanvas = document.createElement("canvas"), this.isSetCursor = !1, this.captureAudioStatus = _.AUDIO_ILLEGAL, this.logon = !1, this.canvas = null, this.firstSetDelay = !0, this.Cursorx = null, this.Cursory = null, this.CursorWidth = null, this.CursorHeight = null, this.isSupportAudioWorklet = "function" == typeof AudioWorklet, this.isCaputureNodeConnect = !1, this.audioWorkletJsPath = null, this.xratio = 1, this.yratio = 1, this.videoCaptureInterval = 0, this.isStartVideoCapture = !1, this.videoCaptureWidth = 0, this.videoCaptureHeight = 0, this.videoCaptureContext = null, this.isCreateVideoWaterMark = !1, this.videoWaterMarkName = "", this.sharingWaterMarkName = "", this.isCreateSharingWaterMark = !1, this.isStartDesktopSharing = !1, this.desktopSharingValue = null, this.desktopCaptureContext = null, this.desktopSharingMediaStram = null, this.desktopSharingCaptureWidth = 0, this.desktopSharingCaptureHeight = 0, this.desktopSharingSend = !1, this.isdesktopCaptureLoadedmetadata = !1, this.captureVideoOutputCanvasDomList = [], this.isVideoCaptureLoadedmetadata = !1, this.VALUE_CACHE_FOR_START_CAPTURE_VIDEO = {}, this.isMediaDevicesGetUserMediaNow = !1, this.vMonitorCount = 0, this.sMonitorCount = 0, this.mMonitorCount = 0, E.default.mediaSDKHandle = this, this._preloadMeetingParam = null, this.mtu_size = 0, this.sharingWidthAndHeightInfo = {
ctiveNodeID: 0,
height: 0,
logicHeight: 0,
logicWidth: 0,
width: 0
}, this.remoteControl = null, this.listenInitEvent = (0, R.default)(function () {
this._listenInitEvent()
}).bind(this), this.isInitVideoDataChannel = !1, this.isInitAudioDataChannel = !1, this.rtcPeerConnectionList = []
};
Q.version = B.version, Q.buildNumber = 5060, Q.prototype = {
JsMediaSDK_Log: function (e) {
this.logon && j(e)
},
JsMediaSDK_PreLoad: function (e, t) {
this.setPropsBeforeInit({
callback: t,
audioWorkerPath: e.audioWorkerPath,
isEnableListenInitEvent: !0
}), this._preloadMeetingParam = e, p.Start_Monitor(), H.default.add_monitor("JSPLD")
},
JsMediaSDK_Init: function (e, t) {
H.default.add_monitor("JSINIT"), e.logon && (this.logon = e.logon);
var n = e.user_id || e.userid;
E.default.monitorCid = e.video_rwc_ip_address.substring(e.video_rwc_ip_address.length - 36, e.video_rwc_ip_address);
var i = e.logon;
this.initVideoEncode(this._preloadMeetingParam.videoEncWorkerPath, e.video_rwc_ip_address, n, i), this.initVideoDecode(this._preloadMeetingParam.videoDecWorkerPath, e.video_rwc_ip_address, n, i), this.initAudioEncode(this._preloadMeetingParam.audioEncWorkerPath, e.audio_rwc_ip_address, n, i), this.initAudioDecode(this._preloadMeetingParam.audioDecWorkerPath, e.audio_rwc_ip_address, n, i), this.initSharingDecode(this._preloadMeetingParam.imageDecWorkerPath, e.sharing_rwc_ip_address, n, i), this.initSharingEncode(this._preloadMeetingParam.imageDecWorkerPath, e.sharing_rwc_ip_address, n, i)
},
recordSharingParamInfo: function () {
var e = this;
A.default.on(_.SHARING_PARAM_INFO_FROM_SOCKET, function (t, n) {
(0, d.default)(e.sharingWidthAndHeightInfo, n.body)
})
},
throwErrorWhenParameterIsEmpty: function (e) {
if (!e) throw new Error("parameter can not be empty")
},
setCallback: function (e) {
if (!(0, O.default)(e)) throw new Error("callback must be function");
E.default.Notify_APPUI = e
},
setPropsBeforeInit: function (e) {
e.callback && this.setCallback(e.callback), e.audioWorkerPath && (this.audioWorkletJsPath = e.audioWorkerPath), e.isEnableListenInitEvent && this.listenInitEvent(), e.e2eEncrypt ? E.default.e2eencrypt = !0 : E.default.e2eencrypt = !1
},
checkISDatachannelOrWebsocket: function () {
var e = (0, M.default)(function () {}, 1e3),
t = (0, M.default)(function () {}, 1e3);
A.default.on(_.PUBSUB_EVT.DC_COMING_MESSAGE, function () {
e()
}), A.default.on(_.VIDEO_DATA_FROM_WORKER, function (e, n) {
-1 !== [2, 7].indexOf(n[0]) && t()
})
},
initVideoDataChannel: (W = (0, s.default)(u.default.mark(function e(t) {
var n;
return u.default.wrap(function (e) {
for (;;) switch (e.prev = e.next) {
case 0:
if (!this.isInitVideoDataChannel) {
e.next = 2;
break
}
return e.abrupt("return");
case 2:
this.isInitVideoDataChannel = !0, H.default.add_monitor("INITVDC"), j("initVideoDataChannel", t), n = new K.RTCPeerConnectionUtil, j("rtc", n), n.onConnectionCreated(function () {
var e = (0, s.default)(u.default.mark(function e(t) {
var i, r, o;
return u.default.wrap(function (e) {
for (;;) switch (e.prev = e.next) {
case 0:
return i = t.localDescription, j("localDesc", i), E.default.Notify_APPUI_SAFE(_.SEND_MESSAGE_TO_RWG, {
evt: _.ZOOM_CONNECTION_VIDEO_OFFER_EVT,
offer: {
sdp: i.sdp,
type: C.ZOOM_CONNECTION_TYPE.ZOOM_CONNECTION_VIDEO
}
}), e.next = 5, n.waitForAnswerFromRWG(_.PUBSUB_EVT.ZOOM_CONNECTION_VIDEO_OFFER_RESPONSE_EVT);
case 5:
r = e.sent, j("jsEvent.PUBSUB_EVT.ZOOM_CONNECTION_VIDEO_OFFER_RESPONSE_EVT", r), n.setRemoteDescription(r.answer), n.closeIfTimeout(), o = r.answer.sdp.match(/a=candidate:.+/)[0], j("received candidate", o), o = o.replace(/^a=/, ""), n.addIceCandidate(o), n.listenOnDataAndSend(_.VIDEO_DATA_FROM_WORKER), n.onMessage(function (e) {
var t = new Uint8Array(e);
A.default.trigger(_.PUBSUB_EVT.DC_COMING_MESSAGE), t[0] == _.MEDIA_VIDEO_REPORT_DROP_RATIO || t[0] == _.MEDIA_VIDEO_REPORT_RTT ? p.pushMessageToWorker(C.WORKER_TYPE.VIDEO_ENCODE, e, void 0, !0) : p.pushMessageToWorker(C.WORKER_TYPE.VIDEO_DECODE, e, void 0, !0)
}), n.dataChannel.addEventListener("open", function () {
p.pushMessageToWorker(C.WORKER_TYPE.VIDEO_DECODE, {
isDataChannelOpen: !0
}, "UPDATE_DATACHANNEL_STATUS", !1, !0), p.pushMessageToWorker(C.WORKER_TYPE.VIDEO_ENCODE, {
isDataChannelOpen: !0
}, "UPDATE_DATACHANNEL_STATUS", !1, !0)
}), n.dataChannel.addEventListener("close", function () {
p.pushMessageToWorker(C.WORKER_TYPE.VIDEO_DECODE, {
isDataChannelOpen: !1
}, "UPDATE_DATACHANNEL_STATUS"), p.pushMessageToWorker(C.WORKER_TYPE.VIDEO_ENCODE, {
isDataChannelOpen: !1
}, "UPDATE_DATACHANNEL_STATUS");
var e = new ArrayBuffer(12);
new Uint8Array(e)[0] = 100, p.pushMessageToWorker(C.WORKER_TYPE.VIDEO_ENCODE, e, void 0, !0)
});
case 17:
case "end":
return e.stop()
}
}, e, this)
}));
return function (t) {
return e.apply(this, arguments)
}
}()), n.initConnection(t).catch(function (e) {
j.warn("initConnection", e), H.default.add_monitor("INITVDCERR:" + e.message)
}), this.rtcPeerConnectionList.push(n), A.default.on(_.PUBSUB_EVT.VIDEO_DATACHANNEL_SPEED, function (e, t) {
j("VIDEO_DATACHANNEL_SPEED", t), p.pushMessageToWorker(C.WORKER_TYPE.VIDEO_ENCODE, {
speed: t
}, "UPDATE_BANDWIDTH_SPEED")
});
case 11:
case "end":
return e.stop()
}
}, e, this)
})), function (e) {
return W.apply(this, arguments)
}),
initAudioDataChannel: (F = (0, s.default)(u.default.mark(function e(t) {
var n;
return u.default.wrap(function (e) {
for (;;) switch (e.prev = e.next) {
case 0:
if (!this.isInitAudioDataChannel) {
e.next = 2;
break
}
return e.abrupt("return");
case 2:
this.isInitAudioDataChannel = !0, H.default.add_monitor("INITADC"), j("initAudioDataChannel", t), n = new K.RTCPeerConnectionUtil, j("rtc", n), n.onConnectionCreated(function () {
var e = (0, s.default)(u.default.mark(function e(t) {
var i, r, o;
return u.default.wrap(function (e) {
for (;;) switch (e.prev = e.next) {
case 0:
return i = t.localDescription, j("localDesc", i), E.default.Notify_APPUI_SAFE(_.SEND_MESSAGE_TO_RWG, {
evt: _.ZOOM_CONNECTION_VIDEO_OFFER_EVT,
offer: {
sdp: i.sdp,
type: C.ZOOM_CONNECTION_TYPE.ZOOM_CONNECTION_AUDIO
}
}), e.next = 5, n.waitForAnswerFromRWG(_.PUBSUB_EVT.ZOOM_CONNECTION_AUDIO_OFFER_RESPONSE_EVT);
case 5:
r = e.sent, j("answer", r), n.setRemoteDescription(r.answer), n.closeIfTimeout(), o = r.answer.sdp.match(/a=candidate:.+/)[0], j("received candidate", o), o = o.replace(/^a=/, ""), n.addIceCandidate(o), n.listenOnDataAndSendAudio(_.AUDIO_DATA_FROM_WORKER), n.onMessage(function (e) {
p.pushMessageToWorker(C.WORKER_TYPE.AUDIO_DECODE, e, void 0, !0)
}), n.dataChannel.addEventListener("open", function () {
p.pushMessageToWorker(C.WORKER_TYPE.AUDIO_DECODE, {
isDataChannelOpen: !0
}, "UPDATE_DATACHANNEL_STATUS", !1, !0), p.pushMessageToWorker(C.WORKER_TYPE.AUDIO_ENCODE, {
isDataChannelOpen: !0
}, "UPDATE_DATACHANNEL_STATUS", !1, !0)
}), n.dataChannel.addEventListener("close", function () {
p.pushMessageToWorker(C.WORKER_TYPE.AUDIO_DECODE, {
isDataChannelOpen: !1
}, "UPDATE_DATACHANNEL_STATUS"), p.pushMessageToWorker(C.WORKER_TYPE.AUDIO_ENCODE, {
isDataChannelOpen: !1
}, "UPDATE_DATACHANNEL_STATUS")
});
case 17:
case "end":
return e.stop()
}
}, e, this)
}));
return function (t) {
return e.apply(this, arguments)
}
}()), n.initConnection(t, "ZoomWebclientAudioDataChannel").catch(function (e) {
j.warn("initConnection", e), H.default.add_monitor("INITADCERR:" + e.message)
}), this.rtcPeerConnectionList.push(n);
case 10:
case "end":
return e.stop()
}
}, e, this)
})), function (e) {
return F.apply(this, arguments)
}),
initVideoEncode: (G = (0, s.default)(u.default.mark(function e(t, n, i) {
var r, o, a, s, d, c = arguments;
return u.default.wrap(function (e) {
for (;;) switch (e.prev = e.next) {
case 0:
return r = c.length > 3 && void 0 !== c[3] && c[3], o = c.length > 4 ? c[4] : void 0, a = c.length > 5 ? c[5] : void 0, j("initVideoEncode"), H.default.add_monitor("INITVE"), this.throwErrorWhenParameterIsEmpty(t), s = new URL(n).searchParams.get("cid"), this.initVideoDataChannel(s), E.default.monitorCid = s, d = {
log: r,
confId: i,
meetingid: o,
meetingnumb: a
}, p.setVideoEngineInitProperties(n, d), e.next = 13, p.initVideoEncode(t);
case 13:
return e.next = 15, I.Video.waitVideoEncodeInitResult();
case 15:
return e.abrupt("return", e.sent);
case 16:
case "end":
return e.stop()
}
}, e, this)
})), function (e, t, n) {
return G.apply(this, arguments)
}),
initVideoDecode: (x = (0, s.default)(u.default.mark(function e(t, n, i) {
var r, o, a, s, d, c = arguments;
return u.default.wrap(function (e) {
for (;;) switch (e.prev = e.next) {
case 0:
return r = c.length > 3 && void 0 !== c[3] && c[3], o = c.length > 4 ? c[4] : void 0, a = c.length > 5 ? c[5] : void 0, j("initVideoDecode"), H.default.add_monitor("INITVD"), this.throwErrorWhenParameterIsEmpty(t), s = new URL(n).searchParams.get("cid"), this.initVideoDataChannel(s), E.default.monitorCid = s, d = {
log: r,
confId: i,
meetingid: o,
meetingnumb: a
}, p.setVideoEngineInitProperties(n, d), e.next = 13, p.initVideoDecode(t);
case 13:
return e.next = 15, I.Video.waitVideoDecodeInitResult();
case 15:
return e.abrupt("return", e.sent);
case 16:
case "end":
return e.stop()
}
}, e, this)
})), function (e, t, n) {
return x.apply(this, arguments)
}),
initAudioEncode: (U = (0, s.default)(u.default.mark(function e(t, n, i) {
var r, o, a, s, d = arguments;
return u.default.wrap(function (e) {
for (;;) switch (e.prev = e.next) {
case 0:
return r = d.length > 3 && void 0 !== d[3] && d[3], o = d.length > 4 ? d[4] : void 0, a = d.length > 5 ? d[5] : void 0, j("initAudioEncode"), H.default.add_monitor("INITAE"), this.throwErrorWhenParameterIsEmpty(t), E.default.monitorCid = new URL(n).searchParams.get("cid"), this.initAudioDataChannel(E.default.monitorCid), s = {
sampleRate: this.audioCtx.sampleRate,
userid: i,
log: r,
meetingid: o,
meetingnumb: a
}, p.setAudioEngineInitProperties(n, s), e.next = 12, p.initAudioEncode(t);
case 12:
return e.next = 14, D.AudioService.waitAudioEncodeInitResult();
case 14:
return e.abrupt("return", e.sent);
case 15:
case "end":
return e.stop()
}
}, e, this)
})), function (e, t, n) {
return U.apply(this, arguments)
}),
initAudioDecode: (L = (0, s.default)(u.default.mark(function e(t, n, i) {
var r, o, a, s, d = arguments;
return u.default.wrap(function (e) {
for (;;) switch (e.prev = e.next) {
case 0:
return r = d.length > 3 && void 0 !== d[3] && d[3], o = d.length > 4 ? d[4] : void 0, a = d.length > 5 ? d[5] : void 0, j("initAudioDecode"), H.default.add_monitor("INITAD"), this.throwErrorWhenParameterIsEmpty(t), E.default.monitorCid = new URL(n).searchParams.get("cid"), this.initAudioDataChannel(E.default.monitorCid), s = {
sampleRate: this.audioCtx.sampleRate,
userid: i,
log: r,
meetingid: o,
meetingnumb: a
}, p.setAudioEngineInitProperties(n, s), e.next = 12, p.initAudioDecode(t);
case 12:
return e.next = 14, D.AudioService.waitAudioDecodeInitResult();
case 14:
return e.abrupt("return", e.sent);
case 15:
case "end":
return e.stop()
}
}, e, this)
})), function (e, t, n) {
return L.apply(this, arguments)
}),
initSharingDecode: (V = (0, s.default)(u.default.mark(function e(t, n, i) {
var r, o, a, s, d = arguments;
return u.default.wrap(function (e) {
for (;;) switch (e.prev = e.next) {
case 0:
return r = d.length > 3 && void 0 !== d[3] && d[3], o = d.length > 4 ? d[4] : void 0, a = d.length > 5 ? d[5] : void 0, j("initSharingDecode"), H.default.add_monitor("INITSD"), this.recordSharingParamInfo(), this.throwErrorWhenParameterIsEmpty(t), E.default.monitorCid = new URL(n).searchParams.get("cid"), s = {
log: r,
userid: i,
meetingid: o,
meetingnumb: a
}, p.setSharingEngineInitProperties(n, s), e.next = 12, p.initSharingDecode(t);
case 12:
return e.next = 14, g.Sharing.waitSharingDecodeResult();
case 14:
return e.abrupt("return", e.sent);
case 15:
case "end":
return e.stop()
}
}, e, this)
})), function (e, t, n) {
return V.apply(this, arguments)
}),
initSharingEncode: (k = (0, s.default)(u.default.mark(function e(t, n, i) {
var r, o, a, s, d = arguments;
return u.default.wrap(function (e) {
for (;;) switch (e.prev = e.next) {
case 0:
return r = d.length > 3 && void 0 !== d[3] && d[3], o = d.length > 4 ? d[4] : void 0, a = d.length > 5 ? d[5] : void 0, j("initSharingEncode"), H.default.add_monitor("INITSE"), this.throwErrorWhenParameterIsEmpty(t), E.default.monitorCid = new URL(n).searchParams.get("cid"), s = {
log: r,
userid: i,
meetingid: o,
meetingnumb: a
}, p.setSharingEngineInitProperties(n, s), e.next = 11, p.initSharingEncode(t);
case 11:
return e.next = 13, g.Sharing.waitSharingEncodeResult();
case 13:
return e.abrupt("return", e.sent);
case 14:
case "end":
return e.stop()
}
}, e, this)
})), function (e, t, n) {
return k.apply(this, arguments)
}),
_listenInitEvent: function () {
var e = {
VIDEO_ENCODE_INIT: I.VIDEO_EVENT.VIDEO_ENCODE_INIT_SUCCESS,
VIDEO_DECODE_INIT: I.VIDEO_EVENT.VIDEO_DECODE_INIT_SUCCESS,
AUDIO_ENCODE: D.AUDIO_INIT_EVENT.AUDIO_ENCODE_SUCCESS,
AUDIO_DECODE: D.AUDIO_INIT_EVENT.AUDIO_DECODE_SUCCESS,
SHARING_DECODE: g.SHARING_INIT_EVENT.SHARING_DECODE_SUCCESS,
SHARING_ENCODE: g.SHARING_INIT_EVENT.SHARING_ENCODE_SUCCESS
},
t = {
VIDEO_ENCODE_INIT: I.VIDEO_EVENT.VIDEO_ENCODE_INIT_FAILED,
VIDEO_DECODE_INIT: I.VIDEO_EVENT.VIDEO_DECODE_INIT_FAILED,
AUDIO_ENCODE: D.AUDIO_INIT_EVENT.AUDIO_ENCODE_FAILED,
AUDIO_DECODE: D.AUDIO_INIT_EVENT.AUDIO_DECODE_FAILED,
SHARING_DECODE: g.SHARING_INIT_EVENT.SHARING_DECODE_FAILED,
SHARING_ENCODE: g.SHARING_INIT_EVENT.SHARING_ENCODE_FAILED
},
n = {
VIDEO_ENCODE_INIT: {
success: _.INIT_SUCCESS_VIDEO,
failed: _.INIT_FAILED_VIDEO,
callbackDataValue: C.EncodeDecodeEnum.encode
},
VIDEO_DECODE_INIT: {
success: _.INIT_SUCCESS_VIDEO,
failed: _.INIT_FAILED_VIDEO,
callbackDataValue: C.EncodeDecodeEnum.decode
},
AUDIO_ENCODE: {
success: _.INIT_SUCCESS_AUDIO,
failed: _.INIT_FAILED_AUDIO,
callbackDataValue: C.EncodeDecodeEnum.encode
},
AUDIO_DECODE: {
success: _.INIT_SUCCESS_AUDIO,
failed: _.INIT_FAILED_AUDIO,
callbackDataValue: C.EncodeDecodeEnum.decode
},
SHARING_DECODE: {
success: _.INIT_SUCCESS_SHARING,
failed: _.INIT_FAILED_SHARING,
callbackDataValue: C.EncodeDecodeEnum.decode
},
SHARING_ENCODE: {
success: _.INIT_SUCCESS_SHARING,
failed: _.INIT_FAILED_SHARING,
callbackDataValue: C.EncodeDecodeEnum.encode
}
},
i = (0, a.default)(e).map(function (n) {
return {
k: n,
promise: new o.default(function (i, r) {
A.default.on(e[n], function () {
i(!0)
}), A.default.on(t[n], function () {
i(!1)
})
})
}
}).map(function (e) {
return e.promise = e.promise.then(function (t) {
return j("init => ".concat(e.k, " => ").concat(t)), t ? n[e.k] && n[e.k].success && E.default.Notify_APPUI(n[e.k].success, n[e.k].callbackDataValue) : n[e.k] && n[e.k].failed && E.default.Notify_APPUI(n[e.k].failed, n[e.k].callbackDataValue), t
}), e
}),
r = {
video: {
success: _.INIT_SUCCESS_VIDEO,
failed: _.INIT_FAILED_VIDEO
},
audio: {
success: _.INIT_SUCCESS_AUDIO,
failed: _.INIT_FAILED_AUDIO
},
sharing: {
success: _.INIT_SUCCESS_SHARING,
failed: _.INIT_FAILED_SHARING
}
};
(0, a.default)(r).map(function (e) {
var t = i.filter(function (t) {
return -1 !== t.k.toLowerCase().indexOf(e)
}).map(function (e) {
return e.promise
});
return o.default.all(t).then(function (e) {
return !(e.filter(function (e) {
return !e
}).length > 0)
})
})
},
JsMediaSDK_UnInit: function () {
p.Stop_Monitor(), p.JsAudioEngine_UnInit(), p.JsVideoEngine_UnInit(), p.JsSharingEngine_UnInit(), this.videoRenderArray && this.videoRenderArray.forEach(function (e) {
e.display && (e.display.cleanup(), e.display = null)
}), E.default.Notify_APPUI = null
},
StartAudioMediaCapture: function () {
this.EndAudioMediaStream();
var e, t = null;
this.audioCapture && (t = this.audioCapture.AudioSelectValue), e = {
audio: !!this.audioCapture && {
deviceId: t ? {
exact: t
} : void 0,
autoGainControl: !1
},
video: !1
};
var n = this.handleAudioCapture.bind(this),
i = this.handleAudioError.bind(this);
navigator.mediaDevices.getUserMedia(e).then(n, i)
},
StartDesktopMediaCapture: (w = (0, s.default)(u.default.mark(function e() {
var t, n, i, r, o;
return u.default.wrap(function (e) {
for (;;) switch (e.prev = e.next) {
case 0:
t = this, h.default.browser.isEdge ? (n = this.handleDesktopCapture.bind(this), i = this.handleCaptureError.bind(this), navigator.getDisplayMedia({
video: !0
}).then(n, i)) : navigator.mediaDevices.getDisplayMedia ? (r = this.handleDesktopCapture.bind(this), o = this.handleCaptureError.bind(this), navigator.mediaDevices.getDisplayMedia({
video: !0
}).then(r, o)) : window.getScreenId(function (e, n, i) {
if (e) {
var r;
switch (e) {
case "WCL.userCancel":
r = _.USER_CANCEL_PERMISSION_REQUEST;
break;
case "WCL.extensionUninstalled":
r = _.DESKTOP_SHARING_CHROME_EXTENSION_UNINSTALLED;
break;
case "WCL.PermissionDeniedError":
r = _.DESKTOP_SHARING_PERMISSION_DENIED
}
t.StopSharingCapture(), r && (H.default.add_monitor("SCSF"), E.default.Notify_APPUI(r, null))
} else navigator.mediaDevices.getUserMedia(i).then(function (e) {
t.desktopSharingMediaStram = e, E.default.Notify_APPUI(_.DESKTOP_SHARING_CAPTURE_SUCCESS, null), t.desktopSharingMediaStram.getVideoTracks()[0].onended = function () {
t.StopSharingCapture(), E.default.Notify_APPUI(_.USER_STOP_DESKTOP_SHARING, null)
}, t.Start_Desktop_Sharing()
}).catch(function (e) {
H.default.add_monitor("SCCF"), t.StopSharingCapture(), E.default.Notify_APPUI(_.DESKTOP_SHARING_ERROR, null)
})
});
case 2:
case "end":
return e.stop()
}
}, e, this)
})), function () {
return w.apply(this, arguments)
}),
StartVideoMediaCapture: (b = (0, s.default)(u.default.mark(function e() {
var t, n, i, r, o;
return u.default.wrap(function (e) {
for (;;) switch (e.prev = e.next) {
case 0:
return this.EndVideoMediaStream(), t = null, n = null, null, this.videoCaptureValue && (t = this.videoCaptureValue.VideoSelectValue), i = !!this.videoCaptureValue && (!!h.default.browser.isSafari || {
width: this.videoCaptureValue.width ? this.videoCaptureValue.width : 320,
height: this.videoCaptureValue.height ? this.videoCaptureValue.height : 180,
deviceId: t ? {
exact: t
} : void 0
}), j("try to getusermedia", n = {
audio: !1,
video: i
}), e.prev = 9, r = this.videoCaptureValue, this.isMediaDevicesGetUserMediaNow = !0, e.prev = 12, e.next = 15, navigator.mediaDevices.getUserMedia(n);
case 15:
o = e.sent, e.next = 23;
break;
case 18:
return e.prev = 18, e.t0 = e.catch(12), e.next = 22, navigator.mediaDevices.getUserMedia((0, d.default)({}, n, {
video: !0
}));
case 22:
o = e.sent;
case 23:
return this.isMediaDevicesGetUserMediaNow = !1, j("mediaStream is ok"), this.videoCaptureValue = r, e.next = 28, this.handleVideoCapture(o);
case 28:
e.sent && (E.default.monitorVideoCapture = !0, E.default.Notify_APPUI(_.START_VIDEO_CAPTURE_SUCCESS, null)), e.next = 35;
break;
case 32:
e.prev = 32, e.t1 = e.catch(9), this.handleVideoError(e.t1);
case 35:
case "end":
return e.stop()
}
}, e, this, [
[9, 32],
[12, 18]
])
})), function () {
return b.apply(this, arguments)
}),
Start_Audio_Play: function () {
if (this.audioPlay = !0, this.isSupportAudioWorklet) E.default.AudioNode && E.default.AudioNode.postCMD("startPlayAudio", null);
else if (this.audioPlayNode && this.audioCtx) this.audioPlayNode.connect(this.audioCtx.destination);
else {
this.audioPlayNode = this.audioCtx.createScriptProcessor(this.audionodebuffersize, 1, 1);
var e = this;
this.audioPlayNode.onaudioprocess = function (t) {
e.JsMediaSDK_OnAudioprocess(t)
}, this.audioPlayNode.connect(this.audioCtx.destination)
}
p.UpdateAudioPlayStatus(!0)
},
Stop_Audio_Play: function () {
if (p.UpdateAudioPlayStatus(!1), this.isSupportAudioWorklet) E.default.AudioNode && E.default.AudioNode.postCMD("stopPlayAudio", null);
else if (this.audioPlay = !1, this.audioPlayNode) try {
this.audioPlayNode.disconnect(this.audioCtx.destination)
} catch (e) {
this.JsMediaSDK_Log(e)
}
},
Remove_Audio_Play: function () {
if (p.UpdateAudioPlayStatus(!1), this.audioPlay = !1, this.isSupportAudioWorklet) E.default.AudioNode && E.default.AudioNode.postCMD("stopPlayAudio", null);
else if (this.audioPlayNode) {
try {
this.audioPlayNode.disconnect(this.audioCtx.destination)
} catch (e) {
this.JsMediaSDK_Log(e)
}
this.audioPlayNode = null
}
},
Meeting_Fail_Over: function (e, t) {
p.Meeting_Fail_Over(e, t)
},
Start_Audio_Capture: function () {
if (!(this.audioRecordNode && this.audioCtx.destination && this.AudioMediaStream))
if (this.AudioMediaStream) {
var e = this.audioCtx.createMediaStreamSource(this.AudioMediaStream);
if (this.webrtcAudioNode = e, this.isSupportAudioWorklet) this.isCaputureNodeConnect || (this.webrtcAudioNode.connect(E.default.AudioNode), E.default.AudioNode.postCMD("StartCaptureAudio", null), this.isCaputureNodeConnect = !0);
else {
this.audioRecordNode = this.audioCtx.createScriptProcessor(this.audionoderecordbuffersize, 1, 1), e.connect(this.audioRecordNode), this.audioRecordNode.connect(this.audioCtx.destination);
var t = this;
this.audioRecordNode.onaudioprocess = function (e) {
if (t.captureAudioStatus === _.AUDIO_REMOVE);
else {
var n = e.inputBuffer.getChannelData(0),
i = new Float32Array(n);
p.Audio_Encode_Frame(t.audioCapture.ssrc, i, n.length, 0)
}
}
}
} else this.StartAudioMediaCapture(), this.captureAudioStatus = _.AUDIO_START
},
Stop_Audio_Capture: function () {
this.captureAudioStatus = _.AUDIO_STOP, p.Notify_Audio_Thread_Status(E.default.SPECIAL_ID, _.AUDIO_STOP)
},
Start_Video_Capture: function () {
var e = this;
if (this.VideoMediaStram) {
var t = this;
return new o.default(function (n, i) {
t.videoCaptureValue.videoCtrl.addEventListener("loadedmetadata", function e(n) {
t.isVideoCaptureLoadedmetadata = !0;
var i = t.videoCaptureValue.videoCtrl.videoWidth,
r = t.videoCaptureValue.videoCtrl.videoHeight;
t.videoCaptureValue.canvasCtrl.width = i, t.videoCaptureValue.canvasCtrl.height = r, t.videoCaptureWidth = i, t.videoCaptureHeight = r, t.videoCaptureContext = t.videoCaptureValue.canvasCtrl.getContext("2d"), t.captureVideoOutputCanvasDomList.forEach(function (e) {
e.width = i, e.height = r
}), p.Notify_Video_Encode_Thread({
command: "startVideoEncode",
width: t.videoCaptureWidth,
height: t.videoCaptureHeight,
fps: t.videoCaptureValue.fps,
ssid: t.videoCaptureValue.ssid,
mtu_size: t.mtu_size
}), p.Notify_Video_Encode_Thread({
command: "updateVideoPara",
width: i,
height: r,
fps: t.videoCaptureValue.fps
}), E.default.monitorVideoUserID = t.videoCaptureValue.ssid, E.default.Notify_APPUI(_.CURRENT_CAPTURE_VIDEO_WIDTH_HEIGHT, {
width: i,
height: r
}), t.videoCaptureValue.videoCtrl.removeEventListener("loadedmetadata", e)
}), setTimeout(function () {
e.VideoMediaStram ? !1 === e.VideoMediaStram.active ? i(new S.CameraOccupiedError("VideoMediaStram.active equals false")) : n(!0) : i(!1)
}, 1e3), t.videoCaptureValue.videoCtrl.setAttribute("playsinline", !0);
try {
t.videoCaptureValue.videoCtrl.srcObject = t.VideoMediaStram
} catch (n) {
t.videoCaptureValue.videoCtrl.src = URL.createObjectURL(e.VideoMediaStram)
}
t.videoCaptureValue.videoCtrl.play()
})
}
this.StartVideoMediaCapture()
},
Stop_Video_Capture: function () {
p.Notify_Video_Encode_Thread({
command: "stopVideoEncode"
}), this.isStartVideoCapture = !1, this.isVideoCaptureLoadedmetadata = !1, clearInterval(this.videoCaptureInterval), this.videoCaptureInterval = 0, this.EndVideoMediaStream(), this.videoCaptureValue && this.videoCaptureValue.videoCtrl && this.videoCaptureValue.videoCtrl.pause(), this.videoCaptureValue = null
},
Remove_Video_Capture: function () {
clearInterval(this.videoCaptureInterval), this.videoCaptureInterval = 0, this.EndVideoMediaStream(), this.videoCaptureValue = null, this.videoCaptureValue.videoCtrl && this.videoCaptureValue.videoCtrl.pause()
},
Start_Desktop_Sharing: function () {
if (this.desktopSharingMediaStram) {
var e = this;
return new o.default(function (t, n) {
e.desktopSharingValue.video.addEventListener("loadedmetadata", function (t) {
e.isdesktopCaptureLoadedmetadata = !0;
var n = e.desktopSharingValue.video.videoWidth,
i = e.desktopSharingValue.video.videoHeight;
e.desktopSharingValue.canvas.width = n, e.desktopSharingValue.canvas.height = i, e.desktopSharingCaptureWidth = n, e.desktopSharingCaptureHeight = i, e.desktopCaptureContext = e.desktopSharingValue.canvas.getContext("2d"), E.default.monitorSharingUserID = e.desktopSharingValue.ssid, p.Notify_Sharing_Encode_Thread({
command: "startSharingEncode",
width: n,
height: i,
fps: 8,
ssid: e.desktopSharingValue.ssid
}), E.default.Notify_APPUI(_.CURRENT_DESKTOP_SHARING_WIDTH_HEIGHT, {
width: n,
height: i
})
}), e.desktopSharingValue.video.setAttribute("playsinline", !0);
try {
e.desktopSharingValue.video.srcObject = e.desktopSharingMediaStram
} catch (t) {
e.desktopSharingValue.video.src = URL.createObjectURL(e.desktopSharingMediaStram)
}
e.desktopSharingValue.video.play()
})
}
this.StartDesktopMediaCapture()
},
Process_Sharing: function () {
if (this.desktopSharingValue && this.desktopSharingSend) {
var e = this.desktopSharingValue.video,
t = e.videoWidth,
n = e.videoHeight,
i = this.desktopCaptureContext;
if (t == this.desktopSharingCaptureWidth && n == this.desktopSharingCaptureHeight || (E.default.Notify_APPUI(_.CURRENT_DESKTOP_SHARING_WIDTH_HEIGHT, {
width: t,
height: n
}), this.desktopSharingCaptureWidth = t, this.desktopSharingCaptureHeight = n, this.desktopSharingValue.canvas.width = t, this.desktopSharingValue.canvas.height = n), this.isdesktopCaptureLoadedmetadata && e) {
i.drawImage(e, 0, 0, t, n, 0, 0, t, n);
var r = i.getImageData(0, 0, t, n);
p.Sharing_Encode_Frame(E.default.SPECIAL_ID, r.data, r.data.length, 0, t, n)
}
}
},
Process_Video: function () {
if (this.videoCaptureValue) {
var e = this.videoCaptureValue.videoCtrl,
t = this,
n = e.videoWidth,
i = e.videoHeight,
r = this.videoCaptureWidth,
o = this.videoCaptureHeight;
r && o && (n !== r || i !== o) && (j("video width/height changed old => begin", r, o, n, i), E.default.Notify_APPUI(_.CURRENT_CAPTURE_VIDEO_WIDTH_HEIGHT, {
width: n,
height: i
}), p.Notify_Video_Encode_Thread({
command: "updateVideoPara",
width: n,
height: i,
fps: this.videoCaptureValue.fps
}), this.captureVideoOutputCanvasDomList.forEach(function (e) {
e.width = n, e.height = i
}), this.videoCaptureWidth = n, this.videoCaptureHeight = i, r = n, o = i);
var a = this.captureVideoOutputCanvasDomList.map(function (e) {
return e.getContext("2d")
})[0];
if (this.isVideoCaptureLoadedmetadata && e) {
this.captureVideoOutputCanvasDomList.forEach(function (n) {
n.ctxCache || (n.ctxCache = n.getContext("2d")), (e.paused || e.ended) && e.play(), n.ctxCache.drawImage(e, 0, 0, t.videoCaptureWidth, t.videoCaptureHeight, 0, 0, t.videoCaptureWidth, t.videoCaptureHeight)
});
var u = a.getImageData(0, 0, t.videoCaptureWidth, t.videoCaptureHeight);
p.Video_Encode_Frame(E.default.SPECIAL_ID, u.data, u.data.length, 0)
}
}
},
Remove_Audio_Capture: function () {
if (p.Notify_Audio_Thread_Status(E.default.SPECIAL_ID, _.AUDIO_REMOVE), this.captureAudioStatus = _.AUDIO_REMOVE, this.firstSetDelay = !0, this.audioRecordNode) {
try {
this.audioRecordNode.disconnect(this.audioCtx.destination)
} catch (e) {
this.JsMediaSDK_Log(e)
}
this.audioRecordNode = null
}
if (this.webrtcAudioNode && this.isSupportAudioWorklet && E.default.AudioNode) {
try {
this.webrtcAudioNode.disconnect(E.default.AudioNode)
} catch (e) {
this.JsMediaSDK_Log(e)
}
this.webrtcAudioNode = null
}
},
Start_Video_Play: function () {
p.UpdateVideoPlayStatus(!0), this.videoRenderIntervalHandle || (this.videoRenderIntervalHandle = this.JsMediaSDK_VideoRenderInterval(this.videorenderinterval))
},
Stop_Video_Play: function () {
p.UpdateVideoPlayStatus(!1), p.Clear_Decoded_Video_Frame(), this.videoRenderIntervalHandle && (clearInterval(this.videoRenderIntervalHandle), this.videoRenderIntervalHandle = null)
},
Remove_Video_Play: function () {
p.UpdateVideoPlayStatus(!1), this.videoRenderIntervalHandle && (clearInterval(this.videoRenderIntervalHandle), this.videoRenderIntervalHandle = null)
},
EndMedia: function () {
try {
this.rtcPeerConnectionList.forEach(function (e) {
e && (e.forceClose(), e = null)
}), this.rtcPeerConnectionList = []
} catch (e) {
j.error("clear rtcPeerConnectionList err", e)
}
try {
this.AudioMediaStream && (this.AudioMediaStream.getTracks().forEach(function (e) {
e.stop()
}), this.AudioMediaStream = null), this.Remove_Audio_Play(), this.Remove_Audio_Capture(), this.Remove_Video_Play(), this.audioCtx && (this.audioCtx.close(), this.audioCtx = null), this.EndVideoMediaStream(), this.EndSharingMediaStream()
} catch (e) {
j("endMedia", e)
}
try {
p.disableSocketReconnect()
} catch (e) {
j("endMedia", e)
}
try {
this.remoteControl && this.remoteControl.destroy()
} catch (e) {
j("endMedia", e)
}
},
EndAudioMediaStream: function () {
this.AudioMediaStream && (this.AudioMediaStream.getTracks().forEach(function (e) {
e.stop()
}), this.AudioMediaStream = null)
},
EndVideoMediaStream: function () {
this.VideoMediaStram && (this.VideoMediaStram.getTracks().forEach(function (e) {
e.stop()
}), this.VideoMediaStram = null)
},
EndSharingMediaStream: function () {
this.desktopSharingMediaStram && (this.desktopSharingMediaStram.getTracks().forEach(function (e) {
e.stop()
}), this.desktopSharingMediaStram = null)
},
StopSharingCapture: function () {
this.EndSharingMediaStream(), this.desktopSharingSend = !1, this.isStartDesktopSharing = !1, this.desktopSharingMediaStram = null, this.desktopSharingValue = null
},
UnMuteAudio: function () {
this.captureAudioStatus = _.AUDIO_START, p.Notify_Audio_Thread_Status(E.default.SPECIAL_ID, _.AUDIO_START)
},
MuteAudio: function () {
this.Stop_Audio_Capture()
},
handleDesktopCapture: function (e) {
this.desktopSharingMediaStram = e;
var t = this;
this.desktopSharingMediaStram.getVideoTracks()[0].onended = function () {
t.StopSharingCapture(), E.default.Notify_APPUI(_.USER_STOP_DESKTOP_SHARING, null)
}, this.Start_Desktop_Sharing(), E.default.Notify_APPUI(_.DESKTOP_SHARING_CAPTURE_SUCCESS, null)
},
handleCaptureError: function (e) {
this.StopSharingCapture(), H.default.add_monitor("SCCF"), E.default.Notify_APPUI(_.DESKTOP_SHARING_ERROR, null)
},
handleAudioCapture: function (e) {
E.default.monitorAudioCapture = !0, E.default.Notify_APPUI(_.USER_GRANT_CAPTURE_AUDIO, null), this.AudioMediaStream = e, this.Start_Audio_Capture()
},
handleVideoCapture: function (e) {
var n, t = this;
return new o.default((n = (0, s.default)(u.default.mark(function n(i, r) {
var o;
return u.default.wrap(function (n) {
for (;;) switch (n.prev = n.next) {
case 0:
if (e) {
n.next = 2;
break
}
return n.abrupt("return", r(new Error("no stream")));
case 2:
return t.VideoMediaStram = e, n.prev = 3, n.next = 6, t.Start_Video_Capture();
case 6:
o = n.sent, i(o), n.next = 14;
break;
case 10:
n.prev = 10, n.t0 = n.catch(3), j("Start_Video_Capture", n.t0), r(new Error("media stream is ok, but start video capture fail"));
case 14:
case "end":
return n.stop()
}
}, n, this, [
[3, 10]
])
})), function (e, t) {
return n.apply(this, arguments)
}))
},
handleAudioError: function (e) {
H.default.add_monitor("HADF"), this.AudioMediaStream = null, E.default.monitorAudioCapture = !1, E.default.Notify_APPUI(_.USER_FORBIDDED_CAPTURE_AUDIO, null)
},
handleVideoError: function (e) {
E.default.monitorVideoCapture = !1, j("handleVideoError", e), e instanceof S.CameraOccupiedError || e.name && -1 !== ["NotReadableError", "SourceUnavailableError"].indexOf(e.name) ? E.default.Notify_APPUI(_.USER_CAMERA_IS_TAKEN_BY_OTHER_PROGRAMS, null) : (H.default.add_monitor("HVDF"), E.default.Notify_APPUI(_.USER_FORBIDDED_CAPTURE_VIDEO, null)), this.Stop_Video_Capture()
},
switchCanvasForVideoCapture: function (e) {
var t = this.videoCaptureValue.videoCtrl.videoWidth,
n = this.videoCaptureValue.videoCtrl.videoHeight,
i = [].concat(e),
r = i[0];
i.forEach(function (e) {
e.width = t, e.height = n
}), this.captureVideoOutputCanvasDomList = i, this.videoCaptureValue.canvasCtrl = r, this.videoCaptureValue.canvasCtrl.width = t, this.videoCaptureValue.canvasCtrl.height = n, this.videoCaptureContext = r.getContext("2d")
},
Notify_MeidaSDK: (N = (0, s.default)(u.default.mark(function e(t, n) {
var i, r, a, s, c, S, v, I, D, g, O = this;
return u.default.wrap(function (e) {
for (;;) switch (e.prev = e.next) {
case 0:
j(t, n), i = 0, H.default.add_monitor2("B" + t), e.t0 = t, e.next = e.t0 === _.START_MEDIA ? 6 : e.t0 === _.ADD_RENDER_VIDEO ? 9 : e.t0 === _.STOP_RENDER_VIDEO ? 25 : e.t0 === _.SWITCH_CANVAS_FOR_VIDEO_CAPTURE ? 29 : e.t0 === _.START_CAPTURE_VIDEO ? 35 : e.t0 === _.STOP_CAPTURE_VIDEO ? 42 : e.t0 === _.ADD_RENDER_AUDIO ? 45 : e.t0 === _.STOP_RENDER_AUDIO ? 47 : e.t0 === _.UNMUTE_AUDIO ? 49 : e.t0 === _.MUTE_AUDIO ? 51 : e.t0 === _.START_SHARING ? 53 : e.t0 === _.STOP_SHARING ? 60 : e.t0 === _.CHANGE_FRAME_RATE ? 71 : e.t0 === _.CHANGE_VIDEO_RESOLUTION ? 72 : e.t0 === _.CHANGE_AUDIO_SPEAKER ? 73 : e.t0 === _.CHANGE_VIDEO_CAPTURE_DEVICE ? 74 : e.t0 === _.CHANGE_CURRENT_ACTIVE_SSRC ? 78 : e.t0 === _.LEAVE_MEETING ? 80 : e.t0 === _.MEETING_FAIL_OVER ? 82 : e.t0 === _.END_MEDIA ? 84 : e.t0 === _.CHANGE_AUDIO_MIC ? 88 : e.t0 === _.WEBRTC_RESTART ? 91 : e.t0 === _.LEAVE_COMPUTER_AUDIO ? 93 : e.t0 === _.JOIN_COMPUTER_AUDIO ? 103 : e.t0 === _.START_REMOTE_CONTROL ? 105 : e.t0 === _.CANCEL_REMOTE_CONTROL ? 117 : e.t0 === _.UPDATE_REMOTE_CONTROL_PROPERTIES ? 119 : e.t0 === _.START_DESKTOP_SHARING ? 121 : e.t0 === _.STOP_DESKTOP_SHARING ? 133 : e.t0 === _.PAUSE_DESKTOP_SHARING ? 141 : e.t0 === _.RESUME_DESKTOP_SHARING ? 148 : e.t0 === _.CHECK_CHROME_SHARING_EXTENSION ? 156 : e.t0 === _.COMMAND_SOCKET_MESSAGE_NOTIFY ? 162 : 174;
break;
case 6:
return this.isMediaStart = !0, this.StartAudioMediaCapture(), e.abrupt("break", 175);
case 9:
i = 0;
case 10:
if (!(i < this.videoRenderArray.length)) {
e.next = 16;
break
}
if (this.videoRenderArray[i].ssrc != n.ssrc) {
e.next = 13;
break
}
return e.abrupt("return");
case 13:
i++, e.next = 10;
break;
case 16:
return this.currentVideoWidth = 0, this.currentVideoHeight = 0, this.isCreateVideoWaterMark = n.enableWaterMark, this.isCreateVideoWaterMark ? this.videoWaterMarkName = n.waterMarkText : this.videoWaterMarkName = "", this.videoRenderArray.push(n), n.display = new l.default(n.canvas), this.canvas = n.canvas, this.Start_Video_Play(), e.abrupt("break", 175);
case 25:
for (this.videoWaterMarkName = "", this.isCreateVideoWaterMark = !1, i = 0; i < this.videoRenderArray.length; i++) this.videoRenderArray[i].ssrc == n.ssrc && (this.videoRenderArray[i].display && this.videoRenderArray[i].display.cleanup(), this.videoRenderArray[i].display = null, this.videoRenderArray.splice(i, 1), 0 == this.videoRenderArray.length && this.Stop_Video_Play());
return e.abrupt("break", 175);
case 29:
return r = [], n instanceof Array ? r = n : r.push(n), a = this.videoCaptureValue.canvasCtrlList, s = a.filter(function (e) {
return -1 !== r.indexOf(e.k)
}).map(function (e) {
return e.dom
}), this.switchCanvasForVideoCapture(s), e.abrupt("break", 175);
case 35:
if (p.Update_Video_Encrpt(E.default.e2eencrypt), p.isVideoEncodeHandleReady()) {
e.next = 40;
break
}
return j.warn("not isVideoEncodeHandleReady so return"), H.default.add_monitor("not isVideoEncodeHandleReady so return"), e.abrupt("return");
case 40:
if (this.isStartVideoCapture) j.warn("video capture is already started, do not call again.");
else {
if (this.VALUE_CACHE_FOR_START_CAPTURE_VIDEO = (0, d.default)({}, n), this.isStartVideoCapture = !0, n.canvasCtrlList = [], n.canvas instanceof Array)
for (i = 0; i < n.canvas.length; i++) n.canvasCtrlList.push({
k: n.canvas[i],
dom: h.default.getDocumentHandle(n.canvas[i])
});
else n.canvasCtrlList.push({
k: n.canvas,
dom: h.default.getDocumentHandle(n.canvas)
});
n.canvasCtrl = n.canvasCtrlList[0].dom, this.captureVideoOutputCanvasDomList = [].concat(n.canvasCtrl), h.default.browser.isSafari ? ((c = document.createElement("video")).setAttribute("style", "position:fixed;top:-10000px;left:-10000px;visibility:hidden;"), document.body.appendChild(c), n.videoCtrl = c) : n.videoCtrl = h.default.getDocumentHandle(n.video), this.videoCaptureValue = n, this.Start_Video_Capture()
}
return e.abrupt("break", 175);
case 42:
return S = this, e.abrupt("return", new o.default(function (e, t) {
try {
if (O.isMediaDevicesGetUserMediaNow) return E.default.Notify_APPUI(_.STOP_VIDEO_CAPTURE_FAILED, null), t(new Error("Too many calls : the device is opening camera now, cannot stop video capture"));
S.isStartVideoCapture && S.Stop_Video_Capture(), E.default.Notify_APPUI(_.STOP_VIDEO_CAPTURE_SUCCESS, null), e(!0)
} catch (e) {
E.default.Notify_APPUI(_.STOP_VIDEO_CAPTURE_FAILED, null), t(e)
}
}));
case 45:
return 0 == this.audioRenderArray.length && (this.audioRenderArray.push(n), this.Start_Audio_Play()), e.abrupt("break", 175);
case 47:
if (this.audioRenderArray.length > 0)
for (this.Stop_Audio_Play(), i = 0; i < this.audioRenderArray.length; i++) this.audioRenderArray[i].ssrc == n.ssrc && this.audioRenderArray.splice(i, 1);
return e.abrupt("break", 175);
case 49:
return this.UnMuteAudio(), e.abrupt("break", 175);
case 51:
return this.MuteAudio(), e.abrupt("break", 175);
case 53:
return this.currentshareactive = n.ssrc, null == this.currentshareactive && H.default.add_monitor2("SSRC"), this.isCreateSharingWaterMark = n.enableWaterMark, this.isCreateSharingWaterMark ? this.sharingWaterMarkName = n.waterMarkText : this.sharingWaterMarkName = "", this.sharingInterval || (this.sharingInterval = this.JsMediaSDK_SharingRenderInterval(this.sharingIntervalTime), this.sharingDisplay = new l.default(n.canvas)), p.UpdateSharingPlayStatus(!0), e.abrupt("break", 175);
case 60:
return p.UpdateSharingPlayStatus(!1), this.isCreateSharingWaterMark = !1, this.sharingWaterMarkName = "", this.currentSharingHeight = 0, this.currentSharingWidth = 0, this.currentSharingLogicHeight = 0, this.currentSharingLogicWidth = 0, this.sharingInterval && (clearInterval(this.sharingInterval), this.sharingInterval = 0), p.Clear_Decoded_Sharing_Frame(), this.sharingDisplay && (this.sharingDisplay.clear(), this.sharingDisplay.cleanup(), this.sharingDisplay = null), e.abrupt("break", 175);
case 71:
case 72:
case 73:
return e.abrupt("break", 175);
case 74:
if (v = (0, d.default)({}, this.VALUE_CACHE_FOR_START_CAPTURE_VIDEO, n), this.Stop_Video_Capture(), !this.isStartVideoCapture) {
if (this.isStartVideoCapture = !0, v.canvasCtrlList = [], v.canvas instanceof Array)
for (i = 0; i < v.canvas.length; i++) v.canvasCtrlList.push({
k: v.canvas[i],
dom: h.default.getDocumentHandle(v.canvas[i])
});
else v.canvasCtrlList.push({
k: v.canvas,
dom: h.default.getDocumentHandle(v.canvas)
});
v.canvasCtrl = v.canvasCtrlList[0].dom, v.videoCtrl = h.default.getDocumentHandle(v.video), this.videoCaptureValue = v, this.Start_Video_Capture()
}
return e.abrupt("break", 175);
case 78:
return this.currentactive != n.ssrc && (p.Clear_Decoded_Video_Frame(), this.currentactive = n.ssrc, E.default.CurrentSSRC = this.currentactive, p.Notify_Audio_Thread_CurrentSSRC(E.default.CurrentSSRC)), e.abrupt("break", 175);
case 80:
return this.Stop_Audio_Play(), e.abrupt("break", 175);
case 82:
return this.Meeting_Fail_Over(n.audio_websocket_address, n.video_websocket_address), e.abrupt("break", 175);
case 84:
return j("jsEvent.END_MEDIA"), A.default.trigger(_.PUBSUB_EVT.END_MEDIA), this.destroy().catch(function (e) {
return j.error(e)
}), e.abrupt("break", 175);
case 88:
if (this.audioCapture && n && this.audioCtx) {
this.Remove_Audio_Capture(), this.EndAudioMediaStream();
try {
this.isCaputureNodeConnect = !1, this.audioCapture = n, this.audioCtx.sampleRate != this.sampleRate && (this.sampleRate = this.audioCtx.sampleRate, p.Modify_Audio_SampleRate(this.sampleRate)), this.isSupportAudioWorklet ? (this.Start_Audio_Capture(), p.Notify_Audio_Thread_Status(E.default.SPECIAL_ID, _.AUDIO_START), p.Reset_Aec()) : (isAudioPlaying && this.Start_Audio_Play(), this.Start_Audio_Capture(), p.Reset_Aec())
} catch (e) {
this.JsMediaSDK_Log(e)
}
}
return e.abrupt("return");
case 91:
return n && (p.Notify_Audio_Thread_Status(E.default.SPECIAL_ID, _.AUDIO_START), this.EndAudioMediaStream(), this.Remove_Audio_Capture(), this.audioCapture = n, this.Start_Audio_Capture(), p.Reset_Aec()), e.abrupt("break", 175);
case 93:
this.Remove_Audio_Capture(), this.Remove_Audio_Play(), this.EndAudioMediaStream();
try {
E.default.AudioNode && (E.default.AudioNode.port = null)
} catch (e) {
j("AudioNode.port", e)
}
return E.default.AudioNode = null, this.audioCtx && (this.audioCtx.close(), this.isCaputureNodeConnect = !1), this.audioCtx = null, this.audioCapture = null, this.audioPlay = !1, e.abrupt("break", 175);
case 103:
try {
E.default.monitorAudioUserID = n.CaptureAudioInfo.ssrc, p.Update_Audio_Encrpt(E.default.e2eencrypt), this.Remove_Audio_Play(), this.Remove_Audio_Capture(), this.EndAudioMediaStream(), p.Notify_Audio_Thread_Status(E.default.SPECIAL_ID, _.AUDIO_START), this.audioCtx && (this.audioCtx.close(), this.isCaputureNodeConnect = !1), this.audioCtx = new(window.AudioContext || window.webkitAudioContext), this.audioCtx.sampleRate != this.sampleRate && (this.sampleRate = this.audioCtx.sampleRate, p.Modify_Audio_SampleRate(this.sampleRate)), this.isSupportAudioWorklet ? (S = this, this.audioCtx.audioWorklet.addModule(S.audioWorkletJsPath).then(function () {
E.default.AudioNode = new f.default(S.audioCtx), E.default.AudioNode.connect(S.audioCtx.destination);
var e = new MessageChannel,
t = new MessageChannel;
E.default.AudioNode.port.postMessage({
status: "encodeAudioPort"
}, [t.port2]), E.default.AudioNode.port.postMessage({
status: "decodeAudioPort"
}, [e.port1]), p.Notify_Audio_Thread_Msg_Channel(e, t), S.Start_Audio_Play(), n.CaptureAudio && (S.audioCapture = n.CaptureAudioInfo, S.Start_Audio_Capture(), O.firstSetDelay && (O.firstSetDelay = !1, p.Reset_Aec(), p.Set_Aec_Delay()))
})) : (this.Start_Audio_Play(), n.CaptureAudio && (this.audioCapture = n.CaptureAudioInfo, this.Start_Audio_Capture(), this.firstSetDelay && (this.firstSetDelay = !1, p.Reset_Aec(), p.Set_Aec_Delay())))
} catch (e) {
this.JsMediaSDK_Log(e)
}
return e.abrupt("break", 175);
case 105:
return j("sdk start remote control 1"), I = this.sharingWidthAndHeightInfo, D = new m.default((0, d.default)({
dom: document
}, n)), this.remoteControl = D, j("sharingInfo", I), D.setDstWidthAndHeight(I.logicWidth, I.logicHeight), D.setSrcWidthAndHeight(I.logicWidth, I.logicHeight), D.setSrcScaleWidthAndHeight(n.scaleWidth, n.scaleHeight), D.setSrcOffsetXY(n.srcOffsetX, n.srcOffsetY), D.setRemoteOS(n.os), e.abrupt("return", D.start().then(function (e) {
return E.default.Notify_APPUI(e ? _.START_REMOTE_CONTROL_SUCCESS : _.START_REMOTE_CONTROL_FAILED), e && (D.onPasteTextLengthOverflow(function () {
E.default.Notify_APPUI(_.REMOTE_CONTROL_PASTE_TEXT_LENGTH_OVERFLOW)
}), D.onReturnCopiedText(function (e) {
j(e), E.default.Notify_APPUI(_.REMOTE_CONTROL_COPIED_TEXT_NOTIFY, e)
})), e
}).catch(function (e) {
return j(e), E.default.Notify_APPUI(_.START_REMOTE_CONTROL_FAILED), H.default.add_monitor(["RMCT", e.message, "f"].join("")), o.default.reject(e)
}));
case 117:
return e.abrupt("return", this.remoteControl.destroy().then(function (e) {
return E.default.Notify_APPUI(e ? _.CANCEL_REMOTE_CONTROL_SUCCESS : _.CANCEL_REMOTE_CONTROL_FAILED), e
}));
case 119:
return this.remoteControl && (n.scaleWidth && n.scaleHeight && this.remoteControl.setSrcScaleWidthAndHeight(n.scaleWidth, n.scaleHeight), (n.srcOffsetX || n.srcOffsetY) && this.remoteControl.setSrcOffsetXYAndSendPDU(n.srcOffsetX, n.srcOffsetY), (0, y.default)(n.isControllerNow) && this.remoteControl.setIsControlerNow(n.isControllerNow), (0, T.default)(n.os) && this.remoteControl.setRemoteOS(n.os)), e.abrupt("break", 175);
case 121:
if (this.isStartDesktopSharing) {
e.next = 131;
break
}
p.Update_Sharing_Encrpt(E.default.e2eencrypt), this.isStartDesktopSharing = !0, this.desktopSharingSend = !0, n.video = h.default.getDocumentHandle(n.video), n.canvas = h.default.getDocumentHandle(n.canvas), this.desktopSharingValue = n, this.Start_Desktop_Sharing(), e.next = 132;
break;
case 131:
return e.abrupt("return");
case 132:
return e.abrupt("break", 175);
case 133:
if (!this.isStartDesktopSharing) {
e.next = 139;
break
}
this.desktopSharingSend = !1, this.StopSharingCapture(), p.Update_Sharing_Encode_Status({
command: "stop"
}), e.next = 140;
break;
case 139:
return e.abrupt("return");
case 140:
return e.abrupt("break", 175);
case 141:
if (!this.isStartDesktopSharing) {
e.next = 146;
break
}
this.desktopSharingSend = !1, p.Update_Sharing_Encode_Status({
command: "pause"
}), e.next = 147;
break;
case 146:
return e.abrupt("return");
case 147:
return e.abrupt("break", 175);
case 148:
if (!this.isStartDesktopSharing) {
e.next = 154;
break
}
this.desktopSharingSend = !0, this.Process_Sharing(), p.Update_Sharing_Encode_Status({
command: "resume"
}), e.next = 155;
break;
case 154:
return e.abrupt("return");
case 155:
return e.abrupt("break", 175);
case 156:
return (g = document.createElement("img")).src = "chrome-extension://kgjfgplpablkjnlkjmjdecgdpfankdle/images/trash.png", g.onload = function () {
E.default.Notify_APPUI(_.CHECK_CHROME_SHARING_EXTENSION_RESPONSE, !0)
}, g.onerror = function () {
E.default.Notify_APPUI(_.CHECK_CHROME_SHARING_EXTENSION_RESPONSE, !1)
}, e.abrupt("break", 175);
case 162:
if (n.evt !== _.ZOOM_CONNECTION_VIDEO_OFFER_RESPONSE_EVT && n.evt !== _.ZOOM_CONNECTION_AUDIO_OFFER_RESPONSE_EVT) {
e.next = 173;
break
}
if (j("rwg answer from ui", n), n.answer) {
e.next = 166;
break
}
return e.abrupt("return");
case 166:
e.t1 = n.answer.type, e.next = e.t1 === C.ZOOM_CONNECTION_TYPE.ZOOM_CONNECTION_VIDEO ? 169 : e.t1 === C.ZOOM_CONNECTION_TYPE.ZOOM_CONNECTION_AUDIO ? 171 : 173;
break;
case 169:
return A.default.trigger(_.PUBSUB_EVT.ZOOM_CONNECTION_VIDEO_OFFER_RESPONSE_EVT, n), e.abrupt("break", 173);
case 171:
return A.default.trigger(_.PUBSUB_EVT.ZOOM_CONNECTION_AUDIO_OFFER_RESPONSE_EVT, n), e.abrupt("break", 173);
case 173:
return e.abrupt("break", 175);
case 174:
j("CAN NOT HANDLE THE EVENT!");
case 175:
case "end":
return e.stop()
}
}, e, this)
})), function (e, t) {
return N.apply(this, arguments)
}),
JsMediaSDK_OnAudioprocess: function (e) {
if (this.audioPlay) {
var t = e.outputBuffer.numberOfChannels,
n = p.Get_Decoded_Audio_Frame(0, 0, this.audionodebuffersize);
if (n) {
n.length < this.audionodebuffersize && this.JsMediaSDK_Log("Audio is Not enough! length:" + n.length);
for (var i = 0; i < t; i++) {
(o = e.outputBuffer.getChannelData(i)).set(n);
for (var r = n.length; r < this.audionodebuffersize; r++) o[r] = 0
}
} else
for (this.JsMediaSDK_Log("Active Queue audio:" + p.Get_Decoded_Audio_Buffer_Length()), i = 0; i < t; ++i) {
var o = e.outputBuffer.getChannelData(i),
a = new Uint8Array(o.length);
o.set(a)
}
}
},
JsMediaSDK_VideoRender: function () {
var e = 0;
if (this.videoRenderLevelCount == this.videoRenderLevel) {
if (this.videoRenderLevelCount = 1, 0 != this.videoRenderArray.length)
for (e = 0; e < this.videoRenderArray.length; e++) {
var t, n;
if (t = this.isSupportAudioWorklet ? E.default.CurrentSSRCTime : p.Get_SSRC_Latest_Time(this.currentactive), this.lastresidual ? (n = this.lastresidual, this.lastresidual = null) : n = p.Get_Decoded_Video_Frame(this.currentactive, 0), n) {
if (this.videoBufEmptyCount = 0, this.videoBufCount = p.Get_Decoded_Video_Buffer_Length(this.currentactive), this.renderPeriodCount == this.renderPeriodTotal) {
var i = this.renderPeriodTotalFps / this.renderPeriodFpsCount;
i && 0 != i || (i || this.JsMediaSDK_Log("fps error"), i = 100);
var r = Math.round(i / this.videorenderinterval);
this.videoRenderLevel < r && this.videoRenderLevel++, this.renderPeriodCount = 0, this.renderPeriodTotalFps = 0, this.videoAfterAudioCount = 0, this.videoBeforeAudioCount = 0, this.renderPeriodFpsCount = 0
}
this.renderPeriodCount++;
var o = p.Get_SSRC_VIDEO_FPS(this.currentactive);
0 != o && (this.renderPeriodFpsCount++, this.renderPeriodTotalFps += o), this.JsMediaSDK_Log("fps is: " + o + "Queue Length is : " + this.videoBufCount);
var a = t - n.ntptime;
0 != n.ntptime && 0 != t && (a > 0 && a <= 1e3 || a < 0 && a >= -1e3 || (a < -1e3 ? this.lastRenderAudioTimeStamp != t && (this.videoRenderLevel -= 1) : this.lastRenderAudioTimeStamp != t && (this.videoRenderLevel += 1)), this.lastRenderAudioTimeStamp = t);
var u = {
top: n.r_x,
left: n.r_y,
height: n.r_h,
width: n.r_w
};
if (this.isCreateVideoWaterMark || (this.currentVideoHeight != u.width || this.currentVideoWidth != u.height) && this.videoWaterMarkName) {
this.isCreateVideoWaterMark = !1;
var s = this.Get_WaterMarkRGBA(this.videoWaterMarkName, n.width, n.height);
this.videoRenderArray[e].display.updateWatherMark(1 * n.width, 1 * n.height, s)
}
this.currentVideoHeight == u.width && this.currentVideoWidth == u.height || (E.default.Notify_APPUI(_.CURRENT_VIDEO_RESOLUTION, {
width: u.width,
height: u.height
}), this.canvas.width = u.width, this.canvas.height = u.height, this.currentVideoHeight = u.width, this.currentVideoWidth = u.height), n.yuvdata.length == n.width * n.height * 3 / 2 && n.r_x >= 0 && n.r_y >= 0 && n.r_x + n.r_w <= n.width && n.r_y + n.r_h <= n.height && (8400 == this.vMonitorCount && (H.default.add_monitor2("VDGL"), this.vMonitorCount = 0), this.vMonitorCount++, this.videoRenderArray[e].display.drawNextOuptutPictureGL(n.width, n.height, u, n.yuvdata, n.rotation, n.yuv_limited))
} else this.videoBufEmptyCount++, this.videoRenderLevel += 1, this.JsMediaSDK_Log("Decelerator is " + this.videoRenderLevel), this.videoBufEmptyCount = 0, this.JsMediaSDK_Log("video buffer is empty");
this.videoBufCount * this.videoRenderLevel * 10 > 150 && (this.videoRenderLevel -= 1, this.JsMediaSDK_Log("Accelerator is " + this.videoRenderLevel)), this.videoRenderLevel < 1 ? this.videoRenderLevel = 1 : this.videoRenderLevel > this.videoRenderMaxLevel && (this.videoRenderLevel = this.videoRenderMaxLevel)
}
} else this.videoRenderLevelCount++
},
JsMediaSDK_SharingRender: function () {
if (this.sharingDisplay) {
var e = p.Get_Decoded_Sharing_Frame(this.currentshareactive, 0),
t = p.Get_Decoded_Mouse_Frame(this.currentshareactive, 0);
if (e && "sharing_data" == e.type) {
3e3 == this.sMonitorCount && (H.default.add_monitor2("SDIM"), this.sMonitorCount = 0), this.sMonitorCount++, this.sharingWidthAndHeightInfo.logicWidth == e.logic_w && this.sharingWidthAndHeightInfo.logicHeight == e.logic_h || (A.default.publish(_.SHARING_PARAM_INFO_FROM_SOCKET, {
body: {
width: e.logic_w,
height: e.logic_h,
logicWidth: e.logic_w,
logicHeight: e.logic_h
}
}), this.sharingWidthAndHeightInfo.logicWidth = e.logic_w, this.sharingWidthAndHeightInfo.logicHeight = e.logic_h);
var n = e.logic_h,
i = e.logic_w,
r = e.r_h,
o = e.r_w;
this.xratio = o / i, this.yratio = r / n;
var a = {
top: e.r_x,
left: e.r_y,
height: e.r_h,
width: e.r_w
};
if (this.isCreateSharingWaterMark) {
this.isCreateSharingWaterMark = !1;
var u = this.Get_WaterMarkRGBA(this.sharingWaterMarkName, e.r_w, e.r_h);
this.sharingDisplay.updateWatherMark(1 * e.r_w, 1 * e.r_h, u)
}
this.sharingDisplay.drawNextOuptutPictureGL(e.width, e.height, a, e.yuvdata, null, e.yuv_limited)
}
t && "mouse_data" == t.type && (3e3 == this.mMonitorCount && (H.default.add_monitor2("SDSB"), this.mMonitorCount = 0), this.mMonitorCount++, this.Cursorx = t.r_x * this.xratio, this.Cursory = t.r_y * this.yratio, this.CursorWidth = t.width * this.xratio, this.CursorHeight = t.height * this.yratio, this.sharingDisplay.updateCursor(t.width, t.height, t.buffer), this.sharingDisplay.draw(1, this.Cursorx, this.Cursory, this.CursorWidth, this.CursorHeight))
}
},
JsMediaSDK_VideoRenderInterval: function (e) {
var t = this.JsMediaSDK_VideoRender.bind(this);
return setInterval(t, e)
},
JsMediaSDK_SharingRenderInterval: function (e) {
var t = this.JsMediaSDK_SharingRender.bind(this);
return setInterval(t, e)
},
Get_WaterMarkRGBA: function (e, t, n, i, r) {
if (e && t && n) {
t *= 1, i = n *= 1, this.waterMarkCanvas.setAttribute("width", t), this.waterMarkCanvas.setAttribute("height", n);
var o = this.waterMarkCanvas.getContext("2d");
o.clearRect(0, 0, this.waterMarkCanvas.width, this.waterMarkCanvas.height), o.translate(this.waterMarkCanvas.width / 2, this.waterMarkCanvas.height / 2), o.rotate(-45 * Math.PI / 180), o.lineWidth = 1, o.fillStyle = "rgba(90,90,90,0.25)";
var a = Math.SQRT2 * i / e.length;
o.imageSmoothingEnabled = !0, o.font = a + "px 'Segoe UI'";
var u = o.measureText(e);
if (1 == e.length) o.fillText(e, -u.width / 2, u.width / 2);
else {
for (a = 2, o.font = a + "px 'Segoe UI'", u = o.measureText(e); u.width < Math.SQRT2 * i - 2 * o.measureText(e[0]).width;) a += 1, o.font = a + "px 'Segoe UI'", u = o.measureText(e);
o.fillText(e, -Math.SQRT2 * i / 2 + Math.abs(Math.SQRT2 * i / 2 - u.width / 2), o.measureText(e[0]).width / 2)
}
var s = o.getImageData(0, 0, o.canvas.width, o.canvas.height);
return new Uint8Array(s.data.buffer)
}
},
destroy: (P = (0, s.default)(u.default.mark(function e() {
return u.default.wrap(function (e) {
for (;;) switch (e.prev = e.next) {
case 0:
j("destroy"), this.EndMedia(), p.destroyAllWorkers(), A.default.clearAllSubscriptions();
case 4:
case "end":
return e.stop()
}
}, e, this)
})), function () {
return P.apply(this, arguments)
})
}, e.exports = Q
}, function (e, t, n) {
"use strict";
var i, o, a = n(1),
u = (a(n(63)), a(n(44)));
void 0 === (o = "function" == typeof (i = function () {
function e(t, n, i) {
if (this.canvasElement = t, this.contextOptions = i, this.glInitSucceed = 0, e.prototype.ROTATION_CLOCK0 = 0, e.prototype.ROTATION_CLOCK90 = 1, e.prototype.ROTATION_CLOCK180 = 2, e.prototype.ROTATION_CLOCK270 = 3, n || this.initContextGL(), this.contextGL) {
this.initProgram(), this.initBuffers(), this.initTextures();
var r = new ArrayBuffer(4);
this.dummpyCursor = new Uint8Array(r), this.dummpyWaterMark = new Uint8Array(r), this.glInitSucceed = this.contextGL.getError() ? 0 : 1, this.cursorWidth = 0, this.cursorHeight = 0, this.hasCursor = 0, this.hasWaterMark = 0, this.hasWholeFrame = 0, this.croppingParams = {}, this.croppingParams.top = 0, this.croppingParams.left = 0, this.croppingParams.width = 0, this.croppingParams.height = 0, this.textureWidth = 0, this.textureHeight = 0, this.canvasWidth = 0, this.canvasHeight = 0, this.picRotation = -1, this.bgColor = [0, 0, 0], this.cx = 0, this.cy = 0, this.cw = 0, this.ch = 0, this.colorRange = -1
}
this.glInitSucceed || u.default.add_monitor("GLIF")
}
return e.prototype.isWebGL = function () {
return this.contextGL
}, e.prototype.initContextGL = function () {
for (var e = this.canvasElement, t = null, n = ["webgl", "experimental-webgl", "moz-webgl", "webkit-3d"], i = 0; !t && i < n.length;) {
var r = n[i];
try {
t = this.contextOptions ? e.getContext(r, this.contextOptions) : e.getContext(r)
} catch (e) {
t = null
}
t && "function" == typeof t.getParameter || (t = null), ++i
}
this.contextGL = t
}, e.prototype.initProgram = function () {
var e = this.contextGL,
t = ["attribute vec4 vertexPos;", "attribute vec4 texturePos;", "varying vec2 textureCoord;", "void main()", "{", "gl_Position = vertexPos;", "textureCoord = texturePos.xy;", "}"].join("\n"),
n = ["precision highp float;", "varying highp vec2 textureCoord;", "uniform sampler2D ySampler;", "uniform sampler2D uSampler;", "uniform sampler2D vSampler;", "uniform sampler2D cursorSampler;", "uniform sampler2D waterMarkSampler;", "uniform vec4 cursorInfo;", "uniform int colorRange;", "const mat4 YUV2RGB_L = mat4", "(", "1.1643828125, 0, 1.59602734375, -.87078515625,", "1.1643828125, -.39176171875, -.81296875, .52959375,", "1.1643828125, 2.017234375, 0, -1.081390625,", "0, 0, 0, 1", ");", "const mat4 YUV2RGB_F = mat4", "(", "1.0, 0, 1.402, -.701,", "1.0, -.34413, -.71414, .529135,", "1.0, 1.772, 0, -.886,", "0, 0, 0, 1", ");", "void main(void) {", "highp float y = texture2D(ySampler, textureCoord).r;", "highp float u = texture2D(uSampler, textureCoord).r;", "highp float v = texture2D(vSampler, textureCoord).r;", "vec4 c;", "if (colorRange == 0)", "{", " c = vec4(y, u, v, 1) * YUV2RGB_L;", "} else {", " c = vec4(y, u, v, 1) * YUV2RGB_F;", "}", "if (cursorInfo.z > 0.0 && textureCoord.x >= cursorInfo.x && textureCoord.y >= cursorInfo.y && ", " textureCoord.x < cursorInfo.x+cursorInfo.z && textureCoord.y < cursorInfo.y+cursorInfo.w ){", " vec2 cursorCoord = textureCoord - cursorInfo.xy;", " cursorCoord /= cursorInfo.zw;", " vec4 cursor = texture2D(cursorSampler, cursorCoord);", " c = c*(1.0-cursor.a) + cursor*cursor.a;", "}", " vec4 waterMark = texture2D(waterMarkSampler, textureCoord);", "if(waterMark.r != 0.0 || waterMark.g != 0.0 || waterMark.b != 0.0){", " //waterMark.a = 0.5", " c = waterMark* waterMark.a+ c*(1.0-waterMark.a);", "}", "c.a = 1.0;", "gl_FragColor = c;", "}"].join("\n"),
i = e.createShader(e.VERTEX_SHADER);
e.shaderSource(i, t), e.compileShader(i), e.getShaderParameter(i, e.COMPILE_STATUS);
var r = e.createShader(e.FRAGMENT_SHADER);
e.shaderSource(r, n), e.compileShader(r), e.getShaderParameter(r, e.COMPILE_STATUS);
var o = e.createProgram();
e.attachShader(o, i), e.attachShader(o, r), e.linkProgram(o), e.getProgramParameter(o, e.LINK_STATUS), e.useProgram(o), this.shaderProgram = o
}, e.prototype.initBuffers = function () {
var e = this.contextGL,
t = this.shaderProgram,
n = e.createBuffer();
e.bindBuffer(e.ARRAY_BUFFER, n), e.bufferData(e.ARRAY_BUFFER, new Float32Array([1, 1, -1, 1, 1, -1, -1, -1]), e.STATIC_DRAW);
var i = e.getAttribLocation(t, "vertexPos");
e.enableVertexAttribArray(i), e.vertexAttribPointer(i, 2, e.FLOAT, !1, 0, 0), this.vertexPosBuffer = n;
var r = e.createBuffer();
e.bindBuffer(e.ARRAY_BUFFER, r), e.bufferData(e.ARRAY_BUFFER, new Float32Array([1, 0, 0, 0, 1, 1, 0, 1]), e.STATIC_DRAW);
var o = e.getAttribLocation(t, "texturePos");
e.enableVertexAttribArray(o), e.vertexAttribPointer(o, 2, e.FLOAT, !1, 0, 0), this.texturePosBuffer = r
}, e.prototype.initTextures = function () {
var e = this.contextGL,
t = this.shaderProgram;
e.pixelStorei(e.UNPACK_ALIGNMENT, 1);
var n = this.initTexture(),
i = e.getUniformLocation(t, "ySampler");
e.uniform1i(i, 0), this.yTextureRef = n;
var r = this.initTexture(),
o = e.getUniformLocation(t, "uSampler");
e.uniform1i(o, 1), this.uTextureRef = r;
var a = this.initTexture(),
u = e.getUniformLocation(t, "vSampler");
e.uniform1i(u, 2), this.vTextureRef = a;
var s = this.initTexture(),
d = e.getUniformLocation(t, "cursorSampler");
e.uniform1i(d, 3), this.cursorTextureRef = s;
var c = this.initTexture(),
l = e.getUniformLocation(t, "waterMarkSampler");
e.uniform1i(l, 4), this.waterMarkTextureRef = c;
var f = e.getUniformLocation(t, "cursorInfo");
this.cursorInfoRef = f;
var h = e.getUniformLocation(t, "colorRange");
this.colorRangeRef = h
}, e.prototype.initTexture = function () {
var e = this.contextGL,
t = e.createTexture();
return e.bindTexture(e.TEXTURE_2D, t), e.texParameteri(e.TEXTURE_2D, e.TEXTURE_MAG_FILTER, e.LINEAR), e.texParameteri(e.TEXTURE_2D, e.TEXTURE_MIN_FILTER, e.LINEAR), e.texParameteri(e.TEXTURE_2D, e.TEXTURE_WRAP_S, e.CLAMP_TO_EDGE), e.texParameteri(e.TEXTURE_2D, e.TEXTURE_WRAP_T, e.CLAMP_TO_EDGE), e.bindTexture(e.TEXTURE_2D, null), t
}, e.prototype.cleanup = function () {
if (this.glInitSucceed) {
var e = this.contextGL;
e.deleteProgram(this.program), e.activeTexture(e.TEXTURE0), e.bindTexture(e.TEXTURE_2D, null), e.activeTexture(e.TEXTURE1), e.bindTexture(e.TEXTURE_2D, null), e.activeTexture(e.TEXTURE2), e.bindTexture(e.TEXTURE_2D, null), e.activeTexture(e.TEXTURE3), e.bindTexture(e.TEXTURE_2D, null), e.bindBuffer(e.ARRAY_BUFFER, null), e.deleteTexture(this.yTextureRef), e.deleteTexture(this.uTextureRef), e.deleteTexture(this.vTextureRef), e.deleteTexture(this.cursorTextureRef), e.deleteTexture(this.waterMarkTextureRef), e.deleteBuffer(this.vertexPosBuffer), e.deleteBuffer(this.texturePosBuffer), this.contextGL = null, this.glInitSucceed = 0
}
}, e.prototype.drawNextOutputPicture = function (e, t, n, i) {
var r = arguments.length > 4 && void 0 !== arguments[4] ? arguments[4] : 0;
this.contextGL ? this.drawNextOuptutPictureGL(e, t, n, i, r) : this.drawNextOuptutPictureRGBA(e, t, n, i)
}, e.prototype.drawNextOuptutPictureGL = function (e, t, n, i, r) {
var o = !(arguments.length > 5 && void 0 !== arguments[5]) || arguments[5],
a = this.contextGL,
u = (this.texturePosBuffer, this.yTextureRef),
s = this.uTextureRef,
d = this.vTextureRef;
if (a.enable(a.BLEND), a.blendFunc(a.SRC_ALPHA, a.ONE_MINUS_SRC_ALPHA), a && this.glInitSucceed && !(e <= 0 || t <= 0 || !i || !i.length || i.length != e * t * 3 / 2 || n && (n.top < 0 || n.left < 0 || n.left + n.width > e || n.top + n.height > t))) {
r = r || this.ROTATION_CLOCK0;
var c = (n = n || {
top: 0,
left: 0,
width: e,
height: t
}).width != this.croppingParams.width || n.height != this.croppingParams.height,
l = n.top != this.croppingParams.top || n.left != this.croppingParams.left,
f = a.canvas.width != this.canvasWidth || a.canvas.height != this.canvasHeight,
h = e != this.textureWidth || t != this.textureHeight,
_ = r != this.picRotation;
(c || f || _) && function (e, t, n, i) {
var r, o, a, u, s = e.contextGL,
d = i == e.ROTATION_CLOCK90 || i == e.ROTATION_CLOCK270 ? n : t,
c = i == e.ROTATION_CLOCK90 || i == e.ROTATION_CLOCK270 ? t : n,
l = d / c * s.canvas.height,
f = c / d * s.canvas.width;
l > s.canvas.width ? (r = 0, a = 1, u = 1 - (o = (s.canvas.height - f) / 2 / s.canvas.height)) : (o = 0, u = 1, a = 1 - (r = (s.canvas.width - l) / 2 / s.canvas.width)), r = 2 * r - 1, a = 2 * a - 1, o = 1 - 2 * o, u = 1 - 2 * u;
var h = new Float32Array([a, o, r, o, a, u, r, u]);
s.bindBuffer(s.ARRAY_BUFFER, e.vertexPosBuffer), s.bufferData(s.ARRAY_BUFFER, h, s.DYNAMIC_DRAW)
}(this, n.width, n.height, r), (c || l || h || _) && function (e, t, n, i, r) {
var o = e.contextGL,
a = i.top / n,
u = i.left / t,
s = a + i.height / n,
d = u + i.width / t,
c = [u, a, d, a, d, s, u, s];
r == e.ROTATION_CLOCK90 && (c.unshift(c[6], c[7]), c = c.slice(0, 8)), r == e.ROTATION_CLOCK180 && (c.unshift(c[4], c[5], c[6], c[7]), c = c.slice(0, 8)), r == e.ROTATION_CLOCK270 && (c.push(c[0], c[1]), c = c.slice(2));
var l = c[0],
f = c[1];
c[0] = c[2], c[1] = c[3], c[2] = l, c[3] = f;
var h = new Float32Array(c);
o.bindBuffer(o.ARRAY_BUFFER, e.texturePosBuffer), o.bufferData(o.ARRAY_BUFFER, h, o.DYNAMIC_DRAW)
}(this, e, t, n, r);
var E = o ? 0 : 1;
E != this.colorRange && (a.uniform1i(this.colorRangeRef, E), this.colorRange = E), a.viewport(0, 0, a.canvas.width, a.canvas.height), this.croppingParams = n, this.textureWidth = e, this.textureHeight = t, this.picRotation = r, this.canvasWidth = a.canvas.width, this.canvasHeight = a.canvas.height, a.clearColor(this.bgColor[0], this.bgColor[1], this.bgColor[2], 255), a.clear(a.COLOR_BUFFER_BIT);
var p = i,
S = e * t,
v = p.subarray(0, S);
a.activeTexture(a.TEXTURE0), a.bindTexture(a.TEXTURE_2D, u), a.texImage2D(a.TEXTURE_2D, 0, a.LUMINANCE, e, t, 0, a.LUMINANCE, a.UNSIGNED_BYTE, v);
var A = e / 2 * t / 2,
I = p.subarray(S, S + A);
a.activeTexture(a.TEXTURE1), a.bindTexture(a.TEXTURE_2D, s), a.texImage2D(a.TEXTURE_2D, 0, a.LUMINANCE, e / 2, t / 2, 0, a.LUMINANCE, a.UNSIGNED_BYTE, I);
var D = A,
g = p.subarray(S + A, S + A + D);
a.activeTexture(a.TEXTURE2), a.bindTexture(a.TEXTURE_2D, d), a.texImage2D(a.TEXTURE_2D, 0, a.LUMINANCE, e / 2, t / 2, 0, a.LUMINANCE, a.UNSIGNED_BYTE, g), a.activeTexture(a.TEXTURE3), a.bindTexture(a.TEXTURE_2D, this.cursorTextureRef), this.hasCursor || a.texImage2D(a.TEXTURE_2D, 0, a.RGBA, 1, 1, 0, a.RGBA, a.UNSIGNED_BYTE, this.dummpyCursor), a.activeTexture(a.TEXTURE4), a.bindTexture(a.TEXTURE_2D, this.waterMarkTextureRef), this.hasWaterMark || a.texImage2D(a.TEXTURE_2D, 0, a.RGBA, 1, 1, 0, a.RGBA, a.UNSIGNED_BYTE, this.dummpyWaterMark), a.uniform4f(this.cursorInfoRef, this.cx, this.cy, this.cw, this.ch), a.drawArrays(a.TRIANGLE_STRIP, 0, 4), this.hasWholeFrame = 1
}
}, e.prototype.updateTextureBlock = function (e, t, n, i, r) {
var o = this.contextGL;
if (o && this.glInitSucceed) {
var a = r;
if (!(!this.hasWholeFrame || e <= 0 || t <= 0 || n < 0 || i < 0 || n + e > this.textureWidth || i + t > this.textureHeight) && r && r.length == e * t * 3 / 2) {
var u = this.yTextureRef,
s = this.uTextureRef,
d = this.vTextureRef,
c = e * t,
l = a.subarray(0, c);
o.activeTexture(o.TEXTURE0), o.bindTexture(o.TEXTURE_2D, u), o.texSubImage2D(o.TEXTURE_2D, 0, n, i, e, t, o.LUMINANCE, o.UNSIGNED_BYTE, l);
var f = e / 2 * t / 2,
h = a.subarray(c, c + f);
o.activeTexture(o.TEXTURE1), o.bindTexture(o.TEXTURE_2D, s), o.texSubImage2D(o.TEXTURE_2D, 0, n / 2, i / 2, e / 2, t / 2, o.LUMINANCE, o.UNSIGNED_BYTE, h);
var _ = f,
E = a.subarray(c + f, c + f + _);
o.activeTexture(o.TEXTURE2), o.bindTexture(o.TEXTURE_2D, d), o.texSubImage2D(o.TEXTURE_2D, 0, n / 2, i / 2, e / 2, t / 2, o.LUMINANCE, o.UNSIGNED_BYTE, E)
}
}
}, e.prototype.updateCursor = function (e, t, n) {
var i = this.contextGL;
i && this.glInitSucceed && (e <= 0 || t <= 0 || !n || n.length != e * t * 4 || (i.activeTexture(i.TEXTURE3), i.bindTexture(i.TEXTURE_2D, this.cursorTextureRef), i.texImage2D(i.TEXTURE_2D, 0, i.RGBA, e, t, 0, i.RGBA, i.UNSIGNED_BYTE, n), this.cursorWidth = e, this.cursorHeight = t, this.hasCursor = 1))
}, e.prototype.updateWatherMark = function (e, t, n) {
var i = this.contextGL;
i && this.glInitSucceed && (e <= 0 || t <= 0 || !n || n.length != e * t * 4 || (i.activeTexture(i.TEXTURE4), i.bindTexture(i.TEXTURE_2D, this.waterMarkTextureRef), i.texImage2D(i.TEXTURE_2D, 0, i.RGBA, e, t, 0, i.RGBA, i.UNSIGNED_BYTE, n), this.hasWaterMark = 1))
}, e.prototype.draw = function (e, t, n, i, r) {
var o = this.contextGL;
if (o && this.glInitSucceed && !(!this.hasWholeFrame || e && (i < 0 || r < 0))) {
o.viewport(0, 0, o.canvas.width, o.canvas.height), this.texturePosBuffer;
var a = this.yTextureRef,
u = this.uTextureRef,
s = this.vTextureRef,
d = this.cursorTextureRef;
if (o.activeTexture(o.TEXTURE0), o.bindTexture(o.TEXTURE_2D, a), o.activeTexture(o.TEXTURE1), o.bindTexture(o.TEXTURE_2D, u), o.activeTexture(o.TEXTURE2), o.bindTexture(o.TEXTURE_2D, s), o.activeTexture(o.TEXTURE3), o.bindTexture(o.TEXTURE_2D, d), o.activeTexture(o.TEXTURE4), o.bindTexture(o.TEXTURE_2D, this.waterMarkTextureRef), this.hasWaterMark || o.texImage2D(o.TEXTURE_2D, 0, o.RGBA, 1, 1, 0, o.RGBA, o.UNSIGNED_BYTE, this.dummpyWaterMark), e && this.hasCursor) {
var c = t / this.croppingParams.width,
l = n / this.croppingParams.height,
f = i / this.croppingParams.width,
h = r / this.croppingParams.height;
this.cx = c, this.cy = l, this.cw = f, this.ch = h, o.uniform4f(this.cursorInfoRef, c, l, f, h)
} else o.uniform4f(this.cursorInfoRef, 0, 0, 0, 0);
o.drawArrays(o.TRIANGLE_STRIP, 0, 4)
}
}, e.prototype.clear = function () {
var e = this.contextGL;
e && this.glInitSucceed && (e.clearColor(this.bgColor[0], this.bgColor[1], this.bgColor[2], 255), e.clear(e.COLOR_BUFFER_BIT), this.hasWholeFrame = 0, this.hasCursor = 0)
}, e.prototype.test_changeColorRange = function (e) {
var t = this.contextGL;
t && this.glInitSucceed && (colorRange = e ? 0 : 1, colorRange != this.colorRange && (t.uniform1i(this.colorRangeRef, colorRange), this.colorRange = colorRange, this.draw(0)))
}, e.prototype.drawNextOuptutPictureRGBA = function (e, t, n, i) {
var r = i,
o = this.canvasElement.getContext("2d"),
a = o.getImageData(0, 0, e, t);
a.data.set(r), o.putImageData(a, 0, 0)
}, e
}) ? i.apply(t, []) : i) || (e.exports = o)
}, function (e, t, n) {
"use strict";
n.r(t);
var i = n(105),
r = n(29),
o = n.n(r);
let a = null;
if ("function" == typeof AudioWorklet) {
class e extends AudioWorkletNode {
constructor(e) {
super(e, "zoomAudioWorklet"), this.port.onmessage = this.handleMessage.bind(this)
}
handleMessage(e) {
var t = e.data;
switch (t.status) {
case "delay":
if (o.a.localAudioDecMGR) {
var n = o.a.localAudioDecMGR.map.get(0);
n && n.postMessage({
command: "delay"
})
}
break;
case "captureAudio":
i.Audio_Encode_Frame(0, t.data, t.data.length, 0);
break;
case "InstantAudioTime":
o.a.CurrentSSRCTime = t.data
}
}
postData(e, t) {
this.port.postMessage({
status: e,
data: t
}, [t.data.buffer])
}
postCMD(e, t) {
this.port.postMessage({
status: e,
data: t
})
}
}
a = e
}
t.default = a
}, function (e, t, n) {
"use strict";
function i(e) {
this.name = "CameraOccupiedError", this.message = e, this.stack = (new Error).stack
}
Object.defineProperty(t, "__esModule", {
value: !0
}), t.CameraOccupiedError = i, i.prototype = new Error
}, function (e, t, n) {
"use strict";
var i = n(1)(n(35)),
r = {};
r.screen = {
chromeMediaSource: "desktop",
screenCallback: null,
getSourceId: function (e) {
r.screenCallback = e, window.postMessage("WCL.getSourceID", "*")
},
onMessageCallback: function (e) {
if ("WCL.PermissionDeniedError" == e.type && r.screenCallback) return r.screenCallback("WCL.PermissionDeniedError");
"WCL.userCancel" == e.type && r.screenCallback("WCL.userCancel"), e.sourceId && (r.screen.sourceId = e.sourceId, r.screenCallback && r.screenCallback("WCL.PermisssionOK", r.screen.sourceId))
},
getChromeExtensionStatus: function (e) {
var t = document.createElement("img");
t.src = "chrome-extension://kgjfgplpablkjnlkjmjdecgdpfankdle/images/trash.png", t.onload = function () {
e("installed-enabled")
}, t.onerror = function () {
e("not-installed")
}
}
}, window.addEventListener("message", function (e) {
e.data && ("string" == typeof e.data || e.data.sourceId || e.data.captureSourceId || e.data.getChromeExtensionStatus || e.data.type) && (e.data.captureSourceId && r.screen.getChromeExtensionStatus(function (e) {
"installed-enabled" == e ? r.screen.getSourceId(function (e, t) {
window.postMessage({
typ: e,
chromeMediaSourceId: t
}, "*")
}) : window.postMessage({
typ: "WCL.extensionUninstalled"
}, "*")
}), r.screen.onMessageCallback(e.data))
}), window.getScreenId = function (e, t) {
i.default.browser.isFirefox ? e(null, "firefox", {
video: {
mediaSource: "screen"
}
}) : (window.addEventListener("message", function t(n) {
n.data && n.data.typ && ("WCL.PermissionDeniedError" === n.data.typ || "WCL.extensionUninstalled" == n.data.typ || "WCL.userCancel" == n.data.typ ? e(n.data.typ) : "WCL.PermisssionOK" == n.data.typ && e(null, n.data.chromeMediaSourceId, function (e, t) {
var n = {
audio: !1,
video: {
mandatory: {
chromeMediaSource: "desktop",
maxWidth: window.screen.width > 1920 ? window.screen.width : 1920,
maxHeight: window.screen.height > 1080 ? window.screen.height : 1080
},
optional: []
}
};
return t && (n.video.mandatory.chromeMediaSourceId = t, n.audio && n.audio.mandatory && (n.audio.mandatory.chromeMediaSourceId = t)), n
}(0, n.data.chromeMediaSourceId)), window.removeEventListener("message", t))
}), window.postMessage({
captureSourceId: !0
}, "*"))
}
}, function (e, t, n) {
"use strict";
var i = n(30),
r = n(1);
Object.defineProperty(t, "__esModule", {
value: !0
}), t.RTCPeerConnectionUtil = void 0;
var o = r(n(10)),
a = r(n(32)),
u = r(n(45)),
s = r(n(33)),
d = r(n(19)),
c = r(n(20)),
l = r(n(21)),
f = r(n(17)),
h = n(34),
_ = i(n(44)),
E = r(n(103)),
p = (0, l.default)("sdk.rtcUtil"),
S = function () {
function e() {
var t = this;
(0, d.default)(this, e), this.rtcPeerConnection = null, this.dataChannel = null, this.dataChannelLabel = null, this.messageListener = null, this.rtcPeerConnectionCreatedListener = null, this.reconnectCount = 0, this.reconnectMax = 10, this.reconnectCountBetweenCloseAndOpenAndSetTo0WhenDCOpen = 0, this.connectionID = null, this.pubSubTokenList = [], this.isForceClosed = !1, this.SEND_VIDEO_PUB_SUB_EVENT = "RTCPeerConnectionUtil.VIDEO.SENDDATA", this.reconnectRTCPeerConnectionThrottle = (0, E.default)(function () {
t.reconnectRTCPeerConnection()
}, 2e3), this.timeoutThenCloseInterval = null
}
var t;
return (0, c.default)(e, [{
key: "isSupportDataChannel",
value: function () {
return !!window.RTCDataChannel
}
}, {
key: "initConnection",
value: (t = (0, s.default)(a.default.mark(function e(t) {
var n, i = this,
r = arguments;
return a.default.wrap(function (e) {
for (;;) switch (e.prev = e.next) {
case 0:
if (n = r.length > 1 && void 0 !== r[1] ? r[1] : "ZoomWebclientVideoDataChannel", _.default.add_monitor("DCCONN"), this.isSupportDataChannel()) {
e.next = 4;
break
}
return e.abrupt("return");
case 4:
return this.dataChannelLabel = n, this.connectionID = t, this.rtcPeerConnection = new RTCPeerConnection({
iceCandidatePoolSize: 1
}), this.rtcPeerConnection.addEventListener("close", function (e) {
p("rtcPeerConnection.onclose", e), i.clear(), i.close(), i.reconnectRTCPeerConnectionThrottle()
}), this.rtcPeerConnection.addEventListener("icecandidate", function (e) {
p("onicecandidate", e)
}), this.rtcPeerConnection.addEventListener("iceconnectionstatechange", function (e) {
var t = i.rtcPeerConnection;
"failed" !== t.iceConnectionState && "disconnected" !== t.iceConnectionState && "closed" !== t.iceConnectionState || (p("".concat(i.dataChannelLabel, " iceconnectionstatechange"), t.iceConnectionState), _.default.add_monitor("ICECONNSTATECHANGE:" + i.dataChannelLabel), t.close())
}), this.createDataChannel(), e.next = 13, this.rtcPeerConnection.createOffer().then(function () {
var e = (0, s.default)(a.default.mark(function e(n) {
return a.default.wrap(function (e) {
for (;;) switch (e.prev = e.next) {
case 0:
return p("original offer", (0, u.default)(n)), n.sdp = n.sdp.replace(/a=ice-ufrag:.+/g, "a=ice-ufrag:".concat(t)), p("modified offer", n), e.abrupt("return", i.rtcPeerConnection.setLocalDescription(n));
case 4:
case "end":
return e.stop()
}
}, e, this)
}));
return function (t) {
return e.apply(this, arguments)
}
}()).then(function () {
i.rtcPeerConnectionCreatedListener.call(null, i.rtcPeerConnection)
});
case 13:
case "end":
return e.stop()
}
}, e, this)
})), function (e) {
return t.apply(this, arguments)
})
}, {
key: "close",
value: function () {
_.default.add_monitor("RTCPeerConnUtil.CLOSE");
try {
try {
this.dataChannel.close()
} catch (e) {
p(e)
}
this.rtcPeerConnection.close()
} catch (e) {
p(e)
} finally {
this.dataChannel = null, this.rtcPeerConnection = null
}
}
}, {
key: "forceClose",
value: function () {
_.default.add_monitor("DCFORCECLOSE:" + this.dataChannelLabel), p("forceClose : " + this.dataChannelLabel), this.isForceClosed = !0, this.clear(), this.close()
}
}, {
key: "clear",
value: function () {
clearInterval(this.timeoutThenCloseInterval), this.messageListener = null, this.pubSubTokenList.forEach(function (e) {
f.default.unsubscribe(e)
}), this.pubSubTokenList = []
}
}, {
key: "onConnectionCreated",
value: function (e) {
this.rtcPeerConnectionCreatedListener = e
}
}, {
key: "reconnectRTCPeerConnection",
value: function () {
var e = this;
this.isForceClosed || this.reconnectCount < this.reconnectMax && this.reconnectCountBetweenCloseAndOpenAndSetTo0WhenDCOpen < this.reconnectMax && (p("".concat(this.dataChannelLabel, " reconnect reconnectTotalCount : ").concat(this.reconnectCount, "; reconnectCountBetweenCloseAndOpenAndSetTo0WhenDCOpen : ").concat(this.reconnectCountBetweenCloseAndOpenAndSetTo0WhenDCOpen, ", reconnectMax : ").concat(this.reconnectMax)), this.reconnectCount += 1, this.reconnectCountBetweenCloseAndOpenAndSetTo0WhenDCOpen += 1, setTimeout(function () {
e.initConnection(e.connectionID, e.dataChannelLabel)
}, 1e3 * Math.pow(2, this.reconnectCountBetweenCloseAndOpenAndSetTo0WhenDCOpen)))
}
}, {
key: "addDataChannelSpeedMonitor",
value: function () {
var e = this,
t = 0,
n = 0,
i = null,
r = 0,
a = f.default.on(this.SEND_VIDEO_PUB_SUB_EVENT, function (a, u) {
if (n) {
var s = (new Date).getTime() / 1e3;
if ((t = s - n) > 10) {
var d = r - e.dataChannel.bufferedAmount;
0 == e.dataChannel.bufferedAmount ? i = i ? .8 * i + 16e4 : 8e5 : i = i ? .8 * i + .2 * (8 * d / (1 * t)) : 8e5, f.default.publish(h.PUBSUB_EVT.VIDEO_DATACHANNEL_SPEED, i), r -= d, n = s
}
} else r = 0, n = (new Date).getTime() / 1e3;
r += u.length
});
this.pubSubTokenList.push(a)
}
}, {
key: "createDataChannel",
value: function () {
var e = this;
if (this.dataChannel) try {
this.dataChannel.close()
} catch (e) {
p("close before createDataChannel error", e)
}
var t = this.rtcPeerConnection.createDataChannel(this.dataChannelLabel, {
ordered: !1,
maxRetransmits: 5,
reliable: !1
});
t.binaryType = "arraybuffer", t.addEventListener("open", function (t) {
e.reconnectCountBetweenCloseAndOpenAndSetTo0WhenDCOpen = 0, clearInterval(e.timeoutThenCloseInterval), _.default.add_monitor("DCOPEN:" + e.dataChannelLabel), p("dataChannel.onopen", t)
}), t.addEventListener("close", function (t) {
clearInterval(e.timeoutThenCloseInterval), p("dataChannel.onclose", t), _.default.add_monitor("DCCLOSE:" + e.dataChannelLabel), e.clear(), e.close(), e.reconnectRTCPeerConnectionThrottle()
}), t.addEventListener("error", function (t) {
clearInterval(e.timeoutThenCloseInterval), _.default.add_monitor("DCERROR:".concat(e.dataChannelLabel, ":") + t.message), p("dataChannel.onerror", t)
}), t.addEventListener("message", function (t) {
e.messageListener && e.messageListener.call(null, t.data)
}), this.dataChannel = t
}
}, {
key: "onMessage",
value: function (e) {
this.messageListener = e
}
}, {
key: "waitForAnswerFromRWG",
value: function (e) {
var t = this;
return new o.default(function (n, i) {
var r = f.default.on(e, function (e, t) {
n(t)
});
t.pubSubTokenList.push(r)
})
}
}, {
key: "setRemoteDescription",
value: function (e) {
p("setRemoteDescription", e), this.rtcPeerConnection.setRemoteDescription(new RTCSessionDescription({
type: "answer",
sdp: e.sdp
}))
}
}, {
key: "closeIfTimeout",
value: function () {
var e = this;
clearInterval(this.timeoutThenCloseInterval), this.timeoutThenCloseInterval = setTimeout(function () {
p("closeIfTimeout"), e.close()
}, 1e4)
}
}, {
key: "addIceCandidate",
value: function (e) {
this.rtcPeerConnection.addIceCandidate(new RTCIceCandidate({
candidate: e,
sdpMLineIndex: 0,
sdpMid: "0"
}))
}
}, {
key: "sendVideoData",
value: function (e) {
try {
this.dataChannel.send(e)
} catch (e) {
p.error("sendVideoData", e)
}
f.default.publish(this.SEND_VIDEO_PUB_SUB_EVENT, e)
}
}, {
key: "sendAudioData",
value: function (e) {
try {
this.dataChannel.send(e)
} catch (e) {
p.error("sendVideoData", e)
}
}
}, {
key: "listenOnDataAndSend",
value: function (e) {
var t = this,
n = f.default.on(e, function (e, n) {
t.sendVideoData(n)
});
this.pubSubTokenList.push(n)
}
}, {
key: "listenOnDataAndSendAudio",
value: function (e) {
var t = this,
n = f.default.on(e, function (e, n) {
t.sendAudioData(n)
});
this.pubSubTokenList.push(n)
}
}]), e
}();
t.RTCPeerConnectionUtil = S
}])
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment