@microsoft/live-share-media 2.0.0-internal.2 → 2.0.0-internal.20

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.
Files changed (151) hide show
  1. package/README.md +26 -27
  2. package/bin/esm/IMediaPlayer.d.ts.map +1 -0
  3. package/bin/{IMediaPlayer.js → esm/IMediaPlayer.js} +1 -2
  4. package/bin/esm/IMediaPlayer.js.map +1 -0
  5. package/bin/{LiveMediaSession.d.ts → esm/LiveMediaSession.d.ts} +16 -9
  6. package/bin/esm/LiveMediaSession.d.ts.map +1 -0
  7. package/bin/esm/LiveMediaSession.js +247 -0
  8. package/bin/esm/LiveMediaSession.js.map +1 -0
  9. package/bin/{LiveMediaSessionCoordinator.d.ts → esm/LiveMediaSessionCoordinator.d.ts} +57 -13
  10. package/bin/esm/LiveMediaSessionCoordinator.d.ts.map +1 -0
  11. package/bin/esm/LiveMediaSessionCoordinator.js +544 -0
  12. package/bin/esm/LiveMediaSessionCoordinator.js.map +1 -0
  13. package/bin/{LiveMediaSessionCoordinatorSuspension.d.ts → esm/LiveMediaSessionCoordinatorSuspension.d.ts} +1 -1
  14. package/bin/esm/LiveMediaSessionCoordinatorSuspension.d.ts.map +1 -0
  15. package/bin/{LiveMediaSessionCoordinatorSuspension.js → esm/LiveMediaSessionCoordinatorSuspension.js} +3 -5
  16. package/bin/esm/LiveMediaSessionCoordinatorSuspension.js.map +1 -0
  17. package/bin/{MediaPlayerSynchronizer.d.ts → esm/MediaPlayerSynchronizer.d.ts} +22 -8
  18. package/bin/esm/MediaPlayerSynchronizer.d.ts.map +1 -0
  19. package/bin/{MediaPlayerSynchronizer.js → esm/MediaPlayerSynchronizer.js} +130 -153
  20. package/bin/esm/MediaPlayerSynchronizer.js.map +1 -0
  21. package/bin/{MediaSessionActionThrottler.d.ts → esm/MediaSessionActionThrottler.d.ts} +1 -1
  22. package/bin/esm/MediaSessionActionThrottler.d.ts.map +1 -0
  23. package/bin/esm/MediaSessionActionThrottler.js +10 -0
  24. package/bin/esm/MediaSessionActionThrottler.js.map +1 -0
  25. package/bin/esm/MediaSessionExtensions.d.ts.map +1 -0
  26. package/bin/{MediaSessionExtensions.js → esm/MediaSessionExtensions.js} +2 -5
  27. package/bin/esm/MediaSessionExtensions.js.map +1 -0
  28. package/bin/{RepeatedActionThrottler.d.ts → esm/RepeatedActionThrottler.d.ts} +2 -2
  29. package/bin/esm/RepeatedActionThrottler.d.ts.map +1 -0
  30. package/bin/{RepeatedActionThrottler.js → esm/RepeatedActionThrottler.js} +12 -17
  31. package/bin/esm/RepeatedActionThrottler.js.map +1 -0
  32. package/bin/{VolumeManager.d.ts → esm/VolumeManager.d.ts} +6 -6
  33. package/bin/esm/VolumeManager.d.ts.map +1 -0
  34. package/bin/{VolumeManager.js → esm/VolumeManager.js} +19 -22
  35. package/bin/esm/VolumeManager.js.map +1 -0
  36. package/bin/esm/index.d.ts +14 -0
  37. package/bin/esm/index.d.ts.map +1 -0
  38. package/bin/esm/index.js +14 -0
  39. package/bin/esm/index.js.map +1 -0
  40. package/bin/{internals → esm/internals}/GroupCoordinatorState.d.ts +14 -12
  41. package/bin/esm/internals/GroupCoordinatorState.d.ts.map +1 -0
  42. package/bin/{internals → esm/internals}/GroupCoordinatorState.js +177 -185
  43. package/bin/esm/internals/GroupCoordinatorState.js.map +1 -0
  44. package/bin/{internals → esm/internals}/GroupPlaybackPosition.d.ts +6 -5
  45. package/bin/esm/internals/GroupPlaybackPosition.d.ts.map +1 -0
  46. package/bin/{internals → esm/internals}/GroupPlaybackPosition.js +16 -12
  47. package/bin/esm/internals/GroupPlaybackPosition.js.map +1 -0
  48. package/bin/{internals → esm/internals}/GroupPlaybackRate.d.ts +4 -5
  49. package/bin/esm/internals/GroupPlaybackRate.d.ts.map +1 -0
  50. package/bin/{internals → esm/internals}/GroupPlaybackRate.js +5 -11
  51. package/bin/esm/internals/GroupPlaybackRate.js.map +1 -0
  52. package/bin/{internals → esm/internals}/GroupPlaybackTrack.d.ts +5 -6
  53. package/bin/esm/internals/GroupPlaybackTrack.d.ts.map +1 -0
  54. package/bin/{internals → esm/internals}/GroupPlaybackTrack.js +6 -11
  55. package/bin/esm/internals/GroupPlaybackTrack.js.map +1 -0
  56. package/bin/{internals → esm/internals}/GroupPlaybackTrackData.d.ts +5 -6
  57. package/bin/esm/internals/GroupPlaybackTrackData.d.ts.map +1 -0
  58. package/bin/{internals → esm/internals}/GroupPlaybackTrackData.js +8 -13
  59. package/bin/esm/internals/GroupPlaybackTrackData.js.map +1 -0
  60. package/bin/{internals → esm/internals}/GroupTransportState.d.ts +8 -9
  61. package/bin/esm/internals/GroupTransportState.d.ts.map +1 -0
  62. package/bin/{internals → esm/internals}/GroupTransportState.js +11 -13
  63. package/bin/esm/internals/GroupTransportState.js.map +1 -0
  64. package/bin/esm/internals/PriorityTimeInterval.d.ts +33 -0
  65. package/bin/esm/internals/PriorityTimeInterval.d.ts.map +1 -0
  66. package/bin/esm/internals/PriorityTimeInterval.js +53 -0
  67. package/bin/esm/internals/PriorityTimeInterval.js.map +1 -0
  68. package/bin/esm/internals/consts.d.ts.map +1 -0
  69. package/bin/{internals → esm/internals}/consts.js +1 -4
  70. package/bin/esm/internals/consts.js.map +1 -0
  71. package/bin/esm/internals/errors.d.ts.map +1 -0
  72. package/bin/{internals → esm/internals}/errors.js +2 -7
  73. package/bin/esm/internals/errors.js.map +1 -0
  74. package/bin/esm/internals/interfaces.d.ts +23 -0
  75. package/bin/esm/internals/interfaces.d.ts.map +1 -0
  76. package/bin/esm/internals/interfaces.js +2 -0
  77. package/bin/{internals → esm/internals}/interfaces.js.map +1 -1
  78. package/package.json +21 -12
  79. package/src/LiveMediaSession.ts +29 -14
  80. package/src/LiveMediaSessionCoordinator.ts +149 -37
  81. package/src/LiveMediaSessionCoordinatorSuspension.ts +2 -4
  82. package/src/MediaPlayerSynchronizer.ts +26 -11
  83. package/src/MediaSessionActionThrottler.ts +1 -1
  84. package/src/RepeatedActionThrottler.ts +2 -2
  85. package/src/VolumeManager.ts +6 -6
  86. package/src/index.ts +9 -9
  87. package/src/internals/GroupCoordinatorState.ts +19 -15
  88. package/src/internals/GroupPlaybackPosition.ts +9 -9
  89. package/src/internals/GroupPlaybackRate.ts +4 -4
  90. package/src/internals/GroupPlaybackTrack.ts +5 -5
  91. package/src/internals/GroupPlaybackTrackData.ts +5 -5
  92. package/src/internals/GroupTransportState.ts +8 -8
  93. package/src/internals/PriorityTimeInterval.ts +76 -0
  94. package/src/internals/interfaces.ts +15 -1
  95. package/tsconfig.json +64 -74
  96. package/.nycrc.json +0 -11
  97. package/bin/IMediaPlayer.d.ts.map +0 -1
  98. package/bin/IMediaPlayer.js.map +0 -1
  99. package/bin/LiveMediaSession.d.ts.map +0 -1
  100. package/bin/LiveMediaSession.js +0 -255
  101. package/bin/LiveMediaSession.js.map +0 -1
  102. package/bin/LiveMediaSessionCoordinator.d.ts.map +0 -1
  103. package/bin/LiveMediaSessionCoordinator.js +0 -472
  104. package/bin/LiveMediaSessionCoordinator.js.map +0 -1
  105. package/bin/LiveMediaSessionCoordinatorSuspension.d.ts.map +0 -1
  106. package/bin/LiveMediaSessionCoordinatorSuspension.js.map +0 -1
  107. package/bin/MediaPlayerSynchronizer.d.ts.map +0 -1
  108. package/bin/MediaPlayerSynchronizer.js.map +0 -1
  109. package/bin/MediaSessionActionThrottler.d.ts.map +0 -1
  110. package/bin/MediaSessionActionThrottler.js +0 -14
  111. package/bin/MediaSessionActionThrottler.js.map +0 -1
  112. package/bin/MediaSessionExtensions.d.ts.map +0 -1
  113. package/bin/MediaSessionExtensions.js.map +0 -1
  114. package/bin/RepeatedActionThrottler.d.ts.map +0 -1
  115. package/bin/RepeatedActionThrottler.js.map +0 -1
  116. package/bin/VolumeManager.d.ts.map +0 -1
  117. package/bin/VolumeManager.js.map +0 -1
  118. package/bin/index.d.ts +0 -14
  119. package/bin/index.d.ts.map +0 -1
  120. package/bin/index.js +0 -30
  121. package/bin/index.js.map +0 -1
  122. package/bin/internals/GroupCoordinatorState.d.ts.map +0 -1
  123. package/bin/internals/GroupCoordinatorState.js.map +0 -1
  124. package/bin/internals/GroupPlaybackPosition.d.ts.map +0 -1
  125. package/bin/internals/GroupPlaybackPosition.js.map +0 -1
  126. package/bin/internals/GroupPlaybackRate.d.ts.map +0 -1
  127. package/bin/internals/GroupPlaybackRate.js.map +0 -1
  128. package/bin/internals/GroupPlaybackTrack.d.ts.map +0 -1
  129. package/bin/internals/GroupPlaybackTrack.js.map +0 -1
  130. package/bin/internals/GroupPlaybackTrackData.d.ts.map +0 -1
  131. package/bin/internals/GroupPlaybackTrackData.js.map +0 -1
  132. package/bin/internals/GroupTransportState.d.ts.map +0 -1
  133. package/bin/internals/GroupTransportState.js.map +0 -1
  134. package/bin/internals/consts.d.ts.map +0 -1
  135. package/bin/internals/consts.js.map +0 -1
  136. package/bin/internals/errors.d.ts.map +0 -1
  137. package/bin/internals/errors.js.map +0 -1
  138. package/bin/internals/index.d.ts +0 -13
  139. package/bin/internals/index.d.ts.map +0 -1
  140. package/bin/internals/index.js +0 -29
  141. package/bin/internals/index.js.map +0 -1
  142. package/bin/internals/interfaces.d.ts +0 -10
  143. package/bin/internals/interfaces.d.ts.map +0 -1
  144. package/bin/internals/interfaces.js +0 -3
  145. package/src/internals/index.ts +0 -13
  146. package/tsconfig.build.json +0 -9
  147. package/typedoc.json +0 -10
  148. /package/bin/{IMediaPlayer.d.ts → esm/IMediaPlayer.d.ts} +0 -0
  149. /package/bin/{MediaSessionExtensions.d.ts → esm/MediaSessionExtensions.d.ts} +0 -0
  150. /package/bin/{internals → esm/internals}/consts.d.ts +0 -0
  151. /package/bin/{internals → esm/internals}/errors.d.ts +0 -0
