import { ErrorLike, MediaFeatureAvailability, MediaStreamType, TextTrackKind } from "./types.js"; //#region src/core/state.d.ts interface MediaPlaybackState { /** * Whether playback is paused. * * @see https://developer.mozilla.org/en-US/docs/Web/API/HTMLMediaElement/paused */ paused: boolean; /** * Whether playback has reached the end. * * @see https://developer.mozilla.org/en-US/docs/Web/API/HTMLMediaElement/ended */ ended: boolean; /** * Whether playback has started (played or seeked). */ started: boolean; /** * Whether playback is stalled waiting for data. * * @see https://developer.mozilla.org/en-US/docs/Web/API/HTMLMediaElement/waiting_event */ waiting: boolean; /** * Start playback. * * @see https://developer.mozilla.org/en-US/docs/Web/API/HTMLMediaElement/play */ play(): Promise; /** * Pause playback. * * @see https://developer.mozilla.org/en-US/docs/Web/API/HTMLMediaElement/pause */ pause(): void; /** Toggle play/pause. Returns `true` if playback started. */ togglePaused(): boolean; } interface MediaVolumeState { /** * Volume level from 0 (silent) to 1 (max). * * @see https://developer.mozilla.org/en-US/docs/Web/API/HTMLMediaElement/volume */ volume: number; /** * Whether audio is muted. * * @see https://developer.mozilla.org/en-US/docs/Web/API/HTMLMediaElement/muted */ muted: boolean; /** * Whether volume can be programmatically set on this platform. * * @see https://developer.mozilla.org/en-US/docs/Web/API/HTMLMediaElement/volume */ volumeAvailability: MediaFeatureAvailability; /** * Whether the media can be muted. Separate from `volumeAvailability` because * the two come apart: an embed can take a mute command while offering no way * to set a level, and iOS Safari refuses a volume write on media that mutes * perfectly well. * * @see https://developer.mozilla.org/en-US/docs/Web/API/HTMLMediaElement/muted */ mutedAvailability: MediaFeatureAvailability; /** * Set volume (clamped 0-1). Returns the clamped value. * * @see https://developer.mozilla.org/en-US/docs/Web/API/HTMLMediaElement/volume */ setVolume(volume: number): number; /** * Toggle mute state. Returns the new muted value. * * @see https://developer.mozilla.org/en-US/docs/Web/API/HTMLMediaElement/muted */ toggleMuted(): boolean; } interface MediaTimeState { /** * Current playback position in seconds. * * @see https://developer.mozilla.org/en-US/docs/Web/API/HTMLMediaElement/currentTime */ currentTime: number; /** * Total duration in seconds (0 if unknown). * * @see https://developer.mozilla.org/en-US/docs/Web/API/HTMLMediaElement/duration */ duration: number; /** * Whether a seek operation is in progress. * * @see https://developer.mozilla.org/en-US/docs/Web/API/HTMLMediaElement/seeking */ seeking: boolean; /** * Seek to a time in seconds. Returns the actual position after seek. * * @see https://developer.mozilla.org/en-US/docs/Web/API/HTMLMediaElement/currentTime */ seek(time: number): Promise; } interface MediaSourceState { /** * Current media source URL (null if none). * * @see https://developer.mozilla.org/en-US/docs/Web/API/HTMLMediaElement/currentSrc * @see https://developer.mozilla.org/en-US/docs/Web/API/HTMLMediaElement/src */ source: string | null; /** * Whether enough data is loaded to begin playback. * * @see https://developer.mozilla.org/en-US/docs/Web/API/HTMLMediaElement/readyState */ canPlay: boolean; /** * Load a new media source. Returns the new source URL. * * @see https://developer.mozilla.org/en-US/docs/Web/API/HTMLMediaElement/src * @see https://developer.mozilla.org/en-US/docs/Web/API/HTMLMediaElement/load */ loadSource(src: string): string; } interface MediaStreamTypeState { /** * Current stream delivery type. * * Components use this to toggle live-specific UI (e.g. a live indicator, * a "jump to live edge" affordance, or hiding the time display). * * @see {@link MediaStreamTypes} for the canonical string values. * @see https://github.com/video-dev/media-ui-extensions/blob/main/proposals/0010-stream-type.md */ streamType: MediaStreamType; } /** Resolved content metadata exposed by the player store. */ interface MediaMetadataState { /** The resolved content title. Set it through the player, not through the store. */ title: string; /** * The resolved poster URL, independent of the media element's own `poster`. * Set it through the player, not through the store. */ poster: string; } interface MediaLiveState { /** * Presentation time marking the start of the Live Edge Window. * * Playing at the live edge when `currentTime >= liveEdgeStart`. `NaN` * when the stream isn't live or the value is unknown. * * @see https://github.com/video-dev/media-ui-extensions/blob/main/proposals/0007-live-edge.md */ liveEdgeStart: number; /** * Offset representing the seekable range size for live content. * * `0` for standard latency live, `Infinity` for DVR, `NaN` for on-demand * or unknown. */ targetLiveWindow: number; } interface MediaBufferState { /** * Buffered time ranges as [start, end] tuples. * * @see https://developer.mozilla.org/en-US/docs/Web/API/HTMLMediaElement/buffered */ buffered: [number, number][]; /** * Seekable time ranges as [start, end] tuples. * * @see https://developer.mozilla.org/en-US/docs/Web/API/HTMLMediaElement/seekable */ seekable: [number, number][]; } interface MediaFullscreenState { /** * Whether fullscreen mode is currently active. * * @see https://developer.mozilla.org/en-US/docs/Web/API/Fullscreen_API */ fullscreen: boolean; /** * Whether fullscreen can be requested on this platform. * * @see https://developer.mozilla.org/en-US/docs/Web/API/Document/fullscreenEnabled */ fullscreenAvailability: MediaFeatureAvailability; /** * Enter fullscreen mode. Tries container first, falls back to media element. * * @see https://developer.mozilla.org/en-US/docs/Web/API/Element/requestFullscreen */ requestFullscreen(): Promise; /** * Exit fullscreen mode. * * @see https://developer.mozilla.org/en-US/docs/Web/API/Document/exitFullscreen */ exitFullscreen(): Promise; /** Toggle fullscreen mode. */ toggleFullscreen(): Promise; } interface MediaControlsState { /** Whether the user has recently interacted with the player. */ userActive: boolean; /** Whether controls should be visible. */ controlsVisible: boolean; /** * Keep controls visible during a sustained interaction. * * The returned function releases the lock. Multiple concurrent locks are * supported and each release function is idempotent. */ requestControlsLock(): () => void; /** Toggle controls visibility. Returns the new `controlsVisible` value. */ toggleControls(): boolean; } interface MediaPlaybackRateState { /** * Available playback rates. * * @see https://developer.mozilla.org/en-US/docs/Web/API/HTMLMediaElement/playbackRate */ readonly playbackRates: readonly number[]; /** * Current playback rate. * * @see https://developer.mozilla.org/en-US/docs/Web/API/HTMLMediaElement/playbackRate */ playbackRate: number; /** * Set the playback rate. * * @see https://developer.mozilla.org/en-US/docs/Web/API/HTMLMediaElement/playbackRate */ setPlaybackRate(rate: number): void; } interface MediaVideoRendition { id?: string; width?: number; height?: number; bitrate?: number; frameRate?: number; codec?: string; selected: boolean; } interface MediaQualityState { /** Video renditions available for manual quality selection. */ videoRenditionList: MediaVideoRendition[]; /** Video rendition currently playing, including when automatic ABR is selected. */ activeVideoRendition: MediaVideoRendition | null; /** Select a video rendition by menu value, or automatic ABR with `"auto"`. */ selectVideoRendition(value: string): void; } interface MediaAudioTrack { id?: string; kind?: string; label: string; language: string; enabled: boolean; } interface MediaAudioTrackState { /** Audio tracks available for manual track selection. */ audioTrackList: MediaAudioTrack[]; /** Select an audio track by menu value. */ selectAudioTrack(value: string): void; } /** * A text cue. * * @see https://developer.mozilla.org/en-US/docs/Web/API/VTTCue */ interface MediaTextCue { startTime: number; endTime: number; text: string; } /** * The mode of a text track. * * @see https://developer.mozilla.org/en-US/docs/Web/API/TextTrack/mode */ type TextTrackMode = 'showing' | 'disabled' | 'hidden'; /** * A text track. * * @see https://developer.mozilla.org/en-US/docs/Web/API/TextTrack */ interface MediaTextTrack { id?: string; kind: Kind; label: string; language: string; mode: TextTrackMode; } interface MediaTextTrackState { /** Cues from the first `kind="chapters"` track. */ chaptersCues: MediaTextCue[]; /** Cues from the first `kind="metadata" label="thumbnails"` track. */ thumbnailCues: MediaTextCue[]; /** The `` element's `src` for resolving relative cue text URLs. */ thumbnailTrackSrc: string | null; /** * The media element's CORS mode, mapped through the CORS-settings-attribute * rules, or `null` when it is not in CORS mode. Thumbnail UI fetches the * sprite sheets the cues point at with this mode, since a cross-origin * `` only loads at all when the media element is CORS-enabled. */ thumbnailTrackCrossOrigin: 'anonymous' | 'use-credentials' | null; /** All text tracks available on the media element. */ textTrackList: MediaTextTrack[]; /** Whether captions/subtitles are currently enabled. */ subtitlesShowing: boolean; /** * Toggle captions/subtitles visibility. Showing restores the track that was * last showing, or the first caption/subtitle track when there is none. * Returns the new enabled value. */ toggleSubtitles(forceShow?: boolean): boolean; /** Select a captions/subtitles track by menu value, or disable with `"off"`. */ selectSubtitlesTrack(value: string): void; } interface MediaErrorState { /** * The current media error, or null if none. * * @see https://developer.mozilla.org/en-US/docs/Web/API/HTMLMediaElement/error */ error: ErrorLike | null; /** Dismiss the current error by clearing it. */ dismissError(): void; } type RemotePlaybackConnectionState = 'disconnected' | 'connecting' | 'connected'; interface MediaRemotePlaybackState { /** * Current remote playback connection state. * * @see https://developer.mozilla.org/en-US/docs/Web/API/RemotePlayback/state */ remotePlaybackState: RemotePlaybackConnectionState; /** * Whether remote playback can be requested on this platform. * * @see https://developer.mozilla.org/en-US/docs/Web/API/RemotePlayback */ remotePlaybackAvailability: MediaFeatureAvailability; /** Toggle the remote playback connection. */ toggleRemotePlayback(): Promise; } interface MediaPictureInPictureState { /** * Whether picture-in-picture mode is currently active. * * @see https://developer.mozilla.org/en-US/docs/Web/API/Picture-in-Picture_API */ pip: boolean; /** * Whether picture-in-picture can be requested on this platform. * * @see https://developer.mozilla.org/en-US/docs/Web/API/Document/pictureInPictureEnabled */ pipAvailability: MediaFeatureAvailability; /** * Enter picture-in-picture mode. * * @see https://developer.mozilla.org/en-US/docs/Web/API/HTMLVideoElement/requestPictureInPicture */ requestPictureInPicture(): Promise; /** * Exit picture-in-picture mode. * * @see https://developer.mozilla.org/en-US/docs/Web/API/Document/exitPictureInPicture */ exitPictureInPicture(): Promise; /** Toggle picture-in-picture mode. */ togglePictureInPicture(): Promise; } //#endregion export { MediaAudioTrack, MediaAudioTrackState, MediaBufferState, MediaControlsState, MediaErrorState, MediaFullscreenState, MediaLiveState, MediaMetadataState, MediaPictureInPictureState, MediaPlaybackRateState, MediaPlaybackState, MediaQualityState, MediaRemotePlaybackState, MediaSourceState, MediaStreamTypeState, MediaTextCue, MediaTextTrack, MediaTextTrackState, MediaTimeState, MediaVideoRendition, MediaVolumeState, RemotePlaybackConnectionState, TextTrackMode }; //# sourceMappingURL=state.d.ts.map