@waitaya.buc/client-js 0.1.0-alpha.1 → 0.1.0-alpha.3
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 +11 -4
- package/dist/adapters/livekit/index.d.ts +4 -3
- package/dist/adapters/livekit/index.d.ts.map +1 -1
- package/dist/adapters/livekit/index.js +16 -4
- package/dist/adapters/livekit/index.js.map +1 -1
- package/dist/adapters/livekit/react-native.d.ts +19 -0
- package/dist/adapters/livekit/react-native.d.ts.map +1 -0
- package/dist/adapters/livekit/react-native.js +41 -0
- package/dist/adapters/livekit/react-native.js.map +1 -0
- package/dist/core/ports/outbound/react-native-bindings.port.d.ts +39 -0
- package/dist/core/ports/outbound/react-native-bindings.port.d.ts.map +1 -0
- package/dist/core/ports/outbound/react-native-bindings.port.js +2 -0
- package/dist/core/ports/outbound/react-native-bindings.port.js.map +1 -0
- package/dist/core/vroom.d.ts +0 -7
- package/dist/core/vroom.d.ts.map +1 -1
- package/dist/core/vroom.js +0 -24
- package/dist/core/vroom.js.map +1 -1
- package/dist/react-native.d.ts +12 -16
- package/dist/react-native.d.ts.map +1 -1
- package/dist/react-native.js +12 -27
- package/dist/react-native.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -17,15 +17,22 @@ npm install @waitaya.buc/client-js
|
|
|
17
17
|
|
|
18
18
|
### React Native
|
|
19
19
|
|
|
20
|
-
|
|
21
|
-
|
|
20
|
+
On iOS/Android, the active provider adapter prepares its required WebRTC globals
|
|
21
|
+
automatically inside `Vroom.connect()` (during adapter creation). You do not need
|
|
22
|
+
to register polyfills manually.
|
|
22
23
|
|
|
23
|
-
If
|
|
24
|
+
If you need RN-specific helpers (e.g., `RTCView` for rendering remote video),
|
|
25
|
+
import them from the provider-agnostic subpath:
|
|
24
26
|
|
|
25
27
|
```typescript
|
|
26
|
-
import { RTCView, MediaStream
|
|
28
|
+
import { RTCView, MediaStream } from '@waitaya.buc/client-js/react-native'
|
|
27
29
|
```
|
|
28
30
|
|
|
31
|
+
This subpath is served by the SDK composition root (`src/react-native.ts`),
|
|
32
|
+
which re-exports from the active adapter's bindings. Consumer code stays
|
|
33
|
+
provider-agnostic — the import path does not change if the active adapter
|
|
34
|
+
changes.
|
|
35
|
+
|
|
29
36
|
#### React Native Dependency Note (v0.x)
|
|
30
37
|
|
|
31
38
|
The current RTC adapter is LiveKit (internal adapter), and React Native native-module autolinking
|
|
@@ -8,10 +8,11 @@ import type { ProviderAdapterFactory } from '../../core/ports/outbound/provider-
|
|
|
8
8
|
* 1. This file is imported when @waitaya.buc/client-js loads (auto-registration)
|
|
9
9
|
* 2. Factory is registered but LiveKitAdapter is NOT imported yet
|
|
10
10
|
* 3. When Vroom.connect() is called, factory.create() runs
|
|
11
|
-
* 4.
|
|
11
|
+
* 4. On iOS/Android, LiveKit's React Native globals are registered first
|
|
12
|
+
* 5. LiveKitAdapter is imported and instantiated
|
|
12
13
|
*
|
|
13
|
-
*
|
|
14
|
-
*
|
|
14
|
+
* Platform-specific setup (e.g., RN WebRTC polyfills) lives entirely inside
|
|
15
|
+
* this factory so the core never has to know which provider needs what.
|
|
15
16
|
*/
|
|
16
17
|
export declare const LiveKitAdapterFactory: ProviderAdapterFactory;
|
|
17
18
|
export { LiveKitAdapterFactory as default };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/adapters/livekit/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,yDAAyD,CAAA;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/adapters/livekit/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,yDAAyD,CAAA;AAMrG;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,qBAAqB,EAAE,sBAkBnC,CAAA;AAKD,OAAO,EAAE,qBAAqB,IAAI,OAAO,EAAE,CAAA"}
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import { Provider } from '../../core/types/vroom.types';
|
|
2
2
|
import { registerProvider } from '../../core/provider-registry';
|
|
3
|
+
import { VroomError } from '../../core/errors/vroom.error';
|
|
4
|
+
import { ErrorCodes } from '../../core/errors/error-codes';
|
|
3
5
|
/**
|
|
4
6
|
* Factory for creating LiveKit adapter instances.
|
|
5
7
|
*
|
|
@@ -9,13 +11,23 @@ import { registerProvider } from '../../core/provider-registry';
|
|
|
9
11
|
* 1. This file is imported when @waitaya.buc/client-js loads (auto-registration)
|
|
10
12
|
* 2. Factory is registered but LiveKitAdapter is NOT imported yet
|
|
11
13
|
* 3. When Vroom.connect() is called, factory.create() runs
|
|
12
|
-
* 4.
|
|
14
|
+
* 4. On iOS/Android, LiveKit's React Native globals are registered first
|
|
15
|
+
* 5. LiveKitAdapter is imported and instantiated
|
|
13
16
|
*
|
|
14
|
-
*
|
|
15
|
-
*
|
|
17
|
+
* Platform-specific setup (e.g., RN WebRTC polyfills) lives entirely inside
|
|
18
|
+
* this factory so the core never has to know which provider needs what.
|
|
16
19
|
*/
|
|
17
20
|
export const LiveKitAdapterFactory = {
|
|
18
|
-
create: async (serviceContext,
|
|
21
|
+
create: async (serviceContext, platform) => {
|
|
22
|
+
if (platform === 'ios' || platform === 'android') {
|
|
23
|
+
try {
|
|
24
|
+
const { registerLiveKitReactNativeGlobals } = await import('./react-native');
|
|
25
|
+
await registerLiveKitReactNativeGlobals();
|
|
26
|
+
}
|
|
27
|
+
catch (error) {
|
|
28
|
+
throw new VroomError(ErrorCodes.E_PLATFORM_MISMATCH, 'Failed to initialize React Native WebRTC globals. Ensure @livekit/react-native and @livekit/react-native-webrtc are installed.', error);
|
|
29
|
+
}
|
|
30
|
+
}
|
|
19
31
|
const { LiveKitAdapter } = await import('./livekit.adapter');
|
|
20
32
|
return new LiveKitAdapter(serviceContext);
|
|
21
33
|
},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/adapters/livekit/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,8BAA8B,CAAA;AACvD,OAAO,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAA;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/adapters/livekit/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,8BAA8B,CAAA;AACvD,OAAO,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAA;AAC/D,OAAO,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAA;AAC1D,OAAO,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAA;AAE1D;;;;;;;;;;;;;;GAcG;AACH,MAAM,CAAC,MAAM,qBAAqB,GAA2B;IAC3D,MAAM,EAAE,KAAK,EAAE,cAAc,EAAE,QAAQ,EAAE,EAAE;QACzC,IAAI,QAAQ,KAAK,KAAK,IAAI,QAAQ,KAAK,SAAS,EAAE,CAAC;YACjD,IAAI,CAAC;gBACH,MAAM,EAAE,iCAAiC,EAAE,GAAG,MAAM,MAAM,CAAC,gBAAgB,CAAC,CAAA;gBAC5E,MAAM,iCAAiC,EAAE,CAAA;YAC3C,CAAC;YAAC,OAAO,KAAK,EAAE,CAAC;gBACf,MAAM,IAAI,UAAU,CAClB,UAAU,CAAC,mBAAmB,EAC9B,gIAAgI,EAChI,KAAK,CACN,CAAA;YACH,CAAC;QACH,CAAC;QAED,MAAM,EAAE,cAAc,EAAE,GAAG,MAAM,MAAM,CAAC,mBAAmB,CAAC,CAAA;QAC5D,OAAO,IAAI,cAAc,CAAC,cAAc,CAAC,CAAA;IAC3C,CAAC;CACF,CAAA;AAED,8DAA8D;AAC9D,gBAAgB,CAAC,QAAQ,CAAC,OAAO,EAAE,qBAAqB,CAAC,CAAA;AAEzD,OAAO,EAAE,qBAAqB,IAAI,OAAO,EAAE,CAAA"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* LiveKit + React Native bindings.
|
|
3
|
+
*
|
|
4
|
+
* Owned by the LiveKit adapter — core code must not import this file.
|
|
5
|
+
* Re-exports `RTCView` / `MediaStream` for consumers that render remote
|
|
6
|
+
* tracks, and exposes the polyfill registration the factory invokes during
|
|
7
|
+
* adapter creation on iOS/Android.
|
|
8
|
+
*/
|
|
9
|
+
import { MediaStream, RTCView } from '@livekit/react-native-webrtc';
|
|
10
|
+
export { RTCView, MediaStream };
|
|
11
|
+
export type { RTCViewProps } from '../../core/ports/outbound/react-native-bindings.port';
|
|
12
|
+
/**
|
|
13
|
+
* Registers all globals required by LiveKit on React Native.
|
|
14
|
+
*
|
|
15
|
+
* Idempotent — safe to call multiple times. Invoked automatically by the
|
|
16
|
+
* LiveKit adapter factory when the SDK runs on iOS/Android.
|
|
17
|
+
*/
|
|
18
|
+
export declare function registerLiveKitReactNativeGlobals(): Promise<void>;
|
|
19
|
+
//# sourceMappingURL=react-native.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"react-native.d.ts","sourceRoot":"","sources":["../../../src/adapters/livekit/react-native.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAGH,OAAO,EAAE,WAAW,EAAE,OAAO,EAAE,MAAM,8BAA8B,CAAA;AAInE,OAAO,EAAE,OAAO,EAAE,WAAW,EAAE,CAAA;AAC/B,YAAY,EAAE,YAAY,EAAE,MAAM,sDAAsD,CAAA;AAUxF;;;;;GAKG;AACH,wBAAsB,iCAAiC,IAAI,OAAO,CAAC,IAAI,CAAC,CAwBvE"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* LiveKit + React Native bindings.
|
|
3
|
+
*
|
|
4
|
+
* Owned by the LiveKit adapter — core code must not import this file.
|
|
5
|
+
* Re-exports `RTCView` / `MediaStream` for consumers that render remote
|
|
6
|
+
* tracks, and exposes the polyfill registration the factory invokes during
|
|
7
|
+
* adapter creation on iOS/Android.
|
|
8
|
+
*/
|
|
9
|
+
import { registerGlobals as registerLiveKitGlobals } from '@livekit/react-native';
|
|
10
|
+
import { MediaStream, RTCView } from '@livekit/react-native-webrtc';
|
|
11
|
+
export { RTCView, MediaStream };
|
|
12
|
+
// Compile-time check: exports must satisfy the ReactNativeBindings port.
|
|
13
|
+
// If LiveKit ever changes the shape of RTCView/MediaStream, this will fail
|
|
14
|
+
// to typecheck — surface the breakage at build time, not at runtime.
|
|
15
|
+
const _contract = { RTCView, MediaStream };
|
|
16
|
+
void _contract;
|
|
17
|
+
let globalsRegistered = false;
|
|
18
|
+
/**
|
|
19
|
+
* Registers all globals required by LiveKit on React Native.
|
|
20
|
+
*
|
|
21
|
+
* Idempotent — safe to call multiple times. Invoked automatically by the
|
|
22
|
+
* LiveKit adapter factory when the SDK runs on iOS/Android.
|
|
23
|
+
*/
|
|
24
|
+
export async function registerLiveKitReactNativeGlobals() {
|
|
25
|
+
if (globalsRegistered)
|
|
26
|
+
return;
|
|
27
|
+
registerLiveKitGlobals();
|
|
28
|
+
if (typeof globalThis.TextDecoder === 'undefined' ||
|
|
29
|
+
typeof globalThis.TextEncoder === 'undefined') {
|
|
30
|
+
throw new Error('Failed to polyfill TextEncoder/TextDecoder for React Native runtime.');
|
|
31
|
+
}
|
|
32
|
+
if (typeof globalThis.DOMException === 'undefined') {
|
|
33
|
+
throw new Error('Failed to polyfill DOMException for React Native runtime.');
|
|
34
|
+
}
|
|
35
|
+
if (typeof globalThis.ReadableStream === 'undefined' ||
|
|
36
|
+
typeof globalThis.WritableStream === 'undefined') {
|
|
37
|
+
throw new Error('Failed to polyfill Web Streams for React Native runtime.');
|
|
38
|
+
}
|
|
39
|
+
globalsRegistered = true;
|
|
40
|
+
}
|
|
41
|
+
//# sourceMappingURL=react-native.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"react-native.js","sourceRoot":"","sources":["../../../src/adapters/livekit/react-native.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,eAAe,IAAI,sBAAsB,EAAE,MAAM,uBAAuB,CAAA;AACjF,OAAO,EAAE,WAAW,EAAE,OAAO,EAAE,MAAM,8BAA8B,CAAA;AAInE,OAAO,EAAE,OAAO,EAAE,WAAW,EAAE,CAAA;AAG/B,yEAAyE;AACzE,2EAA2E;AAC3E,qEAAqE;AACrE,MAAM,SAAS,GAAG,EAAE,OAAO,EAAE,WAAW,EAAgC,CAAA;AACxE,KAAK,SAAS,CAAA;AAEd,IAAI,iBAAiB,GAAG,KAAK,CAAA;AAE7B;;;;;GAKG;AACH,MAAM,CAAC,KAAK,UAAU,iCAAiC;IACrD,IAAI,iBAAiB;QAAE,OAAM;IAE7B,sBAAsB,EAAE,CAAA;IAExB,IACE,OAAO,UAAU,CAAC,WAAW,KAAK,WAAW;QAC7C,OAAO,UAAU,CAAC,WAAW,KAAK,WAAW,EAC7C,CAAC;QACD,MAAM,IAAI,KAAK,CAAC,sEAAsE,CAAC,CAAA;IACzF,CAAC;IAED,IAAI,OAAO,UAAU,CAAC,YAAY,KAAK,WAAW,EAAE,CAAC;QACnD,MAAM,IAAI,KAAK,CAAC,2DAA2D,CAAC,CAAA;IAC9E,CAAC;IAED,IACE,OAAO,UAAU,CAAC,cAAc,KAAK,WAAW;QAChD,OAAO,UAAU,CAAC,cAAc,KAAK,WAAW,EAChD,CAAC;QACD,MAAM,IAAI,KAAK,CAAC,0DAA0D,CAAC,CAAA;IAC7E,CAAC;IAED,iBAAiB,GAAG,IAAI,CAAA;AAC1B,CAAC"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Contract that React Native bindings of any provider adapter must satisfy.
|
|
3
|
+
*
|
|
4
|
+
* Scope: This port currently reflects the **WebRTC family** of providers
|
|
5
|
+
* (LiveKit, Daily, Twilio Video, etc.) which all expose `RTCView` from
|
|
6
|
+
* `react-native-webrtc` and a `MediaStream` with `.toURL()`.
|
|
7
|
+
*
|
|
8
|
+
* If a non-WebRTC provider (e.g., Agora with `RtcSurfaceView`) is added
|
|
9
|
+
* later, do NOT force-fit it into this shape — split into a parallel port
|
|
10
|
+
* or generalize this one with a clear migration plan. The current shape
|
|
11
|
+
* is intentional, not a placeholder.
|
|
12
|
+
*
|
|
13
|
+
* This is an **optional contract** — only providers that support React
|
|
14
|
+
* Native need to satisfy it. Web-only adapters can ignore this port.
|
|
15
|
+
*/
|
|
16
|
+
export interface ReactNativeBindings {
|
|
17
|
+
RTCView: ReactComponentType<RTCViewProps>;
|
|
18
|
+
MediaStream: new (...args: never[]) => MediaStreamLike;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Minimal structural type matching React's `ComponentType`.
|
|
22
|
+
*
|
|
23
|
+
* Defined locally so this port (and the core) does not take a dependency on
|
|
24
|
+
* `react` types. Adapters that import `ComponentType` from `react` will
|
|
25
|
+
* remain assignable to this shape via structural typing.
|
|
26
|
+
*/
|
|
27
|
+
export type ReactComponentType<P> = (props: P) => unknown;
|
|
28
|
+
export interface RTCViewProps {
|
|
29
|
+
streamURL: string | null;
|
|
30
|
+
objectFit?: 'cover' | 'contain';
|
|
31
|
+
mirror?: boolean;
|
|
32
|
+
zOrder?: number;
|
|
33
|
+
style?: unknown;
|
|
34
|
+
}
|
|
35
|
+
export interface MediaStreamLike {
|
|
36
|
+
toURL(): string;
|
|
37
|
+
readonly id: string;
|
|
38
|
+
}
|
|
39
|
+
//# sourceMappingURL=react-native-bindings.port.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"react-native-bindings.port.d.ts","sourceRoot":"","sources":["../../../../src/core/ports/outbound/react-native-bindings.port.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AACH,MAAM,WAAW,mBAAmB;IAClC,OAAO,EAAE,kBAAkB,CAAC,YAAY,CAAC,CAAA;IACzC,WAAW,EAAE,KAAK,GAAG,IAAI,EAAE,KAAK,EAAE,KAAK,eAAe,CAAA;CACvD;AAED;;;;;;GAMG;AACH,MAAM,MAAM,kBAAkB,CAAC,CAAC,IAAI,CAAC,KAAK,EAAE,CAAC,KAAK,OAAO,CAAA;AAEzD,MAAM,WAAW,YAAY;IAC3B,SAAS,EAAE,MAAM,GAAG,IAAI,CAAA;IACxB,SAAS,CAAC,EAAE,OAAO,GAAG,SAAS,CAAA;IAC/B,MAAM,CAAC,EAAE,OAAO,CAAA;IAChB,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,KAAK,CAAC,EAAE,OAAO,CAAA;CAChB;AAED,MAAM,WAAW,eAAe;IAC9B,KAAK,IAAI,MAAM,CAAA;IACf,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAA;CACpB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"react-native-bindings.port.js","sourceRoot":"","sources":["../../../../src/core/ports/outbound/react-native-bindings.port.ts"],"names":[],"mappings":""}
|
package/dist/core/vroom.d.ts
CHANGED
|
@@ -28,7 +28,6 @@ export declare class Vroom {
|
|
|
28
28
|
private static apiClient;
|
|
29
29
|
private static authToken;
|
|
30
30
|
private static platform;
|
|
31
|
-
private static mobileGlobalsReady;
|
|
32
31
|
private static initialized;
|
|
33
32
|
private static connecting;
|
|
34
33
|
/**
|
|
@@ -76,12 +75,6 @@ export declare class Vroom {
|
|
|
76
75
|
* @throws {BadRequestError} If platform cannot be detected in non-browser environment
|
|
77
76
|
*/
|
|
78
77
|
private static detectPlatform;
|
|
79
|
-
/**
|
|
80
|
-
* Setup required globals for React Native runtimes.
|
|
81
|
-
*
|
|
82
|
-
* Ensures WebRTC + TextEncoder/TextDecoder are ready before adapters/components use them.
|
|
83
|
-
*/
|
|
84
|
-
private static setupReactNativePolyfills;
|
|
85
78
|
/**
|
|
86
79
|
* Log message based on config
|
|
87
80
|
*/
|
package/dist/core/vroom.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"vroom.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7D;;OAEG;IACH,MAAM,CAAC,WAAW,IAAI,OAAO,KAAK,GAAG,IAAI;IAIzC;;OAEG;IACH,MAAM,CAAC,SAAS,IAAI,eAAe,GAAG,IAAI;IAI1C;;OAEG;IACH,MAAM,CAAC,KAAK,IAAI,IAAI;IAYpB;;OAEG;mBACkB,aAAa;IAqBlC;;;;;;;OAOG;IACH,OAAO,CAAC,MAAM,CAAC,cAAc;IAuB7B;;OAEG;IACH,OAAO,CAAC,MAAM,CAAC,GAAG;CAkBnB"}
|
package/dist/core/vroom.js
CHANGED
|
@@ -46,11 +46,6 @@ export class Vroom {
|
|
|
46
46
|
}
|
|
47
47
|
// Use provided platform info or auto-detect
|
|
48
48
|
const platformInfo = this.detectPlatform(config.platformInfo);
|
|
49
|
-
// For React Native (iOS/Android), initialize WebRTC globals early
|
|
50
|
-
// This must happen before any component that uses WebRTC renders
|
|
51
|
-
if (platformInfo.platform === 'ios' || platformInfo.platform === 'android') {
|
|
52
|
-
await this.setupReactNativePolyfills();
|
|
53
|
-
}
|
|
54
49
|
// Create internal config with platform info
|
|
55
50
|
const internalConfig = {
|
|
56
51
|
...config,
|
|
@@ -128,7 +123,6 @@ export class Vroom {
|
|
|
128
123
|
this.apiClient = null;
|
|
129
124
|
this.authToken = null;
|
|
130
125
|
this.platform = null;
|
|
131
|
-
this.mobileGlobalsReady = false;
|
|
132
126
|
this.initialized = false;
|
|
133
127
|
this.connecting = false;
|
|
134
128
|
this.log('info', 'Vroom SDK reset');
|
|
@@ -175,23 +169,6 @@ export class Vroom {
|
|
|
175
169
|
' - iOS: { platform: "ios", bundleId: "com.example.app" }\n' +
|
|
176
170
|
' - Android: { platform: "android", packageName: "com.example.app" }');
|
|
177
171
|
}
|
|
178
|
-
/**
|
|
179
|
-
* Setup required globals for React Native runtimes.
|
|
180
|
-
*
|
|
181
|
-
* Ensures WebRTC + TextEncoder/TextDecoder are ready before adapters/components use them.
|
|
182
|
-
*/
|
|
183
|
-
static async setupReactNativePolyfills() {
|
|
184
|
-
if (this.mobileGlobalsReady)
|
|
185
|
-
return;
|
|
186
|
-
try {
|
|
187
|
-
const { registerWebRTCGlobals } = await import('../react-native');
|
|
188
|
-
await registerWebRTCGlobals();
|
|
189
|
-
this.mobileGlobalsReady = true;
|
|
190
|
-
}
|
|
191
|
-
catch (error) {
|
|
192
|
-
throw new VroomError(ErrorCodes.E_PLATFORM_MISMATCH, 'Failed to initialize React Native WebRTC globals. Ensure WebRTC polyfills are installed.', error);
|
|
193
|
-
}
|
|
194
|
-
}
|
|
195
172
|
/**
|
|
196
173
|
* Log message based on config
|
|
197
174
|
*/
|
|
@@ -213,7 +190,6 @@ Vroom.config = null;
|
|
|
213
190
|
Vroom.apiClient = null;
|
|
214
191
|
Vroom.authToken = null;
|
|
215
192
|
Vroom.platform = null;
|
|
216
|
-
Vroom.mobileGlobalsReady = false;
|
|
217
193
|
Vroom.initialized = false;
|
|
218
194
|
Vroom.connecting = false;
|
|
219
195
|
//# sourceMappingURL=vroom.js.map
|
package/dist/core/vroom.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"vroom.js","sourceRoot":"","sources":["../../src/core/vroom.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,sBAAsB,GAMvB,MAAM,qBAAqB,CAAA;AAI5B,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AACnC,OAAO,EAAE,eAAe,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAA;AAClE,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAA;AACjD,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAA;AAC/C,OAAO,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAA;AAExD;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,MAAM,OAAO,KAAK;
|
|
1
|
+
{"version":3,"file":"vroom.js","sourceRoot":"","sources":["../../src/core/vroom.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,sBAAsB,GAMv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AAS,GAA0B,IAAI,CAAA;AACvC,eAAS,GAAkB,IAAI,CAAA;AAC/B,cAAQ,GAAoB,IAAI,CAAA;AAChC,iBAAW,GAAG,KAAK,CAAA;AACnB,gBAAU,GAAG,KAAK,CAAA"}
|
package/dist/react-native.d.ts
CHANGED
|
@@ -1,21 +1,17 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* SDK composition root for React Native.
|
|
3
3
|
*
|
|
4
|
-
*
|
|
5
|
-
|
|
6
|
-
import
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
zOrder?: number;
|
|
13
|
-
style?: unknown;
|
|
14
|
-
}
|
|
15
|
-
/**
|
|
16
|
-
* Registers all globals required by LiveKit on React Native.
|
|
4
|
+
* This file (and only this file) knows which provider adapter is active —
|
|
5
|
+
* it re-exports the active adapter's React Native bindings so consumers
|
|
6
|
+
* can import them via the provider-agnostic public subpath
|
|
7
|
+
* `@waitaya.buc/client-js/react-native`.
|
|
8
|
+
*
|
|
9
|
+
* Hexagonal rule: core code under `src/core/` MUST NOT import this file.
|
|
10
|
+
* The composition root is allowed to know the concrete adapter; the core
|
|
11
|
+
* is not.
|
|
17
12
|
*
|
|
18
|
-
*
|
|
13
|
+
* Swapping providers (e.g., LiveKit → Daily) is a build-time change to
|
|
14
|
+
* this single line — consumers do not need to update import paths.
|
|
19
15
|
*/
|
|
20
|
-
export
|
|
16
|
+
export * from './adapters/livekit/react-native';
|
|
21
17
|
//# sourceMappingURL=react-native.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"react-native.d.ts","sourceRoot":"","sources":["../src/react-native.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"react-native.d.ts","sourceRoot":"","sources":["../src/react-native.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AACH,cAAc,iCAAiC,CAAA"}
|
package/dist/react-native.js
CHANGED
|
@@ -1,32 +1,17 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* SDK composition root for React Native.
|
|
3
3
|
*
|
|
4
|
-
*
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
*
|
|
4
|
+
* This file (and only this file) knows which provider adapter is active —
|
|
5
|
+
* it re-exports the active adapter's React Native bindings so consumers
|
|
6
|
+
* can import them via the provider-agnostic public subpath
|
|
7
|
+
* `@waitaya.buc/client-js/react-native`.
|
|
8
|
+
*
|
|
9
|
+
* Hexagonal rule: core code under `src/core/` MUST NOT import this file.
|
|
10
|
+
* The composition root is allowed to know the concrete adapter; the core
|
|
11
|
+
* is not.
|
|
12
12
|
*
|
|
13
|
-
*
|
|
13
|
+
* Swapping providers (e.g., LiveKit → Daily) is a build-time change to
|
|
14
|
+
* this single line — consumers do not need to update import paths.
|
|
14
15
|
*/
|
|
15
|
-
export
|
|
16
|
-
if (globalsRegistered)
|
|
17
|
-
return;
|
|
18
|
-
registerLiveKitGlobals();
|
|
19
|
-
if (typeof globalThis.TextDecoder === 'undefined' ||
|
|
20
|
-
typeof globalThis.TextEncoder === 'undefined') {
|
|
21
|
-
throw new Error('Failed to polyfill TextEncoder/TextDecoder for React Native runtime.');
|
|
22
|
-
}
|
|
23
|
-
if (typeof globalThis.DOMException === 'undefined') {
|
|
24
|
-
throw new Error('Failed to polyfill DOMException for React Native runtime.');
|
|
25
|
-
}
|
|
26
|
-
if (typeof globalThis.ReadableStream === 'undefined' ||
|
|
27
|
-
typeof globalThis.WritableStream === 'undefined') {
|
|
28
|
-
throw new Error('Failed to polyfill Web Streams for React Native runtime.');
|
|
29
|
-
}
|
|
30
|
-
globalsRegistered = true;
|
|
31
|
-
}
|
|
16
|
+
export * from './adapters/livekit/react-native';
|
|
32
17
|
//# sourceMappingURL=react-native.js.map
|
package/dist/react-native.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"react-native.js","sourceRoot":"","sources":["../src/react-native.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"react-native.js","sourceRoot":"","sources":["../src/react-native.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AACH,cAAc,iCAAiC,CAAA"}
|