@microsoft/live-share-media 0.1.2 → 0.2.0
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/.vscode/settings.json +2 -0
- package/LICENSE +87 -0
- package/README.md +108 -92
- package/bin/EphemeralMediaSession.d.ts +51 -4
- package/bin/EphemeralMediaSession.d.ts.map +1 -1
- package/bin/EphemeralMediaSession.js +91 -44
- package/bin/EphemeralMediaSession.js.map +1 -1
- package/bin/EphemeralMediaSessionCoordinator.d.ts +173 -6
- package/bin/EphemeralMediaSessionCoordinator.d.ts.map +1 -1
- package/bin/EphemeralMediaSessionCoordinator.js +170 -23
- package/bin/EphemeralMediaSessionCoordinator.js.map +1 -1
- package/bin/EphemeralMediaSessionCoordinatorSuspension.d.ts +1 -1
- package/bin/EphemeralMediaSessionCoordinatorSuspension.js +1 -1
- package/bin/IMediaPlayer.d.ts +1 -1
- package/bin/IMediaPlayer.js +1 -1
- package/bin/MediaPlayerSynchronizer.d.ts +95 -6
- package/bin/MediaPlayerSynchronizer.d.ts.map +1 -1
- package/bin/MediaPlayerSynchronizer.js +93 -31
- package/bin/MediaPlayerSynchronizer.js.map +1 -1
- package/bin/MediaSessionActionThrottler.d.ts +1 -1
- package/bin/MediaSessionActionThrottler.js +1 -1
- package/bin/MediaSessionExtensions.d.ts +1 -1
- package/bin/MediaSessionExtensions.js +1 -1
- package/bin/RepeatedActionThrottler.d.ts +1 -1
- package/bin/RepeatedActionThrottler.js +1 -1
- package/bin/VolumeLimiter.d.ts +2 -2
- package/bin/VolumeLimiter.js +2 -2
- package/bin/index.d.ts +1 -1
- package/bin/index.js +1 -1
- package/bin/internals/GroupCoordinatorState.d.ts +1 -1
- package/bin/internals/GroupCoordinatorState.js +1 -1
- package/bin/internals/GroupPlaybackPosition.d.ts +1 -1
- package/bin/internals/GroupPlaybackPosition.js +1 -1
- package/bin/internals/GroupPlaybackTrack.d.ts +1 -1
- package/bin/internals/GroupPlaybackTrack.js +1 -1
- package/bin/internals/GroupPlaybackTrackData.d.ts +1 -1
- package/bin/internals/GroupPlaybackTrackData.js +1 -1
- package/bin/internals/GroupTransportState.d.ts +1 -1
- package/bin/internals/GroupTransportState.js +1 -1
- package/bin/internals/consts.d.ts +1 -1
- package/bin/internals/consts.js +1 -1
- package/bin/internals/index.d.ts +1 -1
- package/bin/internals/index.js +1 -1
- package/package.json +13 -4
- package/src/EphemeralMediaSession.ts +95 -48
- package/src/EphemeralMediaSessionCoordinator.ts +190 -26
- package/src/EphemeralMediaSessionCoordinatorSuspension.ts +1 -1
- package/src/IMediaPlayer.ts +1 -1
- package/src/MediaPlayerSynchronizer.ts +101 -33
- package/src/MediaSessionActionThrottler.ts +1 -1
- package/src/MediaSessionExtensions.ts +1 -1
- package/src/RepeatedActionThrottler.ts +1 -1
- package/src/VolumeLimiter.ts +2 -2
- package/src/index.ts +1 -1
- package/src/internals/GroupCoordinatorState.ts +1 -1
- package/src/internals/GroupPlaybackPosition.ts +1 -1
- package/src/internals/GroupPlaybackTrack.ts +1 -1
- package/src/internals/GroupPlaybackTrackData.ts +1 -1
- package/src/internals/GroupTransportState.ts +1 -1
- package/src/internals/consts.ts +1 -1
- package/src/internals/index.ts +1 -1
- package/src/test/GroupPlaybackPosition.spec.ts +1 -1
- package/src/test/GroupPlaybackTrack.spec.ts +1 -1
- package/src/test/SharedMediaSession.spec.ts +1 -1
- package/src/test/SharedMediaSessionCoordinator.spec.ts +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EphemeralMediaSession.js","sourceRoot":"","sources":["../src/EphemeralMediaSession.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;;;;;;;;;;AAEH,uDAAyE;AACzE,sDAAkF;AAClF,uEAAoE;AACpE,2CAAmE;AACnE,qEAAwI;AACxI,yFAAyG;AAEzG,uEAAoE;AAGpE,MAAa,qBAAsB,SAAQ,qBAAU;IAArD;;
|
|
1
|
+
{"version":3,"file":"EphemeralMediaSession.js","sourceRo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K,CAAC,4DAA4D,CAAC,CAAC;SACjF;QAED,OAAO,IAAI,CAAC,0BAA0B,EAAE,CAAC;IAC7C,CAAC;IAEO,cAAc,CAAC,OAAoE;QACvF,IAAI,IAAI,CAAC,eAAe,CAAC,GAAG,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE;YAC1C,MAAM,OAAO,GAAG,IAAI,CAAC,eAAe,CAAC,GAAG,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;YACzD,IAAI,CAAC,gBAAgB,CAAC,SAAS,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;SACrD;IACL,CAAC;;AAlNJ,sDAmNA;AAvMG;;GAEG;AACqB,8BAAQ,GAAG,2CAA2C,CAAC;AAE/E;;GAEG;AACqB,6BAAO,GAAG,IAAI,4BAAiB,CACnD,qBAAqB,CAAC,QAAQ,EAC9B,qBAAqB,EACrB,EAAE,EACF,EAAE,CACL,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
3
|
-
* Licensed under the
|
|
3
|
+
* Licensed under the Microsoft Live Share SDK License.
|
|
4
4
|
*/
|
|
5
5
|
/// <reference types="node" />
|
|
6
6
|
import { IRuntimeSignaler, UserMeetingRole } from '@microsoft/live-share';
|
|
@@ -10,13 +10,30 @@ import EventEmitter from "events";
|
|
|
10
10
|
* Most recent state of the media session.
|
|
11
11
|
*/
|
|
12
12
|
export interface IMediaPlayerState {
|
|
13
|
+
/**
|
|
14
|
+
* Metadata for the sessions current track.
|
|
15
|
+
*/
|
|
13
16
|
metadata: ExtendedMediaMetadata | null;
|
|
17
|
+
/**
|
|
18
|
+
* Optional track data object being synchronized.
|
|
19
|
+
*
|
|
20
|
+
* @remarks
|
|
21
|
+
* This can be used to sync things like pitch, roll, and yaw when watching 360 videos together.
|
|
22
|
+
*/
|
|
14
23
|
trackData: object | null;
|
|
24
|
+
/**
|
|
25
|
+
* Sessions current playback state.
|
|
26
|
+
*/
|
|
15
27
|
playbackState: ExtendedMediaSessionPlaybackState;
|
|
28
|
+
/**
|
|
29
|
+
* Sessions current position state if known.
|
|
30
|
+
*/
|
|
16
31
|
positionState?: MediaPositionState;
|
|
17
32
|
}
|
|
18
33
|
/**
|
|
19
|
-
*
|
|
34
|
+
* The `EphemeralMediaSessionCoordinator` tracks the playback & position state of all other
|
|
35
|
+
* clients being synchronized with. It is responsible for keeping the local media player
|
|
36
|
+
* in sync with the group.
|
|
20
37
|
*/
|
|
21
38
|
export declare class EphemeralMediaSessionCoordinator extends EventEmitter {
|
|
22
39
|
private readonly _runtime;
|
|
@@ -34,27 +51,177 @@ export declare class EphemeralMediaSessionCoordinator extends EventEmitter {
|
|
|
34
51
|
private _positionUpdateEvent?;
|
|
35
52
|
private _joinedEvent?;
|
|
36
53
|
private _groupState?;
|
|
54
|
+
/**
|
|
55
|
+
* @hidden
|
|
56
|
+
* Applications shouldn't directly create new coordinator instances.
|
|
57
|
+
*/
|
|
37
58
|
constructor(runtime: IRuntimeSignaler, getPlayerState: () => IMediaPlayerState);
|
|
38
|
-
|
|
59
|
+
/**
|
|
60
|
+
* Controls whether or not the local client is allowed to instruct the group to play or pause.
|
|
61
|
+
*
|
|
62
|
+
* @remarks
|
|
63
|
+
* This flag largely meant to influence decisions made by the coordinator and can be used by
|
|
64
|
+
* the UI to determine what controls should be shown to the user. It does not provide any
|
|
65
|
+
* security in itself.
|
|
66
|
+
*
|
|
67
|
+
* If your app is running in a semi-trusted environment where only some clients are allowed
|
|
68
|
+
* to play/pause media, you should use "role based verification" to enforce those policies.
|
|
69
|
+
*/
|
|
39
70
|
canPlayPause: boolean;
|
|
71
|
+
/**
|
|
72
|
+
* Controls whether or not the local client is allowed to seek the group to a new playback
|
|
73
|
+
* position.
|
|
74
|
+
*
|
|
75
|
+
* @remarks
|
|
76
|
+
* This flag largely meant to influence decisions made by the coordinator and can be used by
|
|
77
|
+
* the UI to determine what controls should be shown to the user. It does not provide any
|
|
78
|
+
* security in itself.
|
|
79
|
+
*
|
|
80
|
+
* If your app is running in a semi-trusted environment where only some clients are allowed
|
|
81
|
+
* to change the playback position, you should use "role based verification" to enforce those policies.
|
|
82
|
+
*/
|
|
40
83
|
canSeek: boolean;
|
|
84
|
+
/**
|
|
85
|
+
* Controls whether or not the local client is allowed to change tracks.
|
|
86
|
+
*
|
|
87
|
+
* @remarks
|
|
88
|
+
* This flag largely meant to influence decisions made by the coordinator and can be used by
|
|
89
|
+
* the UI to determine what controls should be shown to the user. It does not provide any
|
|
90
|
+
* security in itself.
|
|
91
|
+
*
|
|
92
|
+
* If your app is running in a semi-trusted environment where only some clients are allowed
|
|
93
|
+
* to change tracks, you should use "role based verification" to enforce those policies.
|
|
94
|
+
*/
|
|
41
95
|
canSetTrack: boolean;
|
|
96
|
+
/**
|
|
97
|
+
* Controls whether or not the local client is allowed to change the tracks custom data object.
|
|
98
|
+
*
|
|
99
|
+
* @remarks
|
|
100
|
+
* This flag largely meant to influence decisions made by the coordinator and can be used by
|
|
101
|
+
* the UI to determine what controls should be shown to the user. It does not provide any
|
|
102
|
+
* security in itself.
|
|
103
|
+
*
|
|
104
|
+
* If your app is running in a semi-trusted environment where only some clients are allowed
|
|
105
|
+
* to change the tracks data object, you should use "role based verification" to enforce those
|
|
106
|
+
* policies.
|
|
107
|
+
*/
|
|
42
108
|
canSetTrackData: boolean;
|
|
109
|
+
/**
|
|
110
|
+
* Returns true if the local client is in a suspended state.
|
|
111
|
+
*/
|
|
43
112
|
get isSuspended(): boolean;
|
|
113
|
+
/**
|
|
114
|
+
* Max amount of playback drift allowed in seconds.
|
|
115
|
+
*
|
|
116
|
+
* @remarks
|
|
117
|
+
* Should the local clients playback position lag by more than the specified value, the
|
|
118
|
+
* coordinator will trigger a `catchup` action.
|
|
119
|
+
*
|
|
120
|
+
* Defaults to a value of `1` second.
|
|
121
|
+
*/
|
|
44
122
|
get maxPlaybackDrift(): number;
|
|
45
123
|
set maxPlaybackDrift(value: number);
|
|
124
|
+
/**
|
|
125
|
+
* Frequency with which position updates are broadcast to the rest of the group in
|
|
126
|
+
* seconds.
|
|
127
|
+
*
|
|
128
|
+
* @remarks
|
|
129
|
+
* Defaults to a value of `2` seconds.
|
|
130
|
+
*/
|
|
46
131
|
get positionUpdateInterval(): number;
|
|
47
132
|
set positionUpdateInterval(value: number);
|
|
48
|
-
|
|
133
|
+
/**
|
|
134
|
+
* Instructs the group to play the current track.
|
|
135
|
+
*
|
|
136
|
+
* @remarks
|
|
137
|
+
* Throws an exception if the session/coordinator hasn't been started, no track has been
|
|
138
|
+
* loaded, or `canPlayPause` is false.
|
|
139
|
+
*/
|
|
49
140
|
play(): void;
|
|
141
|
+
/**
|
|
142
|
+
* Instructs the group to pause the current track.
|
|
143
|
+
*
|
|
144
|
+
* @remarks
|
|
145
|
+
* Throws an exception if the session/coordinator hasn't been started, no track has been
|
|
146
|
+
* loaded, or `canPlayPause` is false.
|
|
147
|
+
*/
|
|
50
148
|
pause(): void;
|
|
149
|
+
/**
|
|
150
|
+
* Instructs the group to seek to a new position within the current track.
|
|
151
|
+
*
|
|
152
|
+
* @remarks
|
|
153
|
+
* Throws an exception if the session/coordinator hasn't been started, no track has been
|
|
154
|
+
* loaded, or `canSeek` is false.
|
|
155
|
+
* @param time Playback position in seconds to seek to.
|
|
156
|
+
*/
|
|
51
157
|
seekTo(time: number): void;
|
|
158
|
+
/**
|
|
159
|
+
* Instructs the group to load a new track.
|
|
160
|
+
*
|
|
161
|
+
* @remarks
|
|
162
|
+
* Throws an exception if the session/coordinator hasn't been started or `canSetTrack` is
|
|
163
|
+
* false.
|
|
164
|
+
* @param metadata The track to load or `null` to indicate that the end of the track is reached.
|
|
165
|
+
* @param waitPoints Optional. List of static wait points to configure for the track. Dynamic wait points can be added via the `beginSuspension()` call.
|
|
166
|
+
*/
|
|
52
167
|
setTrack(metadata: ExtendedMediaMetadata | null, waitPoints?: CoordinationWaitPoint[]): void;
|
|
168
|
+
/**
|
|
169
|
+
* Updates the track data object for the current track.
|
|
170
|
+
*
|
|
171
|
+
* @remarks
|
|
172
|
+
* The track data object can be used by applications to synchronize things like pitch, roll,
|
|
173
|
+
* and yaw of a 360 video. This data object will be reset to null anytime the track changes.
|
|
174
|
+
*
|
|
175
|
+
* Throws an exception if the session/coordinator hasn't been started or `canSetTrackData` is
|
|
176
|
+
* false.
|
|
177
|
+
* @param data New data object to sync with the group. This value will be synchronized using a last writer wins strategy.
|
|
178
|
+
*/
|
|
53
179
|
setTrackData(data: object | null): void;
|
|
180
|
+
/**
|
|
181
|
+
* Begins a new local suspension.
|
|
182
|
+
*
|
|
183
|
+
* @remarks
|
|
184
|
+
* Suspension temporarily suspend the clients local synchronization with the group. This can
|
|
185
|
+
* be useful for displaying ads to users or temporarily disconnecting from the session while
|
|
186
|
+
* the user seeks the video using a timeline scrubber.
|
|
187
|
+
*
|
|
188
|
+
* Multiple simultaneous suspensions are allowed and when the last suspension ends the local
|
|
189
|
+
* client will be immediately re-synchronized with the group.
|
|
190
|
+
*
|
|
191
|
+
* A "Dynamic Wait Point" can be specified when `beginSuspension()` is called and the wait
|
|
192
|
+
* point will be broadcast to all other clients in the group. Those clients will then
|
|
193
|
+
* automatically enter a suspension state once they reach the positions specified by the
|
|
194
|
+
* wait point. Clients that are passed the wait point will immediately suspend.
|
|
195
|
+
*
|
|
196
|
+
* Any wait point based suspension (dynamic or static) will result in all clients remaining
|
|
197
|
+
* in a suspension state until the list client ends their suspension. This behavior can be
|
|
198
|
+
* conditionally bypassed by settings the wait points `maxClients` value.
|
|
199
|
+
*
|
|
200
|
+
* Throws an exception if the session/coordinator hasn't been started.
|
|
201
|
+
* @param waitPoint Optional. Dynamic wait point to broadcast to all of the clients.
|
|
202
|
+
* @returns The suspension object. Call `end()` on the returned suspension to end the suspension.
|
|
203
|
+
*/
|
|
54
204
|
beginSuspension(waitPoint?: CoordinationWaitPoint): MediaSessionCoordinatorSuspension;
|
|
55
|
-
|
|
56
|
-
|
|
205
|
+
/**
|
|
206
|
+
* @hidden
|
|
207
|
+
* Called by MediaSession to verify the coordinator has been started.
|
|
208
|
+
*/
|
|
209
|
+
get isStarted(): boolean;
|
|
210
|
+
/**
|
|
211
|
+
* @hidden
|
|
212
|
+
* Called by MediaSession to start coordinator.
|
|
213
|
+
*/
|
|
57
214
|
start(acceptTransportChangesFrom?: UserMeetingRole[]): Promise<void>;
|
|
215
|
+
/**
|
|
216
|
+
* @hidden
|
|
217
|
+
* Called by the MediaSession to detect if a wait point has been hit.
|
|
218
|
+
*/
|
|
219
|
+
findNextWaitPoint(): CoordinationWaitPoint | null;
|
|
220
|
+
/**
|
|
221
|
+
* @hidden
|
|
222
|
+
* Called by MediaSession to trigger the sending of a position update.
|
|
223
|
+
*/
|
|
224
|
+
sendPositionUpdate(state: IMediaPlayerState): void;
|
|
58
225
|
protected createChildren(acceptTransportChangesFrom?: UserMeetingRole[]): Promise<void>;
|
|
59
226
|
private getPlayerPosition;
|
|
60
227
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EphemeralMediaSessionCoordinator.d.ts","sourceRoot":"","sources":["../src/EphemeralMediaSessionCoordinator.ts"],"names":[],"mappings":"AAAA;;;GAGG;;AAEH,OAAO,EAAwF,gBAAgB,EAAgB,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAC9K,OAAO,EAAE,qBAAqB,EAAqC,qBAAqB,EAAE,iCAAiC,EAA+D,iCAAiC,EAAE,MAAM,0BAA0B,CAAC;AAG9P,OAAO,YAAY,MAAM,QAAQ,CAAC;AAElC;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAC9B,QAAQ,EAAE,qBAAqB,GAAC,IAAI,CAAC;
|
|
1
|
+
{"version":3,"file":"EphemeralMediaSessionCoordinator.d.ts","sourceRoot":"","sources":["../src/EphemeralMediaSessionCoordinator.ts"],"names":[],"mappings":"AAAA;;;GAGG;;AAEH,OAAO,EAAwF,gBAAgB,EAAgB,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAC9K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|
"use strict";
|
|
2
2
|
/**
|
|
3
3
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
4
|
-
* Licensed under the
|
|
4
|
+
* Licensed under the Microsoft Live Share SDK License.
|
|
5
5
|
*/
|
|
6
6
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
7
7
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
@@ -22,44 +22,115 @@ const internals_1 = require("./internals");
|
|
|
22
22
|
const EphemeralMediaSessionCoordinatorSuspension_1 = require("./EphemeralMediaSessionCoordinatorSuspension");
|
|
23
23
|
const events_1 = __importDefault(require("events"));
|
|
24
24
|
/**
|
|
25
|
-
*
|
|
25
|
+
* The `EphemeralMediaSessionCoordinator` tracks the playback & position state of all other
|
|
26
|
+
* clients being synchronized with. It is responsible for keeping the local media player
|
|
27
|
+
* in sync with the group.
|
|
26
28
|
*/
|
|
27
29
|
class EphemeralMediaSessionCoordinator extends events_1.default {
|
|
30
|
+
/**
|
|
31
|
+
* @hidden
|
|
32
|
+
* Applications shouldn't directly create new coordinator instances.
|
|
33
|
+
*/
|
|
28
34
|
constructor(runtime, getPlayerState) {
|
|
29
35
|
super();
|
|
30
36
|
this._positionUpdateInterval = new live_share_1.TimeInterval(2000);
|
|
31
37
|
this._maxPlaybackDrift = new live_share_1.TimeInterval(1000);
|
|
32
38
|
this._hasStarted = false;
|
|
39
|
+
/**
|
|
40
|
+
* Controls whether or not the local client is allowed to instruct the group to play or pause.
|
|
41
|
+
*
|
|
42
|
+
* @remarks
|
|
43
|
+
* This flag largely meant to influence decisions made by the coordinator and can be used by
|
|
44
|
+
* the UI to determine what controls should be shown to the user. It does not provide any
|
|
45
|
+
* security in itself.
|
|
46
|
+
*
|
|
47
|
+
* If your app is running in a semi-trusted environment where only some clients are allowed
|
|
48
|
+
* to play/pause media, you should use "role based verification" to enforce those policies.
|
|
49
|
+
*/
|
|
33
50
|
this.canPlayPause = true;
|
|
51
|
+
/**
|
|
52
|
+
* Controls whether or not the local client is allowed to seek the group to a new playback
|
|
53
|
+
* position.
|
|
54
|
+
*
|
|
55
|
+
* @remarks
|
|
56
|
+
* This flag largely meant to influence decisions made by the coordinator and can be used by
|
|
57
|
+
* the UI to determine what controls should be shown to the user. It does not provide any
|
|
58
|
+
* security in itself.
|
|
59
|
+
*
|
|
60
|
+
* If your app is running in a semi-trusted environment where only some clients are allowed
|
|
61
|
+
* to change the playback position, you should use "role based verification" to enforce those policies.
|
|
62
|
+
*/
|
|
34
63
|
this.canSeek = true;
|
|
64
|
+
/**
|
|
65
|
+
* Controls whether or not the local client is allowed to change tracks.
|
|
66
|
+
*
|
|
67
|
+
* @remarks
|
|
68
|
+
* This flag largely meant to influence decisions made by the coordinator and can be used by
|
|
69
|
+
* the UI to determine what controls should be shown to the user. It does not provide any
|
|
70
|
+
* security in itself.
|
|
71
|
+
*
|
|
72
|
+
* If your app is running in a semi-trusted environment where only some clients are allowed
|
|
73
|
+
* to change tracks, you should use "role based verification" to enforce those policies.
|
|
74
|
+
*/
|
|
35
75
|
this.canSetTrack = true;
|
|
76
|
+
/**
|
|
77
|
+
* Controls whether or not the local client is allowed to change the tracks custom data object.
|
|
78
|
+
*
|
|
79
|
+
* @remarks
|
|
80
|
+
* This flag largely meant to influence decisions made by the coordinator and can be used by
|
|
81
|
+
* the UI to determine what controls should be shown to the user. It does not provide any
|
|
82
|
+
* security in itself.
|
|
83
|
+
*
|
|
84
|
+
* If your app is running in a semi-trusted environment where only some clients are allowed
|
|
85
|
+
* to change the tracks data object, you should use "role based verification" to enforce those
|
|
86
|
+
* policies.
|
|
87
|
+
*/
|
|
36
88
|
this.canSetTrackData = true;
|
|
37
89
|
this._runtime = runtime;
|
|
38
90
|
this._logger = new live_share_1.EphemeralTelemetryLogger(runtime);
|
|
39
91
|
this._getPlayerState = getPlayerState;
|
|
40
92
|
}
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
93
|
+
/**
|
|
94
|
+
* Returns true if the local client is in a suspended state.
|
|
95
|
+
*/
|
|
44
96
|
get isSuspended() {
|
|
45
97
|
return this._groupState ? this._groupState.isSuspended : false;
|
|
46
98
|
}
|
|
99
|
+
/**
|
|
100
|
+
* Max amount of playback drift allowed in seconds.
|
|
101
|
+
*
|
|
102
|
+
* @remarks
|
|
103
|
+
* Should the local clients playback position lag by more than the specified value, the
|
|
104
|
+
* coordinator will trigger a `catchup` action.
|
|
105
|
+
*
|
|
106
|
+
* Defaults to a value of `1` second.
|
|
107
|
+
*/
|
|
47
108
|
get maxPlaybackDrift() {
|
|
48
109
|
return this._maxPlaybackDrift.seconds;
|
|
49
110
|
}
|
|
50
111
|
set maxPlaybackDrift(value) {
|
|
51
112
|
this._maxPlaybackDrift.seconds = value;
|
|
52
113
|
}
|
|
114
|
+
/**
|
|
115
|
+
* Frequency with which position updates are broadcast to the rest of the group in
|
|
116
|
+
* seconds.
|
|
117
|
+
*
|
|
118
|
+
* @remarks
|
|
119
|
+
* Defaults to a value of `2` seconds.
|
|
120
|
+
*/
|
|
53
121
|
get positionUpdateInterval() {
|
|
54
122
|
return this._positionUpdateInterval.seconds;
|
|
55
123
|
}
|
|
56
124
|
set positionUpdateInterval(value) {
|
|
57
125
|
this._positionUpdateInterval.seconds = value;
|
|
58
126
|
}
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
127
|
+
/**
|
|
128
|
+
* Instructs the group to play the current track.
|
|
129
|
+
*
|
|
130
|
+
* @remarks
|
|
131
|
+
* Throws an exception if the session/coordinator hasn't been started, no track has been
|
|
132
|
+
* loaded, or `canPlayPause` is false.
|
|
133
|
+
*/
|
|
63
134
|
play() {
|
|
64
135
|
var _a;
|
|
65
136
|
if (!this._hasStarted) {
|
|
@@ -80,6 +151,13 @@ class EphemeralMediaSessionCoordinator extends events_1.default {
|
|
|
80
151
|
position: position
|
|
81
152
|
});
|
|
82
153
|
}
|
|
154
|
+
/**
|
|
155
|
+
* Instructs the group to pause the current track.
|
|
156
|
+
*
|
|
157
|
+
* @remarks
|
|
158
|
+
* Throws an exception if the session/coordinator hasn't been started, no track has been
|
|
159
|
+
* loaded, or `canPlayPause` is false.
|
|
160
|
+
*/
|
|
83
161
|
pause() {
|
|
84
162
|
var _a;
|
|
85
163
|
if (!this._hasStarted) {
|
|
@@ -100,6 +178,14 @@ class EphemeralMediaSessionCoordinator extends events_1.default {
|
|
|
100
178
|
position: position
|
|
101
179
|
});
|
|
102
180
|
}
|
|
181
|
+
/**
|
|
182
|
+
* Instructs the group to seek to a new position within the current track.
|
|
183
|
+
*
|
|
184
|
+
* @remarks
|
|
185
|
+
* Throws an exception if the session/coordinator hasn't been started, no track has been
|
|
186
|
+
* loaded, or `canSeek` is false.
|
|
187
|
+
* @param time Playback position in seconds to seek to.
|
|
188
|
+
*/
|
|
103
189
|
seekTo(time) {
|
|
104
190
|
var _a;
|
|
105
191
|
if (!this._hasStarted) {
|
|
@@ -118,6 +204,15 @@ class EphemeralMediaSessionCoordinator extends events_1.default {
|
|
|
118
204
|
position: time
|
|
119
205
|
});
|
|
120
206
|
}
|
|
207
|
+
/**
|
|
208
|
+
* Instructs the group to load a new track.
|
|
209
|
+
*
|
|
210
|
+
* @remarks
|
|
211
|
+
* Throws an exception if the session/coordinator hasn't been started or `canSetTrack` is
|
|
212
|
+
* false.
|
|
213
|
+
* @param metadata The track to load or `null` to indicate that the end of the track is reached.
|
|
214
|
+
* @param waitPoints Optional. List of static wait points to configure for the track. Dynamic wait points can be added via the `beginSuspension()` call.
|
|
215
|
+
*/
|
|
121
216
|
setTrack(metadata, waitPoints) {
|
|
122
217
|
if (!this._hasStarted) {
|
|
123
218
|
throw new Error(`EphemeralMediaSessionCoordinator.setTrack() called before start() called.`);
|
|
@@ -132,6 +227,17 @@ class EphemeralMediaSessionCoordinator extends events_1.default {
|
|
|
132
227
|
waitPoints: waitPoints || []
|
|
133
228
|
});
|
|
134
229
|
}
|
|
230
|
+
/**
|
|
231
|
+
* Updates the track data object for the current track.
|
|
232
|
+
*
|
|
233
|
+
* @remarks
|
|
234
|
+
* The track data object can be used by applications to synchronize things like pitch, roll,
|
|
235
|
+
* and yaw of a 360 video. This data object will be reset to null anytime the track changes.
|
|
236
|
+
*
|
|
237
|
+
* Throws an exception if the session/coordinator hasn't been started or `canSetTrackData` is
|
|
238
|
+
* false.
|
|
239
|
+
* @param data New data object to sync with the group. This value will be synchronized using a last writer wins strategy.
|
|
240
|
+
*/
|
|
135
241
|
setTrackData(data) {
|
|
136
242
|
if (!this._hasStarted) {
|
|
137
243
|
throw new Error(`EphemeralMediaSessionCoordinator.setTrackData() called before start() called.`);
|
|
@@ -145,6 +251,30 @@ class EphemeralMediaSessionCoordinator extends events_1.default {
|
|
|
145
251
|
data: data
|
|
146
252
|
});
|
|
147
253
|
}
|
|
254
|
+
/**
|
|
255
|
+
* Begins a new local suspension.
|
|
256
|
+
*
|
|
257
|
+
* @remarks
|
|
258
|
+
* Suspension temporarily suspend the clients local synchronization with the group. This can
|
|
259
|
+
* be useful for displaying ads to users or temporarily disconnecting from the session while
|
|
260
|
+
* the user seeks the video using a timeline scrubber.
|
|
261
|
+
*
|
|
262
|
+
* Multiple simultaneous suspensions are allowed and when the last suspension ends the local
|
|
263
|
+
* client will be immediately re-synchronized with the group.
|
|
264
|
+
*
|
|
265
|
+
* A "Dynamic Wait Point" can be specified when `beginSuspension()` is called and the wait
|
|
266
|
+
* point will be broadcast to all other clients in the group. Those clients will then
|
|
267
|
+
* automatically enter a suspension state once they reach the positions specified by the
|
|
268
|
+
* wait point. Clients that are passed the wait point will immediately suspend.
|
|
269
|
+
*
|
|
270
|
+
* Any wait point based suspension (dynamic or static) will result in all clients remaining
|
|
271
|
+
* in a suspension state until the list client ends their suspension. This behavior can be
|
|
272
|
+
* conditionally bypassed by settings the wait points `maxClients` value.
|
|
273
|
+
*
|
|
274
|
+
* Throws an exception if the session/coordinator hasn't been started.
|
|
275
|
+
* @param waitPoint Optional. Dynamic wait point to broadcast to all of the clients.
|
|
276
|
+
* @returns The suspension object. Call `end()` on the returned suspension to end the suspension.
|
|
277
|
+
*/
|
|
148
278
|
beginSuspension(waitPoint) {
|
|
149
279
|
var _a;
|
|
150
280
|
if (!this._hasStarted) {
|
|
@@ -179,21 +309,17 @@ class EphemeralMediaSessionCoordinator extends events_1.default {
|
|
|
179
309
|
}
|
|
180
310
|
});
|
|
181
311
|
}
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
const evt = this._groupState.createPositionUpdateEvent(state);
|
|
189
|
-
(_a = this._positionUpdateEvent) === null || _a === void 0 ? void 0 : _a.sendEvent(evt);
|
|
190
|
-
}
|
|
191
|
-
syncLocalMediaSession() {
|
|
192
|
-
if (!this._hasStarted) {
|
|
193
|
-
throw new Error(`EphemeralMediaSessionCoordinator.syncLocalMediaSession() called before start() called.`);
|
|
194
|
-
}
|
|
195
|
-
this._groupState.syncLocalMediaSession();
|
|
312
|
+
/**
|
|
313
|
+
* @hidden
|
|
314
|
+
* Called by MediaSession to verify the coordinator has been started.
|
|
315
|
+
*/
|
|
316
|
+
get isStarted() {
|
|
317
|
+
return this._hasStarted;
|
|
196
318
|
}
|
|
319
|
+
/**
|
|
320
|
+
* @hidden
|
|
321
|
+
* Called by MediaSession to start coordinator.
|
|
322
|
+
*/
|
|
197
323
|
start(acceptTransportChangesFrom) {
|
|
198
324
|
return __awaiter(this, void 0, void 0, function* () {
|
|
199
325
|
if (this._hasStarted) {
|
|
@@ -204,6 +330,27 @@ class EphemeralMediaSessionCoordinator extends events_1.default {
|
|
|
204
330
|
this._hasStarted = true;
|
|
205
331
|
});
|
|
206
332
|
}
|
|
333
|
+
/**
|
|
334
|
+
* @hidden
|
|
335
|
+
* Called by the MediaSession to detect if a wait point has been hit.
|
|
336
|
+
*/
|
|
337
|
+
findNextWaitPoint() {
|
|
338
|
+
var _a;
|
|
339
|
+
return ((_a = this._groupState) === null || _a === void 0 ? void 0 : _a.playbackTrack.findNextWaitPoint(this._lastWaitPoint)) || null;
|
|
340
|
+
}
|
|
341
|
+
/**
|
|
342
|
+
* @hidden
|
|
343
|
+
* Called by MediaSession to trigger the sending of a position update.
|
|
344
|
+
*/
|
|
345
|
+
sendPositionUpdate(state) {
|
|
346
|
+
var _a;
|
|
347
|
+
if (!this._hasStarted) {
|
|
348
|
+
throw new Error(`EphemeralMediaSessionCoordinator.sendPositionUpdate() called before start() called.`);
|
|
349
|
+
}
|
|
350
|
+
// Send position update event
|
|
351
|
+
const evt = this._groupState.createPositionUpdateEvent(state);
|
|
352
|
+
(_a = this._positionUpdateEvent) === null || _a === void 0 ? void 0 : _a.sendEvent(evt);
|
|
353
|
+
}
|
|
207
354
|
createChildren(acceptTransportChangesFrom) {
|
|
208
355
|
return __awaiter(this, void 0, void 0, function* () {
|
|
209
356
|
// Create event scopes
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EphemeralMediaSessionCoordinator.js","sourceRoot":"","sources":["../src/EphemeralMediaSessionCoordinator.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;;;;;;;;;;;;;AAEH,sDAA8K;AAE9K,2CAAyM;AACzM,6GAA0G;AAC1G,oDAAkC;
|
|
1
|
+
{"version":3,"file":"EphemeralMediaSessionCoordinator.js","sourceRoot":"","sources":["../src/EphemeralMediaSessionCoordinator.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;;;;;;;;;;;;;AAEH,sDAA8K;AAE9K,2CAAyM;AACzM,6GAA0G;AAC1G,oDAAkC;AA8BlC;;;;GAIG;AACH,MAAa,gCAAiC,SAAQ,gBAAY;IAqB9D;;;OAGG;IACH,YAAY,OAAyB,EAAE,cAAuC;QAC1E,KAAK,EAAE,CAAC;QAtBJ,4BAAuB,GAAG,IAAI,yBAAY,CAAC,IAAI,CAAC,CAAC;QACjD,sBAAiB,GAAG,IAAI,yBAAY,CAAC,IAAI,CAAC,CAAC;QAE3C,gBAAW,GAAG,KAAK,CAAC;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,CAAC,EAAC,CAAC,CAAC;gBACzL,MAAM,KAAK,GAAG,IAAI,CAAC,eAAe,EAAE,CAAC;gBACrC,MAAM,MAAM,GAAG,IAAI,CAAC,WAAY,CAAC,yBAAyB,CAAC,KAAK,CAAC,CAAC;gBAClE,MAAA,IAAI,CAAC,oBAAoB,0CAAE,SAAS,CAAC,MAAM,CAAC,CAAC;YACjD,CAAC,CAAC,CAAC;YAEH,4BAA4B;YAC5B,IAAI,CAAC,YAAY,CAAC,SAAS,CAAC,EAAE,CAAC,CAAC;QACpC,CAAC;KAAA;IAEO,iBAAiB;QACrB,MAAM,EAAE,aAAa,EAAE,aAAa,EAAE,GAAG,IAAI,CAAC,eAAe,EAAE,CAAC;QAChE,QAAQ,aAAa,EAAE;YACnB,KAAK,MAAM,CAAC;YACZ,KAAK,OAAO;gBACR,OAAO,GAAG,CAAC;YACf;gBACI,OAAO,aAAa,IAAI,aAAa,CAAC,QAAQ,IAAI,SAAS,CAAC,CAAC,CAAC,aAAa,CAAC,QAAQ,CAAC,CAAC,CAAC,GAAG,CAAC;SAClG;IACL,CAAC;CACJ;AAhaD,4EAgaC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
3
|
-
* Licensed under the
|
|
3
|
+
* Licensed under the Microsoft Live Share SDK License.
|
|
4
4
|
*/
|
|
5
5
|
import { MediaSessionCoordinatorSuspension, CoordinationWaitPoint } from './MediaSessionExtensions';
|
|
6
6
|
export declare class EphemeralMediaSessionCoordinatorSuspension implements MediaSessionCoordinatorSuspension {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
/**
|
|
3
3
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
4
|
-
* Licensed under the
|
|
4
|
+
* Licensed under the Microsoft Live Share SDK License.
|
|
5
5
|
*/
|
|
6
6
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
7
|
exports.EphemeralMediaSessionCoordinatorSuspension = void 0;
|
package/bin/IMediaPlayer.d.ts
CHANGED
package/bin/IMediaPlayer.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
/**
|
|
3
3
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
4
|
-
* Licensed under the
|
|
4
|
+
* Licensed under the Microsoft Live Share SDK License.
|
|
5
5
|
*/
|
|
6
6
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
7
|
//# sourceMappingURL=IMediaPlayer.js.map
|