/** * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the Microsoft Live Share SDK License. */ import { ILiveEvent, TimeInterval, IRuntimeSignaler, LiveShareRuntime, IEvent } from "@microsoft/live-share"; import EventEmitter from "events"; import { ExtendedMediaMetadata, CoordinationWaitPoint, ExtendedMediaSessionPlaybackState, ExtendedMediaSessionActionDetails } from "../MediaSessionExtensions"; import { GroupPlaybackTrack, IPlaybackTrack } from "./GroupPlaybackTrack"; import { GroupTransportState, ITransportState } from "./GroupTransportState"; import { GroupPlaybackPosition } from "./GroupPlaybackPosition"; import { IMediaPlayerState } from "../LiveMediaSessionCoordinator"; import { GroupPlaybackTrackData, IPlaybackTrackData } from "./GroupPlaybackTrackData"; import { GroupPlaybackRate, IPlaybackRate } from "./GroupPlaybackRate"; /** * @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 EventEmitter { 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: TimeInterval, 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