Skip to main content

MediaCaptureSession

interface
interface MediaCaptureSession

Import

import { MediaCaptureSession } from '@modular/sdk';

Members9

audioTracks
readonly Readonly<{ capability: z.ZodReadonly<z.ZodObject<{ format: z.ZodReadonly<z.ZodObject<{ channels: z.ZodLiteral<1>; encoding: z.ZodLiteral<'linear16'>; sampleRate: z.ZodLiteral<16000> }, z.core.$strip>>; id: z.core.$ZodBranded<z.ZodString, 'MediaAudioCaptureRefId', 'out'>; kind: z.ZodLiteral<'capture-ref'> }, z.core.$strip>>; format: z.ZodReadonly<z.ZodObject<{ channels: z.ZodLiteral<1>; encoding: z.ZodLiteral<'linear16'>; sampleRate: z.ZodLiteral<16000> }, z.core.$strip>>; id: string & $brand<'MediaCaptureTrackId'>; kind: 'audio'; source: Readonly<Readonly<{ kind: 'microphone'; name: string; sourceId: string }>> | Readonly<Readonly<{ kind: 'system-audio'; name: string; sourceId: string }>> | Readonly<Readonly<{ kind: 'screen'; name: string; sourceId: string }>> | Readonly<Readonly<{ kind: 'window'; name: string; sourceId: string }>> }>[]
id
string & $brand<'MediaCaptureSessionId'>
state
Readonly<Readonly<{ capturedAt: string; id: string & $brand<'MediaCaptureSessionId'>; kind: 'capturing'; tracks: readonly (Readonly<{ capability: z.ZodReadonly<z.ZodObject<{ format: ...; id: ...; kind: ... }, z.core.$strip>>; format: z.ZodReadonly<z.ZodObject<{ channels: ...; encoding: ...; sampleRate: ... }, z.core.$strip>>; id: string & $brand<'MediaCaptureTrackId'>; kind: 'audio'; source: Readonly<Readonly<...>> | Readonly<Readonly<...>> | Readonly<Readonly<...>> | Readonly<Readonly<...>> }> | Readonly<{ frameRate: number | null; height: number | null; id: string & $brand<'MediaCaptureTrackId'>; kind: 'video'; source: Readonly<Readonly<...>> | Readonly<Readonly<...>>; width: number | null }>)[] }>> | Readonly<Readonly<{ capturedAt: string; id: string & $brand<'MediaCaptureSessionId'>; kind: 'stopping'; tracks: readonly (Readonly<{ capability: z.ZodReadonly<z.ZodObject<{ format: ...; id: ...; kind: ... }, z.core.$strip>>; format: z.ZodReadonly<z.ZodObject<{ channels: ...; encoding: ...; sampleRate: ... }, z.core.$strip>>; id: string & $brand<'MediaCaptureTrackId'>; kind: 'audio'; source: Readonly<Readonly<...>> | Readonly<Readonly<...>> | Readonly<Readonly<...>> | Readonly<Readonly<...>> }> | Readonly<{ frameRate: number | null; height: number | null; id: string & $brand<'MediaCaptureTrackId'>; kind: 'video'; source: Readonly<Readonly<...>> | Readonly<Readonly<...>>; width: number | null }>)[] }>> | Readonly<Readonly<{ capturedAt: string; endedAt: string; id: string & $brand<'MediaCaptureSessionId'>; kind: 'stopped'; tracks: readonly (Readonly<{ capability: z.ZodReadonly<z.ZodObject<{ format: ...; id: ...; kind: ... }, z.core.$strip>>; format: z.ZodReadonly<z.ZodObject<{ channels: ...; encoding: ...; sampleRate: ... }, z.core.$strip>>; id: string & $brand<'MediaCaptureTrackId'>; kind: 'audio'; source: Readonly<Readonly<...>> | Readonly<Readonly<...>> | Readonly<Readonly<...>> | Readonly<Readonly<...>> }> | Readonly<{ frameRate: number | null; height: number | null; id: string & $brand<'MediaCaptureTrackId'>; kind: 'video'; source: Readonly<Readonly<...>> | Readonly<Readonly<...>>; width: number | null }>)[] }>> | Readonly<Readonly<{ capturedAt: string; endedAt: string; id: string & $brand<'MediaCaptureSessionId'>; kind: 'cancelled'; tracks: readonly (Readonly<{ capability: z.ZodReadonly<z.ZodObject<{ format: ...; id: ...; kind: ... }, z.core.$strip>>; format: z.ZodReadonly<z.ZodObject<{ channels: ...; encoding: ...; sampleRate: ... }, z.core.$strip>>; id: string & $brand<'MediaCaptureTrackId'>; kind: 'audio'; source: Readonly<Readonly<...>> | Readonly<Readonly<...>> | Readonly<Readonly<...>> | Readonly<Readonly<...>> }> | Readonly<{ frameRate: number | null; height: number | null; id: string & $brand<'MediaCaptureTrackId'>; kind: 'video'; source: Readonly<Readonly<...>> | Readonly<Readonly<...>>; width: number | null }>)[] }>> | Readonly<Readonly<{ capturedAt: string; endedAt: string; error: { code: 'cancelled' | 'permission-denied' | 'audio-overrun' | 'capability-invalid' | 'capture-failed' | 'device-not-found' | 'input-closed' | 'no-audio-input' | 'platform-unsupported' | 'source-ended' | 'source-unavailable'; message: string; operation: 'stop' | 'capture' | 'acquire-audio' | 'cancel' | 'list-sources' | 'mix' | 'observe-audio-level' | 'record'; sessionId: string & $brand<'MediaCaptureSessionId'> | null }; id: string & $brand<'MediaCaptureSessionId'>; kind: 'failed'; tracks: readonly (Readonly<{ capability: z.ZodReadonly<z.ZodObject<{ format: ...; id: ...; kind: ... }, z.core.$strip>>; format: z.ZodReadonly<z.ZodObject<{ channels: ...; encoding: ...; sampleRate: ... }, z.core.$strip>>; id: string & $brand<'MediaCaptureTrackId'>; kind: 'audio'; source: Readonly<Readonly<...>> | Readonly<Readonly<...>> | Readonly<Readonly<...>> | Readonly<Readonly<...>> }> | Readonly<{ frameRate: number | null; height: number | null; id: string & $brand<'MediaCaptureTrackId'>; kind: 'video'; source: Readonly<Readonly<...>> | Readonly<Readonly<...>>; width: number | null }>)[] }>>
videoTracks
readonly Readonly<{ frameRate: number | null; height: number | null; id: string & $brand<'MediaCaptureTrackId'>; kind: 'video'; source: Readonly<Readonly<{ kind: 'screen'; name: string; sourceId: string }>> | Readonly<Readonly<{ kind: 'window'; name: string; sourceId: string }>>; width: number | null }>[]
audio
() => Promise<MediaCaptureError | Readonly<{ format: z.ZodReadonly<z.ZodObject<{ channels: z.ZodLiteral<1>; encoding: z.ZodLiteral<'linear16'>; sampleRate: z.ZodLiteral<16000> }, z.core.$strip>>; id: string & $brand<'MediaAudioCaptureRefId'>; kind: 'capture-ref' }>>
cancel
() => Promise<void | MediaCaptureError>
record
(request: { audio: Readonly<{ format: z.ZodReadonly<z.ZodObject<{ channels: z.ZodLiteral<1>; encoding: z.ZodLiteral<'linear16'>; sampleRate: z.ZodLiteral<16000> }, z.core.$strip>>; id: string & $brand<'MediaAudioCaptureRefId'>; kind: 'capture-ref' }> | null; container: 'mp4' | 'webm'; videoTrackId: string & $brand<'MediaCaptureTrackId'> | null }) => Promise<MediaCaptureError | MediaRecording>
stop
() => Promise<void | MediaCaptureError>
subscribe
(listener: (state: Readonly<Readonly<{ capturedAt: string; id: string & $brand<'MediaCaptureSessionId'>; kind: 'capturing'; tracks: readonly (Readonly<{ capability: z.ZodReadonly<z.ZodObject<..., ...>>; format: z.ZodReadonly<z.ZodObject<..., ...>>; id: string & $brand<...>; kind: 'audio'; source: Readonly<...> | Readonly<...> | Readonly<...> | Readonly<...> }> | Readonly<{ frameRate: number | null; height: number | null; id: string & $brand<...>; kind: 'video'; source: Readonly<...> | Readonly<...>; width: number | null }>)[] }>> | Readonly<Readonly<{ capturedAt: string; id: string & $brand<'MediaCaptureSessionId'>; kind: 'stopping'; tracks: readonly (Readonly<{ capability: z.ZodReadonly<z.ZodObject<..., ...>>; format: z.ZodReadonly<z.ZodObject<..., ...>>; id: string & $brand<...>; kind: 'audio'; source: Readonly<...> | Readonly<...> | Readonly<...> | Readonly<...> }> | Readonly<{ frameRate: number | null; height: number | null; id: string & $brand<...>; kind: 'video'; source: Readonly<...> | Readonly<...>; width: number | null }>)[] }>> | Readonly<Readonly<{ capturedAt: string; endedAt: string; id: string & $brand<'MediaCaptureSessionId'>; kind: 'stopped'; tracks: readonly (Readonly<{ capability: z.ZodReadonly<z.ZodObject<..., ...>>; format: z.ZodReadonly<z.ZodObject<..., ...>>; id: string & $brand<...>; kind: 'audio'; source: Readonly<...> | Readonly<...> | Readonly<...> | Readonly<...> }> | Readonly<{ frameRate: number | null; height: number | null; id: string & $brand<...>; kind: 'video'; source: Readonly<...> | Readonly<...>; width: number | null }>)[] }>> | Readonly<Readonly<{ capturedAt: string; endedAt: string; id: string & $brand<'MediaCaptureSessionId'>; kind: 'cancelled'; tracks: readonly (Readonly<{ capability: z.ZodReadonly<z.ZodObject<..., ...>>; format: z.ZodReadonly<z.ZodObject<..., ...>>; id: string & $brand<...>; kind: 'audio'; source: Readonly<...> | Readonly<...> | Readonly<...> | Readonly<...> }> | Readonly<{ frameRate: number | null; height: number | null; id: string & $brand<...>; kind: 'video'; source: Readonly<...> | Readonly<...>; width: number | null }>)[] }>> | Readonly<Readonly<{ capturedAt: string; endedAt: string; error: { code: 'cancelled' | 'permission-denied' | 'audio-overrun' | 'capability-invalid' | 'capture-failed' | 'device-not-found' | 'input-closed' | 'no-audio-input' | 'platform-unsupported' | 'source-ended' | 'source-unavailable'; message: string; operation: 'stop' | 'capture' | 'acquire-audio' | 'cancel' | 'list-sources' | 'mix' | 'observe-audio-level' | 'record'; sessionId: string & $brand<'MediaCaptureSessionId'> | null }; id: string & $brand<'MediaCaptureSessionId'>; kind: 'failed'; tracks: readonly (Readonly<{ capability: z.ZodReadonly<z.ZodObject<..., ...>>; format: z.ZodReadonly<z.ZodObject<..., ...>>; id: string & $brand<...>; kind: 'audio'; source: Readonly<...> | Readonly<...> | Readonly<...> | Readonly<...> }> | Readonly<{ frameRate: number | null; height: number | null; id: string & $brand<...>; kind: 'video'; source: Readonly<...> | Readonly<...>; width: number | null }>)[] }>>) => void) => Disposable