@ikonai/sdk 1.0.41 → 1.0.42
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/assets/{audio-capture-worker-DuKZS6HJ.js → audio-capture-worker-Dmgg-yWd.js} +151 -165
- package/assets/{audio-playback-worker-BkM1Wq_F.js → audio-playback-worker-MsPNs6k4.js} +449 -384
- package/assets/{protocol-worker-BVD4poVW.js → protocol-worker-4bSKGT40.js} +202 -193
- package/assets/{video-capture-worker-CpzIHq4o.js → video-capture-worker-Bitll1TI.js} +161 -161
- package/assets/{video-playback-worker-Djop0qmb.js → video-playback-worker-BQSKswID.js} +247 -245
- package/channel/channel-manager.d.ts +2 -2
- package/client/ikon-client-config.d.ts +1 -1
- package/client/ikon-client.d.ts +2 -0
- package/index.js +2382 -2213
- package/media/ikon-audio-playback.d.ts +4 -0
- package/package.json +1 -1
- package/utils/query-params.d.ts +3 -0
- package/webrtc/webrtc-signaling.d.ts +7 -6
- package/worker/audio-playback-worker.d.ts +10 -2
- package/worker/video-playback-worker.d.ts +1 -0
|
@@ -4,42 +4,42 @@ function st(t) {
|
|
|
4
4
|
return (t[4] | t[5] << 8 | t[6] << 16 | t[7] << 24) >>> 0;
|
|
5
5
|
}
|
|
6
6
|
function It(t) {
|
|
7
|
-
const e =
|
|
7
|
+
const e = ut(t), r = new DataView(e.buffer, e.byteOffset, e.byteLength);
|
|
8
8
|
if (e.length < 27)
|
|
9
9
|
throw new Error("Protocol payload too short");
|
|
10
|
-
const i = r.getUint32(0, !0), n = r.getUint32(4, !0), a = r.getUint32(8, !0), s = r.getUint32(12, !0), I = r.getUint32(16, !0),
|
|
11
|
-
if (27 +
|
|
10
|
+
const i = r.getUint32(0, !0), n = r.getUint32(4, !0), a = r.getUint32(8, !0), s = r.getUint32(12, !0), I = r.getUint32(16, !0), A = r.getUint32(20, !0), C = r.getUint8(24), E = r.getUint8(25), _ = r.getUint8(26);
|
|
11
|
+
if (27 + A * 4 > e.length)
|
|
12
12
|
throw new Error("Protocol header exceeds payload length");
|
|
13
|
-
const
|
|
13
|
+
const T = [];
|
|
14
14
|
let R = 27;
|
|
15
|
-
for (let
|
|
16
|
-
|
|
15
|
+
for (let h = 0; h < A; h++)
|
|
16
|
+
T.push(r.getUint32(R, !0)), R += 4;
|
|
17
17
|
return {
|
|
18
18
|
length: i,
|
|
19
19
|
opcode: n,
|
|
20
20
|
senderId: a,
|
|
21
21
|
trackId: s,
|
|
22
22
|
sequenceId: I,
|
|
23
|
-
targetIds:
|
|
24
|
-
payloadVersion:
|
|
25
|
-
payloadType:
|
|
26
|
-
flags:
|
|
23
|
+
targetIds: T,
|
|
24
|
+
payloadVersion: C,
|
|
25
|
+
payloadType: E,
|
|
26
|
+
flags: _
|
|
27
27
|
};
|
|
28
28
|
}
|
|
29
29
|
function v(t, e, r, i, n) {
|
|
30
|
-
const a = n?.trackId ?? 0, s = n?.sequenceId ?? 0, I = n?.flags ?? 0,
|
|
31
|
-
|
|
30
|
+
const a = n?.trackId ?? 0, s = n?.sequenceId ?? 0, I = n?.flags ?? 0, A = n?.targetIds ?? [], C = n?.payloadType ?? 8, E = 27 + A.length * 4, _ = E + e.length, u = new Uint8Array(_), T = new DataView(u.buffer);
|
|
31
|
+
T.setUint32(0, _, !0), T.setUint32(4, t >>> 0, !0), T.setUint32(8, i >>> 0, !0), T.setUint32(12, a >>> 0, !0), T.setUint32(16, s >>> 0, !0), T.setUint32(20, A.length >>> 0, !0), T.setUint8(24, r & 255), T.setUint8(25, C & 255), T.setUint8(26, I & 255);
|
|
32
32
|
let R = 27;
|
|
33
|
-
for (let
|
|
34
|
-
|
|
35
|
-
return
|
|
33
|
+
for (let h = 0; h < A.length; h++)
|
|
34
|
+
T.setUint32(R, A[h] >>> 0, !0), R += 4;
|
|
35
|
+
return u.set(e, E), u;
|
|
36
36
|
}
|
|
37
37
|
var D = /* @__PURE__ */ ((t) => (t[t.Null = 1] = "Null", t[t.Bool = 2] = "Bool", t[t.Int32 = 3] = "Int32", t[t.Int64 = 4] = "Int64", t[t.UInt32 = 5] = "UInt32", t[t.UInt64 = 6] = "UInt64", t[t.Float32 = 7] = "Float32", t[t.Float64 = 8] = "Float64", t[t.Array = 9] = "Array", t[t.Dict = 10] = "Dict", t[t.Object = 11] = "Object", t[t.String = 12] = "String", t[t.Binary = 13] = "Binary", t[t.Guid = 14] = "Guid", t))(D || {});
|
|
38
|
-
const
|
|
38
|
+
const At = 161, Tt = 162, m = new TextEncoder();
|
|
39
39
|
new TextDecoder("utf-8", { fatal: !0 });
|
|
40
|
-
class
|
|
40
|
+
class F {
|
|
41
41
|
constructor(e = 1) {
|
|
42
|
-
this.version = e, this.buffer.writeByte(
|
|
42
|
+
this.version = e, this.buffer.writeByte(At), this.buffer.writeVarUInt(e >>> 0);
|
|
43
43
|
}
|
|
44
44
|
buffer = new P();
|
|
45
45
|
closed = !1;
|
|
@@ -79,7 +79,7 @@ class g {
|
|
|
79
79
|
this.writeVariableField(e, 13, r);
|
|
80
80
|
}
|
|
81
81
|
writeObjectField(e, r, i) {
|
|
82
|
-
const n = new
|
|
82
|
+
const n = new F(r);
|
|
83
83
|
i(n);
|
|
84
84
|
const a = n.finish();
|
|
85
85
|
this.writeVariableField(e, 11, a);
|
|
@@ -97,7 +97,7 @@ class g {
|
|
|
97
97
|
this.writeVariableField(e, 10, s);
|
|
98
98
|
}
|
|
99
99
|
finish() {
|
|
100
|
-
return this.closed || (this.buffer.writeByte(
|
|
100
|
+
return this.closed || (this.buffer.writeByte(Tt), this.closed = !0, this.cached = this.buffer.toUint8Array()), this.cached;
|
|
101
101
|
}
|
|
102
102
|
writeFixedField(e, r, i) {
|
|
103
103
|
this.writeFieldHeader(e, r, 0), i();
|
|
@@ -106,7 +106,7 @@ class g {
|
|
|
106
106
|
this.writeFieldHeader(e, r, i.length), this.buffer.writeBytes(i);
|
|
107
107
|
}
|
|
108
108
|
writeFieldHeader(e, r, i) {
|
|
109
|
-
this.buffer.writeUInt32(e >>> 0), this.buffer.writeByte(V(r)),
|
|
109
|
+
this.buffer.writeUInt32(e >>> 0), this.buffer.writeByte(V(r)), Ct(r) && this.buffer.writeVarUInt(i >>> 0);
|
|
110
110
|
}
|
|
111
111
|
}
|
|
112
112
|
class M {
|
|
@@ -186,7 +186,7 @@ class M {
|
|
|
186
186
|
11
|
|
187
187
|
/* Object */
|
|
188
188
|
), this.count++;
|
|
189
|
-
const i = new
|
|
189
|
+
const i = new F(e);
|
|
190
190
|
r(i);
|
|
191
191
|
const n = i.finish();
|
|
192
192
|
this.payload.writeVarUInt(n.length), this.payload.writeBytes(n);
|
|
@@ -222,7 +222,7 @@ class M {
|
|
|
222
222
|
}
|
|
223
223
|
class k {
|
|
224
224
|
constructor(e, r) {
|
|
225
|
-
this.keyType = e, this.valueType = r,
|
|
225
|
+
this.keyType = e, this.valueType = r, ht(e);
|
|
226
226
|
}
|
|
227
227
|
payload = new P();
|
|
228
228
|
count = 0;
|
|
@@ -391,7 +391,7 @@ class Nt {
|
|
|
391
391
|
11
|
|
392
392
|
/* Object */
|
|
393
393
|
);
|
|
394
|
-
const i = new
|
|
394
|
+
const i = new F(e);
|
|
395
395
|
r(i);
|
|
396
396
|
const n = i.finish();
|
|
397
397
|
this.payload.writeVarUInt(n.length), this.payload.writeBytes(n), this.valueWritten = !0;
|
|
@@ -559,40 +559,40 @@ function V(t, e = 0) {
|
|
|
559
559
|
throw new Error("Teleport flags must fit into 4 bits");
|
|
560
560
|
return (t & 15) << 4 | e & 15;
|
|
561
561
|
}
|
|
562
|
-
function
|
|
562
|
+
function Ct(t) {
|
|
563
563
|
return t === 12 || t === 13 || t === 9 || t === 11 || t === 10;
|
|
564
564
|
}
|
|
565
|
-
function
|
|
565
|
+
function ht(t) {
|
|
566
566
|
if (t === 9 || t === 11 || t === 10 || t === 1)
|
|
567
567
|
throw new Error("Dictionary keys must be primitive Teleport types");
|
|
568
568
|
}
|
|
569
569
|
function J(t) {
|
|
570
570
|
return Array.from(t).map((e) => e.toString(16).padStart(2, "0")).join("");
|
|
571
571
|
}
|
|
572
|
-
function
|
|
572
|
+
function ut(t) {
|
|
573
573
|
return t instanceof Uint8Array ? t : new Uint8Array(t);
|
|
574
574
|
}
|
|
575
|
-
var u = /* @__PURE__ */ ((t) => (t[t.Unknown = 0] = "Unknown", t[t.H264 = 1] = "H264", t[t.Vp8 = 2] = "Vp8", t[t.Vp9 = 3] = "Vp9", t[t.Av1 = 4] = "Av1", t))(u || {}), Z = /* @__PURE__ */ ((t) => (t[t.NONE = 0] = "NONE", t[t.CONSTANT_GROUP_BITS = 15] = "CONSTANT_GROUP_BITS", t[t.CONSTANT_GROUP_OFFSET = 16] = "CONSTANT_GROUP_OFFSET", t[t.GROUP_CORE = 65536] = "GROUP_CORE", t[t.CORE_AUTH_RESPONSE = 65537] = "CORE_AUTH_RESPONSE", t[t.CORE_AUTH_TICKET = 65538] = "CORE_AUTH_TICKET", t[t.CORE_GLOBAL_STATE = 65539] = "CORE_GLOBAL_STATE", t[t.CORE_ON_SERVER_STATUS_PING = 65540] = "CORE_ON_SERVER_STATUS_PING", t[t.CORE_ON_USER_JOINED = 65541] = "CORE_ON_USER_JOINED", t[t.CORE_ON_USER_LEFT = 65542] = "CORE_ON_USER_LEFT", t[t.CORE_ON_CLIENT_JOINED = 65543] = "CORE_ON_CLIENT_JOINED", t[t.CORE_ON_CLIENT_LEFT = 65544] = "CORE_ON_CLIENT_LEFT", t[t.CORE_ON_SERVER_STARTED = 65545] = "CORE_ON_SERVER_STARTED", t[t.CORE_ON_SERVER_STOPPED = 65546] = "CORE_ON_SERVER_STOPPED", t[t.CORE_ON_SERVER_STOPPING = 65547] = "CORE_ON_SERVER_STOPPING", t[t.CORE_ON_CLIENT_READY = 65548] = "CORE_ON_CLIENT_READY", t[t.CORE_CLIENT_READY = 65549] = "CORE_CLIENT_READY", t[t.CORE_SERVER_INIT = 65550] = "CORE_SERVER_INIT", t[t.CORE_ON_PLUGIN_RELOADED = 65551] = "CORE_ON_PLUGIN_RELOADED", t[t.CORE_SERVER_START = 65552] = "CORE_SERVER_START", t[t.CORE_SERVER_STOP = 65553] = "CORE_SERVER_STOP", t[t.CORE_ON_HOSTED_SERVER_EXIT = 65554] = "CORE_ON_HOSTED_SERVER_EXIT", t[t.CORE_DYNAMIC_CONFIG = 65555] = "CORE_DYNAMIC_CONFIG", t[t.CORE_PROXY_RPC_AUTH_TICKET = 65556] = "CORE_PROXY_RPC_AUTH_TICKET", t[t.CORE_SERVER_INIT2 = 65557] = "CORE_SERVER_INIT2", t[t.CORE_UPDATE_CLIENT_CONTEXT = 65558] = "CORE_UPDATE_CLIENT_CONTEXT", t[t.CORE_BACKGROUND_WORK_ACTIVE = 65559] = "CORE_BACKGROUND_WORK_ACTIVE", t[t.CORE_WEBRTC_OFFER = 65566] = "CORE_WEBRTC_OFFER", t[t.CORE_WEBRTC_ANSWER = 65567] = "CORE_WEBRTC_ANSWER", t[t.CORE_WEBRTC_ICE_CANDIDATE = 65568] = "CORE_WEBRTC_ICE_CANDIDATE", t[t.CORE_WEBRTC_READY = 65569] = "CORE_WEBRTC_READY", t[t.CORE_WEBRTC_AUDIO_SEGMENT = 65570] = "CORE_WEBRTC_AUDIO_SEGMENT", t[t.CORE_WEBRTC_TRACK_MAP = 65571] = "CORE_WEBRTC_TRACK_MAP", t[t.GROUP_KEEPALIVE = 131072] = "GROUP_KEEPALIVE", t[t.KEEPALIVE_REQUEST = 131073] = "KEEPALIVE_REQUEST", t[t.KEEPALIVE_RESPONSE = 131074] = "KEEPALIVE_RESPONSE", t[t.GROUP_EVENTS = 262144] = "GROUP_EVENTS", t[t.EVENTS_PROFILE_UPDATE = 262145] = "EVENTS_PROFILE_UPDATE", t[t.EVENTS_CHANNEL_COMPLETE = 262146] = "EVENTS_CHANNEL_COMPLETE", t[t.EVENTS_SPEECH_PLAYBACK_COMPLETE = 262147] = "EVENTS_SPEECH_PLAYBACK_COMPLETE", t[t.GROUP_ANALYTICS = 524288] = "GROUP_ANALYTICS", t[t.ANALYTICS_LOGS = 524289] = "ANALYTICS_LOGS", t[t.ANALYTICS_EVENTS = 524290] = "ANALYTICS_EVENTS", t[t.ANALYTICS_USAGES = 524291] = "ANALYTICS_USAGES", t[t.ANALYTICS_USAGE = 524292] = "ANALYTICS_USAGE", t[t.ANALYTICS_SPECIAL_LOG = 524293] = "ANALYTICS_SPECIAL_LOG", t[t.ANALYTICS_PROCESSING_UPDATE = 524294] = "ANALYTICS_PROCESSING_UPDATE", t[t.ANALYTICS_REACTIVE_PROCESSING_UPDATE = 524295] = "ANALYTICS_REACTIVE_PROCESSING_UPDATE", t[t.ANALYTICS_IKON_PROXY_SERVER_STATS = 524296] = "ANALYTICS_IKON_PROXY_SERVER_STATS", t[t.GROUP_ACTIONS = 1048576] = "GROUP_ACTIONS", t[t.ACTION_CALL = 1048577] = "ACTION_CALL", t[t.ACTION_ACTIVE = 1048578] = "ACTION_ACTIVE", t[t.ACTION_TEXT_OUTPUT = 1048579] = "ACTION_TEXT_OUTPUT", t[t.ACTION_TEXT_OUTPUT_DELTA = 1048580] = "ACTION_TEXT_OUTPUT_DELTA", t[t.ACTION_TEXT_OUTPUT_DELTA_FULL = 1048581] = "ACTION_TEXT_OUTPUT_DELTA_FULL", t[t.ACTION_SET_STATE = 1048582] = "ACTION_SET_STATE", t[t.ACTION_TAP = 1048583] = "ACTION_TAP", t[t.ACTION_PAN = 1048584] = "ACTION_PAN", t[t.ACTION_ZOOM = 1048585] = "ACTION_ZOOM", t[t.ACTION_FILE_UPLOAD_BEGIN = 1048586] = "ACTION_FILE_UPLOAD_BEGIN", t[t.ACTION_FILE_UPLOAD_DATA = 1048587] = "ACTION_FILE_UPLOAD_DATA", t[t.ACTION_FILE_UPLOAD_ACK = 1048588] = "ACTION_FILE_UPLOAD_ACK", t[t.ACTION_FILE_UPLOAD_END = 1048589] = "ACTION_FILE_UPLOAD_END", t[t.ACTION_FILE_UPLOAD_RESULT = 1048590] = "ACTION_FILE_UPLOAD_RESULT", t[t.ACTION_OPEN_CHANNEL = 1048591] = "ACTION_OPEN_CHANNEL", t[t.ACTION_OPEN_EXTERNAL_URL = 1048592] = "ACTION_OPEN_EXTERNAL_URL", t[t.ACTION_UI_OPEN_VIEW = 1048593] = "ACTION_UI_OPEN_VIEW", t[t.ACTION_UI_CLOSE_VIEW = 1048594] = "ACTION_UI_CLOSE_VIEW", t[t.ACTION_UI_BLOCKING_BEGIN = 1048595] = "ACTION_UI_BLOCKING_BEGIN", t[t.ACTION_UI_BLOCKING_END = 1048596] = "ACTION_UI_BLOCKING_END", t[t.ACTION_UI_UPDATE_TEXT_DELTA = 1048597] = "ACTION_UI_UPDATE_TEXT_DELTA", t[t.ACTION_UI_DELETE_CONTAINER = 1048598] = "ACTION_UI_DELETE_CONTAINER", t[t.ACTION_UPDATE_GFX_SHADER = 1048599] = "ACTION_UPDATE_GFX_SHADER", t[t.ACTION_FUNCTION_REGISTER = 1048600] = "ACTION_FUNCTION_REGISTER", t[t.ACTION_FUNCTION_CALL = 1048601] = "ACTION_FUNCTION_CALL", t[t.ACTION_FUNCTION_RESULT = 1048602] = "ACTION_FUNCTION_RESULT", t[t.ACTION_GENERATE_ANSWER = 1048603] = "ACTION_GENERATE_ANSWER", t[t.ACTION_REGENERATE_ANSWER = 1048604] = "ACTION_REGENERATE_ANSWER", t[t.ACTION_CLEAR_CHAT_MESSAGE_HISTORY = 1048605] = "ACTION_CLEAR_CHAT_MESSAGE_HISTORY", t[t.ACTION_CLEAR_STATE = 1048606] = "ACTION_CLEAR_STATE", t[t.ACTION_RELOAD_CHANNELS = 1048607] = "ACTION_RELOAD_CHANNELS", t[t.ACTION_RELOAD_PROFILE = 1048608] = "ACTION_RELOAD_PROFILE", t[t.ACTION_CLASSIFICATION_RESULT = 1048609] = "ACTION_CLASSIFICATION_RESULT", t[t.ACTION_AUDIO_STOP = 1048610] = "ACTION_AUDIO_STOP", t[t.ACTION_CALL_TEXT = 1048611] = "ACTION_CALL_TEXT", t[t.ACTION_RELOAD_APPLICATION = 1048612] = "ACTION_RELOAD_APPLICATION", t[t.ACTION_CANCEL_GENERATION = 1048613] = "ACTION_CANCEL_GENERATION", t[t.ACTION_UI_SET_CONTAINER_STABLE = 1048614] = "ACTION_UI_SET_CONTAINER_STABLE", t[t.ACTION_SPEECH_RECOGNIZED = 1048615] = "ACTION_SPEECH_RECOGNIZED", t[t.ACTION_CALL_RESULT = 1048616] = "ACTION_CALL_RESULT", t[t.ACTION_RELOAD_PROVIDER = 1048617] = "ACTION_RELOAD_PROVIDER", t[t.ACTION_DOWNLOAD = 1048618] = "ACTION_DOWNLOAD", t[t.ACTION_SCROLL_TO_CONTAINER = 1048619] = "ACTION_SCROLL_TO_CONTAINER", t[t.ACTION_UI_CLEAR_STREAM = 1048620] = "ACTION_UI_CLEAR_STREAM", t[t.ACTION_PLAY_SOUND = 1048621] = "ACTION_PLAY_SOUND", t[t.ACTION_ENTER_FULLSCREEN = 1048622] = "ACTION_ENTER_FULLSCREEN", t[t.ACTION_STOP_SOUND = 1048623] = "ACTION_STOP_SOUND", t[t.ACTION_START_RECORDING = 1048624] = "ACTION_START_RECORDING", t[t.ACTION_STOP_RECORDING = 1048625] = "ACTION_STOP_RECORDING", t[t.ACTION_OPTIMISTIC_CLIENT_CALLS = 1048626] = "ACTION_OPTIMISTIC_CLIENT_CALLS", t[t.ACTION_FUNCTION_ENUMERATION_ITEM = 1048627] = "ACTION_FUNCTION_ENUMERATION_ITEM", t[t.ACTION_FUNCTION_ENUMERATION_END = 1048628] = "ACTION_FUNCTION_ENUMERATION_END", t[t.ACTION_FUNCTION_CANCEL = 1048629] = "ACTION_FUNCTION_CANCEL", t[t.ACTION_FUNCTION_DISPOSE = 1048630] = "ACTION_FUNCTION_DISPOSE", t[t.ACTION_FUNCTION_ERROR = 1048631] = "ACTION_FUNCTION_ERROR", t[t.ACTION_FUNCTION_ACK = 1048632] = "ACTION_FUNCTION_ACK", t[t.ACTION_FUNCTION_AWAITING_APPROVAL = 1048633] = "ACTION_FUNCTION_AWAITING_APPROVAL", t[t.ACTION_FUNCTION_APPROVAL_REQUIRED = 1048634] = "ACTION_FUNCTION_APPROVAL_REQUIRED", t[t.ACTION_FUNCTION_APPROVAL_RESPONSE = 1048635] = "ACTION_FUNCTION_APPROVAL_RESPONSE", t[t.UI_UPDATE_ACK = 1048636] = "UI_UPDATE_ACK", t[t.ACTION_CALL2 = 1048637] = "ACTION_CALL2", t[t.ACTION_FUNCTION_REGISTER_BATCH = 1048638] = "ACTION_FUNCTION_REGISTER_BATCH", t[t.ACTION_TRIGGER_GIT_PULL = 1048639] = "ACTION_TRIGGER_GIT_PULL", t[t.ACTION_FILE_UPLOAD_CALLBACK = 1048640] = "ACTION_FILE_UPLOAD_CALLBACK", t[t.ACTION_CUSTOM_USER_MESSAGE = 1048641] = "ACTION_CUSTOM_USER_MESSAGE", t[t.ACTION_URL_CHANGED = 1048642] = "ACTION_URL_CHANGED", t[t.ACTION_FILE_UPLOAD_PRE_START2 = 1048643] = "ACTION_FILE_UPLOAD_PRE_START2", t[t.ACTION_FILE_UPLOAD_PRE_START_RESPONSE2 = 1048644] = "ACTION_FILE_UPLOAD_PRE_START_RESPONSE2", t[t.ACTION_FILE_UPLOAD_START2 = 1048645] = "ACTION_FILE_UPLOAD_START2", t[t.ACTION_FILE_UPLOAD_START_RESPONSE2 = 1048646] = "ACTION_FILE_UPLOAD_START_RESPONSE2", t[t.ACTION_FILE_UPLOAD_DATA2 = 1048647] = "ACTION_FILE_UPLOAD_DATA2", t[t.ACTION_FILE_UPLOAD_ACK2 = 1048648] = "ACTION_FILE_UPLOAD_ACK2", t[t.ACTION_FILE_UPLOAD_END2 = 1048649] = "ACTION_FILE_UPLOAD_END2", t[t.ACTION_FILE_UPLOAD_COMPLETE2 = 1048650] = "ACTION_FILE_UPLOAD_COMPLETE2", t[t.ACTION_FUNCTION_ENUMERATION_ITEM_BATCH = 1048651] = "ACTION_FUNCTION_ENUMERATION_ITEM_BATCH", t[t.GROUP_UI = 2097152] = "GROUP_UI", t[t.UI_STREAM_BEGIN = 2097153] = "UI_STREAM_BEGIN", t[t.UI_STREAM_END = 2097154] = "UI_STREAM_END", t[t.UI_CONTAINER_BEGIN = 2097155] = "UI_CONTAINER_BEGIN", t[t.UI_CONTAINER_END = 2097156] = "UI_CONTAINER_END", t[t.UI_SECTION_BEGIN = 2097157] = "UI_SECTION_BEGIN", t[t.UI_SECTION_END = 2097158] = "UI_SECTION_END", t[t.UI_LIST_BEGIN = 2097159] = "UI_LIST_BEGIN", t[t.UI_LIST_ITEM = 2097160] = "UI_LIST_ITEM", t[t.UI_LIST_END = 2097161] = "UI_LIST_END", t[t.UI_TEXT = 2097162] = "UI_TEXT", t[t.UI_HEADER = 2097163] = "UI_HEADER", t[t.UI_SEPARATOR = 2097164] = "UI_SEPARATOR", t[t.UI_BUTTON = 2097165] = "UI_BUTTON", t[t.UI_ICON_BUTTON = 2097166] = "UI_ICON_BUTTON", t[t.UI_IMAGE = 2097167] = "UI_IMAGE", t[t.UI_FILE = 2097168] = "UI_FILE", t[t.UI_BADGE = 2097169] = "UI_BADGE", t[t.UI_CONTENT_LINK = 2097170] = "UI_CONTENT_LINK", t[t.UI_MAP = 2097171] = "UI_MAP", t[t.UI_VEGA_CHART = 2097172] = "UI_VEGA_CHART", t[t.UI_ICON = 2097173] = "UI_ICON", t[t.UI_FILE_UPLOAD_SECTION_BEGIN = 2097174] = "UI_FILE_UPLOAD_SECTION_BEGIN", t[t.UI_FILE_UPLOAD_SECTION_END = 2097175] = "UI_FILE_UPLOAD_SECTION_END", t[t.UI_MATERIAL_SYMBOL = 2097176] = "UI_MATERIAL_SYMBOL", t[t.UI_BUTTON_BEGIN = 2097177] = "UI_BUTTON_BEGIN", t[t.UI_BUTTON_END = 2097178] = "UI_BUTTON_END", t[t.UI_CONTAINER_DELETE = 2097179] = "UI_CONTAINER_DELETE", t[t.UI_INPUT_TEXT = 2097180] = "UI_INPUT_TEXT", t[t.UI_PROGRESS_BAR = 2097181] = "UI_PROGRESS_BAR", t[t.UI_UPDATE_BEGIN = 2097182] = "UI_UPDATE_BEGIN", t[t.UI_UPDATE_END = 2097183] = "UI_UPDATE_END", t[t.UI_AUTOCOMPLETE = 2097184] = "UI_AUTOCOMPLETE", t[t.UI_CHECKBOX = 2097185] = "UI_CHECKBOX", t[t.UI_QS = 2097186] = "UI_QS", t[t.UI_ELEMENT = 2097187] = "UI_ELEMENT", t[t.UI_STYLES = 2097188] = "UI_STYLES", t[t.UI_SVG = 2097189] = "UI_SVG", t[t.UI_UPDATE = 2097190] = "UI_UPDATE", t[t.UI_INIT = 2097191] = "UI_INIT", t[t.UI_STYLES_BATCH = 2097192] = "UI_STYLES_BATCH", t[t.UI_STYLES_DELETE = 2097193] = "UI_STYLES_DELETE", t[t.GROUP_COMMON = 4128768] = "GROUP_COMMON", t[t.GROUP_AUDIO = 4194304] = "GROUP_AUDIO", t[t.AUDIO_STREAM_BEGIN = 4194305] = "AUDIO_STREAM_BEGIN", t[t.AUDIO_STREAM_END = 4194306] = "AUDIO_STREAM_END", t[t.AUDIO_FRAME = 4194307] = "AUDIO_FRAME", t[t.AUDIO_FRAME_VOLUME = 4194308] = "AUDIO_FRAME_VOLUME", t[t.AUDIO_FRAME2 = 4194309] = "AUDIO_FRAME2", t[t.GROUP_VIDEO = 8388608] = "GROUP_VIDEO", t[t.VIDEO_STREAM_BEGIN = 8388609] = "VIDEO_STREAM_BEGIN", t[t.VIDEO_STREAM_END = 8388610] = "VIDEO_STREAM_END", t[t.VIDEO_FRAME = 8388611] = "VIDEO_FRAME", t[t.VIDEO_REQUEST_IDR_FRAME = 8388612] = "VIDEO_REQUEST_IDR_FRAME", t[t.VIDEO_INVALIDATE_FRAME = 8388613] = "VIDEO_INVALIDATE_FRAME", t[t.GROUP_TRACKING = 16777216] = "GROUP_TRACKING", t[t.TRACKING_STREAM_BEGIN = 16777217] = "TRACKING_STREAM_BEGIN", t[t.TRACKING_STREAM_END = 16777218] = "TRACKING_STREAM_END", t[t.TRACKING_FRAME = 16777219] = "TRACKING_FRAME", t[t.GROUP_SCENE = 33554432] = "GROUP_SCENE", t[t.SCENE_MESH = 33554433] = "SCENE_MESH", t[t.SCENE_ARRAY = 33554434] = "SCENE_ARRAY", t[t.GROUP_ALL = 67043328] = "GROUP_ALL", t[t.CONSTANT_GROUP_MASK = 2147418112] = "CONSTANT_GROUP_MASK", t))(Z || {});
|
|
576
|
-
const p = 5,
|
|
577
|
-
function
|
|
575
|
+
var o = /* @__PURE__ */ ((t) => (t[t.Unknown = 0] = "Unknown", t[t.H264 = 1] = "H264", t[t.Vp8 = 2] = "Vp8", t[t.Vp9 = 3] = "Vp9", t[t.Av1 = 4] = "Av1", t))(o || {}), Z = /* @__PURE__ */ ((t) => (t[t.NONE = 0] = "NONE", t[t.CONSTANT_GROUP_BITS = 15] = "CONSTANT_GROUP_BITS", t[t.CONSTANT_GROUP_OFFSET = 16] = "CONSTANT_GROUP_OFFSET", t[t.GROUP_CORE = 65536] = "GROUP_CORE", t[t.CORE_AUTH_RESPONSE = 65537] = "CORE_AUTH_RESPONSE", t[t.CORE_AUTH_TICKET = 65538] = "CORE_AUTH_TICKET", t[t.CORE_GLOBAL_STATE = 65539] = "CORE_GLOBAL_STATE", t[t.CORE_ON_SERVER_STATUS_PING = 65540] = "CORE_ON_SERVER_STATUS_PING", t[t.CORE_ON_USER_JOINED = 65541] = "CORE_ON_USER_JOINED", t[t.CORE_ON_USER_LEFT = 65542] = "CORE_ON_USER_LEFT", t[t.CORE_ON_CLIENT_JOINED = 65543] = "CORE_ON_CLIENT_JOINED", t[t.CORE_ON_CLIENT_LEFT = 65544] = "CORE_ON_CLIENT_LEFT", t[t.CORE_ON_SERVER_STARTED = 65545] = "CORE_ON_SERVER_STARTED", t[t.CORE_ON_SERVER_STOPPED = 65546] = "CORE_ON_SERVER_STOPPED", t[t.CORE_ON_SERVER_STOPPING = 65547] = "CORE_ON_SERVER_STOPPING", t[t.CORE_ON_CLIENT_READY = 65548] = "CORE_ON_CLIENT_READY", t[t.CORE_CLIENT_READY = 65549] = "CORE_CLIENT_READY", t[t.CORE_SERVER_INIT = 65550] = "CORE_SERVER_INIT", t[t.CORE_ON_PLUGIN_RELOADED = 65551] = "CORE_ON_PLUGIN_RELOADED", t[t.CORE_SERVER_START = 65552] = "CORE_SERVER_START", t[t.CORE_SERVER_STOP = 65553] = "CORE_SERVER_STOP", t[t.CORE_ON_HOSTED_SERVER_EXIT = 65554] = "CORE_ON_HOSTED_SERVER_EXIT", t[t.CORE_DYNAMIC_CONFIG = 65555] = "CORE_DYNAMIC_CONFIG", t[t.CORE_PROXY_RPC_AUTH_TICKET = 65556] = "CORE_PROXY_RPC_AUTH_TICKET", t[t.CORE_SERVER_INIT2 = 65557] = "CORE_SERVER_INIT2", t[t.CORE_UPDATE_CLIENT_CONTEXT = 65558] = "CORE_UPDATE_CLIENT_CONTEXT", t[t.CORE_BACKGROUND_WORK_ACTIVE = 65559] = "CORE_BACKGROUND_WORK_ACTIVE", t[t.CORE_WEBRTC_OFFER = 65566] = "CORE_WEBRTC_OFFER", t[t.CORE_WEBRTC_ANSWER = 65567] = "CORE_WEBRTC_ANSWER", t[t.CORE_WEBRTC_ICE_CANDIDATE = 65568] = "CORE_WEBRTC_ICE_CANDIDATE", t[t.CORE_WEBRTC_READY = 65569] = "CORE_WEBRTC_READY", t[t.CORE_WEBRTC_AUDIO_SEGMENT = 65570] = "CORE_WEBRTC_AUDIO_SEGMENT", t[t.CORE_WEBRTC_TRACK_MAP = 65571] = "CORE_WEBRTC_TRACK_MAP", t[t.CORE_RELAY_AGENT_HELLO = 65576] = "CORE_RELAY_AGENT_HELLO", t[t.CORE_RELAY_HELLO = 65577] = "CORE_RELAY_HELLO", t[t.CORE_RELAY_HEARTBEAT = 65578] = "CORE_RELAY_HEARTBEAT", t[t.CORE_RELAY_TCP_CONNECTION_OPENED = 65579] = "CORE_RELAY_TCP_CONNECTION_OPENED", t[t.CORE_RELAY_TCP_CONNECTION_CLOSED = 65580] = "CORE_RELAY_TCP_CONNECTION_CLOSED", t[t.CORE_RELAY_TCP_DATA = 65581] = "CORE_RELAY_TCP_DATA", t[t.CORE_RELAY_UDP_DATA = 65582] = "CORE_RELAY_UDP_DATA", t[t.GROUP_KEEPALIVE = 131072] = "GROUP_KEEPALIVE", t[t.KEEPALIVE_REQUEST = 131073] = "KEEPALIVE_REQUEST", t[t.KEEPALIVE_RESPONSE = 131074] = "KEEPALIVE_RESPONSE", t[t.GROUP_EVENTS = 262144] = "GROUP_EVENTS", t[t.EVENTS_PROFILE_UPDATE = 262145] = "EVENTS_PROFILE_UPDATE", t[t.EVENTS_CHANNEL_COMPLETE = 262146] = "EVENTS_CHANNEL_COMPLETE", t[t.EVENTS_SPEECH_PLAYBACK_COMPLETE = 262147] = "EVENTS_SPEECH_PLAYBACK_COMPLETE", t[t.GROUP_ANALYTICS = 524288] = "GROUP_ANALYTICS", t[t.ANALYTICS_LOGS = 524289] = "ANALYTICS_LOGS", t[t.ANALYTICS_EVENTS = 524290] = "ANALYTICS_EVENTS", t[t.ANALYTICS_USAGES = 524291] = "ANALYTICS_USAGES", t[t.ANALYTICS_USAGE = 524292] = "ANALYTICS_USAGE", t[t.ANALYTICS_SPECIAL_LOG = 524293] = "ANALYTICS_SPECIAL_LOG", t[t.ANALYTICS_PROCESSING_UPDATE = 524294] = "ANALYTICS_PROCESSING_UPDATE", t[t.ANALYTICS_REACTIVE_PROCESSING_UPDATE = 524295] = "ANALYTICS_REACTIVE_PROCESSING_UPDATE", t[t.ANALYTICS_IKON_PROXY_SERVER_STATS = 524296] = "ANALYTICS_IKON_PROXY_SERVER_STATS", t[t.ANALYTICS_IKON_RELAY_SERVER_STATS = 524297] = "ANALYTICS_IKON_RELAY_SERVER_STATS", t[t.GROUP_ACTIONS = 1048576] = "GROUP_ACTIONS", t[t.ACTION_CALL = 1048577] = "ACTION_CALL", t[t.ACTION_ACTIVE = 1048578] = "ACTION_ACTIVE", t[t.ACTION_TEXT_OUTPUT = 1048579] = "ACTION_TEXT_OUTPUT", t[t.ACTION_TEXT_OUTPUT_DELTA = 1048580] = "ACTION_TEXT_OUTPUT_DELTA", t[t.ACTION_TEXT_OUTPUT_DELTA_FULL = 1048581] = "ACTION_TEXT_OUTPUT_DELTA_FULL", t[t.ACTION_SET_STATE = 1048582] = "ACTION_SET_STATE", t[t.ACTION_TAP = 1048583] = "ACTION_TAP", t[t.ACTION_PAN = 1048584] = "ACTION_PAN", t[t.ACTION_ZOOM = 1048585] = "ACTION_ZOOM", t[t.ACTION_FILE_UPLOAD_BEGIN = 1048586] = "ACTION_FILE_UPLOAD_BEGIN", t[t.ACTION_FILE_UPLOAD_DATA = 1048587] = "ACTION_FILE_UPLOAD_DATA", t[t.ACTION_FILE_UPLOAD_ACK = 1048588] = "ACTION_FILE_UPLOAD_ACK", t[t.ACTION_FILE_UPLOAD_END = 1048589] = "ACTION_FILE_UPLOAD_END", t[t.ACTION_FILE_UPLOAD_RESULT = 1048590] = "ACTION_FILE_UPLOAD_RESULT", t[t.ACTION_OPEN_CHANNEL = 1048591] = "ACTION_OPEN_CHANNEL", t[t.ACTION_OPEN_EXTERNAL_URL = 1048592] = "ACTION_OPEN_EXTERNAL_URL", t[t.ACTION_UI_OPEN_VIEW = 1048593] = "ACTION_UI_OPEN_VIEW", t[t.ACTION_UI_CLOSE_VIEW = 1048594] = "ACTION_UI_CLOSE_VIEW", t[t.ACTION_UI_BLOCKING_BEGIN = 1048595] = "ACTION_UI_BLOCKING_BEGIN", t[t.ACTION_UI_BLOCKING_END = 1048596] = "ACTION_UI_BLOCKING_END", t[t.ACTION_UI_UPDATE_TEXT_DELTA = 1048597] = "ACTION_UI_UPDATE_TEXT_DELTA", t[t.ACTION_UI_DELETE_CONTAINER = 1048598] = "ACTION_UI_DELETE_CONTAINER", t[t.ACTION_UPDATE_GFX_SHADER = 1048599] = "ACTION_UPDATE_GFX_SHADER", t[t.ACTION_FUNCTION_REGISTER = 1048600] = "ACTION_FUNCTION_REGISTER", t[t.ACTION_FUNCTION_CALL = 1048601] = "ACTION_FUNCTION_CALL", t[t.ACTION_FUNCTION_RESULT = 1048602] = "ACTION_FUNCTION_RESULT", t[t.ACTION_GENERATE_ANSWER = 1048603] = "ACTION_GENERATE_ANSWER", t[t.ACTION_REGENERATE_ANSWER = 1048604] = "ACTION_REGENERATE_ANSWER", t[t.ACTION_CLEAR_CHAT_MESSAGE_HISTORY = 1048605] = "ACTION_CLEAR_CHAT_MESSAGE_HISTORY", t[t.ACTION_CLEAR_STATE = 1048606] = "ACTION_CLEAR_STATE", t[t.ACTION_RELOAD_CHANNELS = 1048607] = "ACTION_RELOAD_CHANNELS", t[t.ACTION_RELOAD_PROFILE = 1048608] = "ACTION_RELOAD_PROFILE", t[t.ACTION_CLASSIFICATION_RESULT = 1048609] = "ACTION_CLASSIFICATION_RESULT", t[t.ACTION_AUDIO_STOP = 1048610] = "ACTION_AUDIO_STOP", t[t.ACTION_CALL_TEXT = 1048611] = "ACTION_CALL_TEXT", t[t.ACTION_RELOAD_APPLICATION = 1048612] = "ACTION_RELOAD_APPLICATION", t[t.ACTION_CANCEL_GENERATION = 1048613] = "ACTION_CANCEL_GENERATION", t[t.ACTION_UI_SET_CONTAINER_STABLE = 1048614] = "ACTION_UI_SET_CONTAINER_STABLE", t[t.ACTION_SPEECH_RECOGNIZED = 1048615] = "ACTION_SPEECH_RECOGNIZED", t[t.ACTION_CALL_RESULT = 1048616] = "ACTION_CALL_RESULT", t[t.ACTION_RELOAD_PROVIDER = 1048617] = "ACTION_RELOAD_PROVIDER", t[t.ACTION_DOWNLOAD = 1048618] = "ACTION_DOWNLOAD", t[t.ACTION_SCROLL_TO_CONTAINER = 1048619] = "ACTION_SCROLL_TO_CONTAINER", t[t.ACTION_UI_CLEAR_STREAM = 1048620] = "ACTION_UI_CLEAR_STREAM", t[t.ACTION_PLAY_SOUND = 1048621] = "ACTION_PLAY_SOUND", t[t.ACTION_ENTER_FULLSCREEN = 1048622] = "ACTION_ENTER_FULLSCREEN", t[t.ACTION_STOP_SOUND = 1048623] = "ACTION_STOP_SOUND", t[t.ACTION_START_RECORDING = 1048624] = "ACTION_START_RECORDING", t[t.ACTION_STOP_RECORDING = 1048625] = "ACTION_STOP_RECORDING", t[t.ACTION_FUNCTION_ENUMERATION_ITEM = 1048627] = "ACTION_FUNCTION_ENUMERATION_ITEM", t[t.ACTION_FUNCTION_ENUMERATION_END = 1048628] = "ACTION_FUNCTION_ENUMERATION_END", t[t.ACTION_FUNCTION_CANCEL = 1048629] = "ACTION_FUNCTION_CANCEL", t[t.ACTION_FUNCTION_DISPOSE = 1048630] = "ACTION_FUNCTION_DISPOSE", t[t.ACTION_FUNCTION_ERROR = 1048631] = "ACTION_FUNCTION_ERROR", t[t.ACTION_FUNCTION_ACK = 1048632] = "ACTION_FUNCTION_ACK", t[t.ACTION_FUNCTION_AWAITING_APPROVAL = 1048633] = "ACTION_FUNCTION_AWAITING_APPROVAL", t[t.ACTION_FUNCTION_APPROVAL_REQUIRED = 1048634] = "ACTION_FUNCTION_APPROVAL_REQUIRED", t[t.ACTION_FUNCTION_APPROVAL_RESPONSE = 1048635] = "ACTION_FUNCTION_APPROVAL_RESPONSE", t[t.UI_UPDATE_ACK = 1048636] = "UI_UPDATE_ACK", t[t.ACTION_CALL2 = 1048637] = "ACTION_CALL2", t[t.ACTION_FUNCTION_REGISTER_BATCH = 1048638] = "ACTION_FUNCTION_REGISTER_BATCH", t[t.ACTION_TRIGGER_GIT_PULL = 1048639] = "ACTION_TRIGGER_GIT_PULL", t[t.ACTION_FILE_UPLOAD_CALLBACK = 1048640] = "ACTION_FILE_UPLOAD_CALLBACK", t[t.ACTION_CUSTOM_USER_MESSAGE = 1048641] = "ACTION_CUSTOM_USER_MESSAGE", t[t.ACTION_URL_CHANGED = 1048642] = "ACTION_URL_CHANGED", t[t.ACTION_FILE_UPLOAD_PRE_START2 = 1048643] = "ACTION_FILE_UPLOAD_PRE_START2", t[t.ACTION_FILE_UPLOAD_PRE_START_RESPONSE2 = 1048644] = "ACTION_FILE_UPLOAD_PRE_START_RESPONSE2", t[t.ACTION_FILE_UPLOAD_START2 = 1048645] = "ACTION_FILE_UPLOAD_START2", t[t.ACTION_FILE_UPLOAD_START_RESPONSE2 = 1048646] = "ACTION_FILE_UPLOAD_START_RESPONSE2", t[t.ACTION_FILE_UPLOAD_DATA2 = 1048647] = "ACTION_FILE_UPLOAD_DATA2", t[t.ACTION_FILE_UPLOAD_ACK2 = 1048648] = "ACTION_FILE_UPLOAD_ACK2", t[t.ACTION_FILE_UPLOAD_END2 = 1048649] = "ACTION_FILE_UPLOAD_END2", t[t.ACTION_FILE_UPLOAD_COMPLETE2 = 1048650] = "ACTION_FILE_UPLOAD_COMPLETE2", t[t.ACTION_FUNCTION_ENUMERATION_ITEM_BATCH = 1048651] = "ACTION_FUNCTION_ENUMERATION_ITEM_BATCH", t[t.GROUP_UI = 2097152] = "GROUP_UI", t[t.UI_STREAM_BEGIN = 2097153] = "UI_STREAM_BEGIN", t[t.UI_STREAM_END = 2097154] = "UI_STREAM_END", t[t.UI_CONTAINER_BEGIN = 2097155] = "UI_CONTAINER_BEGIN", t[t.UI_CONTAINER_END = 2097156] = "UI_CONTAINER_END", t[t.UI_SECTION_BEGIN = 2097157] = "UI_SECTION_BEGIN", t[t.UI_SECTION_END = 2097158] = "UI_SECTION_END", t[t.UI_LIST_BEGIN = 2097159] = "UI_LIST_BEGIN", t[t.UI_LIST_ITEM = 2097160] = "UI_LIST_ITEM", t[t.UI_LIST_END = 2097161] = "UI_LIST_END", t[t.UI_TEXT = 2097162] = "UI_TEXT", t[t.UI_HEADER = 2097163] = "UI_HEADER", t[t.UI_SEPARATOR = 2097164] = "UI_SEPARATOR", t[t.UI_BUTTON = 2097165] = "UI_BUTTON", t[t.UI_ICON_BUTTON = 2097166] = "UI_ICON_BUTTON", t[t.UI_IMAGE = 2097167] = "UI_IMAGE", t[t.UI_FILE = 2097168] = "UI_FILE", t[t.UI_BADGE = 2097169] = "UI_BADGE", t[t.UI_CONTENT_LINK = 2097170] = "UI_CONTENT_LINK", t[t.UI_MAP = 2097171] = "UI_MAP", t[t.UI_VEGA_CHART = 2097172] = "UI_VEGA_CHART", t[t.UI_ICON = 2097173] = "UI_ICON", t[t.UI_FILE_UPLOAD_SECTION_BEGIN = 2097174] = "UI_FILE_UPLOAD_SECTION_BEGIN", t[t.UI_FILE_UPLOAD_SECTION_END = 2097175] = "UI_FILE_UPLOAD_SECTION_END", t[t.UI_MATERIAL_SYMBOL = 2097176] = "UI_MATERIAL_SYMBOL", t[t.UI_BUTTON_BEGIN = 2097177] = "UI_BUTTON_BEGIN", t[t.UI_BUTTON_END = 2097178] = "UI_BUTTON_END", t[t.UI_CONTAINER_DELETE = 2097179] = "UI_CONTAINER_DELETE", t[t.UI_INPUT_TEXT = 2097180] = "UI_INPUT_TEXT", t[t.UI_PROGRESS_BAR = 2097181] = "UI_PROGRESS_BAR", t[t.UI_UPDATE_BEGIN = 2097182] = "UI_UPDATE_BEGIN", t[t.UI_UPDATE_END = 2097183] = "UI_UPDATE_END", t[t.UI_AUTOCOMPLETE = 2097184] = "UI_AUTOCOMPLETE", t[t.UI_CHECKBOX = 2097185] = "UI_CHECKBOX", t[t.UI_QS = 2097186] = "UI_QS", t[t.UI_ELEMENT = 2097187] = "UI_ELEMENT", t[t.UI_STYLES = 2097188] = "UI_STYLES", t[t.UI_SVG = 2097189] = "UI_SVG", t[t.UI_UPDATE = 2097190] = "UI_UPDATE", t[t.UI_INIT = 2097191] = "UI_INIT", t[t.UI_STYLES_BATCH = 2097192] = "UI_STYLES_BATCH", t[t.UI_STYLES_DELETE = 2097193] = "UI_STYLES_DELETE", t[t.GROUP_COMMON = 4128768] = "GROUP_COMMON", t[t.GROUP_AUDIO = 4194304] = "GROUP_AUDIO", t[t.AUDIO_STREAM_BEGIN = 4194305] = "AUDIO_STREAM_BEGIN", t[t.AUDIO_STREAM_END = 4194306] = "AUDIO_STREAM_END", t[t.AUDIO_FRAME = 4194307] = "AUDIO_FRAME", t[t.AUDIO_FRAME_VOLUME = 4194308] = "AUDIO_FRAME_VOLUME", t[t.AUDIO_FRAME2 = 4194309] = "AUDIO_FRAME2", t[t.AUDIO_SHAPE_FRAME = 4194310] = "AUDIO_SHAPE_FRAME", t[t.GROUP_VIDEO = 8388608] = "GROUP_VIDEO", t[t.VIDEO_STREAM_BEGIN = 8388609] = "VIDEO_STREAM_BEGIN", t[t.VIDEO_STREAM_END = 8388610] = "VIDEO_STREAM_END", t[t.VIDEO_FRAME = 8388611] = "VIDEO_FRAME", t[t.VIDEO_REQUEST_IDR_FRAME = 8388612] = "VIDEO_REQUEST_IDR_FRAME", t[t.VIDEO_INVALIDATE_FRAME = 8388613] = "VIDEO_INVALIDATE_FRAME", t[t.GROUP_TRACKING = 16777216] = "GROUP_TRACKING", t[t.TRACKING_STREAM_BEGIN = 16777217] = "TRACKING_STREAM_BEGIN", t[t.TRACKING_STREAM_END = 16777218] = "TRACKING_STREAM_END", t[t.TRACKING_FRAME = 16777219] = "TRACKING_FRAME", t[t.GROUP_SCENE = 33554432] = "GROUP_SCENE", t[t.SCENE_MESH = 33554433] = "SCENE_MESH", t[t.SCENE_ARRAY = 33554434] = "SCENE_ARRAY", t[t.GROUP_ALL = 67043328] = "GROUP_ALL", t[t.CONSTANT_GROUP_MASK = 2147418112] = "CONSTANT_GROUP_MASK", t))(Z || {});
|
|
576
|
+
const p = 5, ot = 8388609, Rt = 161083277, lt = 164808083, Ut = 1368629611, ft = 2745379226, St = 2950031986, ct = 3282782683, yt = 3284746250, Lt = 4065070594;
|
|
577
|
+
function Y(t) {
|
|
578
578
|
const e = {};
|
|
579
|
-
return
|
|
579
|
+
return wt(e), t && Object.assign(e, t), e;
|
|
580
580
|
}
|
|
581
|
-
function
|
|
582
|
-
return t.StreamId = "", t.Description = "", t.SourceType = "", t.Codec =
|
|
581
|
+
function wt(t) {
|
|
582
|
+
return t.StreamId = "", t.Description = "", t.SourceType = "", t.Codec = o.H264, t.CodecDetails = "", t.Width = 0, t.Height = 0, t.Framerate = 30, t;
|
|
583
583
|
}
|
|
584
584
|
function Dt(t) {
|
|
585
|
-
const e = new
|
|
585
|
+
const e = new F(p);
|
|
586
586
|
return Pt(t, e), e.finish();
|
|
587
587
|
}
|
|
588
588
|
function Pt(t, e) {
|
|
589
|
-
e.writeStringField(Rt, t.StreamId), e.writeFloat64Field(lt, t.Framerate), e.writeStringField(Ut, t.Description), e.writeStringField(ft, t.CodecDetails), e.writeInt32Field(St, t.Height | 0), e.writeStringField(ct, t.SourceType), e.writeInt32Field(yt, t.Codec), e.writeInt32Field(
|
|
589
|
+
e.writeStringField(Rt, t.StreamId), e.writeFloat64Field(lt, t.Framerate), e.writeStringField(Ut, t.Description), e.writeStringField(ft, t.CodecDetails), e.writeInt32Field(St, t.Height | 0), e.writeStringField(ct, t.SourceType), e.writeInt32Field(yt, t.Codec), e.writeInt32Field(Lt, t.Width | 0);
|
|
590
590
|
}
|
|
591
|
-
function
|
|
591
|
+
function W(t, e, r) {
|
|
592
592
|
const i = Dt(t);
|
|
593
|
-
return v(
|
|
593
|
+
return v(ot, i, p, e, r);
|
|
594
594
|
}
|
|
595
|
-
const tt = 1,
|
|
595
|
+
const tt = 1, Ot = 8388611, Ft = 271275304, gt = 2541432218, dt = 2986785889, mt = 3105403172, Vt = 3456383222;
|
|
596
596
|
function $(t) {
|
|
597
597
|
const e = {};
|
|
598
598
|
return Mt(e), t && Object.assign(e, t), e;
|
|
@@ -601,15 +601,15 @@ function Mt(t) {
|
|
|
601
601
|
return t.Data = new Uint8Array(0), t.FrameNumber = 0, t.IsKey = !1, t.TimestampInUs = 0n, t.DurationInUs = 0, t;
|
|
602
602
|
}
|
|
603
603
|
function Bt(t) {
|
|
604
|
-
const e = new
|
|
604
|
+
const e = new F(tt);
|
|
605
605
|
return Gt(t, e), e.finish();
|
|
606
606
|
}
|
|
607
607
|
function Gt(t, e) {
|
|
608
|
-
e.writeUInt64Field(
|
|
608
|
+
e.writeUInt64Field(Ft, t.TimestampInUs), e.writeUInt32Field(gt, t.DurationInUs >>> 0), e.writeBinaryField(dt, t.Data), e.writeBoolField(mt, t.IsKey), e.writeInt32Field(Vt, t.FrameNumber | 0);
|
|
609
609
|
}
|
|
610
610
|
function x(t, e, r) {
|
|
611
611
|
const i = Bt(t);
|
|
612
|
-
return v(
|
|
612
|
+
return v(Ot, i, tt, e, r);
|
|
613
613
|
}
|
|
614
614
|
const et = 1, bt = 8388610;
|
|
615
615
|
function Ht(t) {
|
|
@@ -617,7 +617,7 @@ function Ht(t) {
|
|
|
617
617
|
return t && Object.assign(e, t), e;
|
|
618
618
|
}
|
|
619
619
|
function Kt(t) {
|
|
620
|
-
return new
|
|
620
|
+
return new F(et).finish();
|
|
621
621
|
}
|
|
622
622
|
function vt(t, e, r) {
|
|
623
623
|
const i = Kt();
|
|
@@ -638,7 +638,7 @@ const H = 30, kt = 30 * 3, rt = [
|
|
|
638
638
|
// Main L4.0 (1080p)
|
|
639
639
|
];
|
|
640
640
|
rt[0];
|
|
641
|
-
const
|
|
641
|
+
const Yt = "vp8", it = [
|
|
642
642
|
"vp09.00.10.08",
|
|
643
643
|
// Profile 0, Level 1.0, 8-bit (most compatible)
|
|
644
644
|
"vp09.00.20.08",
|
|
@@ -660,7 +660,7 @@ const nt = [
|
|
|
660
660
|
// Main profile, Level 2.0, 8-bit (lower res fallback)
|
|
661
661
|
];
|
|
662
662
|
nt[0];
|
|
663
|
-
const q = ["h264", "vp8", "vp9", "av1"],
|
|
663
|
+
const q = ["h264", "vp8", "vp9", "av1"], Wt = [
|
|
664
664
|
{ width: 1920, height: 1080 },
|
|
665
665
|
// 1080p
|
|
666
666
|
{ width: 1280, height: 720 },
|
|
@@ -671,11 +671,11 @@ const q = ["h264", "vp8", "vp9", "av1"], Yt = [
|
|
|
671
671
|
// 480p (VGA)
|
|
672
672
|
{ width: 640, height: 360 }
|
|
673
673
|
// 360p
|
|
674
|
-
], $t = 0.1, xt = 30, Xt = 5e4, jt = 5e5, Qt = 8e6, zt = 8, Jt = 3,
|
|
675
|
-
let S = null,
|
|
674
|
+
], $t = 0.1, xt = 30, Xt = 5e4, jt = 5e5, Qt = 8e6, zt = 8, Jt = 3, w = (t) => self.postMessage(t);
|
|
675
|
+
let S = null, L = null;
|
|
676
676
|
function y(t, e) {
|
|
677
677
|
const r = t instanceof Error ? t : new Error(String(t));
|
|
678
|
-
|
|
678
|
+
w({ type: "error", captureId: e, error: { name: r.name, message: r.message, stack: r.stack } });
|
|
679
679
|
}
|
|
680
680
|
function K(t) {
|
|
681
681
|
if (!Array.isArray(t) || t.length === 0)
|
|
@@ -691,14 +691,14 @@ function K(t) {
|
|
|
691
691
|
return Array.from(r);
|
|
692
692
|
}
|
|
693
693
|
function qt(t) {
|
|
694
|
-
return t === "h264" ?
|
|
694
|
+
return t === "h264" ? o.H264 : t === "vp8" ? o.Vp8 : t === "vp9" ? o.Vp9 : t === "av1" ? o.Av1 : o.Unknown;
|
|
695
695
|
}
|
|
696
696
|
const Zt = {
|
|
697
|
-
[
|
|
698
|
-
[
|
|
699
|
-
[
|
|
700
|
-
[
|
|
701
|
-
[
|
|
697
|
+
[o.Unknown]: [],
|
|
698
|
+
[o.H264]: rt,
|
|
699
|
+
[o.Vp8]: [Yt],
|
|
700
|
+
[o.Vp9]: it,
|
|
701
|
+
[o.Av1]: nt
|
|
702
702
|
};
|
|
703
703
|
function pt(t, e, r, i) {
|
|
704
704
|
const n = t * e, a = $t * (r / xt), s = Math.floor(n * a);
|
|
@@ -706,7 +706,7 @@ function pt(t, e, r, i) {
|
|
|
706
706
|
}
|
|
707
707
|
function te(t, e) {
|
|
708
708
|
const r = [{ width: t, height: e }];
|
|
709
|
-
for (const i of
|
|
709
|
+
for (const i of Wt)
|
|
710
710
|
(i.width < t || i.height < e) && (r.some((n) => n.width === i.width && n.height === i.height) || r.push(i));
|
|
711
711
|
return r;
|
|
712
712
|
}
|
|
@@ -718,48 +718,48 @@ async function ee(t, e, r, i, n, a, s) {
|
|
|
718
718
|
bitrate: n,
|
|
719
719
|
framerate: a,
|
|
720
720
|
latencyMode: "realtime",
|
|
721
|
-
...t ===
|
|
721
|
+
...t === o.H264 ? { avc: { format: "annexb" } } : {}
|
|
722
722
|
};
|
|
723
723
|
if (typeof VideoEncoder?.isConfigSupported != "function")
|
|
724
724
|
return null;
|
|
725
725
|
if (s) {
|
|
726
|
-
const
|
|
726
|
+
const A = { ...I, hardwareAcceleration: s };
|
|
727
727
|
try {
|
|
728
|
-
const
|
|
729
|
-
if (
|
|
730
|
-
const
|
|
731
|
-
return { config:
|
|
728
|
+
const C = await VideoEncoder.isConfigSupported(A);
|
|
729
|
+
if (C.supported) {
|
|
730
|
+
const E = C.config ?? A;
|
|
731
|
+
return { config: E, isHardwareAccelerated: E.hardwareAcceleration === "prefer-hardware" };
|
|
732
732
|
}
|
|
733
733
|
} catch {
|
|
734
734
|
}
|
|
735
735
|
}
|
|
736
736
|
try {
|
|
737
|
-
const
|
|
738
|
-
if (
|
|
739
|
-
return { config:
|
|
737
|
+
const A = await VideoEncoder.isConfigSupported(I);
|
|
738
|
+
if (A.supported)
|
|
739
|
+
return { config: A.config ?? I, isHardwareAccelerated: !1 };
|
|
740
740
|
} catch {
|
|
741
741
|
}
|
|
742
742
|
return null;
|
|
743
743
|
}
|
|
744
744
|
async function X(t, e, r, i) {
|
|
745
|
-
const n = Math.max(1, Math.floor(r?.framerate ?? H)), a = K(r?.preferredCodecs), I = r?.hardwareAcceleration === "preferSoftware" ? ["prefer-software", "prefer-hardware", void 0] : ["prefer-hardware", "prefer-software", void 0],
|
|
746
|
-
let
|
|
745
|
+
const n = Math.max(1, Math.floor(r?.framerate ?? H)), a = K(r?.preferredCodecs), I = r?.hardwareAcceleration === "preferSoftware" ? ["prefer-software", "prefer-hardware", void 0] : ["prefer-hardware", "prefer-software", void 0], A = te(t, e);
|
|
746
|
+
let C = a;
|
|
747
747
|
if (i) {
|
|
748
|
-
const
|
|
749
|
-
[
|
|
750
|
-
[
|
|
751
|
-
[
|
|
752
|
-
[
|
|
748
|
+
const _ = {
|
|
749
|
+
[o.H264]: "h264",
|
|
750
|
+
[o.Vp8]: "vp8",
|
|
751
|
+
[o.Vp9]: "vp9",
|
|
752
|
+
[o.Av1]: "av1"
|
|
753
753
|
}[i];
|
|
754
|
-
|
|
755
|
-
}
|
|
756
|
-
for (const
|
|
757
|
-
const
|
|
758
|
-
for (const
|
|
759
|
-
for (const
|
|
760
|
-
const R = qt(
|
|
761
|
-
for (const f of
|
|
762
|
-
const l = await ee(R, f,
|
|
754
|
+
_ && !a.includes(_) ? C = [_, ...a] : _ && (C = [_, ...a.filter((u) => u !== _)]);
|
|
755
|
+
}
|
|
756
|
+
for (const E of A) {
|
|
757
|
+
const _ = pt(E.width, E.height, n, r?.bitrate);
|
|
758
|
+
for (const u of I)
|
|
759
|
+
for (const T of C) {
|
|
760
|
+
const R = qt(T), h = Zt[R] ?? [];
|
|
761
|
+
for (const f of h) {
|
|
762
|
+
const l = await ee(R, f, E.width, E.height, _, n, u);
|
|
763
763
|
if (l)
|
|
764
764
|
return { codec: R, config: l.config, isHardwareAccelerated: l.isHardwareAccelerated };
|
|
765
765
|
}
|
|
@@ -770,7 +770,7 @@ async function X(t, e, r, i) {
|
|
|
770
770
|
function re(t) {
|
|
771
771
|
return t.byteOffset === 0 && t.byteLength === t.buffer.byteLength ? t.buffer : t.slice().buffer;
|
|
772
772
|
}
|
|
773
|
-
function
|
|
773
|
+
function O(t) {
|
|
774
774
|
if (!S)
|
|
775
775
|
return;
|
|
776
776
|
const e = re(t);
|
|
@@ -836,31 +836,31 @@ async function ae(t) {
|
|
|
836
836
|
throw new Error("Video capture worker missing send port");
|
|
837
837
|
if (U.has(t.captureId))
|
|
838
838
|
return;
|
|
839
|
-
const e = Math.max(1, Math.floor(t.width)), r = Math.max(1, Math.floor(t.height)), i = await X(e, r, t.options), n = Math.max(1, Math.floor(t.options?.keyFrameIntervalFrames ?? kt)), a = i.config.width ?? e, s = i.config.height ?? r, I = i.config.framerate ?? H,
|
|
839
|
+
const e = Math.max(1, Math.floor(t.width)), r = Math.max(1, Math.floor(t.height)), i = await X(e, r, t.options), n = Math.max(1, Math.floor(t.options?.keyFrameIntervalFrames ?? kt)), a = i.config.width ?? e, s = i.config.height ?? r, I = i.config.framerate ?? H, A = i.config.bitrate ?? 0, C = t.trackSettings?.frameRate, E = C ?? I, _ = t.options?.framerate ?? H, u = t.kind === "screen" ? Math.floor(1e6 / _) : 0, T = new VideoEncoder({
|
|
840
840
|
output: (c) => {
|
|
841
|
-
const
|
|
842
|
-
if (!
|
|
841
|
+
const g = U.get(t.captureId);
|
|
842
|
+
if (!g || g.stopped)
|
|
843
843
|
return;
|
|
844
844
|
const b = j(c.byteLength);
|
|
845
845
|
c.copyTo(b);
|
|
846
|
-
const
|
|
846
|
+
const Et = $({
|
|
847
847
|
Data: b,
|
|
848
|
-
FrameNumber:
|
|
848
|
+
FrameNumber: g.frameCounter,
|
|
849
849
|
IsKey: c.type === "key",
|
|
850
850
|
TimestampInUs: BigInt(Math.max(0, Math.round(c.timestamp ?? 0))),
|
|
851
851
|
DurationInUs: Math.max(0, Math.round(c.duration ?? 0))
|
|
852
|
-
}),
|
|
853
|
-
Q(b),
|
|
852
|
+
}), _t = x(Et, g.senderId, { trackId: g.trackId, targetIds: g.targetIds });
|
|
853
|
+
Q(b), O(_t);
|
|
854
854
|
},
|
|
855
855
|
error: (c) => {
|
|
856
856
|
y(c, t.captureId);
|
|
857
857
|
}
|
|
858
858
|
});
|
|
859
|
-
|
|
860
|
-
const R = i.isHardwareAccelerated ? "hardware" : "software",
|
|
861
|
-
|
|
859
|
+
T.configure(i.config);
|
|
860
|
+
const R = i.isHardwareAccelerated ? "hardware" : "software", h = t.kind === "screen" ? `${Math.round(_)}fps (throttled from ${C !== void 0 ? Math.round(C) : "?"}fps)` : C !== void 0 ? `${Math.round(E)}fps (track)` : `${Math.round(I)}fps (configured)`;
|
|
861
|
+
w({
|
|
862
862
|
type: "debug",
|
|
863
|
-
message: `Encoder configured: codec=${i.config.codec}, ${a}x${s}@${
|
|
863
|
+
message: `Encoder configured: codec=${i.config.codec}, ${a}x${s}@${h}, bitrate=${A}bps, hw=${R}`
|
|
864
864
|
});
|
|
865
865
|
const f = t.readable.getReader(), l = {
|
|
866
866
|
captureId: t.captureId,
|
|
@@ -871,9 +871,9 @@ async function ae(t) {
|
|
|
871
871
|
trackId: t.trackId,
|
|
872
872
|
width: a,
|
|
873
873
|
height: s,
|
|
874
|
-
framerate:
|
|
874
|
+
framerate: E,
|
|
875
875
|
codec: i.codec,
|
|
876
|
-
encoder:
|
|
876
|
+
encoder: T,
|
|
877
877
|
encoderConfig: i.config,
|
|
878
878
|
options: t.options,
|
|
879
879
|
reader: f,
|
|
@@ -884,15 +884,15 @@ async function ae(t) {
|
|
|
884
884
|
isReconfiguring: !1,
|
|
885
885
|
isHardwareAccelerated: i.isHardwareAccelerated,
|
|
886
886
|
targetIds: t.options?.targetIds,
|
|
887
|
-
targetFramerate:
|
|
887
|
+
targetFramerate: _,
|
|
888
888
|
lastEncodedTimestamp: 0,
|
|
889
|
-
minFrameIntervalUs:
|
|
889
|
+
minFrameIntervalUs: u
|
|
890
890
|
};
|
|
891
891
|
U.set(t.captureId, l), B.set(t.trackId, t.captureId);
|
|
892
|
-
const G = t.kind === "screen" ?
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
892
|
+
const G = t.kind === "screen" ? _ : E;
|
|
893
|
+
O(
|
|
894
|
+
W(
|
|
895
|
+
Y({
|
|
896
896
|
StreamId: t.streamId,
|
|
897
897
|
Description: `${t.kind}:${t.streamId}`,
|
|
898
898
|
SourceType: t.sourceType,
|
|
@@ -905,7 +905,7 @@ async function ae(t) {
|
|
|
905
905
|
t.senderId,
|
|
906
906
|
{ trackId: t.trackId, targetIds: l.targetIds }
|
|
907
907
|
)
|
|
908
|
-
),
|
|
908
|
+
), w({ type: "started", captureId: t.captureId, codec: l.codec, width: a, height: s }), ne(l);
|
|
909
909
|
}
|
|
910
910
|
async function at(t) {
|
|
911
911
|
const e = U.get(t);
|
|
@@ -919,14 +919,14 @@ async function at(t) {
|
|
|
919
919
|
await e.encoder.flush();
|
|
920
920
|
} catch {
|
|
921
921
|
}
|
|
922
|
-
z(e),
|
|
922
|
+
z(e), O(vt(Ht({}), e.senderId, { trackId: e.trackId, targetIds: e.targetIds })), w({ type: "stopped", captureId: e.captureId });
|
|
923
923
|
}
|
|
924
924
|
}
|
|
925
|
-
async function
|
|
925
|
+
async function Ee(t, e, r) {
|
|
926
926
|
const i = U.get(t);
|
|
927
927
|
if (!i || i.stopped || i.width === e && i.height === r)
|
|
928
928
|
return;
|
|
929
|
-
i.isReconfiguring = !0,
|
|
929
|
+
i.isReconfiguring = !0, w({
|
|
930
930
|
type: "debug",
|
|
931
931
|
message: `Window resize detected: ${i.width}x${i.height} -> ${e}x${r}`
|
|
932
932
|
});
|
|
@@ -937,29 +937,29 @@ async function _e(t, e, r) {
|
|
|
937
937
|
i.width = e, i.height = r;
|
|
938
938
|
const n = await X(e, r, i.options, i.codec);
|
|
939
939
|
z(i), i.codec = n.codec, i.encoderConfig = n.config, i.isHardwareAccelerated = n.isHardwareAccelerated, i.encoder = new VideoEncoder({
|
|
940
|
-
output: (
|
|
941
|
-
const
|
|
942
|
-
if (!
|
|
940
|
+
output: (E) => {
|
|
941
|
+
const _ = U.get(t);
|
|
942
|
+
if (!_ || _.stopped)
|
|
943
943
|
return;
|
|
944
|
-
const
|
|
945
|
-
|
|
946
|
-
const
|
|
947
|
-
Data:
|
|
948
|
-
FrameNumber:
|
|
949
|
-
IsKey:
|
|
950
|
-
TimestampInUs: BigInt(Math.max(0, Math.round(
|
|
951
|
-
DurationInUs: Math.max(0, Math.round(
|
|
952
|
-
}), R = x(
|
|
953
|
-
Q(
|
|
944
|
+
const u = j(E.byteLength);
|
|
945
|
+
E.copyTo(u);
|
|
946
|
+
const T = $({
|
|
947
|
+
Data: u,
|
|
948
|
+
FrameNumber: _.frameCounter,
|
|
949
|
+
IsKey: E.type === "key",
|
|
950
|
+
TimestampInUs: BigInt(Math.max(0, Math.round(E.timestamp ?? 0))),
|
|
951
|
+
DurationInUs: Math.max(0, Math.round(E.duration ?? 0))
|
|
952
|
+
}), R = x(T, _.senderId, { trackId: _.trackId, targetIds: _.targetIds });
|
|
953
|
+
Q(u), O(R);
|
|
954
954
|
},
|
|
955
|
-
error: (
|
|
956
|
-
y(
|
|
955
|
+
error: (E) => {
|
|
956
|
+
y(E, t);
|
|
957
957
|
}
|
|
958
958
|
}), i.encoder.configure(n.config), i.forceKeyframe = !0;
|
|
959
959
|
const a = n.config.width ?? e, s = n.config.height ?? r, I = i.kind === "screen" ? i.targetFramerate : i.framerate;
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
|
|
960
|
+
O(
|
|
961
|
+
W(
|
|
962
|
+
Y({
|
|
963
963
|
StreamId: i.streamId,
|
|
964
964
|
Description: `${i.kind}:${i.streamId}`,
|
|
965
965
|
SourceType: i.sourceType,
|
|
@@ -973,69 +973,69 @@ async function _e(t, e, r) {
|
|
|
973
973
|
{ trackId: i.trackId, targetIds: i.targetIds }
|
|
974
974
|
)
|
|
975
975
|
), i.isReconfiguring = !1;
|
|
976
|
-
const
|
|
977
|
-
|
|
976
|
+
const A = n.isHardwareAccelerated ? "hardware" : "software", C = i.kind === "screen" ? `${Math.round(i.targetFramerate)}fps (throttled)` : `${Math.round(i.framerate)}fps`;
|
|
977
|
+
w({
|
|
978
978
|
type: "debug",
|
|
979
|
-
message: `Encoder reconfigured: codec=${n.config.codec}, ${a}x${s}@${
|
|
979
|
+
message: `Encoder reconfigured: codec=${n.config.codec}, ${a}x${s}@${C}, bitrate=${n.config.bitrate ?? 0}bps, hw=${A}`
|
|
980
980
|
});
|
|
981
981
|
}
|
|
982
|
-
async function
|
|
982
|
+
async function _e(t, e) {
|
|
983
983
|
const r = U.get(t);
|
|
984
984
|
if (!r || r.stopped)
|
|
985
985
|
return;
|
|
986
|
-
const i = K(r.options?.preferredCodecs), n = K(e.preferredCodecs), a = JSON.stringify(i) !== JSON.stringify(n), s = r.options?.bitrate !== e.bitrate, I = r.options?.framerate !== e.framerate,
|
|
987
|
-
if (!a && !s && !I && !
|
|
986
|
+
const i = K(r.options?.preferredCodecs), n = K(e.preferredCodecs), a = JSON.stringify(i) !== JSON.stringify(n), s = r.options?.bitrate !== e.bitrate, I = r.options?.framerate !== e.framerate, A = e.width !== void 0 && r.options?.width !== e.width, C = e.height !== void 0 && r.options?.height !== e.height;
|
|
987
|
+
if (!a && !s && !I && !A && !C)
|
|
988
988
|
return;
|
|
989
|
-
r.isReconfiguring = !0,
|
|
989
|
+
r.isReconfiguring = !0, w({
|
|
990
990
|
type: "debug",
|
|
991
|
-
message: `Options update: codec=${a}, bitrate=${s}, framerate=${I}, width=${
|
|
992
|
-
}), r.options = e, r.kind === "camera" && (
|
|
991
|
+
message: `Options update: codec=${a}, bitrate=${s}, framerate=${I}, width=${A}, height=${C}`
|
|
992
|
+
}), r.options = e, r.kind === "camera" && (A && e.width !== void 0 && (r.width = e.width), C && e.height !== void 0 && (r.height = e.height));
|
|
993
993
|
try {
|
|
994
994
|
await r.encoder.flush();
|
|
995
995
|
} catch {
|
|
996
996
|
}
|
|
997
|
-
const
|
|
998
|
-
z(r), r.codec =
|
|
999
|
-
output: (
|
|
997
|
+
const E = await X(r.width, r.height, e);
|
|
998
|
+
z(r), r.codec = E.codec, r.encoderConfig = E.config, r.isHardwareAccelerated = E.isHardwareAccelerated, r.framerate = E.config.framerate ?? r.framerate, r.encoder = new VideoEncoder({
|
|
999
|
+
output: (h) => {
|
|
1000
1000
|
const f = U.get(t);
|
|
1001
1001
|
if (!f || f.stopped)
|
|
1002
1002
|
return;
|
|
1003
|
-
const l = j(
|
|
1004
|
-
|
|
1003
|
+
const l = j(h.byteLength);
|
|
1004
|
+
h.copyTo(l);
|
|
1005
1005
|
const G = $({
|
|
1006
1006
|
Data: l,
|
|
1007
1007
|
FrameNumber: f.frameCounter,
|
|
1008
|
-
IsKey:
|
|
1009
|
-
TimestampInUs: BigInt(Math.max(0, Math.round(
|
|
1010
|
-
DurationInUs: Math.max(0, Math.round(
|
|
1008
|
+
IsKey: h.type === "key",
|
|
1009
|
+
TimestampInUs: BigInt(Math.max(0, Math.round(h.timestamp ?? 0))),
|
|
1010
|
+
DurationInUs: Math.max(0, Math.round(h.duration ?? 0))
|
|
1011
1011
|
}), c = x(G, f.senderId, { trackId: f.trackId, targetIds: f.targetIds });
|
|
1012
|
-
Q(l),
|
|
1012
|
+
Q(l), O(c);
|
|
1013
1013
|
},
|
|
1014
|
-
error: (
|
|
1015
|
-
y(
|
|
1014
|
+
error: (h) => {
|
|
1015
|
+
y(h, t);
|
|
1016
1016
|
}
|
|
1017
|
-
}), r.encoder.configure(
|
|
1018
|
-
const
|
|
1019
|
-
|
|
1020
|
-
|
|
1021
|
-
|
|
1017
|
+
}), r.encoder.configure(E.config), r.forceKeyframe = !0, r.kind === "screen" && I && e.framerate !== void 0 && (r.targetFramerate = e.framerate, r.minFrameIntervalUs = Math.floor(1e6 / e.framerate), r.lastEncodedTimestamp = 0);
|
|
1018
|
+
const _ = E.config.width ?? r.width, u = E.config.height ?? r.height;
|
|
1019
|
+
O(
|
|
1020
|
+
W(
|
|
1021
|
+
Y({
|
|
1022
1022
|
StreamId: r.streamId,
|
|
1023
1023
|
Description: `${r.kind}:${r.streamId}`,
|
|
1024
1024
|
SourceType: r.sourceType,
|
|
1025
1025
|
Codec: r.codec,
|
|
1026
|
-
CodecDetails:
|
|
1027
|
-
Width:
|
|
1028
|
-
Height:
|
|
1026
|
+
CodecDetails: E.config.codec,
|
|
1027
|
+
Width: _,
|
|
1028
|
+
Height: u,
|
|
1029
1029
|
Framerate: r.kind === "screen" ? r.targetFramerate : r.framerate
|
|
1030
1030
|
}),
|
|
1031
1031
|
r.senderId,
|
|
1032
1032
|
{ trackId: r.trackId, targetIds: r.targetIds }
|
|
1033
1033
|
)
|
|
1034
1034
|
), r.isReconfiguring = !1;
|
|
1035
|
-
const
|
|
1036
|
-
|
|
1035
|
+
const T = E.isHardwareAccelerated ? "hardware" : "software", R = r.kind === "screen" ? `${Math.round(r.targetFramerate)}fps (throttled)` : `${Math.round(r.framerate)}fps`;
|
|
1036
|
+
w({
|
|
1037
1037
|
type: "debug",
|
|
1038
|
-
message: `Encoder reconfigured (options): codec=${
|
|
1038
|
+
message: `Encoder reconfigured (options): codec=${E.config.codec}, ${_}x${u}@${R}, bitrate=${E.config.bitrate ?? 0}bps, hw=${T}`
|
|
1039
1039
|
});
|
|
1040
1040
|
}
|
|
1041
1041
|
function se(t) {
|
|
@@ -1051,12 +1051,12 @@ function se(t) {
|
|
|
1051
1051
|
function Ie() {
|
|
1052
1052
|
for (const t of U.keys())
|
|
1053
1053
|
at(t);
|
|
1054
|
-
if (U.clear(), B.clear(),
|
|
1054
|
+
if (U.clear(), B.clear(), L) {
|
|
1055
1055
|
try {
|
|
1056
|
-
|
|
1056
|
+
L.close();
|
|
1057
1057
|
} catch {
|
|
1058
1058
|
}
|
|
1059
|
-
|
|
1059
|
+
L = null;
|
|
1060
1060
|
}
|
|
1061
1061
|
if (S) {
|
|
1062
1062
|
try {
|
|
@@ -1082,17 +1082,17 @@ self.addEventListener("message", (t) => {
|
|
|
1082
1082
|
return;
|
|
1083
1083
|
}
|
|
1084
1084
|
if (e.type === "attachProtocolPort") {
|
|
1085
|
-
if (
|
|
1085
|
+
if (L)
|
|
1086
1086
|
try {
|
|
1087
|
-
|
|
1087
|
+
L.close();
|
|
1088
1088
|
} catch {
|
|
1089
1089
|
}
|
|
1090
|
-
|
|
1090
|
+
L = e.port, L.addEventListener("message", (r) => {
|
|
1091
1091
|
const i = r.data;
|
|
1092
1092
|
i?.type === "protocol" && i.message instanceof ArrayBuffer && se(i.message);
|
|
1093
1093
|
});
|
|
1094
1094
|
try {
|
|
1095
|
-
|
|
1095
|
+
L.start?.();
|
|
1096
1096
|
} catch {
|
|
1097
1097
|
}
|
|
1098
1098
|
return;
|
|
@@ -1106,11 +1106,11 @@ self.addEventListener("message", (t) => {
|
|
|
1106
1106
|
return;
|
|
1107
1107
|
}
|
|
1108
1108
|
if (e.type === "updateDimensions") {
|
|
1109
|
-
|
|
1109
|
+
Ee(e.captureId, e.width, e.height).catch((r) => y(r, e.captureId));
|
|
1110
1110
|
return;
|
|
1111
1111
|
}
|
|
1112
1112
|
if (e.type === "updateOptions") {
|
|
1113
|
-
|
|
1113
|
+
_e(e.captureId, e.options).catch((r) => y(r, e.captureId));
|
|
1114
1114
|
return;
|
|
1115
1115
|
}
|
|
1116
1116
|
e.type === "dispose" && Ie();
|