@ikonai/sdk 1.0.45 → 1.0.47
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-BnmgtUMV.js → audio-capture-worker-Brmt2Z7a.js} +156 -152
- package/assets/{audio-playback-worker-os3j8TEw.js → audio-playback-worker-CyEW91Py.js} +91 -83
- package/assets/{protocol-worker-CMTcdGdm.js → protocol-worker-9F3vWnC8.js} +456 -455
- package/assets/{video-capture-worker-CUqzL0P7.js → video-capture-worker-_LRzpUOA.js} +152 -143
- package/assets/{video-playback-worker-BoE6foO2.js → video-playback-worker-Dlf8ieLP.js} +61 -53
- package/channel/channel-manager.d.ts +12 -18
- package/channel/channel.d.ts +8 -2
- package/client/endpoint-selector.d.ts +0 -7
- package/client/ikon-client-config.d.ts +18 -3
- package/client/ikon-client.d.ts +23 -1
- package/connection/urls.d.ts +2 -2
- package/index.js +2289 -2096
- package/media/ikon-audio-capture.d.ts +15 -2
- package/media/ikon-video-capture.d.ts +7 -0
- package/package.json +1 -1
- package/transport/transport.d.ts +1 -2
- package/utils/query-params.d.ts +2 -2
- package/webrtc/webrtc-signaling.d.ts +16 -4
|
@@ -11,9 +11,9 @@ function It(t) {
|
|
|
11
11
|
if (27 + A * 4 > e.length)
|
|
12
12
|
throw new Error("Protocol header exceeds payload length");
|
|
13
13
|
const T = [];
|
|
14
|
-
let
|
|
14
|
+
let u = 27;
|
|
15
15
|
for (let h = 0; h < A; h++)
|
|
16
|
-
T.push(r.getUint32(
|
|
16
|
+
T.push(r.getUint32(u, !0)), u += 4;
|
|
17
17
|
return {
|
|
18
18
|
length: i,
|
|
19
19
|
opcode: n,
|
|
@@ -26,16 +26,16 @@ function It(t) {
|
|
|
26
26
|
flags: a
|
|
27
27
|
};
|
|
28
28
|
}
|
|
29
|
-
function
|
|
29
|
+
function K(t, e, r, i, n) {
|
|
30
30
|
const _ = n?.trackId ?? 0, s = n?.sequenceId ?? 0, I = n?.flags ?? 0, A = n?.targetIds ?? [], C = n?.payloadType ?? 8, E = 27 + A.length * 4, a = E + e.length, R = new Uint8Array(a), T = new DataView(R.buffer);
|
|
31
31
|
T.setUint32(0, a, !0), T.setUint32(4, t >>> 0, !0), T.setUint32(8, i >>> 0, !0), T.setUint32(12, _ >>> 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
|
-
let
|
|
32
|
+
let u = 27;
|
|
33
33
|
for (let h = 0; h < A.length; h++)
|
|
34
|
-
T.setUint32(
|
|
34
|
+
T.setUint32(u, A[h] >>> 0, !0), u += 4;
|
|
35
35
|
return R.set(e, E), R;
|
|
36
36
|
}
|
|
37
37
|
var w = /* @__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))(w || {});
|
|
38
|
-
const At = 161, Tt = 162,
|
|
38
|
+
const At = 161, Tt = 162, d = new TextEncoder();
|
|
39
39
|
new TextDecoder("utf-8", { fatal: !0 });
|
|
40
40
|
class F {
|
|
41
41
|
constructor(e = 1) {
|
|
@@ -72,7 +72,7 @@ class F {
|
|
|
72
72
|
this.writeFixedField(e, 14, () => this.buffer.writeBytes(i));
|
|
73
73
|
}
|
|
74
74
|
writeStringField(e, r) {
|
|
75
|
-
const i =
|
|
75
|
+
const i = d.encode(r ?? "");
|
|
76
76
|
this.writeVariableField(e, 12, i);
|
|
77
77
|
}
|
|
78
78
|
writeBinaryField(e, r) {
|
|
@@ -91,7 +91,7 @@ class F {
|
|
|
91
91
|
this.writeVariableField(e, 9, _);
|
|
92
92
|
}
|
|
93
93
|
writeDictionaryField(e, r, i, n) {
|
|
94
|
-
const _ = new
|
|
94
|
+
const _ = new v(r, i);
|
|
95
95
|
n(_);
|
|
96
96
|
const s = _.finish();
|
|
97
97
|
this.writeVariableField(e, 10, s);
|
|
@@ -106,7 +106,7 @@ class F {
|
|
|
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(
|
|
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 {
|
|
@@ -172,7 +172,7 @@ class M {
|
|
|
172
172
|
12
|
|
173
173
|
/* String */
|
|
174
174
|
), this.count++;
|
|
175
|
-
const r =
|
|
175
|
+
const r = d.encode(e ?? "");
|
|
176
176
|
this.payload.writeVarUInt(r.length), this.payload.writeBytes(r);
|
|
177
177
|
}
|
|
178
178
|
writeBinary(e) {
|
|
@@ -206,21 +206,21 @@ class M {
|
|
|
206
206
|
10
|
|
207
207
|
/* Dict */
|
|
208
208
|
), this.count++;
|
|
209
|
-
const n = new
|
|
209
|
+
const n = new v(e, r);
|
|
210
210
|
i(n);
|
|
211
211
|
const _ = n.finish();
|
|
212
212
|
this.payload.writeBytes(_);
|
|
213
213
|
}
|
|
214
214
|
finish() {
|
|
215
215
|
const e = new P();
|
|
216
|
-
return e.writeByte(
|
|
216
|
+
return e.writeByte(V(this.elementType)), e.writeVarUInt(this.count), e.writeBytes(this.payload.toUint8Array()), e.toUint8Array();
|
|
217
217
|
}
|
|
218
218
|
ensureElementType(e) {
|
|
219
219
|
if (this.elementType !== e)
|
|
220
220
|
throw new Error(`Array element type is ${w[this.elementType]}, expected ${w[e]}`);
|
|
221
221
|
}
|
|
222
222
|
}
|
|
223
|
-
class
|
|
223
|
+
class v {
|
|
224
224
|
constructor(e, r) {
|
|
225
225
|
this.keyType = e, this.valueType = r, ht(e);
|
|
226
226
|
}
|
|
@@ -238,7 +238,7 @@ class Y {
|
|
|
238
238
|
if (this.entryOpen)
|
|
239
239
|
throw new Error("Dictionary entry not completed");
|
|
240
240
|
const e = new P();
|
|
241
|
-
return e.writeByte(
|
|
241
|
+
return e.writeByte(V(this.keyType)), e.writeByte(V(this.valueType)), e.writeVarUInt(this.count), e.writeBytes(this.payload.toUint8Array()), e.toUint8Array();
|
|
242
242
|
}
|
|
243
243
|
}
|
|
244
244
|
class Nt {
|
|
@@ -305,7 +305,7 @@ class Nt {
|
|
|
305
305
|
12
|
|
306
306
|
/* String */
|
|
307
307
|
);
|
|
308
|
-
const r =
|
|
308
|
+
const r = d.encode(e ?? "");
|
|
309
309
|
this.payload.writeVarUInt(r.length), this.payload.writeBytes(r), this.keyWritten = !0;
|
|
310
310
|
}
|
|
311
311
|
writeKeyBinary(e) {
|
|
@@ -383,7 +383,7 @@ class Nt {
|
|
|
383
383
|
12
|
|
384
384
|
/* String */
|
|
385
385
|
);
|
|
386
|
-
const r =
|
|
386
|
+
const r = d.encode(e ?? "");
|
|
387
387
|
this.payload.writeVarUInt(r.length), this.payload.writeBytes(r), this.valueWritten = !0;
|
|
388
388
|
}
|
|
389
389
|
writeValueObject(e, r) {
|
|
@@ -411,7 +411,7 @@ class Nt {
|
|
|
411
411
|
10
|
|
412
412
|
/* Dict */
|
|
413
413
|
);
|
|
414
|
-
const n = new
|
|
414
|
+
const n = new v(e, r);
|
|
415
415
|
i(n);
|
|
416
416
|
const _ = n.finish();
|
|
417
417
|
this.payload.writeBytes(_), this.valueWritten = !0;
|
|
@@ -554,7 +554,7 @@ class P {
|
|
|
554
554
|
return this.buffer.slice(0, this.length);
|
|
555
555
|
}
|
|
556
556
|
}
|
|
557
|
-
function
|
|
557
|
+
function V(t, e = 0) {
|
|
558
558
|
if ((e & 240) !== 0)
|
|
559
559
|
throw new Error("Teleport flags must fit into 4 bits");
|
|
560
560
|
return (t & 15) << 4 | e & 15;
|
|
@@ -572,9 +572,9 @@ function J(t) {
|
|
|
572
572
|
function Rt(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.CORE_RELAY_AGENT_AUTH = 65576] = "CORE_RELAY_AGENT_AUTH", t[t.CORE_RELAY_AGENT_AUTH_RESULT = 65577] = "CORE_RELAY_AGENT_AUTH_RESULT", 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.CORE_RELAY_ADD_TUNNEL = 65583] = "CORE_RELAY_ADD_TUNNEL", t[t.CORE_RELAY_TUNNEL_ADDED = 65584] = "CORE_RELAY_TUNNEL_ADDED", t[t.CORE_RELAY_REMOVE_TUNNEL = 65585] = "CORE_RELAY_REMOVE_TUNNEL", 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.ANALYTICS_IKON_TURN_SERVER_STATS = 524298] = "ANALYTICS_IKON_TURN_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.GROUP_APP_LOCAL = 1073741824] = "GROUP_APP_LOCAL", t[t.CONSTANT_GROUP_MASK = 2147418112] = "CONSTANT_GROUP_MASK", t))(Z || {});
|
|
576
|
-
const p = 1,
|
|
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_WEBRTC_VIDEO_CAPTURE = 65572] = "CORE_WEBRTC_VIDEO_CAPTURE", t[t.CORE_RELAY_AGENT_AUTH = 65576] = "CORE_RELAY_AGENT_AUTH", t[t.CORE_RELAY_AGENT_AUTH_RESULT = 65577] = "CORE_RELAY_AGENT_AUTH_RESULT", 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.CORE_RELAY_ADD_TUNNEL = 65583] = "CORE_RELAY_ADD_TUNNEL", t[t.CORE_RELAY_TUNNEL_ADDED = 65584] = "CORE_RELAY_TUNNEL_ADDED", t[t.CORE_RELAY_REMOVE_TUNNEL = 65585] = "CORE_RELAY_REMOVE_TUNNEL", 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.ANALYTICS_IKON_TURN_SERVER_STATS = 524298] = "ANALYTICS_IKON_TURN_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.ACTION_CALL_ACK = 1048652] = "ACTION_CALL_ACK", 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.GROUP_APP_LOCAL = 1073741824] = "GROUP_APP_LOCAL", t[t.CONSTANT_GROUP_MASK = 2147418112] = "CONSTANT_GROUP_MASK", t))(Z || {});
|
|
576
|
+
const p = 1, ot = 8388611, ut = 271275304, lt = 2541432218, Ut = 2986785889, ft = 3105403172, St = 3456383222;
|
|
577
|
+
function Y(t) {
|
|
578
578
|
const e = {};
|
|
579
579
|
return Lt(e), t && Object.assign(e, t), e;
|
|
580
580
|
}
|
|
@@ -586,44 +586,46 @@ function yt(t) {
|
|
|
586
586
|
return ct(t, e), e.finish();
|
|
587
587
|
}
|
|
588
588
|
function ct(t, e) {
|
|
589
|
-
e.writeUInt64Field(
|
|
589
|
+
e.writeUInt64Field(ut, t.TimestampInUs), e.writeUInt32Field(lt, t.DurationInUs >>> 0), e.writeBinaryField(Ut, t.Data), e.writeBoolField(ft, t.IsKey), e.writeInt32Field(St, t.FrameNumber | 0);
|
|
590
590
|
}
|
|
591
|
-
function
|
|
591
|
+
function k(t, e, r) {
|
|
592
592
|
const i = yt(t);
|
|
593
|
-
return
|
|
593
|
+
return K(ot, i, p, e, r);
|
|
594
594
|
}
|
|
595
|
-
const tt =
|
|
596
|
-
function
|
|
595
|
+
const tt = 6, Dt = 8388609, wt = 161083277, Pt = 164808083, Ot = 1368629611, Ft = 2514959030, gt = 2745379226, mt = 2950031986, dt = 3282782683, Vt = 3284746250, Mt = 4065070594;
|
|
596
|
+
function W(t) {
|
|
597
597
|
const e = {};
|
|
598
|
-
return
|
|
599
|
-
}
|
|
600
|
-
function Mt(t) {
|
|
601
|
-
return t.StreamId = "", t.Description = "", t.SourceType = "", t.Codec = u.H264, t.CodecDetails = "", t.Width = 0, t.Height = 0, t.Framerate = 30, t;
|
|
598
|
+
return Bt(e), t && Object.assign(e, t), e;
|
|
602
599
|
}
|
|
603
600
|
function Bt(t) {
|
|
601
|
+
return t.StreamId = "", t.Description = "", t.SourceType = "", t.Codec = o.H264, t.CodecDetails = "", t.Width = 0, t.Height = 0, t.Framerate = 30, t.CorrelationId = void 0, t;
|
|
602
|
+
}
|
|
603
|
+
function Gt(t) {
|
|
604
604
|
const e = new F(tt);
|
|
605
|
-
return
|
|
605
|
+
return bt(t, e), e.finish();
|
|
606
606
|
}
|
|
607
|
-
function
|
|
608
|
-
e.writeStringField(wt, t.StreamId), e.writeFloat64Field(Pt, t.Framerate), e.writeStringField(Ot, t.Description)
|
|
607
|
+
function bt(t, e) {
|
|
608
|
+
e.writeStringField(wt, t.StreamId), e.writeFloat64Field(Pt, t.Framerate), e.writeStringField(Ot, t.Description);
|
|
609
|
+
const r = t.CorrelationId;
|
|
610
|
+
r != null && e.writeStringField(Ft, r), e.writeStringField(gt, t.CodecDetails), e.writeInt32Field(mt, t.Height | 0), e.writeStringField(dt, t.SourceType), e.writeInt32Field(Vt, t.Codec), e.writeInt32Field(Mt, t.Width | 0);
|
|
609
611
|
}
|
|
610
|
-
function
|
|
611
|
-
const i =
|
|
612
|
-
return
|
|
612
|
+
function $(t, e, r) {
|
|
613
|
+
const i = Gt(t);
|
|
614
|
+
return K(Dt, i, tt, e, r);
|
|
613
615
|
}
|
|
614
|
-
const et = 1,
|
|
615
|
-
function
|
|
616
|
+
const et = 1, Ht = 8388610;
|
|
617
|
+
function Kt(t) {
|
|
616
618
|
const e = {};
|
|
617
619
|
return t && Object.assign(e, t), e;
|
|
618
620
|
}
|
|
619
|
-
function
|
|
621
|
+
function vt(t) {
|
|
620
622
|
return new F(et).finish();
|
|
621
623
|
}
|
|
622
|
-
function
|
|
623
|
-
const i =
|
|
624
|
-
return
|
|
624
|
+
function Yt(t, e, r) {
|
|
625
|
+
const i = vt();
|
|
626
|
+
return K(Ht, i, et, e, r);
|
|
625
627
|
}
|
|
626
|
-
const
|
|
628
|
+
const b = 30, kt = 90, rt = [
|
|
627
629
|
"avc1.42001f",
|
|
628
630
|
// Baseline L3.1 (720p60, 1080p30)
|
|
629
631
|
"avc1.4d001f",
|
|
@@ -638,7 +640,7 @@ const H = 30, Yt = 90, rt = [
|
|
|
638
640
|
// Main L4.0 (1080p)
|
|
639
641
|
];
|
|
640
642
|
rt[0];
|
|
641
|
-
const
|
|
643
|
+
const Wt = "vp8", it = [
|
|
642
644
|
"vp09.00.10.08",
|
|
643
645
|
// Profile 0, Level 1.0, 8-bit (most compatible)
|
|
644
646
|
"vp09.00.20.08",
|
|
@@ -660,7 +662,7 @@ const nt = [
|
|
|
660
662
|
// Main profile, Level 2.0, 8-bit (lower res fallback)
|
|
661
663
|
];
|
|
662
664
|
nt[0];
|
|
663
|
-
const q = ["h264", "vp8", "vp9", "av1"],
|
|
665
|
+
const q = ["h264", "vp8", "vp9", "av1"], $t = [
|
|
664
666
|
{ width: 1920, height: 1080 },
|
|
665
667
|
// 1080p
|
|
666
668
|
{ width: 1280, height: 720 },
|
|
@@ -671,13 +673,13 @@ const q = ["h264", "vp8", "vp9", "av1"], Wt = [
|
|
|
671
673
|
// 480p (VGA)
|
|
672
674
|
{ width: 640, height: 360 }
|
|
673
675
|
// 360p
|
|
674
|
-
],
|
|
676
|
+
], xt = 0.1, Xt = 30, jt = 5e4, Qt = 5e5, zt = 8e6, Jt = 8, qt = 3, D = (t) => self.postMessage(t);
|
|
675
677
|
let S = null, c = null;
|
|
676
678
|
function y(t, e) {
|
|
677
679
|
const r = t instanceof Error ? t : new Error(String(t));
|
|
678
680
|
D({ type: "error", captureId: e, error: { name: r.name, message: r.message, stack: r.stack } });
|
|
679
681
|
}
|
|
680
|
-
function
|
|
682
|
+
function H(t) {
|
|
681
683
|
if (!Array.isArray(t) || t.length === 0)
|
|
682
684
|
return q.slice();
|
|
683
685
|
const e = [];
|
|
@@ -690,27 +692,27 @@ function K(t) {
|
|
|
690
692
|
r.add(i);
|
|
691
693
|
return Array.from(r);
|
|
692
694
|
}
|
|
693
|
-
function
|
|
694
|
-
return t === "h264" ?
|
|
695
|
+
function Zt(t) {
|
|
696
|
+
return t === "h264" ? o.H264 : t === "vp8" ? o.Vp8 : t === "vp9" ? o.Vp9 : t === "av1" ? o.Av1 : o.Unknown;
|
|
695
697
|
}
|
|
696
|
-
const
|
|
697
|
-
[
|
|
698
|
-
[
|
|
699
|
-
[
|
|
700
|
-
[
|
|
701
|
-
[
|
|
698
|
+
const pt = {
|
|
699
|
+
[o.Unknown]: [],
|
|
700
|
+
[o.H264]: rt,
|
|
701
|
+
[o.Vp8]: [Wt],
|
|
702
|
+
[o.Vp9]: it,
|
|
703
|
+
[o.Av1]: nt
|
|
702
704
|
};
|
|
703
|
-
function
|
|
704
|
-
const n = t * e, _ =
|
|
705
|
-
return Math.max(
|
|
705
|
+
function te(t, e, r, i) {
|
|
706
|
+
const n = t * e, _ = xt * (r / Xt), s = Math.floor(n * _);
|
|
707
|
+
return Math.max(jt, Math.floor(i ?? Math.max(Qt, Math.min(s, zt))));
|
|
706
708
|
}
|
|
707
|
-
function
|
|
709
|
+
function ee(t, e) {
|
|
708
710
|
const r = [{ width: t, height: e }];
|
|
709
|
-
for (const i of
|
|
711
|
+
for (const i of $t)
|
|
710
712
|
(i.width < t || i.height < e) && (r.some((n) => n.width === i.width && n.height === i.height) || r.push(i));
|
|
711
713
|
return r;
|
|
712
714
|
}
|
|
713
|
-
async function
|
|
715
|
+
async function re(t, e, r, i, n, _, s) {
|
|
714
716
|
const I = {
|
|
715
717
|
codec: e,
|
|
716
718
|
width: r,
|
|
@@ -718,7 +720,7 @@ async function ee(t, e, r, i, n, _, s) {
|
|
|
718
720
|
bitrate: n,
|
|
719
721
|
framerate: _,
|
|
720
722
|
latencyMode: "realtime",
|
|
721
|
-
...t ===
|
|
723
|
+
...t === o.H264 ? { avc: { format: "annexb" } } : {}
|
|
722
724
|
};
|
|
723
725
|
if (typeof VideoEncoder?.isConfigSupported != "function")
|
|
724
726
|
return null;
|
|
@@ -741,42 +743,42 @@ async function ee(t, e, r, i, n, _, s) {
|
|
|
741
743
|
}
|
|
742
744
|
return null;
|
|
743
745
|
}
|
|
744
|
-
async function
|
|
745
|
-
const n = Math.max(1, Math.floor(r?.framerate ??
|
|
746
|
+
async function x(t, e, r, i) {
|
|
747
|
+
const n = Math.max(1, Math.floor(r?.framerate ?? b)), _ = H(r?.preferredCodecs), I = r?.hardwareAcceleration === "preferSoftware" ? ["prefer-software", "prefer-hardware", void 0] : ["prefer-hardware", "prefer-software", void 0], A = ee(t, e);
|
|
746
748
|
let C = _;
|
|
747
749
|
if (i) {
|
|
748
750
|
const a = {
|
|
749
|
-
[
|
|
750
|
-
[
|
|
751
|
-
[
|
|
752
|
-
[
|
|
751
|
+
[o.H264]: "h264",
|
|
752
|
+
[o.Vp8]: "vp8",
|
|
753
|
+
[o.Vp9]: "vp9",
|
|
754
|
+
[o.Av1]: "av1"
|
|
753
755
|
}[i];
|
|
754
756
|
a && !_.includes(a) ? C = [a, ..._] : a && (C = [a, ..._.filter((R) => R !== a)]);
|
|
755
757
|
}
|
|
756
758
|
for (const E of A) {
|
|
757
|
-
const a =
|
|
759
|
+
const a = te(E.width, E.height, n, r?.bitrate);
|
|
758
760
|
for (const R of I)
|
|
759
761
|
for (const T of C) {
|
|
760
|
-
const
|
|
762
|
+
const u = Zt(T), h = pt[u] ?? [];
|
|
761
763
|
for (const f of h) {
|
|
762
|
-
const
|
|
763
|
-
if (
|
|
764
|
-
return { codec:
|
|
764
|
+
const l = await re(u, f, E.width, E.height, a, n, R);
|
|
765
|
+
if (l)
|
|
766
|
+
return { codec: u, config: l.config, isHardwareAccelerated: l.isHardwareAccelerated };
|
|
765
767
|
}
|
|
766
768
|
}
|
|
767
769
|
}
|
|
768
770
|
throw new Error("No supported video encoder configuration");
|
|
769
771
|
}
|
|
770
|
-
function
|
|
772
|
+
function ie(t) {
|
|
771
773
|
return t.byteOffset === 0 && t.byteLength === t.buffer.byteLength ? t.buffer : t.slice().buffer;
|
|
772
774
|
}
|
|
773
775
|
function O(t) {
|
|
774
776
|
if (!S)
|
|
775
777
|
return;
|
|
776
|
-
const e =
|
|
778
|
+
const e = ie(t);
|
|
777
779
|
S.postMessage({ type: "send", message: e }, [e]);
|
|
778
780
|
}
|
|
779
|
-
const
|
|
781
|
+
const U = /* @__PURE__ */ new Map(), X = /* @__PURE__ */ new Map(), m = [];
|
|
780
782
|
function j(t) {
|
|
781
783
|
for (let e = 0; e < m.length; e++)
|
|
782
784
|
if (m[e].length >= t) {
|
|
@@ -786,7 +788,7 @@ function j(t) {
|
|
|
786
788
|
return new Uint8Array(t);
|
|
787
789
|
}
|
|
788
790
|
function Q(t) {
|
|
789
|
-
m.length <
|
|
791
|
+
m.length < Jt && t.buffer.byteLength > 0 && m.push(new Uint8Array(t.buffer));
|
|
790
792
|
}
|
|
791
793
|
function z(t) {
|
|
792
794
|
try {
|
|
@@ -794,7 +796,7 @@ function z(t) {
|
|
|
794
796
|
} catch {
|
|
795
797
|
}
|
|
796
798
|
}
|
|
797
|
-
function
|
|
799
|
+
function ne(t, e) {
|
|
798
800
|
try {
|
|
799
801
|
if (t.stopped || t.isReconfiguring)
|
|
800
802
|
return;
|
|
@@ -804,7 +806,7 @@ function ie(t, e) {
|
|
|
804
806
|
return;
|
|
805
807
|
t.lastEncodedTimestamp = i;
|
|
806
808
|
}
|
|
807
|
-
if (t.encoder.encodeQueueSize >
|
|
809
|
+
if (t.encoder.encodeQueueSize > qt)
|
|
808
810
|
return;
|
|
809
811
|
t.frameCounter += 1;
|
|
810
812
|
const r = t.forceKeyframe || t.frameCounter > 0 && t.frameCounter % t.keyFrameIntervalFrames === 0;
|
|
@@ -818,51 +820,51 @@ function ie(t, e) {
|
|
|
818
820
|
}
|
|
819
821
|
}
|
|
820
822
|
}
|
|
821
|
-
async function
|
|
823
|
+
async function _e(t) {
|
|
822
824
|
try {
|
|
823
825
|
for (; !t.stopped; ) {
|
|
824
826
|
const e = await t.reader.read();
|
|
825
827
|
if (e.done)
|
|
826
828
|
break;
|
|
827
829
|
const r = e.value;
|
|
828
|
-
r &&
|
|
830
|
+
r && ne(t, r);
|
|
829
831
|
}
|
|
830
832
|
} catch (e) {
|
|
831
833
|
t.stopped || y(e, t.captureId);
|
|
832
834
|
}
|
|
833
835
|
}
|
|
834
|
-
async function
|
|
836
|
+
async function Ee(t) {
|
|
835
837
|
if (!S)
|
|
836
838
|
throw new Error("Video capture worker missing send port");
|
|
837
|
-
if (
|
|
839
|
+
if (U.has(t.captureId))
|
|
838
840
|
return;
|
|
839
|
-
const e = Math.max(1, Math.floor(t.width)), r = Math.max(1, Math.floor(t.height)), i = await
|
|
841
|
+
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)), _ = i.config.width ?? e, s = i.config.height ?? r, I = i.config.framerate ?? b, A = i.config.bitrate ?? 0, C = t.trackSettings?.frameRate, E = C ?? I, a = t.options?.framerate ?? b, R = t.kind === "screen" ? Math.floor(1e6 / a) : 0, T = new VideoEncoder({
|
|
840
842
|
output: (L) => {
|
|
841
|
-
const g =
|
|
843
|
+
const g = U.get(t.captureId);
|
|
842
844
|
if (!g || g.stopped)
|
|
843
845
|
return;
|
|
844
|
-
const
|
|
845
|
-
L.copyTo(
|
|
846
|
-
const Et =
|
|
847
|
-
Data:
|
|
846
|
+
const G = j(L.byteLength);
|
|
847
|
+
L.copyTo(G);
|
|
848
|
+
const Et = Y({
|
|
849
|
+
Data: G,
|
|
848
850
|
FrameNumber: g.frameCounter,
|
|
849
851
|
IsKey: L.type === "key",
|
|
850
852
|
TimestampInUs: BigInt(Math.max(0, Math.round(L.timestamp ?? 0))),
|
|
851
853
|
DurationInUs: Math.max(0, Math.round(L.duration ?? 0))
|
|
852
|
-
}), at =
|
|
853
|
-
Q(
|
|
854
|
+
}), at = k(Et, g.senderId, { trackId: g.trackId, targetIds: g.targetIds });
|
|
855
|
+
Q(G), O(at);
|
|
854
856
|
},
|
|
855
857
|
error: (L) => {
|
|
856
858
|
y(L, t.captureId);
|
|
857
859
|
}
|
|
858
860
|
});
|
|
859
861
|
T.configure(i.config);
|
|
860
|
-
const
|
|
862
|
+
const u = i.isHardwareAccelerated ? "hardware" : "software", h = t.kind === "screen" ? `${Math.round(a)}fps (throttled from ${C !== void 0 ? Math.round(C) : "?"}fps)` : C !== void 0 ? `${Math.round(E)}fps (track)` : `${Math.round(I)}fps (configured)`;
|
|
861
863
|
D({
|
|
862
864
|
type: "debug",
|
|
863
|
-
message: `Encoder configured: codec=${i.config.codec}, ${_}x${s}@${h}, bitrate=${A}bps, hw=${
|
|
865
|
+
message: `Encoder configured: codec=${i.config.codec}, ${_}x${s}@${h}, bitrate=${A}bps, hw=${u}`
|
|
864
866
|
});
|
|
865
|
-
const f = t.readable.getReader(),
|
|
867
|
+
const f = t.readable.getReader(), l = {
|
|
866
868
|
captureId: t.captureId,
|
|
867
869
|
streamId: t.streamId,
|
|
868
870
|
sourceType: t.sourceType,
|
|
@@ -876,6 +878,7 @@ async function _e(t) {
|
|
|
876
878
|
encoder: T,
|
|
877
879
|
encoderConfig: i.config,
|
|
878
880
|
options: t.options,
|
|
881
|
+
correlationId: t.correlationId,
|
|
879
882
|
reader: f,
|
|
880
883
|
frameCounter: 0,
|
|
881
884
|
keyFrameIntervalFrames: n,
|
|
@@ -888,29 +891,30 @@ async function _e(t) {
|
|
|
888
891
|
lastEncodedTimestamp: 0,
|
|
889
892
|
minFrameIntervalUs: R
|
|
890
893
|
};
|
|
891
|
-
|
|
892
|
-
const
|
|
894
|
+
U.set(t.captureId, l), X.set(t.trackId, t.captureId);
|
|
895
|
+
const B = t.kind === "screen" ? a : E;
|
|
893
896
|
O(
|
|
894
|
-
|
|
895
|
-
|
|
897
|
+
$(
|
|
898
|
+
W({
|
|
896
899
|
StreamId: t.streamId,
|
|
897
900
|
Description: `${t.kind}:${t.streamId}`,
|
|
898
901
|
SourceType: t.sourceType,
|
|
899
|
-
Codec:
|
|
902
|
+
Codec: l.codec,
|
|
900
903
|
CodecDetails: i.config.codec,
|
|
901
904
|
Width: _,
|
|
902
905
|
Height: s,
|
|
903
|
-
Framerate:
|
|
906
|
+
Framerate: B,
|
|
907
|
+
CorrelationId: t.correlationId
|
|
904
908
|
}),
|
|
905
909
|
t.senderId,
|
|
906
|
-
{ trackId: t.trackId, targetIds:
|
|
910
|
+
{ trackId: t.trackId, targetIds: l.targetIds }
|
|
907
911
|
)
|
|
908
|
-
), D({ type: "started", captureId: t.captureId, codec:
|
|
912
|
+
), D({ type: "started", captureId: t.captureId, codec: l.codec, width: _, height: s }), _e(l);
|
|
909
913
|
}
|
|
910
914
|
async function _t(t) {
|
|
911
|
-
const e =
|
|
915
|
+
const e = U.get(t);
|
|
912
916
|
if (e) {
|
|
913
|
-
e.stopped = !0,
|
|
917
|
+
e.stopped = !0, U.delete(t), X.delete(e.trackId);
|
|
914
918
|
try {
|
|
915
919
|
await e.reader.cancel();
|
|
916
920
|
} catch {
|
|
@@ -919,11 +923,11 @@ async function _t(t) {
|
|
|
919
923
|
await e.encoder.flush();
|
|
920
924
|
} catch {
|
|
921
925
|
}
|
|
922
|
-
z(e), O(
|
|
926
|
+
z(e), O(Yt(Kt({}), e.senderId, { trackId: e.trackId, targetIds: e.targetIds })), D({ type: "stopped", captureId: e.captureId });
|
|
923
927
|
}
|
|
924
928
|
}
|
|
925
|
-
async function
|
|
926
|
-
const i =
|
|
929
|
+
async function ae(t, e, r) {
|
|
930
|
+
const i = U.get(t);
|
|
927
931
|
if (!i || i.stopped || i.width === e && i.height === r)
|
|
928
932
|
return;
|
|
929
933
|
i.isReconfiguring = !0, D({
|
|
@@ -935,22 +939,22 @@ async function Ee(t, e, r) {
|
|
|
935
939
|
} catch {
|
|
936
940
|
}
|
|
937
941
|
i.width = e, i.height = r;
|
|
938
|
-
const n = await
|
|
942
|
+
const n = await x(e, r, i.options, i.codec);
|
|
939
943
|
z(i), i.codec = n.codec, i.encoderConfig = n.config, i.isHardwareAccelerated = n.isHardwareAccelerated, i.encoder = new VideoEncoder({
|
|
940
944
|
output: (E) => {
|
|
941
|
-
const a =
|
|
945
|
+
const a = U.get(t);
|
|
942
946
|
if (!a || a.stopped)
|
|
943
947
|
return;
|
|
944
948
|
const R = j(E.byteLength);
|
|
945
949
|
E.copyTo(R);
|
|
946
|
-
const T =
|
|
950
|
+
const T = Y({
|
|
947
951
|
Data: R,
|
|
948
952
|
FrameNumber: a.frameCounter,
|
|
949
953
|
IsKey: E.type === "key",
|
|
950
954
|
TimestampInUs: BigInt(Math.max(0, Math.round(E.timestamp ?? 0))),
|
|
951
955
|
DurationInUs: Math.max(0, Math.round(E.duration ?? 0))
|
|
952
|
-
}),
|
|
953
|
-
Q(R), O(
|
|
956
|
+
}), u = k(T, a.senderId, { trackId: a.trackId, targetIds: a.targetIds });
|
|
957
|
+
Q(R), O(u);
|
|
954
958
|
},
|
|
955
959
|
error: (E) => {
|
|
956
960
|
y(E, t);
|
|
@@ -958,8 +962,8 @@ async function Ee(t, e, r) {
|
|
|
958
962
|
}), i.encoder.configure(n.config), i.forceKeyframe = !0;
|
|
959
963
|
const _ = n.config.width ?? e, s = n.config.height ?? r, I = i.kind === "screen" ? i.targetFramerate : i.framerate;
|
|
960
964
|
O(
|
|
961
|
-
|
|
962
|
-
|
|
965
|
+
$(
|
|
966
|
+
W({
|
|
963
967
|
StreamId: i.streamId,
|
|
964
968
|
Description: `${i.kind}:${i.streamId}`,
|
|
965
969
|
SourceType: i.sourceType,
|
|
@@ -967,7 +971,8 @@ async function Ee(t, e, r) {
|
|
|
967
971
|
CodecDetails: n.config.codec,
|
|
968
972
|
Width: _,
|
|
969
973
|
Height: s,
|
|
970
|
-
Framerate: I
|
|
974
|
+
Framerate: I,
|
|
975
|
+
CorrelationId: i.correlationId
|
|
971
976
|
}),
|
|
972
977
|
i.senderId,
|
|
973
978
|
{ trackId: i.trackId, targetIds: i.targetIds }
|
|
@@ -979,11 +984,11 @@ async function Ee(t, e, r) {
|
|
|
979
984
|
message: `Encoder reconfigured: codec=${n.config.codec}, ${_}x${s}@${C}, bitrate=${n.config.bitrate ?? 0}bps, hw=${A}`
|
|
980
985
|
});
|
|
981
986
|
}
|
|
982
|
-
async function
|
|
983
|
-
const r =
|
|
987
|
+
async function se(t, e) {
|
|
988
|
+
const r = U.get(t);
|
|
984
989
|
if (!r || r.stopped)
|
|
985
990
|
return;
|
|
986
|
-
const i =
|
|
991
|
+
const i = H(r.options?.preferredCodecs), n = H(e.preferredCodecs), _ = 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
992
|
if (!_ && !s && !I && !A && !C)
|
|
988
993
|
return;
|
|
989
994
|
r.isReconfiguring = !0, D({
|
|
@@ -994,22 +999,22 @@ async function ae(t, e) {
|
|
|
994
999
|
await r.encoder.flush();
|
|
995
1000
|
} catch {
|
|
996
1001
|
}
|
|
997
|
-
const E = await
|
|
1002
|
+
const E = await x(r.width, r.height, e);
|
|
998
1003
|
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
1004
|
output: (h) => {
|
|
1000
|
-
const f =
|
|
1005
|
+
const f = U.get(t);
|
|
1001
1006
|
if (!f || f.stopped)
|
|
1002
1007
|
return;
|
|
1003
|
-
const
|
|
1004
|
-
h.copyTo(
|
|
1005
|
-
const
|
|
1006
|
-
Data:
|
|
1008
|
+
const l = j(h.byteLength);
|
|
1009
|
+
h.copyTo(l);
|
|
1010
|
+
const B = Y({
|
|
1011
|
+
Data: l,
|
|
1007
1012
|
FrameNumber: f.frameCounter,
|
|
1008
1013
|
IsKey: h.type === "key",
|
|
1009
1014
|
TimestampInUs: BigInt(Math.max(0, Math.round(h.timestamp ?? 0))),
|
|
1010
1015
|
DurationInUs: Math.max(0, Math.round(h.duration ?? 0))
|
|
1011
|
-
}), L =
|
|
1012
|
-
Q(
|
|
1016
|
+
}), L = k(B, f.senderId, { trackId: f.trackId, targetIds: f.targetIds });
|
|
1017
|
+
Q(l), O(L);
|
|
1013
1018
|
},
|
|
1014
1019
|
error: (h) => {
|
|
1015
1020
|
y(h, t);
|
|
@@ -1017,8 +1022,8 @@ async function ae(t, e) {
|
|
|
1017
1022
|
}), 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
1023
|
const a = E.config.width ?? r.width, R = E.config.height ?? r.height;
|
|
1019
1024
|
O(
|
|
1020
|
-
|
|
1021
|
-
|
|
1025
|
+
$(
|
|
1026
|
+
W({
|
|
1022
1027
|
StreamId: r.streamId,
|
|
1023
1028
|
Description: `${r.kind}:${r.streamId}`,
|
|
1024
1029
|
SourceType: r.sourceType,
|
|
@@ -1026,32 +1031,35 @@ async function ae(t, e) {
|
|
|
1026
1031
|
CodecDetails: E.config.codec,
|
|
1027
1032
|
Width: a,
|
|
1028
1033
|
Height: R,
|
|
1029
|
-
Framerate: r.kind === "screen" ? r.targetFramerate : r.framerate
|
|
1034
|
+
Framerate: r.kind === "screen" ? r.targetFramerate : r.framerate,
|
|
1035
|
+
CorrelationId: r.correlationId
|
|
1030
1036
|
}),
|
|
1031
1037
|
r.senderId,
|
|
1032
1038
|
{ trackId: r.trackId, targetIds: r.targetIds }
|
|
1033
1039
|
)
|
|
1034
1040
|
), r.isReconfiguring = !1;
|
|
1035
|
-
const T = E.isHardwareAccelerated ? "hardware" : "software",
|
|
1041
|
+
const T = E.isHardwareAccelerated ? "hardware" : "software", u = r.kind === "screen" ? `${Math.round(r.targetFramerate)}fps (throttled)` : `${Math.round(r.framerate)}fps`;
|
|
1036
1042
|
D({
|
|
1037
1043
|
type: "debug",
|
|
1038
|
-
message: `Encoder reconfigured (options): codec=${E.config.codec}, ${a}x${R}@${
|
|
1044
|
+
message: `Encoder reconfigured (options): codec=${E.config.codec}, ${a}x${R}@${u}, bitrate=${E.config.bitrate ?? 0}bps, hw=${T}`
|
|
1039
1045
|
});
|
|
1040
1046
|
}
|
|
1041
|
-
function
|
|
1047
|
+
function Ie(t) {
|
|
1042
1048
|
const e = new Uint8Array(t);
|
|
1043
1049
|
if (st(e) !== Z.VIDEO_REQUEST_IDR_FRAME)
|
|
1044
1050
|
return;
|
|
1045
|
-
const i = It(e), n =
|
|
1051
|
+
const i = It(e), n = X.get(i.trackId);
|
|
1046
1052
|
if (!n)
|
|
1047
1053
|
return;
|
|
1048
|
-
const _ =
|
|
1054
|
+
const _ = U.get(n);
|
|
1049
1055
|
_ && (_.forceKeyframe = !0);
|
|
1050
1056
|
}
|
|
1051
|
-
function
|
|
1052
|
-
|
|
1053
|
-
_t(
|
|
1054
|
-
|
|
1057
|
+
async function Ae() {
|
|
1058
|
+
const t = Array.from(U.keys()).map(
|
|
1059
|
+
(e) => _t(e).catch(() => {
|
|
1060
|
+
})
|
|
1061
|
+
);
|
|
1062
|
+
if (await Promise.all(t), c) {
|
|
1055
1063
|
try {
|
|
1056
1064
|
c.close();
|
|
1057
1065
|
} catch {
|
|
@@ -1089,7 +1097,7 @@ self.addEventListener("message", (t) => {
|
|
|
1089
1097
|
}
|
|
1090
1098
|
c = e.port, c.addEventListener("message", (r) => {
|
|
1091
1099
|
const i = r.data;
|
|
1092
|
-
i?.type === "protocol" && i.message instanceof ArrayBuffer &&
|
|
1100
|
+
i?.type === "protocol" && i.message instanceof ArrayBuffer && Ie(i.message);
|
|
1093
1101
|
});
|
|
1094
1102
|
try {
|
|
1095
1103
|
c.start?.();
|
|
@@ -1098,7 +1106,7 @@ self.addEventListener("message", (t) => {
|
|
|
1098
1106
|
return;
|
|
1099
1107
|
}
|
|
1100
1108
|
if (e.type === "start") {
|
|
1101
|
-
|
|
1109
|
+
Ee(e).catch((r) => y(r, e.captureId));
|
|
1102
1110
|
return;
|
|
1103
1111
|
}
|
|
1104
1112
|
if (e.type === "stop") {
|
|
@@ -1106,12 +1114,13 @@ self.addEventListener("message", (t) => {
|
|
|
1106
1114
|
return;
|
|
1107
1115
|
}
|
|
1108
1116
|
if (e.type === "updateDimensions") {
|
|
1109
|
-
|
|
1117
|
+
ae(e.captureId, e.width, e.height).catch((r) => y(r, e.captureId));
|
|
1110
1118
|
return;
|
|
1111
1119
|
}
|
|
1112
1120
|
if (e.type === "updateOptions") {
|
|
1113
|
-
|
|
1121
|
+
se(e.captureId, e.options).catch((r) => y(r, e.captureId));
|
|
1114
1122
|
return;
|
|
1115
1123
|
}
|
|
1116
|
-
e.type === "dispose" &&
|
|
1124
|
+
e.type === "dispose" && Ae().catch(() => {
|
|
1125
|
+
});
|
|
1117
1126
|
});
|