@microsoft/live-share-media 2.0.0-internal.6 → 2.0.0-internal.8

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 (150) hide show
  1. package/bin/cjs/LiveMediaSessionCoordinator.d.ts +38 -7
  2. package/bin/cjs/LiveMediaSessionCoordinator.d.ts.map +1 -1
  3. package/bin/cjs/LiveMediaSessionCoordinator.js +90 -9
  4. package/bin/cjs/LiveMediaSessionCoordinator.js.map +1 -1
  5. package/bin/cjs/internals/GroupCoordinatorState.d.ts +2 -1
  6. package/bin/cjs/internals/GroupCoordinatorState.d.ts.map +1 -1
  7. package/bin/cjs/internals/GroupCoordinatorState.js.map +1 -1
  8. package/bin/cjs/internals/GroupPlaybackPosition.d.ts +2 -2
  9. package/bin/cjs/internals/GroupPlaybackPosition.d.ts.map +1 -1
  10. package/bin/cjs/internals/GroupPlaybackPosition.js +1 -1
  11. package/bin/cjs/internals/GroupPlaybackPosition.js.map +1 -1
  12. package/bin/cjs/internals/PriorityTimeInterval.d.ts +33 -0
  13. package/bin/cjs/internals/PriorityTimeInterval.d.ts.map +1 -0
  14. package/bin/cjs/internals/PriorityTimeInterval.js +45 -0
  15. package/bin/cjs/internals/PriorityTimeInterval.js.map +1 -0
  16. package/bin/esm/LiveMediaSessionCoordinator.d.ts +38 -7
  17. package/bin/esm/LiveMediaSessionCoordinator.d.ts.map +1 -1
  18. package/bin/esm/LiveMediaSessionCoordinator.js +91 -10
  19. package/bin/esm/LiveMediaSessionCoordinator.js.map +1 -1
  20. package/bin/esm/internals/GroupCoordinatorState.d.ts +2 -1
  21. package/bin/esm/internals/GroupCoordinatorState.d.ts.map +1 -1
  22. package/bin/esm/internals/GroupCoordinatorState.js.map +1 -1
  23. package/bin/esm/internals/GroupPlaybackPosition.d.ts +2 -2
  24. package/bin/esm/internals/GroupPlaybackPosition.d.ts.map +1 -1
  25. package/bin/esm/internals/GroupPlaybackPosition.js +1 -1
  26. package/bin/esm/internals/GroupPlaybackPosition.js.map +1 -1
  27. package/bin/esm/internals/PriorityTimeInterval.d.ts +33 -0
  28. package/bin/esm/internals/PriorityTimeInterval.d.ts.map +1 -0
  29. package/bin/esm/internals/PriorityTimeInterval.js +41 -0
  30. package/bin/esm/internals/PriorityTimeInterval.js.map +1 -0
  31. package/package.json +3 -3
  32. package/src/LiveMediaSessionCoordinator.ts +96 -10
  33. package/src/internals/GroupCoordinatorState.ts +2 -1
  34. package/src/internals/GroupPlaybackPosition.ts +4 -4
  35. package/src/internals/PriorityTimeInterval.ts +76 -0
  36. package/.mocharc.cjs +0 -12
  37. package/.nycrc.json +0 -11
  38. package/bin/test/IMediaPlayer.d.ts +0 -21
  39. package/bin/test/IMediaPlayer.d.ts.map +0 -1
  40. package/bin/test/IMediaPlayer.js +0 -7
  41. package/bin/test/IMediaPlayer.js.map +0 -1
  42. package/bin/test/LiveMediaSession.d.ts +0 -97
  43. package/bin/test/LiveMediaSession.d.ts.map +0 -1
  44. package/bin/test/LiveMediaSession.js +0 -261
  45. package/bin/test/LiveMediaSession.js.map +0 -1
  46. package/bin/test/LiveMediaSessionCoordinator.d.ts +0 -273
  47. package/bin/test/LiveMediaSessionCoordinator.d.ts.map +0 -1
  48. package/bin/test/LiveMediaSessionCoordinator.js +0 -479
  49. package/bin/test/LiveMediaSessionCoordinator.js.map +0 -1
  50. package/bin/test/LiveMediaSessionCoordinatorSuspension.d.ts +0 -20
  51. package/bin/test/LiveMediaSessionCoordinatorSuspension.d.ts.map +0 -1
  52. package/bin/test/LiveMediaSessionCoordinatorSuspension.js +0 -28
  53. package/bin/test/LiveMediaSessionCoordinatorSuspension.js.map +0 -1
  54. package/bin/test/MediaPlayerSynchronizer.d.ts +0 -204
  55. package/bin/test/MediaPlayerSynchronizer.d.ts.map +0 -1
  56. package/bin/test/MediaPlayerSynchronizer.js +0 -574
  57. package/bin/test/MediaPlayerSynchronizer.js.map +0 -1
  58. package/bin/test/MediaSessionActionThrottler.d.ts +0 -12
  59. package/bin/test/MediaSessionActionThrottler.d.ts.map +0 -1
  60. package/bin/test/MediaSessionActionThrottler.js +0 -14
  61. package/bin/test/MediaSessionActionThrottler.js.map +0 -1
  62. package/bin/test/MediaSessionExtensions.d.ts +0 -177
  63. package/bin/test/MediaSessionExtensions.d.ts.map +0 -1
  64. package/bin/test/MediaSessionExtensions.js +0 -26
  65. package/bin/test/MediaSessionExtensions.js.map +0 -1
  66. package/bin/test/RepeatedActionThrottler.d.ts +0 -20
  67. package/bin/test/RepeatedActionThrottler.d.ts.map +0 -1
  68. package/bin/test/RepeatedActionThrottler.js +0 -63
  69. package/bin/test/RepeatedActionThrottler.js.map +0 -1
  70. package/bin/test/VolumeManager.d.ts +0 -84
  71. package/bin/test/VolumeManager.d.ts.map +0 -1
  72. package/bin/test/VolumeManager.js +0 -175
  73. package/bin/test/VolumeManager.js.map +0 -1
  74. package/bin/test/index.d.ts +0 -14
  75. package/bin/test/index.d.ts.map +0 -1
  76. package/bin/test/index.js +0 -30
  77. package/bin/test/index.js.map +0 -1
  78. package/bin/test/internals/GroupCoordinatorState.d.ts +0 -109
  79. package/bin/test/internals/GroupCoordinatorState.d.ts.map +0 -1
  80. package/bin/test/internals/GroupCoordinatorState.js +0 -516
  81. package/bin/test/internals/GroupCoordinatorState.js.map +0 -1
  82. package/bin/test/internals/GroupPlaybackPosition.d.ts +0 -71
  83. package/bin/test/internals/GroupPlaybackPosition.d.ts.map +0 -1
  84. package/bin/test/internals/GroupPlaybackPosition.js +0 -170
  85. package/bin/test/internals/GroupPlaybackPosition.js.map +0 -1
  86. package/bin/test/internals/GroupPlaybackRate.d.ts +0 -38
  87. package/bin/test/internals/GroupPlaybackRate.d.ts.map +0 -1
  88. package/bin/test/internals/GroupPlaybackRate.js +0 -59
  89. package/bin/test/internals/GroupPlaybackRate.js.map +0 -1
  90. package/bin/test/internals/GroupPlaybackTrack.d.ts +0 -45
  91. package/bin/test/internals/GroupPlaybackTrack.d.ts.map +0 -1
  92. package/bin/test/internals/GroupPlaybackTrack.js +0 -122
  93. package/bin/test/internals/GroupPlaybackTrack.js.map +0 -1
  94. package/bin/test/internals/GroupPlaybackTrackData.d.ts +0 -40
  95. package/bin/test/internals/GroupPlaybackTrackData.d.ts.map +0 -1
  96. package/bin/test/internals/GroupPlaybackTrackData.js +0 -70
  97. package/bin/test/internals/GroupPlaybackTrackData.js.map +0 -1
  98. package/bin/test/internals/GroupTransportState.d.ts +0 -52
  99. package/bin/test/internals/GroupTransportState.d.ts.map +0 -1
  100. package/bin/test/internals/GroupTransportState.js +0 -120
  101. package/bin/test/internals/GroupTransportState.js.map +0 -1
  102. package/bin/test/internals/consts.d.ts +0 -83
  103. package/bin/test/internals/consts.d.ts.map +0 -1
  104. package/bin/test/internals/consts.js +0 -92
  105. package/bin/test/internals/consts.js.map +0 -1
  106. package/bin/test/internals/errors.d.ts +0 -17
  107. package/bin/test/internals/errors.d.ts.map +0 -1
  108. package/bin/test/internals/errors.js +0 -34
  109. package/bin/test/internals/errors.js.map +0 -1
  110. package/bin/test/internals/interfaces.d.ts +0 -23
  111. package/bin/test/internals/interfaces.d.ts.map +0 -1
  112. package/bin/test/internals/interfaces.js +0 -3
  113. package/bin/test/internals/interfaces.js.map +0 -1
  114. package/bin/test/package.json +0 -1
  115. package/bin/test/test/GroupPlaybackPosition.spec.d.ts +0 -6
  116. package/bin/test/test/GroupPlaybackPosition.spec.d.ts.map +0 -1
  117. package/bin/test/test/GroupPlaybackPosition.spec.js +0 -314
  118. package/bin/test/test/GroupPlaybackPosition.spec.js.map +0 -1
  119. package/bin/test/test/GroupPlaybackRate.spec.d.ts +0 -6
  120. package/bin/test/test/GroupPlaybackRate.spec.d.ts.map +0 -1
  121. package/bin/test/test/GroupPlaybackRate.spec.js +0 -47
  122. package/bin/test/test/GroupPlaybackRate.spec.js.map +0 -1
  123. package/bin/test/test/GroupPlaybackTrack.spec.d.ts +0 -6
  124. package/bin/test/test/GroupPlaybackTrack.spec.d.ts.map +0 -1
  125. package/bin/test/test/GroupPlaybackTrack.spec.js +0 -171
  126. package/bin/test/test/GroupPlaybackTrack.spec.js.map +0 -1
  127. package/bin/test/test/GroupPlaybackTrackData.spec.d.ts +0 -6
  128. package/bin/test/test/GroupPlaybackTrackData.spec.d.ts.map +0 -1
  129. package/bin/test/test/GroupPlaybackTrackData.spec.js +0 -63
  130. package/bin/test/test/GroupPlaybackTrackData.spec.js.map +0 -1
  131. package/bin/test/test/LiveMediaSession_ManualActionHandler.spec.d.ts +0 -6
  132. package/bin/test/test/LiveMediaSession_ManualActionHandler.spec.d.ts.map +0 -1
  133. package/bin/test/test/LiveMediaSession_ManualActionHandler.spec.js +0 -324
  134. package/bin/test/test/LiveMediaSession_ManualActionHandler.spec.js.map +0 -1
  135. package/bin/test/test/LiveMediaSession_Synchronizer.spec.d.ts +0 -6
  136. package/bin/test/test/LiveMediaSession_Synchronizer.spec.d.ts.map +0 -1
  137. package/bin/test/test/LiveMediaSession_Synchronizer.spec.js +0 -669
  138. package/bin/test/test/LiveMediaSession_Synchronizer.spec.js.map +0 -1
  139. package/bin/test/test/TestUtils.d.ts +0 -44
  140. package/bin/test/test/TestUtils.d.ts.map +0 -1
  141. package/bin/test/test/TestUtils.js +0 -116
  142. package/bin/test/test/TestUtils.js.map +0 -1
  143. package/bin/test/test/VolumeManager.spec.d.ts +0 -2
  144. package/bin/test/test/VolumeManager.spec.d.ts.map +0 -1
  145. package/bin/test/test/VolumeManager.spec.js +0 -163
  146. package/bin/test/test/VolumeManager.spec.js.map +0 -1
  147. package/nyc/junit-report.json +0 -850
  148. package/nyc/junit-report.xml +0 -54
  149. package/tsconfig.test.json +0 -9
  150. package/typedoc.json +0 -10