@@ -0,0 +1,544 @@
1
+ /**
2
+ * Copyright (c) Microsoft Corporation. All rights reserved.
3
+ * Licensed under the Microsoft Live Share SDK License.
4
+ */
5
+ import { LiveTelemetryLogger, LiveDataObjectInitializeState, LiveDataObjectInitializeNotNeededError, LiveDataObjectNotInitializedError, } from "@microsoft/live-share";
6
+ import { LiveEventScope, LiveEventTarget, LiveObjectSynchronizer, isErrorLike, } from "@microsoft/live-share/internal";
7
+ import { GroupCoordinatorState, GroupCoordinatorStateEvents, } from "./internals/GroupCoordinatorState.js";
8
+ import { TelemetryEvents } from "./internals/consts.js";
9
+ import { TrackMetadataNotSetError, ActionBlockedError, } from "./internals/errors.js";
10
+ import { PriorityTimeInterval } from "./internals/PriorityTimeInterval.js";
11
+ import { LiveMediaSessionCoordinatorSuspension } from "./LiveMediaSessionCoordinatorSuspension.js";
12
+ import { TypedEventEmitter } from "@fluid-internal/client-utils";
13
+ /**
14
+ * The `LiveMediaSessionCoordinator` tracks the playback & position state of all other
15
+ * clients being synchronized with. It is responsible for keeping the local media player
16
+ * in sync with the group.
17
+ */
18
+ export class LiveMediaSessionCoordinator extends TypedEventEmitter {
19
+ _id;
20
+ _runtime;
21
+ _liveRuntime;
22
+ _logger;
23
+ _getPlayerState;
24
+ _positionUpdateInterval = new PriorityTimeInterval(2000,
25
+ // Scale by function
26
+ () => {
27
+ const audience = this._liveRuntime.audience;
28
+ if (!audience)
29
+ return 1;
30
+ // As the audience size gets bigger, we relax the update interval, since more variance is expected
31
+ const count = audience.getMembers().size;
32
+ return 1 + count / 5;
33
+ });
34
+ _maxPlaybackDrift = new PriorityTimeInterval(1500, // Scale by function
35
+ () => {
36
+ const audience = this._liveRuntime.audience;
37
+ if (!audience)
38
+ return 1;
39
+ // As the audience size gets bigger, we relax the playback drift, since more variance is expected
40
+ const count = audience.getMembers().size;
41
+ return 1 + count / 25;
42
+ });
43
+ _lastWaitPoint;
44
+ initializeState = LiveDataObjectInitializeState.needed;
45
+ // Broadcast events
46
+ _playEvent;
47
+ _pauseEvent;
48
+ _seekToEvent;
49
+ _rateChangeEvent;
50
+ _setTrackEvent;
51
+ _setTrackDataEvent;
52
+ _positionUpdateEvent;
53
+ // Synchronizer does not play a significant role in LiveMediaSession beyond being able to
54
+ // use "connect" events to replace old "joined" events when sending position data to new clients.
55
+ _synchronizer;
56
+ // Distributed state
57
+ _groupState;
58
+ /**
59
+ * @hidden
60
+ * Applications shouldn't directly create new coordinator instances.
61
+ */
62
+ constructor(id, runtime, liveRuntime, getPlayerState) {
63
+ super();
64
+ this._id = id;
65
+ this._runtime = runtime;
66
+ this._liveRuntime = liveRuntime;
67
+ this._logger = new LiveTelemetryLogger(runtime, liveRuntime);
68
+ this._getPlayerState = getPlayerState;
69
+ }
70
+ /**
71
+ * Controls whether or not the local client is allowed to instruct the group to play or pause.
72
+ *
73
+ * @remarks
74
+ * This flag largely meant to influence decisions made by the coordinator and can be used by
75
+ * the UI to determine what controls should be shown to the user. It does not provide any
76
+ * security in itself.
77
+ *
78
+ * If your app is running in a semi-trusted environment where only some clients are allowed
79
+ * to play/pause media, you should use "role based verification" to enforce those policies.
80
+ */
81
+ canPlayPause = true;
82
+ /**
83
+ * Controls whether or not the local client is allowed to seek the group to a new playback
84
+ * position.
85
+ *
86
+ * @remarks
87
+ * This flag largely meant to influence decisions made by the coordinator and can be used by
88
+ * the UI to determine what controls should be shown to the user. It does not provide any
89
+ * security in itself.
90
+ *
91
+ * If your app is running in a semi-trusted environment where only some clients are allowed
92
+ * to change the playback position, you should use "role based verification" to enforce those policies.
93
+ */
94
+ canSeek = true;
95
+ /**
96
+ * Controls whether or not the local client is allowed to change tracks.
97
+ *
98
+ * @remarks
99
+ * This flag largely meant to influence decisions made by the coordinator and can be used by
100
+ * the UI to determine what controls should be shown to the user. It does not provide any
101
+ * security in itself.
102
+ *
103
+ * If your app is running in a semi-trusted environment where only some clients are allowed
104
+ * to change tracks, you should use "role based verification" to enforce those policies.
105
+ */
106
+ canSetTrack = true;
107
+ /**
108
+ * Controls whether or not the local client is allowed to change the tracks custom data object.
109
+ *
110
+ * @remarks
111
+ * This flag largely meant to influence decisions made by the coordinator and can be used by
112
+ * the UI to determine what controls should be shown to the user. It does not provide any
113
+ * security in itself.
114
+ *
115
+ * If your app is running in a semi-trusted environment where only some clients are allowed
116
+ * to change the tracks data object, you should use "role based verification" to enforce those
117
+ * policies.
118
+ */
119
+ canSetTrackData = true;
120
+ /**
121
+ * Controls whether or not the local client is allowed to change the playback rate.
122
+ *
123
+ * @remarks
124
+ * This flag largely meant to influence decisions made by the coordinator and can be used by
125
+ * the UI to determine what controls should be shown to the user. It does not provide any
126
+ * security in itself.
127
+ *
128
+ * If your app is running in a semi-trusted environment where only some clients are allowed
129
+ * to change the tracks data object, you should use "role based verification" to enforce those
130
+ * policies.
131
+ */
132
+ canSetPlaybackRate = true;
133
+ /**
134
+ * Controls whether or not the local client is allowed to send position updates to the group.
135
+ *
136
+ * @remarks
137
+ * This flag largely meant to limit the number of signals sent to the group for performance reasons.
138
+ * It does not provide any security in itself.
139
+ */
140
+ canSendPositionUpdates = true;
141
+ /**
142
+ * Returns true if the local client is in a suspended state.
143
+ */
144
+ get isSuspended() {
145
+ return this._groupState ? this._groupState.isSuspended : false;
146
+ }
147
+ /**
148
+ * Controls whether or not to scale {@link maxPlaybackDrift} by the number of users in the session.
149
+ *
150
+ * @remarks
151
+ * As more clients join a session, it is more likely that some users will fall behind the presenter.
152
+ * It is also less likely that users will notice drift as more clients are added.
153
+ * It is usually helpful to be more lenient as more clients are added so everyone can watch all the content.
154
+ * Default value is true.
155
+ */
156
+ get shouldScaleMaxPlaybackDrift() {
157
+ return this._maxPlaybackDrift.shouldPrioritize;
158
+ }
159
+ set shouldScaleMaxPlaybackDrift(value) {
160
+ this._maxPlaybackDrift.shouldPrioritize = value;
161
+ }
162
+ /**
163
+ * Max amount of playback drift allowed in seconds.
164
+ * This will scale automatically according to the number of participants in the session when {@link shouldScaleMaxPlaybackDrift} is true.
165
+ *
166
+ * @remarks
167
+ * Should the local clients playback position lag by more than the specified value, the coordinator will trigger a `catchup` action.
168
+ * Default value is `1.5` seconds.
169
+ */
170
+ get maxPlaybackDrift() {
171
+ return this._maxPlaybackDrift.seconds;
172
+ }
173
+ set maxPlaybackDrift(value) {
174
+ this._maxPlaybackDrift.seconds = value;
175
+ }
176
+ /**
177
+ * Controls whether or not to compute {@link positionUpdateInterval} based on whether user has initiated a playback command.
178
+ * Default value is true.
179
+ *
180
+ * @remarks
181
+ * When true, users that are simply watching but not controlling playback will report their positions less frequently.
182
+ * When a user has sent a transport command, they will begin sending position updates more frequently.
183
+ * Most Live Share apps have a concept of a primary presenter, and don't allow anyone to pause/play for the group.
184
+ * By ensuring only one/few users broadcast updates frequently, the server load is reduced considerably.
185
+ */
186
+ get shouldScalePositionUpdateInterval() {
187
+ return this._positionUpdateInterval.shouldPrioritize;
188
+ }
189
+ set shouldScalePositionUpdateInterval(value) {
190
+ this._positionUpdateInterval.shouldPrioritize = value;
191
+ }
192
+ /**
193
+ * Frequency with which position updates are broadcast to the rest of the group in seconds.
194
+ * When {@link shouldScalePositionUpdateInterval} is set to `true`, the value set is the minimum value.
195
+ * The value returned is the actual value used to send updates by the local user, which may be larger than the value set.
196
+ *
197
+ * @remarks
198
+ * Defaults to a minimum value of `2` seconds.
199
+ */
200
+ get positionUpdateInterval() {
201
+ return this._positionUpdateInterval.seconds;
202
+ }
203
+ set positionUpdateInterval(value) {
204
+ this._positionUpdateInterval.seconds = value;
205
+ }
206
+ /**
207
+ * Instructs the group to play the current track.
208
+ *
209
+ * @remarks
210
+ * Throws an exception if the session/coordinator hasn't been initialized, no track has been
211
+ * loaded, or `canPlayPause` is false.
212
+ *
213
+ * @returns a void promise that resolves once complete, throws if user does not have proper roles
214
+ */
215
+ async play() {
216
+ LiveDataObjectNotInitializedError.assert("LiveMediaSessionCoordinator:play", "play", this.initializeState);
217
+ TrackMetadataNotSetError.assert(!!this._groupState?.playbackTrack.current.metadata, "LiveMediaSessionCoordinator:play", "play");
218
+ ActionBlockedError.assert(this.canPlayPause, "LiveMediaSessionCoordinator:play", "play", "canPlayPause");
219
+ // Get projected position
220
+ const position = this.getPlayerPosition();
221
+ // Send transport command
222
+ this._logger.sendTelemetryEvent(TelemetryEvents.SessionCoordinator.PlayCalled, null, { position: position });
223
+ await this._playEvent.sendEvent({
224
+ track: this._groupState.playbackTrack.current,
225
+ position: position,
226
+ });
227
+ if (this.canSendPositionUpdates) {
228
+ // User has taken initiative to send event, give priority for sending position updates
229
+ this._positionUpdateInterval.hasPriority = true;
230
+ }
231
+ }
232
+ /**
233
+ * Instructs the group to pause the current track.
234
+ *
235
+ * @remarks
236
+ * Throws an exception if the session/coordinator hasn't been initialized, no track has been
237
+ * loaded, or `canPlayPause` is false.
238
+ *
239
+ * @returns a void promise that resolves once complete, throws if user does not have proper roles
240
+ */
241
+ async pause() {
242
+ LiveDataObjectNotInitializedError.assert("LiveMediaSessionCoordinator:pause", "pause", this.initializeState);
243
+ TrackMetadataNotSetError.assert(!!this._groupState?.playbackTrack.current.metadata, "LiveMediaSessionCoordinator:pause", "pause");
244
+ ActionBlockedError.assert(this.canPlayPause, "LiveMediaSessionCoordinator:pause", "pause", "canPlayPause");
245
+ // Get projected position
246
+ const position = this.getPlayerPosition();
247
+ // Send transport command
248
+ this._logger.sendTelemetryEvent(TelemetryEvents.SessionCoordinator.PauseCalled, null, { position: position });
249
+ await this._pauseEvent.sendEvent({
250
+ track: this._groupState.playbackTrack.current,
251
+ position: position,
252
+ });
253
+ if (this.canSendPositionUpdates) {
254
+ // User has taken initiative to send event, give priority for sending position updates
255
+ this._positionUpdateInterval.hasPriority = true;
256
+ }
257
+ }
258
+ /**
259
+ * Instructs the group to seek to a new position within the current track.
260
+ *
261
+ * @remarks
262
+ * Throws an exception if the session/coordinator hasn't been initialized, no track has been
263
+ * loaded, or `canSeek` is false.
264
+ * @param time Playback position in seconds to seek to.
265
+ * @returns a void promise that resolves once complete, throws if user does not have proper roles
266
+ */
267
+ async seekTo(time) {
268
+ LiveDataObjectNotInitializedError.assert("LiveMediaSessionCoordinator:seekTo", "seekTo", this.initializeState);
269
+ TrackMetadataNotSetError.assert(!!this._groupState?.playbackTrack.current.metadata, "LiveMediaSessionCoordinator:seekTo", "seekTo");
270
+ ActionBlockedError.assert(this.canSeek, "LiveMediaSessionCoordinator:seekTo", "seekTo", "canSeek");
271
+ // Send transport command
272
+ this._logger.sendTelemetryEvent(TelemetryEvents.SessionCoordinator.SeekToCalled, null, { position: time });
273
+ try {
274
+ await this._seekToEvent.sendEvent({
275
+ track: this._groupState.playbackTrack.current,
276
+ position: time,
277
+ });
278
+ if (this.canSendPositionUpdates) {
279
+ // User has taken initiative to send event, give priority for sending position updates
280
+ this._positionUpdateInterval.hasPriority = true;
281
+ }
282
+ }
283
+ catch (err) {
284
+ await this._groupState.syncLocalMediaSession();
285
+ throw err;
286
+ }
287
+ }
288
+ /**
289
+ * Sets the playback rate for everyone in the session.
290
+ *
291
+ * @param playbackRate the playback rate to set.
292
+ *
293
+ * @throws
294
+ * Throws an exception if the session/coordinator hasn't been initialized or {@link canSetPlaybackRate} is false.
295
+ */
296
+ async setPlaybackRate(playbackRate) {
297
+ LiveDataObjectNotInitializedError.assert("LiveMediaSessionCoordinator:setPlaybackRate", "setPlaybackRate", this.initializeState);
298
+ ActionBlockedError.assert(this.canSetPlaybackRate, "LiveMediaSessionCoordinator:setPlaybackRate", "setPlaybackRate", "canSetPlaybackRate");
299
+ this._logger.sendTelemetryEvent(TelemetryEvents.SessionCoordinator.SetPlaybackRateCalled, null, { playbackRate });
300
+ await this._rateChangeEvent.sendEvent({ playbackRate });
301
+ if (this.canSendPositionUpdates) {
302
+ // User has taken initiative to send event, give priority for sending position updates
303
+ this._positionUpdateInterval.hasPriority = true;
304
+ }
305
+ }
306
+ /**
307
+ * Instructs the group to load a new track.
308
+ *
309
+ * @remarks
310
+ * Throws an exception if the session/coordinator hasn't been initialized or `canSetTrack` is
311
+ * false.
312
+ * @param metadata The track to load or `null` to indicate that the end of the track is reached.
313
+ * @param waitPoints Optional. List of static wait points to configure for the track. Dynamic wait points can be added via the `beginSuspension()` call.
314
+ * @returns a void promise that resolves once complete, throws if user does not have proper roles
315
+ */
316
+ async setTrack(metadata, waitPoints) {
317
+ LiveDataObjectNotInitializedError.assert("LiveMediaSessionCoordinator:setTrack", "setTrack", this.initializeState);
318
+ ActionBlockedError.assert(this.canSetTrack, "LiveMediaSessionCoordinator:setTrack", "setTrack", "canSetTrack");
319
+ // Send transport command
320
+ this._logger.sendTelemetryEvent(TelemetryEvents.SessionCoordinator.SetTrackCalled);
321
+ await this._setTrackEvent.sendEvent({
322
+ metadata: metadata,
323
+ waitPoints: waitPoints || [],
324
+ });
325
+ if (this.canSendPositionUpdates) {
326
+ // User has taken initiative to send event, give priority for sending position updates
327
+ this._positionUpdateInterval.hasPriority = true;
328
+ }
329
+ }
330
+ /**
331
+ * Updates the track data object for the current track.
332
+ *
333
+ * @remarks
334
+ * The track data object can be used by applications to synchronize things like pitch, roll,
335
+ * and yaw of a 360 video. This data object will be reset to null anytime the track changes.
336
+ *
337
+ * Throws an exception if the session/coordinator hasn't been initialized or `canSetTrackData` is
338
+ * false.
339
+ * @param data New data object to sync with the group. This value will be synchronized using a last writer wins strategy.
340
+ * @returns a void promise that resolves once complete, throws if user does not have proper roles
341
+ */
342
+ async setTrackData(data) {
343
+ LiveDataObjectNotInitializedError.assert("LiveMediaSessionCoordinator:setTrackData", "setTrackData", this.initializeState);
344
+ ActionBlockedError.assert(this.canSetTrackData, "LiveMediaSessionCoordinator:setTrackData", "setTrackData", "canSetTrackData");
345
+ // Send transport command
346
+ this._logger.sendTelemetryEvent(TelemetryEvents.SessionCoordinator.SetTrackDataCalled);
347
+ await this._setTrackDataEvent.sendEvent({
348
+ data: data,
349
+ });
350
+ if (this.canSendPositionUpdates) {
351
+ // User has taken initiative to send event, give priority for sending position updates
352
+ this._positionUpdateInterval.hasPriority = true;
353
+ }
354
+ }
355
+ /**
356
+ * Begins a new local suspension.
357
+ *
358
+ * @remarks
359
+ * Suspension temporarily suspend the clients local synchronization with the group. This can
360
+ * be useful for displaying ads to users or temporarily disconnecting from the session while
361
+ * the user seeks the video using a timeline scrubber.
362
+ *
363
+ * Multiple simultaneous suspensions are allowed and when the last suspension ends the local
364
+ * client will be immediately re-synchronized with the group.
365
+ *
366
+ * A "Dynamic Wait Point" can be specified when `beginSuspension()` is called and the wait
367
+ * point will be broadcast to all other clients in the group. Those clients will then
368
+ * automatically enter a suspension state once they reach the positions specified by the
369
+ * wait point. Clients that are passed the wait point will immediately suspend.
370
+ *
371
+ * Any wait point based suspension (dynamic or static) will result in all clients remaining
372
+ * in a suspension state until the list client ends their suspension. This behavior can be
373
+ * conditionally bypassed by settings the wait points `maxClients` value.
374
+ *
375
+ * Throws an exception if the session/coordinator hasn't been initialized.
376
+ * @param waitPoint Optional. Dynamic wait point to broadcast to all of the clients.
377
+ * @returns The suspension object. Call `end()` on the returned suspension to end the suspension.
378
+ */
379
+ beginSuspension(waitPoint) {
380
+ LiveDataObjectNotInitializedError.assert("LiveMediaSessionCoordinator:beginSuspension", "beginSuspension", this.initializeState);
381
+ TrackMetadataNotSetError.assert(!!this._groupState?.playbackTrack.current.metadata, "LiveMediaSessionCoordinator:beginSuspension", "beginSuspension");
382
+ // Tell group state that suspension is started
383
+ if (waitPoint) {
384
+ this._logger.sendTelemetryEvent(TelemetryEvents.SessionCoordinator.BeginSuspensionAndWait, null, {
385
+ position: waitPoint.position,
386
+ maxClients: waitPoint.maxClients,
387
+ });
388
+ this._lastWaitPoint = waitPoint;
389
+ this._groupState.beginSuspension(waitPoint);
390
+ }
391
+ else {
392
+ this._logger.sendTelemetryEvent(TelemetryEvents.SessionCoordinator.BeginSuspension);
393
+ this._groupState.beginSuspension();
394
+ }
395
+ // Return new suspension object
396
+ return new LiveMediaSessionCoordinatorSuspension(waitPoint, (time) => {
397
+ if (waitPoint) {
398
+ this._logger.sendTelemetryEvent(TelemetryEvents.SessionCoordinator.EndSuspensionAndWait, null, {
399
+ position: waitPoint.position,
400
+ maxClients: waitPoint.maxClients,
401
+ });
402
+ }
403
+ else {
404
+ this._logger.sendTelemetryEvent(TelemetryEvents.SessionCoordinator.EndSuspension);
405
+ }
406
+ this._groupState.endSuspension(time == undefined);
407
+ if (time != undefined &&
408
+ !this._groupState?.isSuspended &&
409
+ !this._groupState?.isWaiting) {
410
+ // Seek to new position
411
+ this.seekTo(Math.max(time, 0.0));
412
+ }
413
+ });
414
+ }
415
+ /**
416
+ * @hidden
417
+ * Called by MediaSession to verify the coordinator has been initialized.
418
+ */
419
+ get isInitialized() {
420
+ return this.initializeState === LiveDataObjectInitializeState.succeeded;
421
+ }
422
+ /**
423
+ * @hidden
424
+ * Called by MediaSession to start coordinator.
425
+ */
426
+ async initialize(acceptTransportChangesFrom) {
427
+ LiveDataObjectInitializeNotNeededError.assert("LiveMediaSessionCoordinator:initialize", this.initializeState);
428
+ this.initializeState = LiveDataObjectInitializeState.pending;
429
+ try {
430
+ // Create children
431
+ await this.createChildren(acceptTransportChangesFrom);
432
+ }
433
+ catch (error) {
434
+ this.initializeState = LiveDataObjectInitializeState.needed;
435
+ throw error;
436
+ }
437
+ this.initializeState = LiveDataObjectInitializeState.succeeded;
438
+ try {
439
+ // start needs to happen after setting initializedState to "succeeded"
440
+ await this._synchronizer?.start({
441
+ initialState: undefined,
442
+ updateState: async (evt, sender, local) => false,
443
+ getLocalUserCanSend: async (connecting) => true,
444
+ enableBackgroundUpdates: false,
445
+ });
446
+ }
447
+ catch (error) {
448
+ // not a fatal error for LiveMediaSession, only used for "connect" event to send new clients position updates.
449
+ this._logger.sendErrorEvent(TelemetryEvents.SessionCoordinator
450
+ .LiveObjectSynchronizerStartError, error);
451
+ }
452
+ }
453
+ /**
454
+ * @hidden
455
+ * Called by the MediaSession to detect if a wait point has been hit.
456
+ */
457
+ findNextWaitPoint() {
458
+ return (this._groupState?.playbackTrack.findNextWaitPoint(this._lastWaitPoint) || null);
459
+ }
460
+ /**
461
+ * @hidden
462
+ * Called by MediaSession to trigger the sending of a position update.
463
+ */
464
+ sendPositionUpdate(state, targetClientId) {
465
+ LiveDataObjectNotInitializedError.assert("LiveMediaSessionCoordinator:sendPositionUpdate", "sendPositionUpdate", this.initializeState);
466
+ if (this.canSendPositionUpdates) {
467
+ // Send position update event
468
+ const evt = this._groupState.createPositionUpdateEvent(state);
469
+ this._positionUpdateEvent
470
+ ?.sendEvent(evt, targetClientId)
471
+ .catch((err) => {
472
+ this._logger.sendErrorEvent(TelemetryEvents.SessionCoordinator
473
+ .PositionUpdateEventError, err);
474
+ });
475
+ }
476
+ else if (this.isSuspended) {
477
+ // send a local only position update event that was not sent as a signal, and use to handle local
478
+ // position update for clients that have canSendPositionUpdates==false, but are suspending
479
+ const evt = this._groupState.createPositionUpdateEvent(state);
480
+ this._positionUpdateEvent?.sendLocalEvent(evt).catch((err) => {
481
+ this._logger.sendErrorEvent(TelemetryEvents.SessionCoordinator.PositionUpdateEventError, err);
482
+ });
483
+ }
484
+ else {
485
+ // make sure position is synced to position of clients who can send position updates
486
+ this._groupState.syncLocalMediaSession();
487
+ }
488
+ }
489
+ async createChildren(acceptTransportChangesFrom) {
490
+ // Create event scopes
491
+ const scope = new LiveEventScope(this._runtime, this._liveRuntime, acceptTransportChangesFrom);
492
+ const unrestrictedScope = new LiveEventScope(this._runtime, this._liveRuntime);
493
+ // Initialize internal coordinator state
494
+ this._groupState = new GroupCoordinatorState(this._runtime, this._liveRuntime, this._maxPlaybackDrift, this._positionUpdateInterval, this._getPlayerState);
495
+ this._groupState.on(GroupCoordinatorStateEvents.triggeraction, (evt) => this.emit(evt.name, evt));
496
+ this._groupState.on(GroupCoordinatorStateEvents.triggeractionignored, (evt) => this.emit(evt.name, evt));
497
+ // Listen for track changes
498
+ this._setTrackEvent = new LiveEventTarget(scope, "setTrack", (event, local) => this._groupState.handleSetTrack(event, local));
499
+ this._setTrackDataEvent = new LiveEventTarget(scope, "setTrackData", (event, local) => this._groupState.handleSetTrackData(event, local));
500
+ // Listen for transport commands
501
+ this._playEvent = new LiveEventTarget(scope, "play", (event, local) => this._groupState.handleTransportCommand(event, local));
502
+ this._pauseEvent = new LiveEventTarget(scope, "pause", (event, local) => this._groupState.handleTransportCommand(event, local));
503
+ this._seekToEvent = new LiveEventTarget(scope, "seekTo", (event, local) => this._groupState.handleTransportCommand(event, local));
504
+ this._rateChangeEvent = new LiveEventTarget(scope, "rateChange", (event, local) => {
505
+ this._groupState.handleRateChangeCommand(event, local);
506
+ });
507
+ // Listen for position updates
508
+ this._positionUpdateEvent = new LiveEventTarget(unrestrictedScope, "positionUpdate", (event, local) => this._groupState.handlePositionUpdate(event, local));
509
+ this._synchronizer = new LiveObjectSynchronizer(this._id, this._runtime, this._liveRuntime);
510
+ this._synchronizer.onJoinedListener = (clientId, timestamp) => {
511
+ this._logger.sendTelemetryEvent(TelemetryEvents.SessionCoordinator.RemoteConnectReceived, null, {
512
+ correlationId: LiveTelemetryLogger.formatCorrelationId(clientId, timestamp),
513
+ });
514
+ // Immediately send a position update
515
+ try {
516
+ const state = this._getPlayerState();
517
+ // Send only to the user that joined the session using the targetClientId prop.
518
+ // This ensures that only the user that connected receives this one-time position update, minimizing costs.
519
+ this.sendPositionUpdate(state, clientId);
520
+ }
521
+ catch (err) {
522
+ // if player is not setup yet, local client might have also just joined and can't send its position.
523
+ const playerNotSetup = isErrorLike(err) &&
524
+ err.message.includes("LiveMediaSession:getCurrentPlayerState");
525
+ if (!playerNotSetup) {
526
+ throw err;
527
+ }
528
+ }
529
+ };
530
+ }
531
+ getPlayerPosition() {
532
+ const { positionState, playbackState } = this._getPlayerState();
533
+ switch (playbackState) {
534
+ case "none":
535
+ case "ended":
536
+ return 0.0;
537
+ default:
538
+ return positionState && positionState.position != undefined
539
+ ? positionState.position
540
+ : 0.0;
541
+ }
542
+ }
543
+ }
544
+ //# sourceMappingURL=LiveMediaSessionCoordinator.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"LiveMediaSessionCoordinator.js","sourceRoot":"","sources":["../../src/LiveMediaSessionCoordinator.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EACH,mBAAmB,EAGnB,6BAA6B,EAC7B,sCAAsC,EACtC,iCAAiC,GAEpC,MAAM,uBAAuB,C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G,IAAI,CAAC,eAAe,EAAE,CAAC;QAChE,QAAQ,aAAa,EAAE,CAAC;YACpB,KAAK,MAAM,CAAC;YACZ,KAAK,OAAO;gBACR,OAAO,GAAG,CAAC;YACf;gBACI,OAAO,aAAa,IAAI,aAAa,CAAC,QAAQ,IAAI,SAAS;oBACvD,CAAC,CAAC,aAAa,CAAC,QAAQ;oBACxB,CAAC,CAAC,GAAG,CAAC;QAClB,CAAC;IACL,CAAC;CACJ"}
@@ -2,7 +2,7 @@
2
2
  * Copyright (c) Microsoft Corporation. All rights reserved.
