/** * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the Microsoft Live Share SDK License. */ import { ILiveEvent, TimeInterval, IEvent } from "@microsoft/live-share"; import { IRuntimeSignaler, LiveShareRuntime } from "@microsoft/live-share/internal"; import { ExtendedMediaMetadata, CoordinationWaitPoint, ExtendedMediaSessionPlaybackState, ExtendedMediaSessionActionDetails } from "../MediaSessionExtensions.js"; import { GroupPlaybackTrack, IPlaybackTrack } from "./GroupPlaybackTrack.js"; import { GroupTransportState, ITransportState } from "./GroupTransportState.js"; import { GroupPlaybackPosition } from "./GroupPlaybackPosition.js"; import { IMediaPlayerState } from "../LiveMediaSessionCoordinator.js"; import { GroupPlaybackTrackData, IPlaybackTrackData } from "./GroupPlaybackTrackData.js"; import { GroupPlaybackRate, IPlaybackRate } from "./GroupPlaybackRate.js"; import { TypedEventEmitter } from "@fluid-internal/client-utils"; import { IGenericTypedEvents } from "./interfaces.js"; import { PriorityTimeInterval } from "./PriorityTimeInterval.js"; /** * @hidden */ export interface IPositionUpdateEvent { track: IPlaybackTrack; trackData: IPlaybackTrackData; transport: ITransportState; playbackRate: IPlaybackRate; playbackState: ExtendedMediaSessionPlaybackState; position: number; waitPoint?: CoordinationWaitPoint; } /** * @hidden */ export interface ITransportCommandEvent { track: IPlaybackTrack; position: number; } /** * @hidden */ export interface IRateChangeCommandEvent { playbackRate: number; } /** * @hidden */ export interface ISetTrackEvent { metadata: ExtendedMediaMetadata | null; waitPoints: CoordinationWaitPoint[]; } /** * @hidden */ export interface ISetTrackDataEvent { data: object | null; } /** * @hidden */ export interface ITriggerActionEvent extends IEvent { details: ExtendedMediaSessionActionDetails; } /** * @hidden */ export declare enum GroupCoordinatorStateEvents { newwaitpoint = "newwaitpoint", triggeraction = "triggeraction", triggeractionignored = "triggeractionignored" } /** * @hidden */ export declare class GroupCoordinatorState extends TypedEventEmitter { private readonly _runtime; private readonly _liveRuntime; private readonly _logger; private readonly _maxPlaybackDrift; private _getMediaPlayerState; private _playbackTrack; private _playbackTrackData; private _transportState; private _playbackPosition; private _playbackRate; private _suspensionCnt; private _waitPoint?; private _lastStateChange; private _lastStateChangeTime; constructor(runtime: IRuntimeSignaler, liveRuntime: LiveShareRuntime, maxPlaybackDrift: TimeInterval, positionUpdateInterval: PriorityTimeInterval, getMediaPlayerState: () => IMediaPlayerState); get playbackTrack(): GroupPlaybackTrack; get playbackTrackData(): GroupPlaybackTrackData; get transportState(): GroupTransportState; get playbackPosition(): GroupPlaybackPosition; get playbackRate(): GroupPlaybackRate; get waitingAt(): CoordinationWaitPoint | undefined; get isSuspended(): boolean; get isWaiting(): boolean; beginSuspension(waitPoint?: CoordinationWaitPoint): void; endSuspension(syncState: boolean): void; createPositionUpdateEvent(state: IMediaPlayerState): IPositionUpdateEvent; handleSetTrack(event: ILiveEvent, local: boolean): void; handleSetTrackData(event: ILiveEvent, local: boolean): void; handleRateChangeCommand(event: ILiveEvent, local: boolean): void; handleTransportCommand(event: ILiveEvent, local: boolean): void; handlePositionUpdate(event: ILiveEvent, local: boolean): void; syncLocalMediaSession(): Promise; private emitSetTrack; private emitTriggerActionOrIgnored; private emitTriggerAction; private emitTriggerActionIgnored; } //# sourceMappingURL=GroupCoordinatorState.d.ts.map