@spatialwalk/avatarkit-rtc 1.0.0-beta.1 → 1.0.0-beta.10
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/README.md +2 -410
- package/dist/assets/animation-worker-DOGeTjF0.js.map +1 -0
- package/dist/core/AvatarPlayer.d.ts +96 -12
- package/dist/core/AvatarPlayer.d.ts.map +1 -1
- package/dist/core/RTCProvider.d.ts +12 -16
- package/dist/core/RTCProvider.d.ts.map +1 -1
- package/dist/index.d.ts +3 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -2
- package/dist/index10.js +91 -39
- package/dist/index10.js.map +1 -1
- package/dist/index11.js +14 -386
- package/dist/index11.js.map +1 -1
- package/dist/index12.js +350 -64
- package/dist/index12.js.map +1 -1
- package/dist/index13.js +44 -14
- package/dist/index13.js.map +1 -1
- package/dist/index14.js +25 -44
- package/dist/index14.js.map +1 -1
- package/dist/index2.js +335 -46
- package/dist/index2.js.map +1 -1
- package/dist/index3.js +265 -54
- package/dist/index3.js.map +1 -1
- package/dist/index4.js +105 -86
- package/dist/index4.js.map +1 -1
- package/dist/index5.js +6 -2
- package/dist/index5.js.map +1 -1
- package/dist/index6.js +603 -39
- package/dist/index6.js.map +1 -1
- package/dist/index8.js +128 -167
- package/dist/index8.js.map +1 -1
- package/dist/index9.js +65 -164
- package/dist/index9.js.map +1 -1
- package/dist/providers/agora/AgoraProvider.d.ts +0 -13
- package/dist/providers/agora/AgoraProvider.d.ts.map +1 -1
- package/dist/providers/agora/index.d.ts +1 -5
- package/dist/providers/agora/index.d.ts.map +1 -1
- package/dist/providers/agora/types.d.ts.map +1 -1
- package/dist/providers/base/BaseProvider.d.ts +50 -8
- package/dist/providers/base/BaseProvider.d.ts.map +1 -1
- package/dist/providers/livekit/LiveKitProvider.d.ts +4 -15
- package/dist/providers/livekit/LiveKitProvider.d.ts.map +1 -1
- package/dist/providers/livekit/animation-worker.d.ts.map +1 -1
- package/dist/providers/livekit/index.d.ts +1 -5
- package/dist/providers/livekit/index.d.ts.map +1 -1
- package/dist/types/index.d.ts +21 -0
- package/dist/types/index.d.ts.map +1 -1
- package/dist/utils/index.d.ts +2 -0
- package/dist/utils/index.d.ts.map +1 -1
- package/dist/utils/telemetry.d.ts +22 -0
- package/dist/utils/telemetry.d.ts.map +1 -0
- package/package.json +21 -12
- package/dist/assets/animation-worker-CUXZycUw.js.map +0 -1
- package/dist/index15.js +0 -29
- package/dist/index15.js.map +0 -1
- package/dist/index16.js +0 -144
- package/dist/index16.js.map +0 -1
- package/dist/index17.js +0 -106
- package/dist/index17.js.map +0 -1
- package/dist/index18.js +0 -28
- package/dist/index18.js.map +0 -1
- package/dist/proto/animation.d.ts +0 -12
- package/dist/proto/animation.d.ts.map +0 -1
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import { RTCConnectionConfig } from '../types';
|
|
2
|
-
import { RTCProviderEvents } from './types';
|
|
1
|
+
import { RTCConnectionConfig, RTCPrepareConnectionConfig } from '../types';
|
|
3
2
|
/**
|
|
4
3
|
* RTC Provider interface.
|
|
5
4
|
*
|
|
@@ -18,12 +17,19 @@ import { RTCProviderEvents } from './types';
|
|
|
18
17
|
* }
|
|
19
18
|
* ```
|
|
20
19
|
*/
|
|
20
|
+
export type RTCProviderEventHandler = (...args: unknown[]) => void;
|
|
21
21
|
export interface RTCProvider {
|
|
22
22
|
/**
|
|
23
23
|
* Provider name identifier (e.g., 'livekit', 'agora').
|
|
24
24
|
* Used for logging and debugging.
|
|
25
25
|
*/
|
|
26
26
|
readonly name: string;
|
|
27
|
+
/**
|
|
28
|
+
* Pre-warm a future connection if the provider supports it.
|
|
29
|
+
* This should not establish a full RTC session or change connection state,
|
|
30
|
+
* but may warm DNS/TLS caches or select an edge region.
|
|
31
|
+
*/
|
|
32
|
+
prepareConnection?(config: RTCPrepareConnectionConfig): Promise<void>;
|
|
27
33
|
/**
|
|
28
34
|
* Connect to RTC server.
|
|
29
35
|
* @param config - Connection configuration containing server URL and credentials
|
|
@@ -42,35 +48,25 @@ export interface RTCProvider {
|
|
|
42
48
|
getConnectionState(): string;
|
|
43
49
|
/**
|
|
44
50
|
* Publish local audio track (microphone) to the RTC server.
|
|
45
|
-
* @param track - MediaStreamTrack from getUserMedia
|
|
51
|
+
* @param track - Optional MediaStreamTrack from getUserMedia; when omitted the provider may create a microphone track
|
|
46
52
|
*/
|
|
47
|
-
publishAudioTrack(track
|
|
53
|
+
publishAudioTrack(track?: MediaStreamTrack): Promise<void>;
|
|
48
54
|
/**
|
|
49
55
|
* Unpublish audio track from the RTC server.
|
|
50
56
|
*/
|
|
51
57
|
unpublishAudioTrack(): Promise<void>;
|
|
52
|
-
/**
|
|
53
|
-
* Play remote audio (resume playback).
|
|
54
|
-
* Used to sync audio with animation transitions.
|
|
55
|
-
*/
|
|
56
|
-
playRemoteAudio(): void;
|
|
57
|
-
/**
|
|
58
|
-
* Pause remote audio.
|
|
59
|
-
* Used to sync audio with animation transitions.
|
|
60
|
-
*/
|
|
61
|
-
pauseRemoteAudio(): void;
|
|
62
58
|
/**
|
|
63
59
|
* Add event listener.
|
|
64
60
|
* @param event - Event name
|
|
65
61
|
* @param handler - Event handler function
|
|
66
62
|
*/
|
|
67
|
-
on
|
|
63
|
+
on(event: string, handler: RTCProviderEventHandler): void;
|
|
68
64
|
/**
|
|
69
65
|
* Remove event listener.
|
|
70
66
|
* @param event - Event name
|
|
71
67
|
* @param handler - Event handler function
|
|
72
68
|
*/
|
|
73
|
-
off
|
|
69
|
+
off(event: string, handler: RTCProviderEventHandler): void;
|
|
74
70
|
/**
|
|
75
71
|
* Get the native RTC client object.
|
|
76
72
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RTCProvider.d.ts","sourceRoot":"","sources":["../../src/core/RTCProvider.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"RTCProvider.d.ts","sourceRoot":"","sources":["../../src/core/RTCProvider.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,mBAAmB,EAAE,0BAA0B,EAAE,MAAM,UAAU,CAAC;AAGhF;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,MAAM,uBAAuB,GAAG,CAAC,GAAG,IAAI,EAAE,OAAO,EAAE,KAAK,IAAI,CAAC;AAEnE,MAAM,WAAW,WAAW;IAC1B;;;OAGG;IACH,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IAEtB;;;;OAIG;IACH,iBAAiB,CAAC,CAAC,MAAM,EAAE,0BAA0B,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAEtE;;;;OAIG;IACH,OAAO,CAAC,MAAM,EAAE,mBAAmB,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAEpD;;;OAGG;IACH,UAAU,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;IAE5B;;;OAGG;IACH,kBAAkB,IAAI,MAAM,CAAC;IA4B7B;;;OAGG;IACH,iBAAiB,CAAC,KAAK,CAAC,EAAE,gBAAgB,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAE3D;;OAEG;IACH,mBAAmB,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;IAErC;;;;OAIG;IACH,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,uBAAuB,GAAG,IAAI,CAAC;IAE1D;;;;OAIG;IACH,GAAG,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,uBAAuB,GAAG,IAAI,CAAC;IAE3D;;;;;;;OAOG;IACH,eAAe,IAAI,OAAO,CAAC;CAC5B"}
|
package/dist/index.d.ts
CHANGED
|
@@ -9,8 +9,8 @@
|
|
|
9
9
|
export { AvatarPlayer } from './core';
|
|
10
10
|
export type { AvatarPlayerOptions } from './core';
|
|
11
11
|
export { LiveKitProvider, AgoraProvider } from './providers';
|
|
12
|
-
export type { AgoraProviderOptions, LiveKitRoom, AgoraClient } from './providers';
|
|
13
|
-
export { ConnectionState, isLiveKitConfig, isAgoraConfig } from './types';
|
|
14
|
-
export type { RTCConnectionConfig, LiveKitConnectionConfig, AgoraConnectionConfig, } from './types';
|
|
12
|
+
export type { AgoraProviderOptions, LiveKitRoom, AgoraClient, } from './providers';
|
|
13
|
+
export { ConnectionState, isLiveKitConfig, isLiveKitPrepareConfig, isAgoraConfig, } from './types';
|
|
14
|
+
export type { RTCConnectionConfig, RTCPrepareConnectionConfig, LiveKitConnectionConfig, LiveKitPrepareConnectionConfig, AgoraConnectionConfig, } from './types';
|
|
15
15
|
export type { LogLevel } from './utils';
|
|
16
16
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAGH,OAAO,EAAE,YAAY,EAAE,MAAM,QAAQ,CAAC;AACtC,YAAY,EAAE,mBAAmB,EAAE,MAAM,QAAQ,CAAC;AAGlD,OAAO,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAC7D,YAAY,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAGH,OAAO,EAAE,YAAY,EAAE,MAAM,QAAQ,CAAC;AACtC,YAAY,EAAE,mBAAmB,EAAE,MAAM,QAAQ,CAAC;AAGlD,OAAO,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAC7D,YAAY,EACV,oBAAoB,EACpB,WAAW,EACX,WAAW,GACZ,MAAM,aAAa,CAAC;AAGrB,OAAO,EACL,eAAe,EACf,eAAe,EACf,sBAAsB,EACtB,aAAa,GACd,MAAM,SAAS,CAAC;AACjB,YAAY,EACV,mBAAmB,EACnB,0BAA0B,EAC1B,uBAAuB,EACvB,8BAA8B,EAC9B,qBAAqB,GACtB,MAAM,SAAS,CAAC;AAGjB,YAAY,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
import { AvatarPlayer } from "./index2.js";
|
|
2
2
|
import { LiveKitProvider } from "./index3.js";
|
|
3
3
|
import { AgoraProvider } from "./index4.js";
|
|
4
|
-
import { ConnectionState, isAgoraConfig, isLiveKitConfig } from "./index5.js";
|
|
4
|
+
import { ConnectionState, isAgoraConfig, isLiveKitConfig, isLiveKitPrepareConfig } from "./index5.js";
|
|
5
5
|
export {
|
|
6
6
|
AgoraProvider,
|
|
7
7
|
AvatarPlayer,
|
|
8
8
|
ConnectionState,
|
|
9
9
|
LiveKitProvider,
|
|
10
10
|
isAgoraConfig,
|
|
11
|
-
isLiveKitConfig
|
|
11
|
+
isLiveKitConfig,
|
|
12
|
+
isLiveKitPrepareConfig
|
|
12
13
|
};
|
|
13
14
|
//# sourceMappingURL=index.js.map
|
package/dist/index10.js
CHANGED
|
@@ -1,67 +1,119 @@
|
|
|
1
1
|
var __defProp = Object.defineProperty;
|
|
2
2
|
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
3
3
|
var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
4
|
+
import { createAnimationReceiverTransform } from "./index13.js";
|
|
4
5
|
import { logger } from "./index7.js";
|
|
5
|
-
|
|
6
|
+
import { trackEvent } from "./index8.js";
|
|
7
|
+
import WorkerWrapper from "./index14.js";
|
|
8
|
+
const DEFAULT_TRANSITION_START_FRAMES = 8;
|
|
9
|
+
const DEFAULT_TRANSITION_END_FRAMES = 12;
|
|
10
|
+
class VP8Extractor {
|
|
6
11
|
constructor() {
|
|
7
12
|
/** @internal */
|
|
8
|
-
__publicField(this, "
|
|
13
|
+
__publicField(this, "callbacks", null);
|
|
9
14
|
/** @internal */
|
|
10
|
-
__publicField(this, "
|
|
15
|
+
__publicField(this, "receiver", null);
|
|
16
|
+
/** @internal */
|
|
17
|
+
__publicField(this, "transform", null);
|
|
11
18
|
}
|
|
12
19
|
/**
|
|
13
|
-
*
|
|
14
|
-
* @param
|
|
15
|
-
* @param
|
|
20
|
+
* Initialize the extractor with a receiver and callbacks.
|
|
21
|
+
* @param receiver - RTCRtpReceiver to extract data from
|
|
22
|
+
* @param callbacks - Callbacks to receive extracted data
|
|
23
|
+
* @internal
|
|
16
24
|
*/
|
|
17
|
-
|
|
18
|
-
if (
|
|
19
|
-
|
|
25
|
+
async initialize(receiver, callbacks) {
|
|
26
|
+
if (this.receiver || this.transform) {
|
|
27
|
+
throw new Error("VP8Extractor already initialized");
|
|
20
28
|
}
|
|
21
|
-
this.
|
|
29
|
+
this.receiver = receiver;
|
|
30
|
+
this.callbacks = callbacks;
|
|
31
|
+
if (receiver.transform) {
|
|
32
|
+
return;
|
|
33
|
+
}
|
|
34
|
+
const worker = new WorkerWrapper();
|
|
35
|
+
const onEvent = (evt) => {
|
|
36
|
+
this.handleTransformEvent(evt);
|
|
37
|
+
};
|
|
38
|
+
this.transform = createAnimationReceiverTransform(worker, onEvent);
|
|
39
|
+
receiver.transform = this.transform;
|
|
22
40
|
}
|
|
23
41
|
/**
|
|
24
|
-
*
|
|
25
|
-
* @
|
|
26
|
-
* @param handler - Event handler
|
|
42
|
+
* Handle events from the animation transform.
|
|
43
|
+
* @internal
|
|
27
44
|
*/
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
if (
|
|
31
|
-
|
|
45
|
+
handleTransformEvent(evt) {
|
|
46
|
+
if (!this.callbacks) return;
|
|
47
|
+
if (evt.type === "metadata") {
|
|
48
|
+
this.callbacks.onStreamStats({
|
|
49
|
+
framesPerSec: evt.framesPerSec,
|
|
50
|
+
totalFrames: evt.totalFrames ?? 0,
|
|
51
|
+
framesSent: evt.framesSent ?? 0,
|
|
52
|
+
framesLost: evt.framesLost ?? 0,
|
|
53
|
+
framesRecovered: evt.framesRecovered ?? 0,
|
|
54
|
+
framesDropped: evt.framesDropped ?? 0,
|
|
55
|
+
framesOutOfOrder: evt.framesOutOfOrder ?? 0,
|
|
56
|
+
framesDuplicate: evt.framesDuplicate ?? 0,
|
|
57
|
+
lastRenderedSeq: evt.lastRenderedSeq ?? -1
|
|
58
|
+
});
|
|
59
|
+
} else if (evt.type === "transition") {
|
|
60
|
+
this.callbacks.onTransition(
|
|
61
|
+
evt.protobufData,
|
|
62
|
+
DEFAULT_TRANSITION_START_FRAMES
|
|
63
|
+
);
|
|
64
|
+
} else if (evt.type === "transitionEnd") {
|
|
65
|
+
this.callbacks.onTransitionEnd(
|
|
66
|
+
evt.protobufData,
|
|
67
|
+
DEFAULT_TRANSITION_END_FRAMES
|
|
68
|
+
);
|
|
69
|
+
} else if (evt.type === "animation") {
|
|
70
|
+
if (!evt.isIdle) {
|
|
71
|
+
this.callbacks.onAnimationData(evt.protobufData, {
|
|
72
|
+
frameSeq: evt.frameSeq,
|
|
73
|
+
isStart: evt.isStart,
|
|
74
|
+
isEnd: evt.isEnd,
|
|
75
|
+
isIdle: evt.isIdle,
|
|
76
|
+
isRecovered: evt.isRecovered
|
|
77
|
+
});
|
|
78
|
+
}
|
|
79
|
+
} else if (evt.type === "idleStart") {
|
|
80
|
+
this.callbacks.onIdleStart();
|
|
81
|
+
} else if (evt.type === "error") {
|
|
82
|
+
logger.error("VP8Extractor", "Error:", evt.error);
|
|
83
|
+
trackEvent("rtc_worker_failed", "error", {
|
|
84
|
+
provider: "livekit",
|
|
85
|
+
description: typeof evt.error === "string" ? evt.error : String(evt.error)
|
|
86
|
+
});
|
|
32
87
|
}
|
|
33
88
|
}
|
|
34
89
|
/**
|
|
35
|
-
*
|
|
36
|
-
* @param
|
|
37
|
-
* @
|
|
90
|
+
* Check if this extractor is connected to the given receiver.
|
|
91
|
+
* @param receiver - RTCRtpReceiver to check
|
|
92
|
+
* @returns true if connected to this receiver
|
|
38
93
|
* @internal
|
|
39
94
|
*/
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
if (handlers) {
|
|
43
|
-
handlers.forEach((handler) => {
|
|
44
|
-
try {
|
|
45
|
-
handler(...args);
|
|
46
|
-
} catch (error) {
|
|
47
|
-
logger.error(this.name, `Error in event handler for ${event}:`, error);
|
|
48
|
-
}
|
|
49
|
-
});
|
|
50
|
-
}
|
|
95
|
+
isConnectedTo(receiver) {
|
|
96
|
+
return this.receiver === receiver;
|
|
51
97
|
}
|
|
52
98
|
/**
|
|
53
|
-
*
|
|
54
|
-
* @
|
|
99
|
+
* Get the receiver this extractor is connected to.
|
|
100
|
+
* @returns The connected RTCRtpReceiver or null
|
|
55
101
|
* @internal
|
|
56
102
|
*/
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
103
|
+
getReceiver() {
|
|
104
|
+
return this.receiver;
|
|
105
|
+
}
|
|
106
|
+
/**
|
|
107
|
+
* Dispose the extractor and release resources.
|
|
108
|
+
* @internal
|
|
109
|
+
*/
|
|
110
|
+
dispose() {
|
|
111
|
+
this.receiver = null;
|
|
112
|
+
this.transform = null;
|
|
113
|
+
this.callbacks = null;
|
|
62
114
|
}
|
|
63
115
|
}
|
|
64
116
|
export {
|
|
65
|
-
|
|
117
|
+
VP8Extractor
|
|
66
118
|
};
|
|
67
119
|
//# sourceMappingURL=index10.js.map
|
package/dist/index10.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index10.js","sources":["../src/providers/
|
|
1
|
+
{"version":3,"file":"index10.js","sources":["../src/providers/livekit/VP8Extractor.ts"],"sourcesContent":["/**\n * VP8 Data Extractor for LiveKit.\n *\n * Extracts animation data from VP8 video tracks using RTCRtpScriptTransform.\n *\n * @internal\n * @packageDocumentation\n */\n\nimport type { AnimationTrackCallbacks } from '../../core/types';\nimport type { AnimationTransformEvent } from './types';\nimport { createAnimationReceiverTransform } from './animation-transform';\nimport { logger, trackEvent } from '../../utils';\n\n// Import worker with inline - this bundles the worker code as a blob URL\nimport AnimationWorker from './animation-worker.ts?worker&inline';\n\n// Default transition frame counts (used when protocol doesn't specify)\nconst DEFAULT_TRANSITION_START_FRAMES = 8;\nconst DEFAULT_TRANSITION_END_FRAMES = 12;\n\n/**\n * VP8Extractor - Extracts animation data from VP8 video tracks.\n *\n * Uses RTCRtpScriptTransform and a Web Worker to parse VP8 frames\n * and extract embedded animation data.\n *\n * @internal\n */\nexport class VP8Extractor {\n /** @internal */\n private callbacks: AnimationTrackCallbacks | null = null;\n /** @internal */\n private receiver: RTCRtpReceiver | null = null;\n /** @internal */\n private transform: RTCRtpScriptTransform | null = null;\n\n /**\n * Initialize the extractor with a receiver and callbacks.\n * @param receiver - RTCRtpReceiver to extract data from\n * @param callbacks - Callbacks to receive extracted data\n * @internal\n */\n async initialize(\n receiver: RTCRtpReceiver,\n callbacks: AnimationTrackCallbacks,\n ): Promise<void> {\n if (this.receiver || this.transform) {\n throw new Error('VP8Extractor already initialized');\n }\n\n this.receiver = receiver;\n this.callbacks = callbacks;\n\n // Check if transform is already set\n if (receiver.transform) {\n return;\n }\n\n // Create worker and transform\n const worker = new AnimationWorker();\n const onEvent = (evt: AnimationTransformEvent) => {\n this.handleTransformEvent(evt);\n };\n\n this.transform = createAnimationReceiverTransform(worker, onEvent);\n receiver.transform = this.transform;\n }\n\n /**\n * Handle events from the animation transform.\n * @internal\n */\n private handleTransformEvent(evt: AnimationTransformEvent): void {\n if (!this.callbacks) return;\n\n if (evt.type === 'metadata') {\n this.callbacks.onStreamStats({\n framesPerSec: evt.framesPerSec,\n totalFrames: evt.totalFrames ?? 0,\n framesSent: evt.framesSent ?? 0,\n framesLost: evt.framesLost ?? 0,\n framesRecovered: evt.framesRecovered ?? 0,\n framesDropped: evt.framesDropped ?? 0,\n framesOutOfOrder: evt.framesOutOfOrder ?? 0,\n framesDuplicate: evt.framesDuplicate ?? 0,\n lastRenderedSeq: evt.lastRenderedSeq ?? -1,\n });\n } else if (evt.type === 'transition') {\n this.callbacks.onTransition(\n evt.protobufData,\n DEFAULT_TRANSITION_START_FRAMES,\n );\n } else if (evt.type === 'transitionEnd') {\n this.callbacks.onTransitionEnd(\n evt.protobufData,\n DEFAULT_TRANSITION_END_FRAMES,\n );\n } else if (evt.type === 'animation') {\n if (!evt.isIdle) {\n this.callbacks.onAnimationData(evt.protobufData, {\n frameSeq: evt.frameSeq,\n isStart: evt.isStart,\n isEnd: evt.isEnd,\n isIdle: evt.isIdle,\n isRecovered: evt.isRecovered,\n });\n }\n } else if (evt.type === 'idleStart') {\n this.callbacks.onIdleStart();\n } else if (evt.type === 'error') {\n logger.error('VP8Extractor', 'Error:', evt.error);\n trackEvent('rtc_worker_failed', 'error', {\n provider: 'livekit',\n description: typeof evt.error === 'string' ? evt.error : String(evt.error),\n });\n }\n }\n\n /**\n * Check if this extractor is connected to the given receiver.\n * @param receiver - RTCRtpReceiver to check\n * @returns true if connected to this receiver\n * @internal\n */\n isConnectedTo(receiver: RTCRtpReceiver): boolean {\n return this.receiver === receiver;\n }\n\n /**\n * Get the receiver this extractor is connected to.\n * @returns The connected RTCRtpReceiver or null\n * @internal\n */\n getReceiver(): RTCRtpReceiver | null {\n return this.receiver;\n }\n\n /**\n * Dispose the extractor and release resources.\n * @internal\n */\n dispose(): void {\n this.receiver = null;\n this.transform = null;\n this.callbacks = null;\n }\n}\n"],"names":["AnimationWorker"],"mappings":";;;;;;;AAkBA,MAAM,kCAAkC;AACxC,MAAM,gCAAgC;AAU/B,MAAM,aAAa;AAAA,EAAnB;AAEG;AAAA,qCAA4C;AAE5C;AAAA,oCAAkC;AAElC;AAAA,qCAA0C;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAQlD,MAAM,WACJ,UACA,WACe;AACf,QAAI,KAAK,YAAY,KAAK,WAAW;AACnC,YAAM,IAAI,MAAM,kCAAkC;AAAA,IACpD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