@limrun/ui 0.22.5 → 0.22.6

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.
@@ -226,6 +226,21 @@ export interface RemoteControlProps {
226
226
  * track mid-stream, and when capture stops.
227
227
  */
228
228
  onMicrophoneStateChange?: (state: MicrophoneState) => void;
229
+ /**
230
+ * iOS only: plays the simulator's speaker output in sync with the screen
231
+ * when false. Defaults to true, and the simulator sends no sound while every
232
+ * viewer is muted. Unmute from a click handler or after other user
233
+ * interaction, because browsers refuse sound before it. Changing it never
234
+ * reconnects the stream.
235
+ */
236
+ speakerMuted?: boolean;
237
+ /**
238
+ * Fires when the browser refuses to play the sound, for example when the
239
+ * audio arrives or reconnects long after the click that unmuted it. The
240
+ * sound stays off until the next click or key press on the page, unless the
241
+ * caller sets `speakerMuted` first.
242
+ */
243
+ onSpeakerBlocked?: () => void;
229
244
  }
230
245
  export interface RemoteControlHandle {
231
246
  openUrl: (url: string) => void;
@@ -6,6 +6,7 @@ export declare function createDeviceStream(initialOptions: DeviceStreamOptions):
6
6
  start: () => void;
7
7
  stop: () => void;
8
8
  attachVideo: (video: HTMLVideoElement, display?: StreamDisplay) => () => void;
9
+ attachAudio: (audio: HTMLAudioElement) => () => void;
9
10
  attachFrameSink: (sink: DeviceFrameSink, display?: StreamDisplay) => () => void;
10
11
  dispose: () => void;
11
12
  getState: () => DeviceStreamState;
@@ -45,6 +45,16 @@ export interface DeviceStreamLiveOptions {
45
45
  onCameraDemandChange?: (active: boolean, granted?: boolean, camera?: CameraCaptureInfo) => void;
46
46
  onCameraStats?: (stats: CameraStreamStats | null) => void;
47
47
  onMicrophoneStateChange?: (state: MicrophoneState) => void;
48
+ /**
49
+ * iOS only: false asks the simulator to send its speaker output, which
50
+ * elements passed to `attachAudio` play in sync with the screen. Defaults to
51
+ * true, so a stream nobody listens to carries no sound. Muting those
52
+ * elements stays with the caller, because only a user gesture lets a
53
+ * browser play sound.
54
+ */
55
+ speakerMuted?: boolean;
56
+ /** The browser refused unmuted speaker audio, so an attached audio element went muted. */
57
+ onSpeakerBlocked?: () => void;
48
58
  }
49
59
  export type DeviceStreamOptions = DeviceStreamLiveOptions & {
50
60
  /** Disable device input and outbound media. Enforce access with a server-issued watch token. */
@@ -1,5 +1,15 @@
1
1
  export declare const debugLog: (...args: any[]) => void;
2
2
  export declare const debugWarn: (...args: any[]) => void;
3
+ /** Drops a pending retry, because the caller chose mute or unmute itself. */
4
+ export declare const cancelSpeakerRetry: (audio: HTMLMediaElement) => void;
5
+ /**
6
+ * Plays an element that carries the simulator's speaker audio. Browsers
7
+ * refuse sound outside a recent user gesture; the element then keeps playing
8
+ * muted, `onBlocked` lets the caller show that the sound is off, and the next
9
+ * click or key press anywhere on the page turns the sound back on. A caller
10
+ * that mutes in between cancels that with `cancelSpeakerRetry`.
11
+ */
12
+ export declare const playSpeaker: (audio: HTMLMediaElement, onBlocked: () => void) => void;
3
13
  export declare const safeInvoke: <Args extends unknown[]>(label: string, fn: ((...args: Args) => unknown) | undefined, ...args: Args) => void;
4
14
  export type DevicePlatform = 'ios' | 'android' | 'macos';
5
15
  export declare const detectPlatform: (url: string) => DevicePlatform;