@ikonai/sdk 0.0.40 → 0.0.41
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-Bnqb8-xb.js → audio-capture-worker-BZ6P8AHQ.js} +64 -70
- package/assets/{audio-playback-worker-CXmAFv0O.js → audio-playback-worker-DU7j77Kb.js} +4 -2
- package/assets/{index-C-9F_--I.js → index-7lK3WfPs.js} +40 -96
- package/assets/{index-C3ZAK5YF.js → index-k5wFN_NP.js} +24 -76
- package/assets/libopus-BEPFPIM_.js +139 -0
- package/client/ikon-client-config.d.ts +3 -3
- package/index.js +57 -57
- package/media/ikon-audio-capture.d.ts +3 -3
- package/media/ikon-audio-playback.d.ts +2 -2
- package/media/ikon-video-playback.d.ts +2 -2
- package/package.json +1 -1
- package/assets/libopus-BBY7KH2-.js +0 -169
- package/assets/libopus-simd-CQXMVirP.js +0 -169
|
@@ -209,9 +209,9 @@ export interface AudioConfig {
|
|
|
209
209
|
*/
|
|
210
210
|
enabled?: boolean;
|
|
211
211
|
/**
|
|
212
|
-
*
|
|
212
|
+
* Performance preferences for audio processing.
|
|
213
213
|
*/
|
|
214
|
-
|
|
214
|
+
performance?: IkonAudioPlaybackConfig['performance'];
|
|
215
215
|
/**
|
|
216
216
|
* Background audio playback configuration.
|
|
217
217
|
*/
|
|
@@ -229,7 +229,7 @@ export interface AudioConfig {
|
|
|
229
229
|
*/
|
|
230
230
|
export interface VideoConfig {
|
|
231
231
|
enabled?: boolean;
|
|
232
|
-
|
|
232
|
+
performance?: IkonVideoPlaybackConfig['performance'];
|
|
233
233
|
}
|
|
234
234
|
/**
|
|
235
235
|
* Configuration for IkonClient.
|
package/index.js
CHANGED
|
@@ -987,8 +987,8 @@ function Kr(t, e, r) {
|
|
|
987
987
|
const n = Hr(t);
|
|
988
988
|
return F(xr, n, pt, e, r);
|
|
989
989
|
}
|
|
990
|
-
const jr = 467348717, Yr = 972460562, zr = 1911490601, Xr = 2603556958, Jr = 3609695522, Qr = 4094837378,
|
|
991
|
-
function
|
|
990
|
+
const jr = 467348717, Yr = 972460562, zr = 1911490601, Xr = 2603556958, Jr = 3609695522, Qr = 4094837378, Zr = 4257460908;
|
|
991
|
+
function qr(t) {
|
|
992
992
|
const e = {};
|
|
993
993
|
return Et(e), e;
|
|
994
994
|
}
|
|
@@ -996,7 +996,7 @@ function Et(t) {
|
|
|
996
996
|
return t.ParameterIndex = 0, t.TypeName = "", t.ValueJson = "", t.ValueData = new Uint8Array(0), t.IsEnumerable = !1, t.EnumerableItemTypeName = "", t.EnumerationId = I.fromBytes(new Uint8Array(16)), t;
|
|
997
997
|
}
|
|
998
998
|
function en(t, e) {
|
|
999
|
-
const r = e ??
|
|
999
|
+
const r = e ?? qr();
|
|
1000
1000
|
return Et(r), tn(t, r), r;
|
|
1001
1001
|
}
|
|
1002
1002
|
function tn(t, e) {
|
|
@@ -1033,7 +1033,7 @@ function tn(t, e) {
|
|
|
1033
1033
|
e.ValueData = r.asBinary();
|
|
1034
1034
|
break;
|
|
1035
1035
|
}
|
|
1036
|
-
case
|
|
1036
|
+
case Zr: {
|
|
1037
1037
|
if (r.isNull) throw new Error();
|
|
1038
1038
|
e.ParameterIndex = r.asInt32();
|
|
1039
1039
|
break;
|
|
@@ -1283,7 +1283,7 @@ function Kn(t, e) {
|
|
|
1283
1283
|
}
|
|
1284
1284
|
}
|
|
1285
1285
|
}
|
|
1286
|
-
const jn = 5, Yn = 65537, zn = 166277978, Xn = 1482635149, Jn = 1559330978, Qn = 2802434353,
|
|
1286
|
+
const jn = 5, Yn = 65537, zn = 166277978, Xn = 1482635149, Jn = 1559330978, Qn = 2802434353, Zn = 3085883711, qn = 3669484338, es = 3707543140, ts = 3712281496, rs = 4160646707;
|
|
1287
1287
|
function ns(t) {
|
|
1288
1288
|
const e = {};
|
|
1289
1289
|
return St(e), e;
|
|
@@ -1323,12 +1323,12 @@ function os(t, e) {
|
|
|
1323
1323
|
e.ClientContext = Ne(r.asObject());
|
|
1324
1324
|
break;
|
|
1325
1325
|
}
|
|
1326
|
-
case
|
|
1326
|
+
case Zn: {
|
|
1327
1327
|
if (r.isNull) throw new Error();
|
|
1328
1328
|
e.ServerContext = Ne(r.asObject());
|
|
1329
1329
|
break;
|
|
1330
1330
|
}
|
|
1331
|
-
case
|
|
1331
|
+
case qn: {
|
|
1332
1332
|
if (r.isNull) throw new Error();
|
|
1333
1333
|
e.FeatureFlags = ls(r.asDictionary());
|
|
1334
1334
|
break;
|
|
@@ -1518,8 +1518,8 @@ function Qs(t, e, r) {
|
|
|
1518
1518
|
const n = Xs(t);
|
|
1519
1519
|
return F(Ws, n, Nt, e, r);
|
|
1520
1520
|
}
|
|
1521
|
-
const Ge = 1,
|
|
1522
|
-
function
|
|
1521
|
+
const Ge = 1, Zs = 1048600, gt = 703025676, Ct = 814454131, bt = 972460562, Rt = 976255570, kt = 1368629611, Ut = 1479280922, Dt = 1533537016, Ot = 2274386296, Mt = 2603556958, Lt = 2885165957, vt = 3568439632;
|
|
1522
|
+
function qs(t) {
|
|
1523
1523
|
const e = {};
|
|
1524
1524
|
return Ft(e), e;
|
|
1525
1525
|
}
|
|
@@ -1539,7 +1539,7 @@ function Pt(t, e) {
|
|
|
1539
1539
|
}), e.writeBoolField(vt, t.LlmCallOnlyOnce);
|
|
1540
1540
|
}
|
|
1541
1541
|
function ti(t, e) {
|
|
1542
|
-
const r = e ??
|
|
1542
|
+
const r = e ?? qs();
|
|
1543
1543
|
return Ft(r), ri(t, r), r;
|
|
1544
1544
|
}
|
|
1545
1545
|
function ri(t, e) {
|
|
@@ -1605,7 +1605,7 @@ function ri(t, e) {
|
|
|
1605
1605
|
}
|
|
1606
1606
|
function ni(t, e, r) {
|
|
1607
1607
|
const n = ei(t);
|
|
1608
|
-
return F(
|
|
1608
|
+
return F(Zs, n, Ge, e, r);
|
|
1609
1609
|
}
|
|
1610
1610
|
function si(t) {
|
|
1611
1611
|
const e = [];
|
|
@@ -1737,14 +1737,14 @@ function Xe(t, e, r) {
|
|
|
1737
1737
|
const Ui = 3167053791, Di = 3342364356, Oi = 3612929027;
|
|
1738
1738
|
function Qt(t) {
|
|
1739
1739
|
const e = {};
|
|
1740
|
-
return
|
|
1740
|
+
return Zt(e), e;
|
|
1741
1741
|
}
|
|
1742
|
-
function
|
|
1742
|
+
function Zt(t) {
|
|
1743
1743
|
return t.Category = "", t.Type = ht.Face, t.FaceBlendshapes = [], t;
|
|
1744
1744
|
}
|
|
1745
1745
|
function Mi(t, e) {
|
|
1746
1746
|
const r = e ?? Qt();
|
|
1747
|
-
return
|
|
1747
|
+
return Zt(r), Li(t, r), r;
|
|
1748
1748
|
}
|
|
1749
1749
|
function Li(t, e) {
|
|
1750
1750
|
let r;
|
|
@@ -1775,7 +1775,7 @@ function vi(t) {
|
|
|
1775
1775
|
return e;
|
|
1776
1776
|
}
|
|
1777
1777
|
const Fi = 3612929027;
|
|
1778
|
-
function
|
|
1778
|
+
function qt(t) {
|
|
1779
1779
|
const e = {};
|
|
1780
1780
|
return er(e), e;
|
|
1781
1781
|
}
|
|
@@ -1783,7 +1783,7 @@ function er(t) {
|
|
|
1783
1783
|
return t.Category = "", t;
|
|
1784
1784
|
}
|
|
1785
1785
|
function Pi(t, e) {
|
|
1786
|
-
const r = e ??
|
|
1786
|
+
const r = e ?? qt();
|
|
1787
1787
|
return er(r), Bi(t, r), r;
|
|
1788
1788
|
}
|
|
1789
1789
|
function Bi(t, e) {
|
|
@@ -1835,7 +1835,7 @@ function $i(t, e) {
|
|
|
1835
1835
|
}
|
|
1836
1836
|
}
|
|
1837
1837
|
}
|
|
1838
|
-
const Ki = 3, ji = 65539, Yi = 693643444, zi = 1144553441, Xi = 1497620243, Ji = 1559330978, Qi = 1999510636,
|
|
1838
|
+
const Ki = 3, ji = 65539, Yi = 693643444, zi = 1144553441, Xi = 1497620243, Ji = 1559330978, Qi = 1999510636, Zi = 2277643855, qi = 2469008121, eo = 3219210453, to = 3678477544, ro = 3696445035, no = 3707543140, so = 3712281496, io = 3823842552, oo = 3895362455, ao = 3897397815, co = 4225107827;
|
|
1839
1839
|
function lo(t) {
|
|
1840
1840
|
const e = {};
|
|
1841
1841
|
return nr(e), e;
|
|
@@ -1880,12 +1880,12 @@ function fo(t, e) {
|
|
|
1880
1880
|
e.SessionId = r.asString();
|
|
1881
1881
|
break;
|
|
1882
1882
|
}
|
|
1883
|
-
case
|
|
1883
|
+
case Zi: {
|
|
1884
1884
|
if (r.isNull) throw new Error();
|
|
1885
1885
|
e.ChannelUrl = r.asString();
|
|
1886
1886
|
break;
|
|
1887
1887
|
}
|
|
1888
|
-
case
|
|
1888
|
+
case qi: {
|
|
1889
1889
|
if (r.isNull) throw new Error();
|
|
1890
1890
|
e.ChannelName = r.asString();
|
|
1891
1891
|
break;
|
|
@@ -2008,7 +2008,7 @@ function Co(t) {
|
|
|
2008
2008
|
return sr(e), e;
|
|
2009
2009
|
}
|
|
2010
2010
|
function sr(t) {
|
|
2011
|
-
return t.StreamId = "", t.ClientSessionId = 0, t.TrackId = 0, t.Info =
|
|
2011
|
+
return t.StreamId = "", t.ClientSessionId = 0, t.TrackId = 0, t.Info = qt(), t;
|
|
2012
2012
|
}
|
|
2013
2013
|
function bo(t, e) {
|
|
2014
2014
|
const r = e ?? Co();
|
|
@@ -2165,8 +2165,8 @@ function ur(t, e, r) {
|
|
|
2165
2165
|
const n = Qo();
|
|
2166
2166
|
return F(Jo, n, cr, e, r);
|
|
2167
2167
|
}
|
|
2168
|
-
const dr = 1,
|
|
2169
|
-
function
|
|
2168
|
+
const dr = 1, Zo = 8388612;
|
|
2169
|
+
function qo(t) {
|
|
2170
2170
|
return {};
|
|
2171
2171
|
}
|
|
2172
2172
|
function ea(t) {
|
|
@@ -2174,7 +2174,7 @@ function ea(t) {
|
|
|
2174
2174
|
}
|
|
2175
2175
|
function ta(t, e, r) {
|
|
2176
2176
|
const n = ea();
|
|
2177
|
-
return F(
|
|
2177
|
+
return F(Zo, n, dr, e, r);
|
|
2178
2178
|
}
|
|
2179
2179
|
function ra(t) {
|
|
2180
2180
|
return new Worker(
|
|
@@ -2554,7 +2554,7 @@ class da {
|
|
|
2554
2554
|
}
|
|
2555
2555
|
}
|
|
2556
2556
|
}
|
|
2557
|
-
const
|
|
2557
|
+
const Z = L("Channel");
|
|
2558
2558
|
class ha {
|
|
2559
2559
|
state = "disconnected";
|
|
2560
2560
|
transport = null;
|
|
@@ -2597,7 +2597,7 @@ class ha {
|
|
|
2597
2597
|
try {
|
|
2598
2598
|
await this.connectTransport(), this.setState("connected");
|
|
2599
2599
|
} catch (e) {
|
|
2600
|
-
throw
|
|
2600
|
+
throw Z.error("Channel connection failed:", e), this.setState("disconnected"), e;
|
|
2601
2601
|
}
|
|
2602
2602
|
}
|
|
2603
2603
|
/**
|
|
@@ -2611,7 +2611,7 @@ class ha {
|
|
|
2611
2611
|
*/
|
|
2612
2612
|
send(e) {
|
|
2613
2613
|
if (!this.transport?.isConnected) {
|
|
2614
|
-
|
|
2614
|
+
Z.warn("Cannot send: channel not connected");
|
|
2615
2615
|
return;
|
|
2616
2616
|
}
|
|
2617
2617
|
this.transport.send(e);
|
|
@@ -2652,12 +2652,12 @@ class ha {
|
|
|
2652
2652
|
try {
|
|
2653
2653
|
const r = e;
|
|
2654
2654
|
if (ce(r) === T.CORE_ON_SERVER_STOPPING) {
|
|
2655
|
-
|
|
2655
|
+
Z.debug("Received server stopping message"), this.setState("stopped"), this.transport?.close();
|
|
2656
2656
|
return;
|
|
2657
2657
|
}
|
|
2658
2658
|
this.config.onProtocolMessage?.(r);
|
|
2659
2659
|
} catch (r) {
|
|
2660
|
-
|
|
2660
|
+
Z.error("Failed to handle protocol message:", r), this.config.onError?.(r instanceof Error ? r : new Error(String(r)));
|
|
2661
2661
|
}
|
|
2662
2662
|
}
|
|
2663
2663
|
/**
|
|
@@ -2670,7 +2670,7 @@ class ha {
|
|
|
2670
2670
|
* Handle transport error.
|
|
2671
2671
|
*/
|
|
2672
2672
|
handleError(e) {
|
|
2673
|
-
|
|
2673
|
+
Z.error("Channel error:", e), this.config.onError?.(e), e instanceof We && this.handleClose("Keepalive timeout", !1);
|
|
2674
2674
|
}
|
|
2675
2675
|
/**
|
|
2676
2676
|
* Update and notify state change.
|
|
@@ -2864,7 +2864,7 @@ class fa {
|
|
|
2864
2864
|
this.state !== e && (this.state = e, this.config.onStateChange?.(e));
|
|
2865
2865
|
}
|
|
2866
2866
|
}
|
|
2867
|
-
const pa = 5e3, Ea = 3e4, Qe = 35e3,
|
|
2867
|
+
const pa = 5e3, Ea = 3e4, Qe = 35e3, Ze = 500, qe = 6, Er = 6e4, ge = "ikon_device_id";
|
|
2868
2868
|
function He() {
|
|
2869
2869
|
if (typeof window > "u" || typeof localStorage > "u")
|
|
2870
2870
|
return crypto.randomUUID();
|
|
@@ -3420,7 +3420,7 @@ const Qa = {
|
|
|
3420
3420
|
{ name: "icon", type: { kind: "string", nullable: !0 }, description: "URL of notification icon" }
|
|
3421
3421
|
]
|
|
3422
3422
|
};
|
|
3423
|
-
async function
|
|
3423
|
+
async function Za(t, e, r) {
|
|
3424
3424
|
if (typeof window > "u" || !("Notification" in window) || typeof t != "string" || !t.trim())
|
|
3425
3425
|
return !1;
|
|
3426
3426
|
try {
|
|
@@ -3433,7 +3433,7 @@ async function qa(t, e, r) {
|
|
|
3433
3433
|
return !1;
|
|
3434
3434
|
}
|
|
3435
3435
|
}
|
|
3436
|
-
const
|
|
3436
|
+
const qa = {
|
|
3437
3437
|
name: "ikon.client.requestFullscreen",
|
|
3438
3438
|
description: "Enter fullscreen mode",
|
|
3439
3439
|
returnType: { kind: "boolean" }
|
|
@@ -3482,7 +3482,7 @@ function sc(t, e) {
|
|
|
3482
3482
|
return !1;
|
|
3483
3483
|
}
|
|
3484
3484
|
}
|
|
3485
|
-
let
|
|
3485
|
+
let q = null;
|
|
3486
3486
|
const ic = {
|
|
3487
3487
|
name: "ikon.client.keepScreenAwake",
|
|
3488
3488
|
description: "Prevent or allow the screen to sleep",
|
|
@@ -3493,7 +3493,7 @@ async function oc(t) {
|
|
|
3493
3493
|
if (typeof navigator > "u" || !("wakeLock" in navigator))
|
|
3494
3494
|
return !1;
|
|
3495
3495
|
try {
|
|
3496
|
-
return !!t ?
|
|
3496
|
+
return !!t ? q || (q = await navigator.wakeLock.request("screen")) : q && (await q.release(), q = null), !0;
|
|
3497
3497
|
} catch {
|
|
3498
3498
|
return !1;
|
|
3499
3499
|
}
|
|
@@ -3568,8 +3568,8 @@ const Ec = [
|
|
|
3568
3568
|
{ definition: Ka, handler: ja },
|
|
3569
3569
|
{ definition: Ya, handler: za },
|
|
3570
3570
|
{ definition: Xa, handler: Ja },
|
|
3571
|
-
{ definition: Qa, handler:
|
|
3572
|
-
{ definition:
|
|
3571
|
+
{ definition: Qa, handler: Za },
|
|
3572
|
+
{ definition: qa, handler: ec },
|
|
3573
3573
|
{ definition: tc, handler: rc },
|
|
3574
3574
|
{ definition: nc, handler: sc },
|
|
3575
3575
|
{ definition: ic, handler: oc },
|
|
@@ -3949,7 +3949,7 @@ function Nr(t) {
|
|
|
3949
3949
|
}
|
|
3950
3950
|
function kc(t) {
|
|
3951
3951
|
return new Worker(
|
|
3952
|
-
"" + new URL("assets/audio-playback-worker-
|
|
3952
|
+
"" + new URL("assets/audio-playback-worker-DU7j77Kb.js", import.meta.url).href,
|
|
3953
3953
|
{
|
|
3954
3954
|
type: "module",
|
|
3955
3955
|
name: t?.name
|
|
@@ -5025,7 +5025,7 @@ class je {
|
|
|
5025
5025
|
this.outputSampleRateHz = this.audioContext.sampleRate || Te, this.outputSampleRateHz !== a && A.debug(`AudioContext running at ${this.outputSampleRateHz}Hz (requested ${a}Hz)`), this.attachAudioContextHealthHandlers(this.audioContext);
|
|
5026
5026
|
}
|
|
5027
5027
|
const n = this.audioContext, s = this.resolveDiagnosticsConfig();
|
|
5028
|
-
if ((this.config.
|
|
5028
|
+
if ((this.config.performance?.preferAudioWorklet ?? !0) && Nr(n)) {
|
|
5029
5029
|
await this.ensureAudioWorklet(n, s, e, r);
|
|
5030
5030
|
return;
|
|
5031
5031
|
}
|
|
@@ -5197,7 +5197,7 @@ class je {
|
|
|
5197
5197
|
return;
|
|
5198
5198
|
}
|
|
5199
5199
|
this.stopScriptProcessor();
|
|
5200
|
-
const a = (this.config.
|
|
5200
|
+
const a = (this.config.performance?.preferSharedArrayBuffer ?? !0) && ae();
|
|
5201
5201
|
this.audioWorkletNode = new AudioWorkletNode(e, "ikon-audio-player", {
|
|
5202
5202
|
numberOfInputs: 0,
|
|
5203
5203
|
numberOfOutputs: 1,
|
|
@@ -5406,7 +5406,7 @@ class je {
|
|
|
5406
5406
|
rebindWorkerTransportIfNeeded() {
|
|
5407
5407
|
if (!this.audioWorker || !this.audioContext)
|
|
5408
5408
|
return;
|
|
5409
|
-
const s = (this.config.
|
|
5409
|
+
const s = (this.config.performance?.preferSharedArrayBuffer ?? !0) && !!this.audioWorkletNode && ae() ? "sab" : "pcm";
|
|
5410
5410
|
try {
|
|
5411
5411
|
this.audioWorker.postMessage({
|
|
5412
5412
|
type: "rebind",
|
|
@@ -5441,7 +5441,7 @@ class je {
|
|
|
5441
5441
|
const h = [d.message, d.filename, d.lineno, d.colno].filter((f) => f != null && String(f).length > 0);
|
|
5442
5442
|
A.error(`Audio worker failed: ${h.join(" ")}`.trim());
|
|
5443
5443
|
});
|
|
5444
|
-
const s = (this.config.
|
|
5444
|
+
const s = (this.config.performance?.preferSharedArrayBuffer ?? !0) && !!this.audioWorkletNode && ae(), i = this.config.performance?.preferWebCodecs ?? !0, o = {
|
|
5445
5445
|
type: "configure",
|
|
5446
5446
|
transport: s ? "sab" : "pcm",
|
|
5447
5447
|
outputSampleRate: this.outputSampleRateHz,
|
|
@@ -5675,7 +5675,7 @@ class Hc {
|
|
|
5675
5675
|
this.enabled = !1, this.stateUnsubscribe?.(), this.stateUnsubscribe = null, this.surfaces.clear(), this.stopWorker();
|
|
5676
5676
|
}
|
|
5677
5677
|
canUseOffscreenCanvas(e) {
|
|
5678
|
-
return this.config.
|
|
5678
|
+
return this.config.performance?.preferOffscreenCanvas ?? !0 ? "transferControlToOffscreen" in e && typeof e.transferControlToOffscreen == "function" : !1;
|
|
5679
5679
|
}
|
|
5680
5680
|
hasDemand() {
|
|
5681
5681
|
return this.surfaces.size > 0;
|
|
@@ -5760,7 +5760,7 @@ class Hc {
|
|
|
5760
5760
|
const r = this.parseStreamId(e);
|
|
5761
5761
|
if (!r)
|
|
5762
5762
|
return;
|
|
5763
|
-
const n = ta(
|
|
5763
|
+
const n = ta(qo(), this.client.sessionId ?? 0, {
|
|
5764
5764
|
trackId: r.trackId,
|
|
5765
5765
|
targetIds: [r.senderId]
|
|
5766
5766
|
});
|
|
@@ -5894,7 +5894,7 @@ class Kc {
|
|
|
5894
5894
|
}
|
|
5895
5895
|
function jc(t) {
|
|
5896
5896
|
return new Worker(
|
|
5897
|
-
"" + new URL("assets/audio-capture-worker-
|
|
5897
|
+
"" + new URL("assets/audio-capture-worker-BZ6P8AHQ.js", import.meta.url).href,
|
|
5898
5898
|
{
|
|
5899
5899
|
type: "module",
|
|
5900
5900
|
name: t?.name
|
|
@@ -6132,7 +6132,7 @@ class Jc {
|
|
|
6132
6132
|
channels: 1,
|
|
6133
6133
|
options: {
|
|
6134
6134
|
...e.options,
|
|
6135
|
-
preferWebCodecs: this.config.
|
|
6135
|
+
preferWebCodecs: this.config.performance?.preferWebCodecs
|
|
6136
6136
|
},
|
|
6137
6137
|
transport: h,
|
|
6138
6138
|
sharedArrayBuffer: f
|
|
@@ -6271,7 +6271,7 @@ async function Qc(t, e) {
|
|
|
6271
6271
|
);
|
|
6272
6272
|
});
|
|
6273
6273
|
}
|
|
6274
|
-
class
|
|
6274
|
+
class Zc {
|
|
6275
6275
|
async acquireCameraStream(e) {
|
|
6276
6276
|
if (!navigator.mediaDevices)
|
|
6277
6277
|
throw new Error("Media devices are not available in this environment");
|
|
@@ -6335,7 +6335,7 @@ class qc {
|
|
|
6335
6335
|
}
|
|
6336
6336
|
}
|
|
6337
6337
|
}
|
|
6338
|
-
function
|
|
6338
|
+
function qc(t) {
|
|
6339
6339
|
return new Worker(
|
|
6340
6340
|
"" + new URL("assets/video-capture-worker-CTRX9PKp.js", import.meta.url).href,
|
|
6341
6341
|
{
|
|
@@ -6371,7 +6371,7 @@ class rl {
|
|
|
6371
6371
|
ensureWorker() {
|
|
6372
6372
|
if (this.worker)
|
|
6373
6373
|
return this.worker;
|
|
6374
|
-
const e = new
|
|
6374
|
+
const e = new qc();
|
|
6375
6375
|
return this.worker = e, e.addEventListener("message", (r) => {
|
|
6376
6376
|
const n = r.data;
|
|
6377
6377
|
if (n?.type === "error") {
|
|
@@ -6495,7 +6495,7 @@ class nl {
|
|
|
6495
6495
|
video;
|
|
6496
6496
|
image;
|
|
6497
6497
|
constructor(e, r) {
|
|
6498
|
-
this.audio = new Jc(e, r?.audio), this.video = new rl(e), this.image = new
|
|
6498
|
+
this.audio = new Jc(e, r?.audio), this.video = new rl(e), this.image = new Zc();
|
|
6499
6499
|
}
|
|
6500
6500
|
dispose() {
|
|
6501
6501
|
this.audio.dispose(), this.video.dispose();
|
|
@@ -6635,16 +6635,16 @@ class yl {
|
|
|
6635
6635
|
local: e.local
|
|
6636
6636
|
}), this._functionRegistry = new wc(), rt() && !e.disableBrowserFunctions && (this.unregisterBrowserFunctions = Ic(this._functionRegistry)), e.audio || e.video) {
|
|
6637
6637
|
const n = e.audio ? {
|
|
6638
|
-
|
|
6638
|
+
performance: e.audio.performance,
|
|
6639
6639
|
background: e.audio.background,
|
|
6640
6640
|
diagnostics: e.audio.diagnostics
|
|
6641
|
-
} : void 0, s = e.video ? {
|
|
6641
|
+
} : void 0, s = e.video ? { performance: e.video.performance } : void 0;
|
|
6642
6642
|
this._media = new $c(this, { audio: n, video: s, mediaSession: e.mediaSession }), e.audio?.enabled && this._media.audio.setEnabled(!0), e.video?.enabled && this._media.video.setEnabled(!0);
|
|
6643
6643
|
}
|
|
6644
6644
|
rt() && (this._mediaCapture = new nl(this, {
|
|
6645
6645
|
audio: {
|
|
6646
|
-
|
|
6647
|
-
preferWebCodecs: e.audio?.
|
|
6646
|
+
performance: {
|
|
6647
|
+
preferWebCodecs: e.audio?.performance?.preferWebCodecs
|
|
6648
6648
|
}
|
|
6649
6649
|
}
|
|
6650
6650
|
}), this.unregisterMediaCaptureFunctions = bc(this._functionRegistry, this));
|
|
@@ -7024,7 +7024,7 @@ class yl {
|
|
|
7024
7024
|
const h = [d.message, d.filename, d.lineno, d.colno].filter((f) => f != null && String(f).length > 0);
|
|
7025
7025
|
l(new Error(`Protocol worker failed: ${h.join(" ")}`.trim()));
|
|
7026
7026
|
});
|
|
7027
|
-
}), s = this.computeOrderedEndpointTypes(e), i = this.config.timeouts?.keepaliveTimeoutMs ?? Qe, o = this.config.timeouts?.reconnectBackoffMs ??
|
|
7027
|
+
}), s = this.computeOrderedEndpointTypes(e), i = this.config.timeouts?.keepaliveTimeoutMs ?? Qe, o = this.config.timeouts?.reconnectBackoffMs ?? Ze, a = this.config.timeouts?.maxReconnectAttempts ?? qe;
|
|
7028
7028
|
this.updateWorkerInterestMask(), this.config.debug?.devtools && r.postMessage({ type: "enableDevtools", enabled: !0 }), r.postMessage({
|
|
7029
7029
|
type: "connect",
|
|
7030
7030
|
sessionId: this._sessionId,
|
|
@@ -7044,8 +7044,8 @@ class yl {
|
|
|
7044
7044
|
this.workerManagerState = null, this.protocolWorker = null, this.channelManager = new fa({
|
|
7045
7045
|
sessionId: this._sessionId,
|
|
7046
7046
|
keepaliveTimeoutMs: this.config.timeouts?.keepaliveTimeoutMs ?? Qe,
|
|
7047
|
-
reconnectBackoffMs: this.config.timeouts?.reconnectBackoffMs ??
|
|
7048
|
-
maxReconnectAttempts: this.config.timeouts?.maxReconnectAttempts ??
|
|
7047
|
+
reconnectBackoffMs: this.config.timeouts?.reconnectBackoffMs ?? Ze,
|
|
7048
|
+
maxReconnectAttempts: this.config.timeouts?.maxReconnectAttempts ?? qe,
|
|
7049
7049
|
endpointSelector: this.endpointSelector,
|
|
7050
7050
|
onProtocolMessage: (r) => {
|
|
7051
7051
|
this.handleProtocolMessage(r);
|
|
@@ -7240,7 +7240,7 @@ export {
|
|
|
7240
7240
|
Jc as IkonAudioCapture,
|
|
7241
7241
|
je as IkonAudioPlayback,
|
|
7242
7242
|
yl as IkonClient,
|
|
7243
|
-
|
|
7243
|
+
Zc as IkonImageCapture,
|
|
7244
7244
|
$c as IkonMedia,
|
|
7245
7245
|
nl as IkonMediaCapture,
|
|
7246
7246
|
rl as IkonVideoCapture,
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { IkonClient } from '../client/ikon-client';
|
|
2
2
|
export interface IkonAudioCaptureConfig {
|
|
3
3
|
/**
|
|
4
|
-
*
|
|
5
|
-
* These mirror the playback
|
|
4
|
+
* Performance preferences for audio capture.
|
|
5
|
+
* These mirror the playback performance options where applicable.
|
|
6
6
|
*/
|
|
7
|
-
|
|
7
|
+
performance?: {
|
|
8
8
|
/** Prefer WebCodecs AudioEncoder over WASM Opus. Default: false */
|
|
9
9
|
preferWebCodecs?: boolean;
|
|
10
10
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { IkonClient } from '../client/ikon-client';
|
|
2
2
|
export interface IkonAudioPlaybackConfig {
|
|
3
3
|
/**
|
|
4
|
-
*
|
|
4
|
+
* Performance preferences for audio processing.
|
|
5
5
|
*
|
|
6
6
|
* The SDK prefers:
|
|
7
7
|
* - decode in a worker
|
|
@@ -10,7 +10,7 @@ export interface IkonAudioPlaybackConfig {
|
|
|
10
10
|
*
|
|
11
11
|
* All of these have fallbacks for restrictive embed environments.
|
|
12
12
|
*/
|
|
13
|
-
|
|
13
|
+
performance?: {
|
|
14
14
|
preferSharedArrayBuffer?: boolean;
|
|
15
15
|
preferAudioWorklet?: boolean;
|
|
16
16
|
preferWebCodecs?: boolean;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { IkonClient } from '../client/ikon-client';
|
|
2
2
|
export interface IkonVideoPlaybackConfig {
|
|
3
3
|
/**
|
|
4
|
-
*
|
|
4
|
+
* Performance preferences for video processing.
|
|
5
5
|
*
|
|
6
6
|
* The preferred path is decode + render inside a dedicated worker using OffscreenCanvas,
|
|
7
7
|
* which avoids scheduling heavy work on the UI thread during high-frequency streaming.
|
|
8
8
|
*/
|
|
9
|
-
|
|
9
|
+
performance?: {
|
|
10
10
|
preferOffscreenCanvas?: boolean;
|
|
11
11
|
};
|
|
12
12
|
}
|