@@ -1,479 +0,0 @@
1
- "use strict";
2
- /**
3
- * Copyright (c) Microsoft Corporation. All rights reserved.
4
- * Licensed under the Microsoft Live Share SDK License.
5
- */
6
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
7
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
8
- return new (P || (P = Promise))(function (resolve, reject) {
9
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
10
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
11
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
12
- step((generator = generator.apply(thisArg, _arguments || [])).next());
13
- });
14
- };
15
- Object.defineProperty(exports, "__esModule", { value: true });
16
- exports.LiveMediaSessionCoordinator = void 0;
17
- const live_share_1 = require("@microsoft/live-share");
18
- const internal_1 = require("@microsoft/live-share/internal");
19
- const GroupCoordinatorState_js_1 = require("./internals/GroupCoordinatorState.js");
20
- const consts_js_1 = require("./internals/consts.js");
21
- const errors_js_1 = require("./internals/errors.js");
22
- const LiveMediaSessionCoordinatorSuspension_js_1 = require("./LiveMediaSessionCoordinatorSuspension.js");
23
- const client_utils_1 = require("@fluid-internal/client-utils");
24
- /**
25
- * The `LiveMediaSessionCoordinator` 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.
28
- */
29
- class LiveMediaSessionCoordinator extends client_utils_1.TypedEventEmitter {
30
- /**
31
- * @hidden
32
- * Applications shouldn't directly create new coordinator instances.
33
- */
34
- constructor(id, runtime, liveRuntime, getPlayerState) {
35
- super();
36
- this._positionUpdateInterval = new live_share_1.TimeInterval(2000);
37
- this._maxPlaybackDrift = new live_share_1.TimeInterval(1000);
38
- this.initializeState = live_share_1.LiveDataObjectInitializeState.needed;
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
- */
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
- */
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
- */
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
- */
88
- this.canSetTrackData = true;
89
- /**
90
- * Controls whether or not the local client is allowed to change the playback rate.
91
- *
92
- * @remarks
93
- * This flag largely meant to influence decisions made by the coordinator and can be used by
94
- * the UI to determine what controls should be shown to the user. It does not provide any
95
- * security in itself.
96
- *
97
- * If your app is running in a semi-trusted environment where only some clients are allowed
98
- * to change the tracks data object, you should use "role based verification" to enforce those
99
- * policies.
100
- */
101
- this.canSetPlaybackRate = true;
102
- /**
103
- * Controls whether or not the local client is allowed to send position updates to the group.
104
- *
105
- * @remarks
106
- * This flag largely meant to limit the number of signals sent to the group for performance reasons.
107
- * It does not provide any security in itself.
108
- */
109
- this.canSendPositionUpdates = true;
110
- this._id = id;
111
- this._runtime = runtime;
112
- this._liveRuntime = liveRuntime;
113
- this._logger = new live_share_1.LiveTelemetryLogger(runtime, liveRuntime);
114
- this._getPlayerState = getPlayerState;
115
- }
116
- /**
117
- * Returns true if the local client is in a suspended state.
118
- */
119
- get isSuspended() {
120
- return this._groupState ? this._groupState.isSuspended : false;
121
- }
122
- /**
123
- * Max amount of playback drift allowed in seconds.
124
- *
125
- * @remarks
126
- * Should the local clients playback position lag by more than the specified value, the
127
- * coordinator will trigger a `catchup` action.
128
- *
129
- * Defaults to a value of `1` second.
130
- */
131
- get maxPlaybackDrift() {
132
- return this._maxPlaybackDrift.seconds;
133
- }
134
- set maxPlaybackDrift(value) {
135
- this._maxPlaybackDrift.seconds = value;
136
- }
137
- /**
138
- * Frequency with which position updates are broadcast to the rest of the group in
139
- * seconds.
140
- *
141
- * @remarks
142
- * Defaults to a value of `2` seconds.
143
- */
144
- get positionUpdateInterval() {
145
- return this._positionUpdateInterval.seconds;
146
- }
147
- set positionUpdateInterval(value) {
148
- this._positionUpdateInterval.seconds = value;
149
- }
150
- /**
151
- * Instructs the group to play the current track.
152
- *
153
- * @remarks
154
- * Throws an exception if the session/coordinator hasn't been initialized, no track has been
155
- * loaded, or `canPlayPause` is false.
156
- *
157
- * @returns a void promise that resolves once complete, throws if user does not have proper roles
158
- */
159
- play() {
160
- return __awaiter(this, void 0, void 0, function* () {
161
- var _a;
162
- live_share_1.LiveDataObjectNotInitializedError.assert("LiveMediaSessionCoordinator:play", "play", this.initializeState);
163
- errors_js_1.TrackMetadataNotSetError.assert(!!((_a = this._groupState) === null || _a === void 0 ? void 0 : _a.playbackTrack.current.metadata), "LiveMediaSessionCoordinator:play", "play");
164
- errors_js_1.ActionBlockedError.assert(this.canPlayPause, "LiveMediaSessionCoordinator:play", "play", "canPlayPause");
165
- // Get projected position
166
- const position = this.getPlayerPosition();
167
- // Send transport command
168
- this._logger.sendTelemetryEvent(consts_js_1.TelemetryEvents.SessionCoordinator.PlayCalled, null, { position: position });
169
- yield this._playEvent.sendEvent({
170
- track: this._groupState.playbackTrack.current,
171
- position: position,
172
- });
173
- });
174
- }
175
- /**
176
- * Instructs the group to pause the current track.
177
- *
178
- * @remarks
179
- * Throws an exception if the session/coordinator hasn't been initialized, no track has been
180
- * loaded, or `canPlayPause` is false.
181
- *
182
- * @returns a void promise that resolves once complete, throws if user does not have proper roles
183
- */
184
- pause() {
185
- return __awaiter(this, void 0, void 0, function* () {
186
- var _a;
187
- live_share_1.LiveDataObjectNotInitializedError.assert("LiveMediaSessionCoordinator:pause", "pause", this.initializeState);
188
- errors_js_1.TrackMetadataNotSetError.assert(!!((_a = this._groupState) === null || _a === void 0 ? void 0 : _a.playbackTrack.current.metadata), "LiveMediaSessionCoordinator:pause", "pause");
189
- errors_js_1.ActionBlockedError.assert(this.canPlayPause, "LiveMediaSessionCoordinator:pause", "pause", "canPlayPause");
190
- // Get projected position
191
- const position = this.getPlayerPosition();
192
- // Send transport command
193
- this._logger.sendTelemetryEvent(consts_js_1.TelemetryEvents.SessionCoordinator.PauseCalled, null, { position: position });
194
- yield this._pauseEvent.sendEvent({
195
- track: this._groupState.playbackTrack.current,
196
- position: position,
197
- });
198
- });
199
- }
200
- /**
201
- * Instructs the group to seek to a new position within the current track.
202
- *
203
- * @remarks
204
- * Throws an exception if the session/coordinator hasn't been initialized, no track has been
205
- * loaded, or `canSeek` is false.
206
- * @param time Playback position in seconds to seek to.
207
- * @returns a void promise that resolves once complete, throws if user does not have proper roles
208
- */
209
- seekTo(time) {
210
- return __awaiter(this, void 0, void 0, function* () {
211
- var _a;
212
- live_share_1.LiveDataObjectNotInitializedError.assert("LiveMediaSessionCoordinator:seekTo", "seekTo", this.initializeState);
213
- errors_js_1.TrackMetadataNotSetError.assert(!!((_a = this._groupState) === null || _a === void 0 ? void 0 : _a.playbackTrack.current.metadata), "LiveMediaSessionCoordinator:seekTo", "seekTo");
214
- errors_js_1.ActionBlockedError.assert(this.canSeek, "LiveMediaSessionCoordinator:seekTo", "seekTo", "canSeek");
215
- // Send transport command
216
- this._logger.sendTelemetryEvent(consts_js_1.TelemetryEvents.SessionCoordinator.SeekToCalled, null, { position: time });
217
- try {
218
- yield this._seekToEvent.sendEvent({
219
- track: this._groupState.playbackTrack.current,
220
- position: time,
221
- });
222
- }
223
- catch (err) {
224
- yield this._groupState.syncLocalMediaSession();
225
- throw err;
226
- }
227
- });
228
- }
229
- setPlaybackRate(playbackRate) {
230
- return __awaiter(this, void 0, void 0, function* () {
231
- live_share_1.LiveDataObjectNotInitializedError.assert("LiveMediaSessionCoordinator:setPlaybackRate", "setPlaybackRate", this.initializeState);
232
- errors_js_1.ActionBlockedError.assert(this.canSetPlaybackRate, "LiveMediaSessionCoordinator:setPlaybackRate", "setPlaybackRate", "canSetPlaybackRate");
233
- this._logger.sendTelemetryEvent(consts_js_1.TelemetryEvents.SessionCoordinator.SetPlaybackRateCalled, null, { playbackRate });
234
- yield this._rateChangeEvent.sendEvent({ playbackRate });
235
- });
236
- }
237
- /**
238
- * Instructs the group to load a new track.
239
- *
240
- * @remarks
241
- * Throws an exception if the session/coordinator hasn't been initialized or `canSetTrack` is
242
- * false.
243
- * @param metadata The track to load or `null` to indicate that the end of the track is reached.
244
- * @param waitPoints Optional. List of static wait points to configure for the track. Dynamic wait points can be added via the `beginSuspension()` call.
245
- * @returns a void promise that resolves once complete, throws if user does not have proper roles
246
- */
247
- setTrack(metadata, waitPoints) {
248
- return __awaiter(this, void 0, void 0, function* () {
249
- live_share_1.LiveDataObjectNotInitializedError.assert("LiveMediaSessionCoordinator:setTrack", "setTrack", this.initializeState);
250
- errors_js_1.ActionBlockedError.assert(this.canSetTrack, "LiveMediaSessionCoordinator:setTrack", "setTrack", "canSetTrack");
251
- // Send transport command
252
- this._logger.sendTelemetryEvent(consts_js_1.TelemetryEvents.SessionCoordinator.SetTrackCalled);
253
- yield this._setTrackEvent.sendEvent({
254
- metadata: metadata,
255
- waitPoints: waitPoints || [],
256
- });
257
- });
258
- }
259
- /**
260
- * Updates the track data object for the current track.
261
- *
262
- * @remarks
263
- * The track data object can be used by applications to synchronize things like pitch, roll,
264
- * and yaw of a 360 video. This data object will be reset to null anytime the track changes.
265
- *
266
- * Throws an exception if the session/coordinator hasn't been initialized or `canSetTrackData` is
267
- * false.
268
- * @param data New data object to sync with the group. This value will be synchronized using a last writer wins strategy.
269
- * @returns a void promise that resolves once complete, throws if user does not have proper roles
270
- */
271
- setTrackData(data) {
272
- return __awaiter(this, void 0, void 0, function* () {
273
- live_share_1.LiveDataObjectNotInitializedError.assert("LiveMediaSessionCoordinator:setTrackData", "setTrackData", this.initializeState);
274
- errors_js_1.ActionBlockedError.assert(this.canSetTrackData, "LiveMediaSessionCoordinator:setTrackData", "setTrackData", "canSetTrackData");
275
- // Send transport command
276
- this._logger.sendTelemetryEvent(consts_js_1.TelemetryEvents.SessionCoordinator.SetTrackDataCalled);
277
- yield this._setTrackDataEvent.sendEvent({
278
- data: data,
279
- });
280
- });
281
- }
282
- /**
283
- * Begins a new local suspension.
284
- *
285
- * @remarks
286
- * Suspension temporarily suspend the clients local synchronization with the group. This can
287
- * be useful for displaying ads to users or temporarily disconnecting from the session while
288
- * the user seeks the video using a timeline scrubber.
289
- *
290
- * Multiple simultaneous suspensions are allowed and when the last suspension ends the local
291
- * client will be immediately re-synchronized with the group.
292
- *
293
- * A "Dynamic Wait Point" can be specified when `beginSuspension()` is called and the wait
294
- * point will be broadcast to all other clients in the group. Those clients will then
295
- * automatically enter a suspension state once they reach the positions specified by the
296
- * wait point. Clients that are passed the wait point will immediately suspend.
297
- *
298
- * Any wait point based suspension (dynamic or static) will result in all clients remaining
299
- * in a suspension state until the list client ends their suspension. This behavior can be
300
- * conditionally bypassed by settings the wait points `maxClients` value.
301
- *
302
- * Throws an exception if the session/coordinator hasn't been initialized.
303
- * @param waitPoint Optional. Dynamic wait point to broadcast to all of the clients.
304
- * @returns The suspension object. Call `end()` on the returned suspension to end the suspension.
305
- */
306
- beginSuspension(waitPoint) {
307
- var _a;
308
- live_share_1.LiveDataObjectNotInitializedError.assert("LiveMediaSessionCoordinator:beginSuspension", "beginSuspension", this.initializeState);
309
- errors_js_1.TrackMetadataNotSetError.assert(!!((_a = this._groupState) === null || _a === void 0 ? void 0 : _a.playbackTrack.current.metadata), "LiveMediaSessionCoordinator:beginSuspension", "beginSuspension");
310
- // Tell group state that suspension is started
311
- if (waitPoint) {
312
- this._logger.sendTelemetryEvent(consts_js_1.TelemetryEvents.SessionCoordinator.BeginSuspensionAndWait, null, {
313
- position: waitPoint.position,
314
- maxClients: waitPoint.maxClients,
315
- });
316
- this._lastWaitPoint = waitPoint;
317
- this._groupState.beginSuspension(waitPoint);
318
- }
319
- else {
320
- this._logger.sendTelemetryEvent(consts_js_1.TelemetryEvents.SessionCoordinator.BeginSuspension);
321
- this._groupState.beginSuspension();
322
- }
323
- // Return new suspension object
324
- return new LiveMediaSessionCoordinatorSuspension_js_1.LiveMediaSessionCoordinatorSuspension(waitPoint, (time) => {
325
- var _a, _b;
326
- if (waitPoint) {
327
- this._logger.sendTelemetryEvent(consts_js_1.TelemetryEvents.SessionCoordinator.EndSuspensionAndWait, null, {
328
- position: waitPoint.position,
329
- maxClients: waitPoint.maxClients,
330
- });
331
- }
332
- else {
333
- this._logger.sendTelemetryEvent(consts_js_1.TelemetryEvents.SessionCoordinator.EndSuspension);
334
- }
335
- this._groupState.endSuspension(time == undefined);
336
- if (time != undefined &&
337
- !((_a = this._groupState) === null || _a === void 0 ? void 0 : _a.isSuspended) &&
338
- !((_b = this._groupState) === null || _b === void 0 ? void 0 : _b.isWaiting)) {
339
- // Seek to new position
340
- this.seekTo(Math.max(time, 0.0));
341
- }
342
- });
343
- }
344
- /**
345
- * @hidden
346
- * Called by MediaSession to verify the coordinator has been initialized.
347
- */
348
- get isInitialized() {
349
- return this.initializeState === live_share_1.LiveDataObjectInitializeState.succeeded;
350
- }
351
- /**
352
- * @hidden
353
- * Called by MediaSession to start coordinator.
354
- */
355
- initialize(acceptTransportChangesFrom) {
356
- return __awaiter(this, void 0, void 0, function* () {
357
- var _a;
358
- live_share_1.LiveDataObjectInitializeNotNeededError.assert("LiveMediaSessionCoordinator:initialize", this.initializeState);
359
- this.initializeState = live_share_1.LiveDataObjectInitializeState.pending;
360
- try {
361
- // Create children
362
- yield this.createChildren(acceptTransportChangesFrom);
363
- }
364
- catch (error) {
365
- this.initializeState = live_share_1.LiveDataObjectInitializeState.needed;
366
- throw error;
367
- }
368
- this.initializeState = live_share_1.LiveDataObjectInitializeState.succeeded;
369
- try {
370
- // start needs to happen after setting initializedState to "succeeded"
371
- yield ((_a = this._synchronizer) === null || _a === void 0 ? void 0 : _a.start({
372
- initialState: undefined,
373
- updateState: (evt, sender, local) => __awaiter(this, void 0, void 0, function* () { return false; }),
374
- getLocalUserCanSend: (connecting) => __awaiter(this, void 0, void 0, function* () { return true; }),
375
- enableBackgroundUpdates: false,
376
- }));
377
- }
378
- catch (error) {
379
- // not a fatal error for LiveMediaSession, only used for "connect" event to send new clients position updates.
380
- this._logger.sendErrorEvent(consts_js_1.TelemetryEvents.SessionCoordinator
381
- .LiveObjectSynchronizerStartError, error);
382
- }
383
- });
384
- }
385
- /**
386
- * @hidden
387
- * Called by the MediaSession to detect if a wait point has been hit.
388
- */
389
- findNextWaitPoint() {
390
- var _a;
391
- return (((_a = this._groupState) === null || _a === void 0 ? void 0 : _a.playbackTrack.findNextWaitPoint(this._lastWaitPoint)) || null);
392
- }
393
- /**
394
- * @hidden
395
- * Called by MediaSession to trigger the sending of a position update.
396
- */
397
- sendPositionUpdate(state, targetClientId) {
398
- var _a, _b;
399
- live_share_1.LiveDataObjectNotInitializedError.assert("LiveMediaSessionCoordinator:sendPositionUpdate", "sendPositionUpdate", this.initializeState);
400
- if (this.canSendPositionUpdates) {
401
- // Send position update event
402
- const evt = this._groupState.createPositionUpdateEvent(state);
403
- (_a = this._positionUpdateEvent) === null || _a === void 0 ? void 0 : _a.sendEvent(evt, targetClientId).catch((err) => {
404
- this._logger.sendErrorEvent(consts_js_1.TelemetryEvents.SessionCoordinator
405
- .PositionUpdateEventError, err);
406
- });
407
- }
408
- else if (this.isSuspended) {
409
- // send a local only position update event that was not sent as a signal, and use to handle local
410
- // position update for clients that have canSendPositionUpdates==false, but are suspending
411
- const evt = this._groupState.createPositionUpdateEvent(state);
412
- (_b = this._positionUpdateEvent) === null || _b === void 0 ? void 0 : _b.sendLocalEvent(evt).catch((err) => {
413
- this._logger.sendErrorEvent(consts_js_1.TelemetryEvents.SessionCoordinator.PositionUpdateEventError, err);
414
- });
415
- }
416
- else {
417
- // make sure position is synced to position of clients who can send position updates
418
- this._groupState.syncLocalMediaSession();
419
- }
420
- }
421
- createChildren(acceptTransportChangesFrom) {
422
- return __awaiter(this, void 0, void 0, function* () {
423
- // Create event scopes
424
- const scope = new internal_1.LiveEventScope(this._runtime, this._liveRuntime, acceptTransportChangesFrom);
425
- const unrestrictedScope = new internal_1.LiveEventScope(this._runtime, this._liveRuntime);
426
- // Initialize internal coordinator state
427
- this._groupState = new GroupCoordinatorState_js_1.GroupCoordinatorState(this._runtime, this._liveRuntime, this._maxPlaybackDrift, this._positionUpdateInterval, this._getPlayerState);
428
- this._groupState.on(GroupCoordinatorState_js_1.GroupCoordinatorStateEvents.triggeraction, (evt) => this.emit(evt.name, evt));
429
- this._groupState.on(GroupCoordinatorState_js_1.GroupCoordinatorStateEvents.triggeractionignored, (evt) => this.emit(evt.name, evt));
430
- // Listen for track changes
431
- this._setTrackEvent = new internal_1.LiveEventTarget(scope, "setTrack", (event, local) => this._groupState.handleSetTrack(event, local));
432
- this._setTrackDataEvent = new internal_1.LiveEventTarget(scope, "setTrackData", (event, local) => this._groupState.handleSetTrackData(event, local));
433
- // Listen for transport commands
434
- this._playEvent = new internal_1.LiveEventTarget(scope, "play", (event, local) => this._groupState.handleTransportCommand(event, local));
435
- this._pauseEvent = new internal_1.LiveEventTarget(scope, "pause", (event, local) => this._groupState.handleTransportCommand(event, local));
436
- this._seekToEvent = new internal_1.LiveEventTarget(scope, "seekTo", (event, local) => this._groupState.handleTransportCommand(event, local));
437
- this._rateChangeEvent = new internal_1.LiveEventTarget(scope, "rateChange", (event, local) => {
438
- this._groupState.handleRateChangeCommand(event, local);
439
- });
440
- // Listen for position updates
441
- this._positionUpdateEvent = new internal_1.LiveEventTarget(unrestrictedScope, "positionUpdate", (event, local) => this._groupState.handlePositionUpdate(event, local));
442
- this._synchronizer = new internal_1.LiveObjectSynchronizer(this._id, this._runtime, this._liveRuntime);
443
- this._synchronizer.onJoinedListener = (clientId, timestamp) => {
444
- this._logger.sendTelemetryEvent(consts_js_1.TelemetryEvents.SessionCoordinator.RemoteConnectReceived, null, {
445
- correlationId: live_share_1.LiveTelemetryLogger.formatCorrelationId(clientId, timestamp),
446
- });
447
- // Immediately send a position update
448
- try {
449
- const state = this._getPlayerState();
450
- // Send only to the user that joined the session using the targetClientId prop.
451
- // This ensures that only the user that connected receives this one-time position update, minimizing costs.
452
- this.sendPositionUpdate(state, clientId);
453
- }
454
- catch (err) {
455
- // if player is not setup yet, local client might have also just joined and can't send its position.
456
- const playerNotSetup = (0, internal_1.isErrorLike)(err) &&
457
- err.message.includes("LiveMediaSession:getCurrentPlayerState");
458
- if (!playerNotSetup) {
459
- throw err;
460
- }
461
- }
462
- };
463
- });
464
- }
465
- getPlayerPosition() {
466
- const { positionState, playbackState } = this._getPlayerState();
467
- switch (playbackState) {
468
- case "none":
469
- case "ended":
470
- return 0.0;
471
- default:
472
- return positionState && positionState.position != undefined
473
- ? positionState.position
474
- : 0.0;
475
- }
476
- }
477
- }
478
- exports.LiveMediaSessionCoordinator = LiveMediaSessionCoordinator;
479
- //# sourceMappingURL=LiveMediaSessionCoordinator.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"LiveMediaSessionCoordinator.js","sourceRoot":"","sources":["../../src/LiveMediaSessionCoordinator.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;;;;;;;;;;AAEH,sDAQ+B;AAC/B,6DAOwC;AAOxC,mFAQ8C;AAC9C,qDAAwD;AACxD,qDAG+B;AAE/B,yGAAmG;AACnG,+DAAiE;AA4CjE;;;;GAIG;AACH,MAAa,2BAA4B,SAAQ,gCAAqD;IA4BlG;;;OAGG;IACH,YACI,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AAE,aAAa,EAAE,aAAa,EAAE,GAAG,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;AAprBD,kEAorBC"}
@@ -1,20 +0,0 @@
1
- /**
2
- * Copyright (c) Microsoft Corporation. All rights reserved.
3
- * Licensed under the Microsoft Live Share SDK License.
4
- */
5
- import { MediaSessionCoordinatorSuspension, CoordinationWaitPoint } from "./MediaSessionExtensions.js";
6
- export declare class LiveMediaSessionCoordinatorSuspension implements MediaSessionCoordinatorSuspension {
7
- private _waitPoint?;
8
- private _onEnd;
9
- constructor(waitPoint: CoordinationWaitPoint | undefined, onEnd: (seekTo?: number) => void);
10
- /**
11
- * Returns an optional wait point associated with the suspension.
12
- */
13
- get waitPoint(): CoordinationWaitPoint | undefined;
14
- /**
15
- * Ends the suspension and optionally proposes a time to seek to.
16
- * @param seekTo Optional. Proposed time to seek to. Ignored for suspensions at wait points.
17
- */
18
- end(seekTo?: number): void;
19
- }
20
- //# sourceMappingURL=LiveMediaSessionCoordinatorSuspension.d.ts.map
@@ -1 +0,0 @@
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,qCACT,YAAW,iCAAiC;IAE5C,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,28 +0,0 @@
1
- "use strict";
2
- /**
3
- * Copyright (c) Microsoft Corporation. All rights reserved.
4
- * Licensed under the Microsoft Live Share SDK License.
5
- */
6
- Object.defineProperty(exports, "__esModule", { value: true });
7
- exports.LiveMediaSessionCoordinatorSuspension = void 0;
8
- class LiveMediaSessionCoordinatorSuspension {
9
- constructor(waitPoint, onEnd) {
10
- this._waitPoint = waitPoint;
11
- this._onEnd = onEnd;
12
- }
13
- /**
14
- * Returns an optional wait point associated with the suspension.
15
- */
16
- get waitPoint() {
17
- return this._waitPoint;
18
- }
19
- /**
20
- * Ends the suspension and optionally proposes a time to seek to.
21
- * @param seekTo Optional. Proposed time to seek to. Ignored for suspensions at wait points.
22
- */
23
- end(seekTo) {
24
- this._onEnd(seekTo);
25
- }
26
- }
27
- exports.LiveMediaSessionCoordinatorSuspension = LiveMediaSessionCoordinatorSuspension;
28
- //# sourceMappingURL=LiveMediaSessionCoordinatorSuspension.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"LiveMediaSessionCoordinatorSuspension.js","sourceRoot":"","sources":["../../src/LiveMediaSessionCoordinatorSuspension.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAOH,MAAa,qCAAqC;IAM9C,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;AA5BD,sFA4BC"}