3
3
  * Licensed under the Microsoft Live Share SDK License.
4
4
  */
5
- import { MediaSessionCoordinatorSuspension, CoordinationWaitPoint } from "./MediaSessionExtensions";
5
+ import { MediaSessionCoordinatorSuspension, CoordinationWaitPoint } from "./MediaSessionExtensions.js";
6
6
  export declare class LiveMediaSessionCoordinatorSuspension implements MediaSessionCoordinatorSuspension {
7
7
  private _waitPoint?;
8
8
  private _onEnd;
@@ -0,0 +1 @@
1
+ {"version":3,"file":"LiveMediaSessionCoordinatorSuspension.d.ts","sourceRoot":"","sources":["../../src/LiveMediaSessionCoordinatorSuspension.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EACH,iCAAiC,EACjC,qBAAqB,EACxB,MAAM,6BAA6B,CAAC;AAErC,qBAAa,qCAAsC,YAAW,iCAAiC;IAC3F,OAAO,CAAC,UAAU,CAAC,CAAwB;IAC3C,OAAO,CAAC,MAAM,CAA4B;gBAGtC,SAAS,EAAE,qBAAqB,GAAG,SAAS,EAC5C,KAAK,EAAE,CAAC,MAAM,CAAC,EAAE,MAAM,KAAK,IAAI;IAMpC;;OAEG;IACH,IAAW,SAAS,IAAI,qBAAqB,GAAG,SAAS,CAExD;IAED;;;OAGG;IACI,GAAG,CAAC,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI;CAGpC"}
@@ -1,11 +1,10 @@
1
- "use strict";
2
1
  /**
3
2
  * Copyright (c) Microsoft Corporation. All rights reserved.
4
3
  * Licensed under the Microsoft Live Share SDK License.
5
4
  */
6
- Object.defineProperty(exports, "__esModule", { value: true });
7
- exports.LiveMediaSessionCoordinatorSuspension = void 0;
8
- class LiveMediaSessionCoordinatorSuspension {
5
+ export class LiveMediaSessionCoordinatorSuspension {
6
+ _waitPoint;
7
+ _onEnd;
9
8
  constructor(waitPoint, onEnd) {
10
9
  this._waitPoint = waitPoint;
11
10
  this._onEnd = onEnd;
@@ -24,5 +23,4 @@ class LiveMediaSessionCoordinatorSuspension {
24
23
  this._onEnd(seekTo);
25
24
  }
26
25
  }
27
- exports.LiveMediaSessionCoordinatorSuspension = LiveMediaSessionCoordinatorSuspension;
28
26
  //# sourceMappingURL=LiveMediaSessionCoordinatorSuspension.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"LiveMediaSessionCoordinatorSuspension.js","sourceRoot":"","sources":["../../src/LiveMediaSessionCoordinatorSuspension.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAOH,MAAM,OAAO,qCAAqC;IACtC,UAAU,CAAyB;IACnC,MAAM,CAA4B;IAE1C,YACI,SAA4C,EAC5C,KAAgC;QAEhC,IAAI,CAAC,UAAU,GAAG,SAAS,CAAC;QAC5B,IAAI,CAAC,MAAM,GAAG,KAAK,CAAC;IACxB,CAAC;IAED;;OAEG;IACH,IAAW,SAAS;QAChB,OAAO,IAAI,CAAC,UAAU,CAAC;IAC3B,CAAC;IAED;;;OAGG;IACI,GAAG,CAAC,MAAe;QACtB,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;IACxB,CAAC;CACJ"}
@@ -1,14 +1,15 @@
1
- /// <reference types="node" />
2
1
  /**
3
2
  * Copyright (c) Microsoft Corporation. All rights reserved.
4
3
  * Licensed under the Microsoft Live Share SDK License.
5
4
  */
6
- import { ILiveEvent, IRuntimeSignaler } from "@microsoft/live-share";
7
- import EventEmitter from "events";
8
- import { ExtendedMediaMetadata, CoordinationWaitPoint, ExtendedMediaSessionActionDetails } from "./MediaSessionExtensions";
9
- import { VolumeManager } from "./VolumeManager";
10
- import { LiveMediaSession } from "./LiveMediaSession";
11
- import { IMediaPlayer } from "./IMediaPlayer";
5
+ import { ILiveEvent } from "@microsoft/live-share";
6
+ import { IRuntimeSignaler } from "@microsoft/live-share/internal";
7
+ import { ExtendedMediaMetadata, CoordinationWaitPoint, ExtendedMediaSessionActionDetails } from "./MediaSessionExtensions.js";
8
+ import { VolumeManager } from "./VolumeManager.js";
9
+ import { LiveMediaSession } from "./LiveMediaSession.js";
10
+ import { IMediaPlayer } from "./IMediaPlayer.js";
11
+ import { TypedEventEmitter } from "@fluid-internal/client-utils";
12
+ import { IEvent } from "@fluidframework/core-interfaces";
12
13
  /**
13
14
  * Event data returned by `MediaPlayerSynchronizer` object.
14
15
  */
@@ -33,6 +34,19 @@ export declare enum MediaPlayerSynchronizerEvents {
33
34
  groupaction = "groupaction",
34
35
  useraction = "useraction"
35
36
  }
37
+ /**
38
+ * @hidden
39
+ * Emitted events from the `MediaPlayerSynchronizer` class.
40
+ */
41
+ export interface IMediaPlayerSynchronizerEvents extends IEvent {
42
+ /**
43
+ * Event listener for events emitted
44
+ * @param event update
45
+ * @param listener listener function
46
+ * @param listener.event the event instance
47
+ */
48
+ (event: string, listener: (event: any) => void): void;
49
+ }
36
50
  /**
37
51
  * Synchronizes a local HTML Media Element with a group of remote HTML Media Elements.
38
52
  *
@@ -42,7 +56,7 @@ export declare enum MediaPlayerSynchronizerEvents {
42
56
  * to the local player. When the group session is joined the commands will be broadcast to the
43
57
  * group in addition to being applied to the local player.
44
58
  */
45
- export declare class MediaPlayerSynchronizer extends EventEmitter {
59
+ export declare class MediaPlayerSynchronizer extends TypedEventEmitter<IMediaPlayerSynchronizerEvents> {
46
60
  private static SESSION_ACTIONS;
47
61
  private static PLAYER_EVENTS;
48
62
  private _logger;