@microsoft/live-share-media 1.4.0 → 1.4.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/LiveMediaSessionCoordinator.d.ts +0 -1
- package/bin/LiveMediaSessionCoordinator.d.ts.map +1 -1
- package/bin/MediaPlayerSynchronizer.d.ts +0 -1
- package/bin/MediaPlayerSynchronizer.d.ts.map +1 -1
- package/bin/cjs/IMediaPlayer.d.ts +21 -0
- package/bin/cjs/IMediaPlayer.d.ts.map +1 -0
- package/bin/cjs/IMediaPlayer.js +7 -0
- package/bin/cjs/IMediaPlayer.js.map +1 -0
- package/bin/cjs/LiveMediaSession.d.ts +97 -0
- package/bin/cjs/LiveMediaSession.d.ts.map +1 -0
- package/bin/cjs/LiveMediaSession.js +261 -0
- package/bin/cjs/LiveMediaSession.js.map +1 -0
- package/bin/cjs/LiveMediaSessionCoordinator.d.ts +304 -0
- package/bin/cjs/LiveMediaSessionCoordinator.d.ts.map +1 -0
- package/bin/cjs/LiveMediaSessionCoordinator.js +560 -0
- package/bin/cjs/LiveMediaSessionCoordinator.js.map +1 -0
- package/bin/cjs/LiveMediaSessionCoordinatorSuspension.d.ts +20 -0
- package/bin/cjs/LiveMediaSessionCoordinatorSuspension.d.ts.map +1 -0
- package/bin/cjs/LiveMediaSessionCoordinatorSuspension.js +28 -0
- package/bin/cjs/LiveMediaSessionCoordinatorSuspension.js.map +1 -0
- package/bin/cjs/MediaPlayerSynchronizer.d.ts +204 -0
- package/bin/cjs/MediaPlayerSynchronizer.d.ts.map +1 -0
- package/bin/cjs/MediaPlayerSynchronizer.js +574 -0
- package/bin/cjs/MediaPlayerSynchronizer.js.map +1 -0
- package/bin/cjs/MediaSessionActionThrottler.d.ts +12 -0
- package/bin/cjs/MediaSessionActionThrottler.d.ts.map +1 -0
- package/bin/cjs/MediaSessionActionThrottler.js +14 -0
- package/bin/cjs/MediaSessionActionThrottler.js.map +1 -0
- package/bin/cjs/MediaSessionExtensions.d.ts +177 -0
- package/bin/cjs/MediaSessionExtensions.d.ts.map +1 -0
- package/bin/cjs/MediaSessionExtensions.js +26 -0
- package/bin/cjs/MediaSessionExtensions.js.map +1 -0
- package/bin/cjs/RepeatedActionThrottler.d.ts +20 -0
- package/bin/cjs/RepeatedActionThrottler.d.ts.map +1 -0
- package/bin/cjs/RepeatedActionThrottler.js +63 -0
- package/bin/cjs/RepeatedActionThrottler.js.map +1 -0
- package/bin/cjs/VolumeManager.d.ts +84 -0
- package/bin/cjs/VolumeManager.d.ts.map +1 -0
- package/bin/cjs/VolumeManager.js +175 -0
- package/bin/cjs/VolumeManager.js.map +1 -0
- package/bin/cjs/index.d.ts +14 -0
- package/bin/cjs/index.d.ts.map +1 -0
- package/bin/cjs/index.js +30 -0
- package/bin/cjs/index.js.map +1 -0
- package/bin/cjs/internals/GroupCoordinatorState.d.ts +110 -0
- package/bin/cjs/internals/GroupCoordinatorState.d.ts.map +1 -0
- package/bin/cjs/internals/GroupCoordinatorState.js +516 -0
- package/bin/cjs/internals/GroupCoordinatorState.js.map +1 -0
- package/bin/cjs/internals/GroupPlaybackPosition.d.ts +71 -0
- package/bin/cjs/internals/GroupPlaybackPosition.d.ts.map +1 -0
- package/bin/cjs/internals/GroupPlaybackPosition.js +170 -0
- package/bin/cjs/internals/GroupPlaybackPosition.js.map +1 -0
- package/bin/cjs/internals/GroupPlaybackRate.d.ts +38 -0
- package/bin/cjs/internals/GroupPlaybackRate.d.ts.map +1 -0
- package/bin/cjs/internals/GroupPlaybackRate.js +59 -0
- package/bin/cjs/internals/GroupPlaybackRate.js.map +1 -0
- package/bin/cjs/internals/GroupPlaybackTrack.d.ts +45 -0
- package/bin/cjs/internals/GroupPlaybackTrack.d.ts.map +1 -0
- package/bin/cjs/internals/GroupPlaybackTrack.js +122 -0
- package/bin/cjs/internals/GroupPlaybackTrack.js.map +1 -0
- package/bin/cjs/internals/GroupPlaybackTrackData.d.ts +40 -0
- package/bin/cjs/internals/GroupPlaybackTrackData.d.ts.map +1 -0
- package/bin/cjs/internals/GroupPlaybackTrackData.js +70 -0
- package/bin/cjs/internals/GroupPlaybackTrackData.js.map +1 -0
- package/bin/cjs/internals/GroupTransportState.d.ts +52 -0
- package/bin/cjs/internals/GroupTransportState.d.ts.map +1 -0
- package/bin/cjs/internals/GroupTransportState.js +120 -0
- package/bin/cjs/internals/GroupTransportState.js.map +1 -0
- package/bin/cjs/internals/PriorityTimeInterval.d.ts +33 -0
- package/bin/cjs/internals/PriorityTimeInterval.d.ts.map +1 -0
- package/bin/cjs/internals/PriorityTimeInterval.js +45 -0
- package/bin/cjs/internals/PriorityTimeInterval.js.map +1 -0
- package/bin/cjs/internals/consts.d.ts +83 -0
- package/bin/cjs/internals/consts.d.ts.map +1 -0
- package/bin/cjs/internals/consts.js +92 -0
- package/bin/cjs/internals/consts.js.map +1 -0
- package/bin/cjs/internals/errors.d.ts +17 -0
- package/bin/cjs/internals/errors.d.ts.map +1 -0
- package/bin/cjs/internals/errors.js +34 -0
- package/bin/cjs/internals/errors.js.map +1 -0
- package/bin/cjs/internals/interfaces.d.ts +23 -0
- package/bin/cjs/internals/interfaces.d.ts.map +1 -0
- package/bin/cjs/internals/interfaces.js +3 -0
- package/bin/cjs/internals/interfaces.js.map +1 -0
- package/bin/cjs/package.json +1 -0
- package/bin/esm/IMediaPlayer.d.ts +21 -0
- package/bin/esm/IMediaPlayer.d.ts.map +1 -0
- package/bin/esm/IMediaPlayer.js +6 -0
- package/bin/esm/IMediaPlayer.js.map +1 -0
- package/bin/esm/LiveMediaSession.d.ts +97 -0
- package/bin/esm/LiveMediaSession.d.ts.map +1 -0
- package/bin/esm/LiveMediaSession.js +257 -0
- package/bin/esm/LiveMediaSession.js.map +1 -0
- package/bin/esm/LiveMediaSessionCoordinator.d.ts +304 -0
- package/bin/esm/LiveMediaSessionCoordinator.d.ts.map +1 -0
- package/bin/esm/LiveMediaSessionCoordinator.js +556 -0
- package/bin/esm/LiveMediaSessionCoordinator.js.map +1 -0
- package/bin/esm/LiveMediaSessionCoordinatorSuspension.d.ts +20 -0
- package/bin/esm/LiveMediaSessionCoordinatorSuspension.d.ts.map +1 -0
- package/bin/esm/LiveMediaSessionCoordinatorSuspension.js +24 -0
- package/bin/esm/LiveMediaSessionCoordinatorSuspension.js.map +1 -0
- package/bin/esm/MediaPlayerSynchronizer.d.ts +204 -0
- package/bin/esm/MediaPlayerSynchronizer.d.ts.map +1 -0
- package/bin/esm/MediaPlayerSynchronizer.js +570 -0
- package/bin/esm/MediaPlayerSynchronizer.js.map +1 -0
- package/bin/esm/MediaSessionActionThrottler.d.ts +12 -0
- package/bin/esm/MediaSessionActionThrottler.d.ts.map +1 -0
- package/bin/esm/MediaSessionActionThrottler.js +10 -0
- package/bin/esm/MediaSessionActionThrottler.js.map +1 -0
- package/bin/esm/MediaSessionExtensions.d.ts +177 -0
- package/bin/esm/MediaSessionExtensions.d.ts.map +1 -0
- package/bin/esm/MediaSessionExtensions.js +23 -0
- package/bin/esm/MediaSessionExtensions.js.map +1 -0
- package/bin/esm/RepeatedActionThrottler.d.ts +20 -0
- package/bin/esm/RepeatedActionThrottler.d.ts.map +1 -0
- package/bin/esm/RepeatedActionThrottler.js +59 -0
- package/bin/esm/RepeatedActionThrottler.js.map +1 -0
- package/bin/esm/VolumeManager.d.ts +84 -0
- package/bin/esm/VolumeManager.d.ts.map +1 -0
- package/bin/esm/VolumeManager.js +171 -0
- package/bin/esm/VolumeManager.js.map +1 -0
- package/bin/esm/index.d.ts +14 -0
- package/bin/esm/index.d.ts.map +1 -0
- package/bin/esm/index.js +14 -0
- package/bin/esm/index.js.map +1 -0
- package/bin/esm/internals/GroupCoordinatorState.d.ts +110 -0
- package/bin/esm/internals/GroupCoordinatorState.d.ts.map +1 -0
- package/bin/esm/internals/GroupCoordinatorState.js +512 -0
- package/bin/esm/internals/GroupCoordinatorState.js.map +1 -0
- package/bin/esm/internals/GroupPlaybackPosition.d.ts +71 -0
- package/bin/esm/internals/GroupPlaybackPosition.d.ts.map +1 -0
- package/bin/esm/internals/GroupPlaybackPosition.js +166 -0
- package/bin/esm/internals/GroupPlaybackPosition.js.map +1 -0
- package/bin/esm/internals/GroupPlaybackRate.d.ts +38 -0
- package/bin/esm/internals/GroupPlaybackRate.d.ts.map +1 -0
- package/bin/esm/internals/GroupPlaybackRate.js +55 -0
- package/bin/esm/internals/GroupPlaybackRate.js.map +1 -0
- package/bin/esm/internals/GroupPlaybackTrack.d.ts +45 -0
- package/bin/esm/internals/GroupPlaybackTrack.d.ts.map +1 -0
- package/bin/esm/internals/GroupPlaybackTrack.js +118 -0
- package/bin/esm/internals/GroupPlaybackTrack.js.map +1 -0
- package/bin/esm/internals/GroupPlaybackTrackData.d.ts +40 -0
- package/bin/esm/internals/GroupPlaybackTrackData.d.ts.map +1 -0
- package/bin/esm/internals/GroupPlaybackTrackData.js +66 -0
- package/bin/esm/internals/GroupPlaybackTrackData.js.map +1 -0
- package/bin/esm/internals/GroupTransportState.d.ts +52 -0
- package/bin/esm/internals/GroupTransportState.d.ts.map +1 -0
- package/bin/esm/internals/GroupTransportState.js +116 -0
- package/bin/esm/internals/GroupTransportState.js.map +1 -0
- package/bin/esm/internals/PriorityTimeInterval.d.ts +33 -0
- package/bin/esm/internals/PriorityTimeInterval.d.ts.map +1 -0
- package/bin/esm/internals/PriorityTimeInterval.js +41 -0
- package/bin/esm/internals/PriorityTimeInterval.js.map +1 -0
- package/bin/esm/internals/consts.d.ts +83 -0
- package/bin/esm/internals/consts.d.ts.map +1 -0
- package/bin/esm/internals/consts.js +89 -0
- package/bin/esm/internals/consts.js.map +1 -0
- package/bin/esm/internals/errors.d.ts +17 -0
- package/bin/esm/internals/errors.d.ts.map +1 -0
- package/bin/esm/internals/errors.js +29 -0
- package/bin/esm/internals/errors.js.map +1 -0
- package/bin/esm/internals/interfaces.d.ts +23 -0
- package/bin/esm/internals/interfaces.d.ts.map +1 -0
- package/bin/esm/internals/interfaces.js +2 -0
- package/bin/esm/internals/interfaces.js.map +1 -0
- package/bin/internals/GroupCoordinatorState.d.ts +0 -1
- package/bin/internals/GroupCoordinatorState.d.ts.map +1 -1
- package/bin/internals/GroupPlaybackRate.d.ts +0 -1
- package/bin/internals/GroupPlaybackRate.d.ts.map +1 -1
- package/bin/internals/GroupPlaybackTrack.d.ts +0 -1
- package/bin/internals/GroupPlaybackTrack.d.ts.map +1 -1
- package/bin/internals/GroupPlaybackTrackData.d.ts +0 -1
- package/bin/internals/GroupPlaybackTrackData.d.ts.map +1 -1
- package/bin/internals/GroupTransportState.d.ts +0 -1
- package/bin/internals/GroupTransportState.d.ts.map +1 -1
- package/bin/test/IMediaPlayer.d.ts +21 -0
- package/bin/test/IMediaPlayer.d.ts.map +1 -0
- package/bin/test/IMediaPlayer.js +7 -0
- package/bin/test/IMediaPlayer.js.map +1 -0
- package/bin/test/LiveMediaSession.d.ts +97 -0
- package/bin/test/LiveMediaSession.d.ts.map +1 -0
- package/bin/test/LiveMediaSession.js +261 -0
- package/bin/test/LiveMediaSession.js.map +1 -0
- package/bin/test/LiveMediaSessionCoordinator.d.ts +304 -0
- package/bin/test/LiveMediaSessionCoordinator.d.ts.map +1 -0
- package/bin/test/LiveMediaSessionCoordinator.js +560 -0
- package/bin/test/LiveMediaSessionCoordinator.js.map +1 -0
- package/bin/test/LiveMediaSessionCoordinatorSuspension.d.ts +20 -0
- package/bin/test/LiveMediaSessionCoordinatorSuspension.d.ts.map +1 -0
- package/bin/test/LiveMediaSessionCoordinatorSuspension.js +28 -0
- package/bin/test/LiveMediaSessionCoordinatorSuspension.js.map +1 -0
- package/bin/test/MediaPlayerSynchronizer.d.ts +204 -0
- package/bin/test/MediaPlayerSynchronizer.d.ts.map +1 -0
- package/bin/test/MediaPlayerSynchronizer.js +574 -0
- package/bin/test/MediaPlayerSynchronizer.js.map +1 -0
- package/bin/test/MediaSessionActionThrottler.d.ts +12 -0
- package/bin/test/MediaSessionActionThrottler.d.ts.map +1 -0
- package/bin/test/MediaSessionActionThrottler.js +14 -0
- package/bin/test/MediaSessionActionThrottler.js.map +1 -0
- package/bin/test/MediaSessionExtensions.d.ts +177 -0
- package/bin/test/MediaSessionExtensions.d.ts.map +1 -0
- package/bin/test/MediaSessionExtensions.js +26 -0
- package/bin/test/MediaSessionExtensions.js.map +1 -0
- package/bin/test/RepeatedActionThrottler.d.ts +20 -0
- package/bin/test/RepeatedActionThrottler.d.ts.map +1 -0
- package/bin/test/RepeatedActionThrottler.js +63 -0
- package/bin/test/RepeatedActionThrottler.js.map +1 -0
- package/bin/test/VolumeManager.d.ts +84 -0
- package/bin/test/VolumeManager.d.ts.map +1 -0
- package/bin/test/VolumeManager.js +175 -0
- package/bin/test/VolumeManager.js.map +1 -0
- package/bin/test/index.d.ts +14 -0
- package/bin/test/index.d.ts.map +1 -0
- package/bin/test/index.js +30 -0
- package/bin/test/index.js.map +1 -0
- package/bin/test/internals/GroupCoordinatorState.d.ts +110 -0
- package/bin/test/internals/GroupCoordinatorState.d.ts.map +1 -0
- package/bin/test/internals/GroupCoordinatorState.js +516 -0
- package/bin/test/internals/GroupCoordinatorState.js.map +1 -0
- package/bin/test/internals/GroupPlaybackPosition.d.ts +71 -0
- package/bin/test/internals/GroupPlaybackPosition.d.ts.map +1 -0
- package/bin/test/internals/GroupPlaybackPosition.js +170 -0
- package/bin/test/internals/GroupPlaybackPosition.js.map +1 -0
- package/bin/test/internals/GroupPlaybackRate.d.ts +38 -0
- package/bin/test/internals/GroupPlaybackRate.d.ts.map +1 -0
- package/bin/test/internals/GroupPlaybackRate.js +59 -0
- package/bin/test/internals/GroupPlaybackRate.js.map +1 -0
- package/bin/test/internals/GroupPlaybackTrack.d.ts +45 -0
- package/bin/test/internals/GroupPlaybackTrack.d.ts.map +1 -0
- package/bin/test/internals/GroupPlaybackTrack.js +122 -0
- package/bin/test/internals/GroupPlaybackTrack.js.map +1 -0
- package/bin/test/internals/GroupPlaybackTrackData.d.ts +40 -0
- package/bin/test/internals/GroupPlaybackTrackData.d.ts.map +1 -0
- package/bin/test/internals/GroupPlaybackTrackData.js +70 -0
- package/bin/test/internals/GroupPlaybackTrackData.js.map +1 -0
- package/bin/test/internals/GroupTransportState.d.ts +52 -0
- package/bin/test/internals/GroupTransportState.d.ts.map +1 -0
- package/bin/test/internals/GroupTransportState.js +120 -0
- package/bin/test/internals/GroupTransportState.js.map +1 -0
- package/bin/test/internals/PriorityTimeInterval.d.ts +33 -0
- package/bin/test/internals/PriorityTimeInterval.d.ts.map +1 -0
- package/bin/test/internals/PriorityTimeInterval.js +45 -0
- package/bin/test/internals/PriorityTimeInterval.js.map +1 -0
- package/bin/test/internals/consts.d.ts +83 -0
- package/bin/test/internals/consts.d.ts.map +1 -0
- package/bin/test/internals/consts.js +92 -0
- package/bin/test/internals/consts.js.map +1 -0
- package/bin/test/internals/errors.d.ts +17 -0
- package/bin/test/internals/errors.d.ts.map +1 -0
- package/bin/test/internals/errors.js +34 -0
- package/bin/test/internals/errors.js.map +1 -0
- package/bin/test/internals/interfaces.d.ts +23 -0
- package/bin/test/internals/interfaces.d.ts.map +1 -0
- package/bin/test/internals/interfaces.js +3 -0
- package/bin/test/internals/interfaces.js.map +1 -0
- package/bin/test/package.json +1 -0
- package/bin/test/test/GroupPlaybackPosition.spec.d.ts +6 -0
- package/bin/test/test/GroupPlaybackPosition.spec.d.ts.map +1 -0
- package/bin/test/test/GroupPlaybackPosition.spec.js +315 -0
- package/bin/test/test/GroupPlaybackPosition.spec.js.map +1 -0
- package/bin/test/test/GroupPlaybackRate.spec.d.ts +6 -0
- package/bin/test/test/GroupPlaybackRate.spec.d.ts.map +1 -0
- package/bin/test/test/GroupPlaybackRate.spec.js +47 -0
- package/bin/test/test/GroupPlaybackRate.spec.js.map +1 -0
- package/bin/test/test/GroupPlaybackTrack.spec.d.ts +6 -0
- package/bin/test/test/GroupPlaybackTrack.spec.d.ts.map +1 -0
- package/bin/test/test/GroupPlaybackTrack.spec.js +171 -0
- package/bin/test/test/GroupPlaybackTrack.spec.js.map +1 -0
- package/bin/test/test/GroupPlaybackTrackData.spec.d.ts +6 -0
- package/bin/test/test/GroupPlaybackTrackData.spec.d.ts.map +1 -0
- package/bin/test/test/GroupPlaybackTrackData.spec.js +63 -0
- package/bin/test/test/GroupPlaybackTrackData.spec.js.map +1 -0
- package/bin/test/test/LiveMediaSession_ManualActionHandler.spec.d.ts +6 -0
- package/bin/test/test/LiveMediaSession_ManualActionHandler.spec.d.ts.map +1 -0
- package/bin/test/test/LiveMediaSession_ManualActionHandler.spec.js +323 -0
- package/bin/test/test/LiveMediaSession_ManualActionHandler.spec.js.map +1 -0
- package/bin/test/test/LiveMediaSession_Synchronizer.spec.d.ts +6 -0
- package/bin/test/test/LiveMediaSession_Synchronizer.spec.d.ts.map +1 -0
- package/bin/test/test/LiveMediaSession_Synchronizer.spec.js +669 -0
- package/bin/test/test/LiveMediaSession_Synchronizer.spec.js.map +1 -0
- package/bin/test/test/PriorityTimeInterval.spec.d.ts +6 -0
- package/bin/test/test/PriorityTimeInterval.spec.d.ts.map +1 -0
- package/bin/test/test/PriorityTimeInterval.spec.js +67 -0
- package/bin/test/test/PriorityTimeInterval.spec.js.map +1 -0
- package/bin/test/test/TestUtils.d.ts +44 -0
- package/bin/test/test/TestUtils.d.ts.map +1 -0
- package/bin/test/test/TestUtils.js +116 -0
- package/bin/test/test/TestUtils.js.map +1 -0
- package/bin/test/test/VolumeManager.spec.d.ts +2 -0
- package/bin/test/test/VolumeManager.spec.d.ts.map +1 -0
- package/bin/test/test/VolumeManager.spec.js +163 -0
- package/bin/test/test/VolumeManager.spec.js.map +1 -0
- package/package.json +3 -3
|
@@ -0,0 +1,304 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
3
|
+
* Licensed under the Microsoft Live Share SDK License.
|
|
4
|
+
*/
|
|
5
|
+
import { UserMeetingRole } from "@microsoft/live-share";
|
|
6
|
+
import { IRuntimeSignaler, LiveShareRuntime } from "@microsoft/live-share/internal";
|
|
7
|
+
import { CoordinationWaitPoint, ExtendedMediaMetadata, ExtendedMediaSessionPlaybackState, MediaSessionCoordinatorSuspension } from "./MediaSessionExtensions.js";
|
|
8
|
+
import { TypedEventEmitter } from "@fluid-internal/client-utils";
|
|
9
|
+
import { IEvent } from "@fluidframework/core-interfaces";
|
|
10
|
+
/**
|
|
11
|
+
* Most recent state of the media session.
|
|
12
|
+
*/
|
|
13
|
+
export interface IMediaPlayerState {
|
|
14
|
+
/**
|
|
15
|
+
* Metadata for the sessions current track.
|
|
16
|
+
*/
|
|
17
|
+
metadata: ExtendedMediaMetadata | null;
|
|
18
|
+
/**
|
|
19
|
+
* Optional track data object being synchronized.
|
|
20
|
+
*
|
|
21
|
+
* @remarks
|
|
22
|
+
* This can be used to sync things like pitch, roll, and yaw when watching 360 videos together.
|
|
23
|
+
*/
|
|
24
|
+
trackData: object | null;
|
|
25
|
+
/**
|
|
26
|
+
* Sessions current playback state.
|
|
27
|
+
*/
|
|
28
|
+
playbackState: ExtendedMediaSessionPlaybackState;
|
|
29
|
+
/**
|
|
30
|
+
* Sessions current position state if known.
|
|
31
|
+
*/
|
|
32
|
+
positionState?: MediaPositionState;
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* @hidden
|
|
36
|
+
*/
|
|
37
|
+
export interface ILiveMediaSessionCoordinatorEvents extends IEvent {
|
|
38
|
+
/**
|
|
39
|
+
* Event listener for events emitted
|
|
40
|
+
* @param event update
|
|
41
|
+
* @param listener listener function
|
|
42
|
+
* @param listener.event the event instance
|
|
43
|
+
*/
|
|
44
|
+
(event: string, listener: (event: any) => void): void;
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* The `LiveMediaSessionCoordinator` tracks the playback & position state of all other
|
|
48
|
+
* clients being synchronized with. It is responsible for keeping the local media player
|
|
49
|
+
* in sync with the group.
|
|
50
|
+
*/
|
|
51
|
+
export declare class LiveMediaSessionCoordinator extends TypedEventEmitter<ILiveMediaSessionCoordinatorEvents> {
|
|
52
|
+
private readonly _id;
|
|
53
|
+
private readonly _runtime;
|
|
54
|
+
private readonly _liveRuntime;
|
|
55
|
+
private readonly _logger;
|
|
56
|
+
private readonly _getPlayerState;
|
|
57
|
+
private _positionUpdateInterval;
|
|
58
|
+
private _maxPlaybackDrift;
|
|
59
|
+
private _lastWaitPoint?;
|
|
60
|
+
private initializeState;
|
|
61
|
+
private _playEvent?;
|
|
62
|
+
private _pauseEvent?;
|
|
63
|
+
private _seekToEvent?;
|
|
64
|
+
private _rateChangeEvent?;
|
|
65
|
+
private _setTrackEvent?;
|
|
66
|
+
private _setTrackDataEvent?;
|
|
67
|
+
private _positionUpdateEvent?;
|
|
68
|
+
private _synchronizer?;
|
|
69
|
+
private _groupState?;
|
|
70
|
+
/**
|
|
71
|
+
* @hidden
|
|
72
|
+
* Applications shouldn't directly create new coordinator instances.
|
|
73
|
+
*/
|
|
74
|
+
constructor(id: string, runtime: IRuntimeSignaler, liveRuntime: LiveShareRuntime, getPlayerState: () => IMediaPlayerState);
|
|
75
|
+
/**
|
|
76
|
+
* Controls whether or not the local client is allowed to instruct the group to play or pause.
|
|
77
|
+
*
|
|
78
|
+
* @remarks
|
|
79
|
+
* This flag largely meant to influence decisions made by the coordinator and can be used by
|
|
80
|
+
* the UI to determine what controls should be shown to the user. It does not provide any
|
|
81
|
+
* security in itself.
|
|
82
|
+
*
|
|
83
|
+
* If your app is running in a semi-trusted environment where only some clients are allowed
|
|
84
|
+
* to play/pause media, you should use "role based verification" to enforce those policies.
|
|
85
|
+
*/
|
|
86
|
+
canPlayPause: boolean;
|
|
87
|
+
/**
|
|
88
|
+
* Controls whether or not the local client is allowed to seek the group to a new playback
|
|
89
|
+
* position.
|
|
90
|
+
*
|
|
91
|
+
* @remarks
|
|
92
|
+
* This flag largely meant to influence decisions made by the coordinator and can be used by
|
|
93
|
+
* the UI to determine what controls should be shown to the user. It does not provide any
|
|
94
|
+
* security in itself.
|
|
95
|
+
*
|
|
96
|
+
* If your app is running in a semi-trusted environment where only some clients are allowed
|
|
97
|
+
* to change the playback position, you should use "role based verification" to enforce those policies.
|
|
98
|
+
*/
|
|
99
|
+
canSeek: boolean;
|
|
100
|
+
/**
|
|
101
|
+
* Controls whether or not the local client is allowed to change tracks.
|
|
102
|
+
*
|
|
103
|
+
* @remarks
|
|
104
|
+
* This flag largely meant to influence decisions made by the coordinator and can be used by
|
|
105
|
+
* the UI to determine what controls should be shown to the user. It does not provide any
|
|
106
|
+
* security in itself.
|
|
107
|
+
*
|
|
108
|
+
* If your app is running in a semi-trusted environment where only some clients are allowed
|
|
109
|
+
* to change tracks, you should use "role based verification" to enforce those policies.
|
|
110
|
+
*/
|
|
111
|
+
canSetTrack: boolean;
|
|
112
|
+
/**
|
|
113
|
+
* Controls whether or not the local client is allowed to change the tracks custom data object.
|
|
114
|
+
*
|
|
115
|
+
* @remarks
|
|
116
|
+
* This flag largely meant to influence decisions made by the coordinator and can be used by
|
|
117
|
+
* the UI to determine what controls should be shown to the user. It does not provide any
|
|
118
|
+
* security in itself.
|
|
119
|
+
*
|
|
120
|
+
* If your app is running in a semi-trusted environment where only some clients are allowed
|
|
121
|
+
* to change the tracks data object, you should use "role based verification" to enforce those
|
|
122
|
+
* policies.
|
|
123
|
+
*/
|
|
124
|
+
canSetTrackData: boolean;
|
|
125
|
+
/**
|
|
126
|
+
* Controls whether or not the local client is allowed to change the playback rate.
|
|
127
|
+
*
|
|
128
|
+
* @remarks
|
|
129
|
+
* This flag largely meant to influence decisions made by the coordinator and can be used by
|
|
130
|
+
* the UI to determine what controls should be shown to the user. It does not provide any
|
|
131
|
+
* security in itself.
|
|
132
|
+
*
|
|
133
|
+
* If your app is running in a semi-trusted environment where only some clients are allowed
|
|
134
|
+
* to change the tracks data object, you should use "role based verification" to enforce those
|
|
135
|
+
* policies.
|
|
136
|
+
*/
|
|
137
|
+
canSetPlaybackRate: boolean;
|
|
138
|
+
/**
|
|
139
|
+
* Controls whether or not the local client is allowed to send position updates to the group.
|
|
140
|
+
*
|
|
141
|
+
* @remarks
|
|
142
|
+
* This flag largely meant to limit the number of signals sent to the group for performance reasons.
|
|
143
|
+
* It does not provide any security in itself.
|
|
144
|
+
*/
|
|
145
|
+
canSendPositionUpdates: boolean;
|
|
146
|
+
/**
|
|
147
|
+
* Returns true if the local client is in a suspended state.
|
|
148
|
+
*/
|
|
149
|
+
get isSuspended(): boolean;
|
|
150
|
+
/**
|
|
151
|
+
* Controls whether or not to scale {@link maxPlaybackDrift} by the number of users in the session.
|
|
152
|
+
*
|
|
153
|
+
* @remarks
|
|
154
|
+
* As more clients join a session, it is more likely that some users will fall behind the presenter.
|
|
155
|
+
* It is also less likely that users will notice drift as more clients are added.
|
|
156
|
+
* It is usually helpful to be more lenient as more clients are added so everyone can watch all the content.
|
|
157
|
+
* Default value is true.
|
|
158
|
+
*/
|
|
159
|
+
get shouldScaleMaxPlaybackDrift(): boolean;
|
|
160
|
+
set shouldScaleMaxPlaybackDrift(value: boolean);
|
|
161
|
+
/**
|
|
162
|
+
* Max amount of playback drift allowed in seconds.
|
|
163
|
+
* This will scale automatically according to the number of participants in the session when {@link shouldScaleMaxPlaybackDrift} is true.
|
|
164
|
+
*
|
|
165
|
+
* @remarks
|
|
166
|
+
* Should the local clients playback position lag by more than the specified value, the coordinator will trigger a `catchup` action.
|
|
167
|
+
* Default value is `1.5` seconds.
|
|
168
|
+
*/
|
|
169
|
+
get maxPlaybackDrift(): number;
|
|
170
|
+
set maxPlaybackDrift(value: number);
|
|
171
|
+
/**
|
|
172
|
+
* Controls whether or not to compute {@link positionUpdateInterval} based on whether user has initiated a playback command.
|
|
173
|
+
* Default value is true.
|
|
174
|
+
*
|
|
175
|
+
* @remarks
|
|
176
|
+
* When true, users that are simply watching but not controlling playback will report their positions less frequently.
|
|
177
|
+
* When a user has sent a transport command, they will begin sending position updates more frequently.
|
|
178
|
+
* Most Live Share apps have a concept of a primary presenter, and don't allow anyone to pause/play for the group.
|
|
179
|
+
* By ensuring only one/few users broadcast updates frequently, the server load is reduced considerably.
|
|
180
|
+
*/
|
|
181
|
+
get shouldScalePositionUpdateInterval(): boolean;
|
|
182
|
+
set shouldScalePositionUpdateInterval(value: boolean);
|
|
183
|
+
/**
|
|
184
|
+
* Frequency with which position updates are broadcast to the rest of the group in seconds.
|
|
185
|
+
* When {@link shouldScalePositionUpdateInterval} is set to `true`, the value set is the minimum value.
|
|
186
|
+
* The value returned is the actual value used to send updates by the local user, which may be larger than the value set.
|
|
187
|
+
*
|
|
188
|
+
* @remarks
|
|
189
|
+
* Defaults to a minimum value of `2` seconds.
|
|
190
|
+
*/
|
|
191
|
+
get positionUpdateInterval(): number;
|
|
192
|
+
set positionUpdateInterval(value: number);
|
|
193
|
+
/**
|
|
194
|
+
* Instructs the group to play the current track.
|
|
195
|
+
*
|
|
196
|
+
* @remarks
|
|
197
|
+
* Throws an exception if the session/coordinator hasn't been initialized, no track has been
|
|
198
|
+
* loaded, or `canPlayPause` is false.
|
|
199
|
+
*
|
|
200
|
+
* @returns a void promise that resolves once complete, throws if user does not have proper roles
|
|
201
|
+
*/
|
|
202
|
+
play(): Promise<void>;
|
|
203
|
+
/**
|
|
204
|
+
* Instructs the group to pause the current track.
|
|
205
|
+
*
|
|
206
|
+
* @remarks
|
|
207
|
+
* Throws an exception if the session/coordinator hasn't been initialized, no track has been
|
|
208
|
+
* loaded, or `canPlayPause` is false.
|
|
209
|
+
*
|
|
210
|
+
* @returns a void promise that resolves once complete, throws if user does not have proper roles
|
|
211
|
+
*/
|
|
212
|
+
pause(): Promise<void>;
|
|
213
|
+
/**
|
|
214
|
+
* Instructs the group to seek to a new position within the current track.
|
|
215
|
+
*
|
|
216
|
+
* @remarks
|
|
217
|
+
* Throws an exception if the session/coordinator hasn't been initialized, no track has been
|
|
218
|
+
* loaded, or `canSeek` is false.
|
|
219
|
+
* @param time Playback position in seconds to seek to.
|
|
220
|
+
* @returns a void promise that resolves once complete, throws if user does not have proper roles
|
|
221
|
+
*/
|
|
222
|
+
seekTo(time: number): Promise<void>;
|
|
223
|
+
/**
|
|
224
|
+
* Sets the playback rate for everyone in the session.
|
|
225
|
+
*
|
|
226
|
+
* @param playbackRate the playback rate to set.
|
|
227
|
+
*
|
|
228
|
+
* @throws
|
|
229
|
+
* Throws an exception if the session/coordinator hasn't been initialized or {@link canSetPlaybackRate} is false.
|
|
230
|
+
*/
|
|
231
|
+
setPlaybackRate(playbackRate: number): Promise<void>;
|
|
232
|
+
/**
|
|
233
|
+
* Instructs the group to load a new track.
|
|
234
|
+
*
|
|
235
|
+
* @remarks
|
|
236
|
+
* Throws an exception if the session/coordinator hasn't been initialized or `canSetTrack` is
|
|
237
|
+
* false.
|
|
238
|
+
* @param metadata The track to load or `null` to indicate that the end of the track is reached.
|
|
239
|
+
* @param waitPoints Optional. List of static wait points to configure for the track. Dynamic wait points can be added via the `beginSuspension()` call.
|
|
240
|
+
* @returns a void promise that resolves once complete, throws if user does not have proper roles
|
|
241
|
+
*/
|
|
242
|
+
setTrack(metadata: ExtendedMediaMetadata | null, waitPoints?: CoordinationWaitPoint[]): Promise<void>;
|
|
243
|
+
/**
|
|
244
|
+
* Updates the track data object for the current track.
|
|
245
|
+
*
|
|
246
|
+
* @remarks
|
|
247
|
+
* The track data object can be used by applications to synchronize things like pitch, roll,
|
|
248
|
+
* and yaw of a 360 video. This data object will be reset to null anytime the track changes.
|
|
249
|
+
*
|
|
250
|
+
* Throws an exception if the session/coordinator hasn't been initialized or `canSetTrackData` is
|
|
251
|
+
* false.
|
|
252
|
+
* @param data New data object to sync with the group. This value will be synchronized using a last writer wins strategy.
|
|
253
|
+
* @returns a void promise that resolves once complete, throws if user does not have proper roles
|
|
254
|
+
*/
|
|
255
|
+
setTrackData(data: object | null): Promise<void>;
|
|
256
|
+
/**
|
|
257
|
+
* Begins a new local suspension.
|
|
258
|
+
*
|
|
259
|
+
* @remarks
|
|
260
|
+
* Suspension temporarily suspend the clients local synchronization with the group. This can
|
|
261
|
+
* be useful for displaying ads to users or temporarily disconnecting from the session while
|
|
262
|
+
* the user seeks the video using a timeline scrubber.
|
|
263
|
+
*
|
|
264
|
+
* Multiple simultaneous suspensions are allowed and when the last suspension ends the local
|
|
265
|
+
* client will be immediately re-synchronized with the group.
|
|
266
|
+
*
|
|
267
|
+
* A "Dynamic Wait Point" can be specified when `beginSuspension()` is called and the wait
|
|
268
|
+
* point will be broadcast to all other clients in the group. Those clients will then
|
|
269
|
+
* automatically enter a suspension state once they reach the positions specified by the
|
|
270
|
+
* wait point. Clients that are passed the wait point will immediately suspend.
|
|
271
|
+
*
|
|
272
|
+
* Any wait point based suspension (dynamic or static) will result in all clients remaining
|
|
273
|
+
* in a suspension state until the list client ends their suspension. This behavior can be
|
|
274
|
+
* conditionally bypassed by settings the wait points `maxClients` value.
|
|
275
|
+
*
|
|
276
|
+
* Throws an exception if the session/coordinator hasn't been initialized.
|
|
277
|
+
* @param waitPoint Optional. Dynamic wait point to broadcast to all of the clients.
|
|
278
|
+
* @returns The suspension object. Call `end()` on the returned suspension to end the suspension.
|
|
279
|
+
*/
|
|
280
|
+
beginSuspension(waitPoint?: CoordinationWaitPoint): MediaSessionCoordinatorSuspension;
|
|
281
|
+
/**
|
|
282
|
+
* @hidden
|
|
283
|
+
* Called by MediaSession to verify the coordinator has been initialized.
|
|
284
|
+
*/
|
|
285
|
+
get isInitialized(): boolean;
|
|
286
|
+
/**
|
|
287
|
+
* @hidden
|
|
288
|
+
* Called by MediaSession to start coordinator.
|
|
289
|
+
*/
|
|
290
|
+
initialize(acceptTransportChangesFrom?: UserMeetingRole[]): Promise<void>;
|
|
291
|
+
/**
|
|
292
|
+
* @hidden
|
|
293
|
+
* Called by the MediaSession to detect if a wait point has been hit.
|
|
294
|
+
*/
|
|
295
|
+
findNextWaitPoint(): CoordinationWaitPoint | null;
|
|
296
|
+
/**
|
|
297
|
+
* @hidden
|
|
298
|
+
* Called by MediaSession to trigger the sending of a position update.
|
|
299
|
+
*/
|
|
300
|
+
sendPositionUpdate(state: IMediaPlayerState, targetClientId?: string): void;
|
|
301
|
+
protected createChildren(acceptTransportChangesFrom?: UserMeetingRole[]): Promise<void>;
|
|
302
|
+
private getPlayerPosition;
|
|
303
|
+
}
|
|
304
|
+
//# sourceMappingURL=LiveMediaSessionCoordinator.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LiveMediaSessionCoordinator.d.ts","sourceRoot":"","sources":["../../src/LiveMediaSessionCoordinator.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAGH,eAAe,EAKlB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EACH,gBAAgB,EAIhB,gBAAgB,EAEnB,MAAM,gCAAgC,CAAC;AACxC,OAAO,EACH,qBAAqB,EACrB,qBAAqB,EACrB,iCAAiC,EACjC,iCAAiC,EACpC,MAAM,6BAA6B,CAAC;AAiBrC,OAAO,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAAC;AACjE,OAAO,EAAE,MAAM,EAAE,MAAM,iCAAiC,CAAC;AAEzD;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAC9B;;OAEG;IACH,QAAQ,EAAE,qBAAqB,GAAG,IAAI,CAAC;IAEvC;;;;;OAKG;IACH,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IAEzB;;OAEG;IACH,aAAa,EAAE,iCAAiC,CAAC;IAEjD;;OAEG;IACH,aAAa,CAAC,EAAE,kBAAkB,CAAC;CACtC;AAED;;GAEG;AACH,MAAM,WAAW,kCAAmC,SAAQ,MAAM;IAC9D;;;;;OAKG;IACH,CAAC,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,CAAC,KAAK,EAAE,GAAG,KAAK,IAAI,GAAG,IAAI,CAAC;CACzD;AAED;;;;GAIG;AACH,qBAAa,2BAA4B,SAAQ,iBAAiB,CAAC,kCAAkC,CAAC;IAClG,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAS;IAC7B,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAmB;IAC5C,OAAO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