UNPKG

@signalwire/core

Version:
40 lines 1.94 kB
import { BaseComponent } from '../BaseComponent'; import { BaseComponentOptionsWithPayload } from '../utils/interfaces'; import type { VideoPlaybackContract, VideoPlaybackMethods, VideoPlaybackEventNames, VideoPlaybackEventParams } from '../types/videoPlayback'; /** * Instances of this class allow you to control (e.g., pause, resume, stop) the * playback inside a room session. You can obtain instances of this class by * starting a playback from the desired {@link RoomSession} (see * {@link RoomSession.play}) */ export interface RoomSessionPlayback extends VideoPlaybackContract { setPayload(payload: VideoPlaybackEventParams): void; } export type RoomSessionPlaybackEventsHandlerMapping = Record<VideoPlaybackEventNames, (playback: RoomSessionPlayback) => void>; export interface RoomSessionPlaybackOptions extends BaseComponentOptionsWithPayload<VideoPlaybackEventParams> { } export declare class RoomSessionPlaybackAPI extends BaseComponent<RoomSessionPlaybackEventsHandlerMapping> implements VideoPlaybackMethods { private _payload; constructor(options: RoomSessionPlaybackOptions); get id(): string; get roomId(): string; get roomSessionId(): string; get url(): string; get state(): "paused" | "completed" | "playing"; get volume(): number; get startedAt(): Date | undefined; get endedAt(): Date | undefined; get position(): number; get seekable(): boolean; /** @internal */ protected setPayload(payload: VideoPlaybackEventParams): void; pause(): Promise<void>; resume(): Promise<void>; stop(): Promise<void>; setVolume(volume: number): Promise<void>; seek(timecode: number): Promise<void>; forward(offset?: number): Promise<void>; rewind(offset?: number): Promise<void>; } export declare const createRoomSessionPlaybackObject: (params: RoomSessionPlaybackOptions) => RoomSessionPlayback; //# sourceMappingURL=RoomSessionPlayback.d.ts.map