@microsoft/live-share-media 2.0.0-internal.7 → 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/esm/LiveMediaSessionCoordinator.d.ts +38 -7
  13. package/bin/esm/LiveMediaSessionCoordinator.d.ts.map +1 -1
  14. package/bin/esm/LiveMediaSessionCoordinator.js +91 -10
  15. package/bin/esm/LiveMediaSessionCoordinator.js.map +1 -1
  16. package/bin/esm/internals/GroupCoordinatorState.d.ts +2 -1
  17. package/bin/esm/internals/GroupCoordinatorState.d.ts.map +1 -1
  18. package/bin/esm/internals/GroupCoordinatorState.js.map +1 -1
  19. package/bin/esm/internals/GroupPlaybackPosition.d.ts +2 -2
  20. package/bin/esm/internals/GroupPlaybackPosition.d.ts.map +1 -1
  21. package/bin/esm/internals/GroupPlaybackPosition.js +1 -1
  22. package/bin/esm/internals/GroupPlaybackPosition.js.map +1 -1
  23. package/package.json +3 -3
  24. package/src/LiveMediaSessionCoordinator.ts +96 -10
  25. package/src/internals/GroupCoordinatorState.ts +2 -1
  26. package/src/internals/GroupPlaybackPosition.ts +4 -4
  27. package/src/internals/PriorityTimeInterval.ts +76 -0
  28. package/.mocharc.cjs +0 -12
  29. package/.nycrc.json +0 -11
  30. package/bin/test/IMediaPlayer.d.ts +0 -21
  31. package/bin/test/IMediaPlayer.d.ts.map +0 -1
  32. package/bin/test/IMediaPlayer.js +0 -7
  33. package/bin/test/IMediaPlayer.js.map +0 -1
  34. package/bin/test/LiveMediaSession.d.ts +0 -97
  35. package/bin/test/LiveMediaSession.d.ts.map +0 -1
  36. package/bin/test/LiveMediaSession.js +0 -261
  37. package/bin/test/LiveMediaSession.js.map +0 -1
  38. package/bin/test/LiveMediaSessionCoordinator.d.ts +0 -296
  39. package/bin/test/LiveMediaSessionCoordinator.d.ts.map +0 -1
  40. package/bin/test/LiveMediaSessionCoordinator.js +0 -552
  41. package/bin/test/LiveMediaSessionCoordinator.js.map +0 -1
  42. package/bin/test/LiveMediaSessionCoordinatorSuspension.d.ts +0 -20
  43. package/bin/test/LiveMediaSessionCoordinatorSuspension.d.ts.map +0 -1
  44. package/bin/test/LiveMediaSessionCoordinatorSuspension.js +0 -28
  45. package/bin/test/LiveMediaSessionCoordinatorSuspension.js.map +0 -1
  46. package/bin/test/MediaPlayerSynchronizer.d.ts +0 -204
  47. package/bin/test/MediaPlayerSynchronizer.d.ts.map +0 -1
  48. package/bin/test/MediaPlayerSynchronizer.js +0 -574
  49. package/bin/test/MediaPlayerSynchronizer.js.map +0 -1
  50. package/bin/test/MediaSessionActionThrottler.d.ts +0 -12
  51. package/bin/test/MediaSessionActionThrottler.d.ts.map +0 -1
  52. package/bin/test/MediaSessionActionThrottler.js +0 -14
  53. package/bin/test/MediaSessionActionThrottler.js.map +0 -1
  54. package/bin/test/MediaSessionExtensions.d.ts +0 -177
  55. package/bin/test/MediaSessionExtensions.d.ts.map +0 -1
  56. package/bin/test/MediaSessionExtensions.js +0 -26
  57. package/bin/test/MediaSessionExtensions.js.map +0 -1
  58. package/bin/test/RepeatedActionThrottler.d.ts +0 -20
  59. package/bin/test/RepeatedActionThrottler.d.ts.map +0 -1
  60. package/bin/test/RepeatedActionThrottler.js +0 -63
  61. package/bin/test/RepeatedActionThrottler.js.map +0 -1
  62. package/bin/test/VolumeManager.d.ts +0 -84
  63. package/bin/test/VolumeManager.d.ts.map +0 -1
  64. package/bin/test/VolumeManager.js +0 -175
  65. package/bin/test/VolumeManager.js.map +0 -1
  66. package/bin/test/index.d.ts +0 -14
  67. package/bin/test/index.d.ts.map +0 -1
  68. package/bin/test/index.js +0 -30
  69. package/bin/test/index.js.map +0 -1
  70. package/bin/test/internals/GroupCoordinatorState.d.ts +0 -110
  71. package/bin/test/internals/GroupCoordinatorState.d.ts.map +0 -1
  72. package/bin/test/internals/GroupCoordinatorState.js +0 -516
  73. package/bin/test/internals/GroupCoordinatorState.js.map +0 -1
  74. package/bin/test/internals/GroupPlaybackPosition.d.ts +0 -71
  75. package/bin/test/internals/GroupPlaybackPosition.d.ts.map +0 -1
  76. package/bin/test/internals/GroupPlaybackPosition.js +0 -170
  77. package/bin/test/internals/GroupPlaybackPosition.js.map +0 -1
  78. package/bin/test/internals/GroupPlaybackRate.d.ts +0 -38
  79. package/bin/test/internals/GroupPlaybackRate.d.ts.map +0 -1
  80. package/bin/test/internals/GroupPlaybackRate.js +0 -59
  81. package/bin/test/internals/GroupPlaybackRate.js.map +0 -1
  82. package/bin/test/internals/GroupPlaybackTrack.d.ts +0 -45
  83. package/bin/test/internals/GroupPlaybackTrack.d.ts.map +0 -1
  84. package/bin/test/internals/GroupPlaybackTrack.js +0 -122
  85. package/bin/test/internals/GroupPlaybackTrack.js.map +0 -1
  86. package/bin/test/internals/GroupPlaybackTrackData.d.ts +0 -40
  87. package/bin/test/internals/GroupPlaybackTrackData.d.ts.map +0 -1
  88. package/bin/test/internals/GroupPlaybackTrackData.js +0 -70
  89. package/bin/test/internals/GroupPlaybackTrackData.js.map +0 -1
  90. package/bin/test/internals/GroupTransportState.d.ts +0 -52
  91. package/bin/test/internals/GroupTransportState.d.ts.map +0 -1
  92. package/bin/test/internals/GroupTransportState.js +0 -120
  93. package/bin/test/internals/GroupTransportState.js.map +0 -1
  94. package/bin/test/internals/PriorityTimeInterval.d.ts +0 -33
  95. package/bin/test/internals/PriorityTimeInterval.d.ts.map +0 -1
  96. package/bin/test/internals/PriorityTimeInterval.js +0 -45
  97. package/bin/test/internals/PriorityTimeInterval.js.map +0 -1
  98. package/bin/test/internals/consts.d.ts +0 -83
  99. package/bin/test/internals/consts.d.ts.map +0 -1
  100. package/bin/test/internals/consts.js +0 -92
  101. package/bin/test/internals/consts.js.map +0 -1
  102. package/bin/test/internals/errors.d.ts +0 -17
  103. package/bin/test/internals/errors.d.ts.map +0 -1
  104. package/bin/test/internals/errors.js +0 -34
  105. package/bin/test/internals/errors.js.map +0 -1
  106. package/bin/test/internals/interfaces.d.ts +0 -23
  107. package/bin/test/internals/interfaces.d.ts.map +0 -1
  108. package/bin/test/internals/interfaces.js +0 -3
  109. package/bin/test/internals/interfaces.js.map +0 -1
  110. package/bin/test/package.json +0 -1
  111. package/bin/test/test/GroupPlaybackPosition.spec.d.ts +0 -6
  112. package/bin/test/test/GroupPlaybackPosition.spec.d.ts.map +0 -1
  113. package/bin/test/test/GroupPlaybackPosition.spec.js +0 -315
  114. package/bin/test/test/GroupPlaybackPosition.spec.js.map +0 -1
  115. package/bin/test/test/GroupPlaybackRate.spec.d.ts +0 -6
  116. package/bin/test/test/GroupPlaybackRate.spec.d.ts.map +0 -1
  117. package/bin/test/test/GroupPlaybackRate.spec.js +0 -47
  118. package/bin/test/test/GroupPlaybackRate.spec.js.map +0 -1
  119. package/bin/test/test/GroupPlaybackTrack.spec.d.ts +0 -6
  120. package/bin/test/test/GroupPlaybackTrack.spec.d.ts.map +0 -1
  121. package/bin/test/test/GroupPlaybackTrack.spec.js +0 -171
  122. package/bin/test/test/GroupPlaybackTrack.spec.js.map +0 -1
  123. package/bin/test/test/GroupPlaybackTrackData.spec.d.ts +0 -6
  124. package/bin/test/test/GroupPlaybackTrackData.spec.d.ts.map +0 -1
  125. package/bin/test/test/GroupPlaybackTrackData.spec.js +0 -63
  126. package/bin/test/test/GroupPlaybackTrackData.spec.js.map +0 -1
  127. package/bin/test/test/LiveMediaSession_ManualActionHandler.spec.d.ts +0 -6
  128. package/bin/test/test/LiveMediaSession_ManualActionHandler.spec.d.ts.map +0 -1
  129. package/bin/test/test/LiveMediaSession_ManualActionHandler.spec.js +0 -324
  130. package/bin/test/test/LiveMediaSession_ManualActionHandler.spec.js.map +0 -1
  131. package/bin/test/test/LiveMediaSession_Synchronizer.spec.d.ts +0 -6
  132. package/bin/test/test/LiveMediaSession_Synchronizer.spec.d.ts.map +0 -1
  133. package/bin/test/test/LiveMediaSession_Synchronizer.spec.js +0 -669
  134. package/bin/test/test/LiveMediaSession_Synchronizer.spec.js.map +0 -1
  135. package/bin/test/test/PriorityTimeInterval.spec.d.ts +0 -6
  136. package/bin/test/test/PriorityTimeInterval.spec.d.ts.map +0 -1
  137. package/bin/test/test/PriorityTimeInterval.spec.js +0 -67
  138. package/bin/test/test/PriorityTimeInterval.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 -930
  148. package/nyc/junit-report.xml +0 -59
  149. package/tsconfig.test.json +0 -9
  150. package/typedoc.json +0 -10
@@ -1,552 +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 PriorityTimeInterval_js_1 = require("./internals/PriorityTimeInterval.js");
23
- const LiveMediaSessionCoordinatorSuspension_js_1 = require("./LiveMediaSessionCoordinatorSuspension.js");
24
- const client_utils_1 = require("@fluid-internal/client-utils");
25
- /**
26
- * The `LiveMediaSessionCoordinator` tracks the playback & position state of all other
27
- * clients being synchronized with. It is responsible for keeping the local media player
28
- * in sync with the group.
29
- */
30
- class LiveMediaSessionCoordinator extends client_utils_1.TypedEventEmitter {
31
- /**
32
- * @hidden
33
- * Applications shouldn't directly create new coordinator instances.
34
- */
35
- constructor(id, runtime, liveRuntime, getPlayerState) {
36
- super();
37
- this._positionUpdateInterval = new PriorityTimeInterval_js_1.PriorityTimeInterval(2000,
38
- // Scale by function
39
- () => {
40
- const audience = this._liveRuntime.audience;
41
- if (!audience)
42
- return 1;
43
- // As the audience size gets bigger, we relax the update interval, since more variance is expected
44
- const count = audience.getMembers().size;
45
- return 1 + count / 5;
46
- });
47
- this._maxPlaybackDrift = new PriorityTimeInterval_js_1.PriorityTimeInterval(1500, // Scale by function
48
- () => {
49
- const audience = this._liveRuntime.audience;
50
- if (!audience)
51
- return 1;
52
- // As the audience size gets bigger, we relax the playback drift, since more variance is expected
53
- const count = audience.getMembers().size;
54
- return 1 + count / 25;
55
- });
56
- this.initializeState = live_share_1.LiveDataObjectInitializeState.needed;
57
- /**
58
- * Controls whether or not the local client is allowed to instruct the group to play or pause.
59
- *
60
- * @remarks
61
- * This flag largely meant to influence decisions made by the coordinator and can be used by
62
- * the UI to determine what controls should be shown to the user. It does not provide any
63
- * security in itself.
64
- *
65
- * If your app is running in a semi-trusted environment where only some clients are allowed
66
- * to play/pause media, you should use "role based verification" to enforce those policies.
67
- */
68
- this.canPlayPause = true;
69
- /**
70
- * Controls whether or not the local client is allowed to seek the group to a new playback
71
- * position.
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 change the playback position, you should use "role based verification" to enforce those policies.
80
- */
81
- this.canSeek = true;
82
- /**
83
- * Controls whether or not the local client is allowed to change tracks.
84
- *
85
- * @remarks
86
- * This flag largely meant to influence decisions made by the coordinator and can be used by
87
- * the UI to determine what controls should be shown to the user. It does not provide any
88
- * security in itself.
89
- *
90
- * If your app is running in a semi-trusted environment where only some clients are allowed
91
- * to change tracks, you should use "role based verification" to enforce those policies.
92
- */
93
- this.canSetTrack = true;
94
- /**
95
- * Controls whether or not the local client is allowed to change the tracks custom data object.
96
- *
97
- * @remarks
98
- * This flag largely meant to influence decisions made by the coordinator and can be used by
99
- * the UI to determine what controls should be shown to the user. It does not provide any
100
- * security in itself.
101
- *
102
- * If your app is running in a semi-trusted environment where only some clients are allowed
103
- * to change the tracks data object, you should use "role based verification" to enforce those
104
- * policies.
105
- */
106
- this.canSetTrackData = true;
107
- /**
108
- * Controls whether or not the local client is allowed to change the playback rate.
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
- this.canSetPlaybackRate = true;
120
- /**
121
- * Controls whether or not the local client is allowed to send position updates to the group.
122
- *
123
- * @remarks
124
- * This flag largely meant to limit the number of signals sent to the group for performance reasons.
125
- * It does not provide any security in itself.
126
- */
127
- this.canSendPositionUpdates = true;
128
- this._id = id;
129
- this._runtime = runtime;
130
- this._liveRuntime = liveRuntime;
131
- this._logger = new live_share_1.LiveTelemetryLogger(runtime, liveRuntime);
132
- this._getPlayerState = getPlayerState;
133
- }
134
- /**
135
- * Returns true if the local client is in a suspended state.
136
- */
137
- get isSuspended() {
138
- return this._groupState ? this._groupState.isSuspended : false;
139
- }
140
- /**
141
- * Controls whether or not to scale {@link maxPlaybackDrift} by the number of users in the session.
142
- *
143
- * @remarks
144
- * As more clients join a session, it is more likely that some users will fall behind the presenter.
145
- * It is also less likely that users will notice drift as more clients are added.
146
- * It is usually helpful to be more lenient as more clients are added so everyone can watch all the content.
147
- * Default value is true.
148
- */
149
- get shouldScaleMaxPlaybackDrift() {
150
- return this._maxPlaybackDrift.shouldPrioritize;
151
- }
152
- set shouldScaleMaxPlaybackDrift(value) {
153
- this._maxPlaybackDrift.shouldPrioritize = value;
154
- }
155
- /**
156
- * Max amount of playback drift allowed in seconds.
157
- * This will scale automatically according to the number of participants in the session when {@link shouldScalePositionUpdateInterval} is true.
158
- *
159
- * @remarks
160
- * Should the local clients playback position lag by more than the specified value, the coordinator will trigger a `catchup` action.
161
- * Default value is `1.5` seconds.
162
- */
163
- get maxPlaybackDrift() {
164
- return this._maxPlaybackDrift.seconds;
165
- }
166
- set maxPlaybackDrift(value) {
167
- this._maxPlaybackDrift.seconds = value;
168
- }
169
- /**
170
- * Controls whether or not to compute position update interval based on whether user has initiated a playback command.
171
- * Default value is true.
172
- *
173
- * @remarks
174
- * When true, users that are simply watching but not controlling playback will report their positions less frequently.
175
- * When a user has sent a transport command, they will begin sending position updates more frequently.
176
- * Most Live Share apps have a concept of a primary presenter, and don't allow anyone to pause/play for the group.
177
- * By ensuring only one/few users broadcast updates frequently, the server load is reduced considerably.
178
- */
179
- get shouldScalePositionUpdateInterval() {
180
- return this._positionUpdateInterval.shouldPrioritize;
181
- }
182
- set shouldScalePositionUpdateInterval(value) {
183
- this._positionUpdateInterval.shouldPrioritize = value;
184
- }
185
- /**
186
- * Frequency with which position updates are broadcast to the rest of the group in seconds.
187
- * When {@link shouldScalePositionUpdateInterval} is set to `true`, the value set is the minimum value.
188
- * The value returned is the actual value used to send updates by the local user, which may be larger than the value set.
189
- *
190
- * @remarks
191
- * Defaults to a minimum value of `2` seconds.
192
- */
193
- get positionUpdateInterval() {
194
- return this._positionUpdateInterval.seconds;
195
- }
196
- set positionUpdateInterval(value) {
197
- this._positionUpdateInterval.seconds = value;
198
- }
199
- /**
200
- * Instructs the group to play the current track.
201
- *
202
- * @remarks
203
- * Throws an exception if the session/coordinator hasn't been initialized, no track has been
204
- * loaded, or `canPlayPause` is false.
205
- *
206
- * @returns a void promise that resolves once complete, throws if user does not have proper roles
207
- */
208
- play() {
209
- return __awaiter(this, void 0, void 0, function* () {
210
- var _a;
211
- live_share_1.LiveDataObjectNotInitializedError.assert("LiveMediaSessionCoordinator:play", "play", this.initializeState);
212
- errors_js_1.TrackMetadataNotSetError.assert(!!((_a = this._groupState) === null || _a === void 0 ? void 0 : _a.playbackTrack.current.metadata), "LiveMediaSessionCoordinator:play", "play");
213
- errors_js_1.ActionBlockedError.assert(this.canPlayPause, "LiveMediaSessionCoordinator:play", "play", "canPlayPause");
214
- // Get projected position
215
- const position = this.getPlayerPosition();
216
- // Send transport command
217
- this._logger.sendTelemetryEvent(consts_js_1.TelemetryEvents.SessionCoordinator.PlayCalled, null, { position: position });
218
- yield this._playEvent.sendEvent({
219
- track: this._groupState.playbackTrack.current,
220
- position: position,
221
- });
222
- if (this.canSendPositionUpdates) {
223
- // User has taken initiative to send event, give priority for sending position updates
224
- this._positionUpdateInterval.hasPriority = true;
225
- }
226
- });
227
- }
228
- /**
229
- * Instructs the group to pause the current track.
230
- *
231
- * @remarks
232
- * Throws an exception if the session/coordinator hasn't been initialized, no track has been
233
- * loaded, or `canPlayPause` is false.
234
- *
235
- * @returns a void promise that resolves once complete, throws if user does not have proper roles
236
- */
237
- pause() {
238
- return __awaiter(this, void 0, void 0, function* () {
239
- var _a;
240
- live_share_1.LiveDataObjectNotInitializedError.assert("LiveMediaSessionCoordinator:pause", "pause", this.initializeState);
241
- errors_js_1.TrackMetadataNotSetError.assert(!!((_a = this._groupState) === null || _a === void 0 ? void 0 : _a.playbackTrack.current.metadata), "LiveMediaSessionCoordinator:pause", "pause");
242
- errors_js_1.ActionBlockedError.assert(this.canPlayPause, "LiveMediaSessionCoordinator:pause", "pause", "canPlayPause");
243
- // Get projected position
244
- const position = this.getPlayerPosition();
245
- // Send transport command
246
- this._logger.sendTelemetryEvent(consts_js_1.TelemetryEvents.SessionCoordinator.PauseCalled, null, { position: position });
247
- yield this._pauseEvent.sendEvent({
248
- track: this._groupState.playbackTrack.current,
249
- position: position,
250
- });
251
- if (this.canSendPositionUpdates) {
252
- // User has taken initiative to send event, give priority for sending position updates
253
- this._positionUpdateInterval.hasPriority = true;
254
- }
255
- });
256
- }
257
- /**
258
- * Instructs the group to seek to a new position within the current track.
259
- *
260
- * @remarks
261
- * Throws an exception if the session/coordinator hasn't been initialized, no track has been
262
- * loaded, or `canSeek` is false.
263
- * @param time Playback position in seconds to seek to.
264
- * @returns a void promise that resolves once complete, throws if user does not have proper roles
265
- */
266
- seekTo(time) {
267
- return __awaiter(this, void 0, void 0, function* () {
268
- var _a;
269
- live_share_1.LiveDataObjectNotInitializedError.assert("LiveMediaSessionCoordinator:seekTo", "seekTo", this.initializeState);
270
- errors_js_1.TrackMetadataNotSetError.assert(!!((_a = this._groupState) === null || _a === void 0 ? void 0 : _a.playbackTrack.current.metadata), "LiveMediaSessionCoordinator:seekTo", "seekTo");
271
- errors_js_1.ActionBlockedError.assert(this.canSeek, "LiveMediaSessionCoordinator:seekTo", "seekTo", "canSeek");
272
- // Send transport command
273
- this._logger.sendTelemetryEvent(consts_js_1.TelemetryEvents.SessionCoordinator.SeekToCalled, null, { position: time });
274
- try {
275
- yield this._seekToEvent.sendEvent({
276
- track: this._groupState.playbackTrack.current,
277
- position: time,
278
- });
279
- if (this.canSendPositionUpdates) {
280
- // User has taken initiative to send event, give priority for sending position updates
281
- this._positionUpdateInterval.hasPriority = true;
282
- }
283
- }
284
- catch (err) {
285
- yield this._groupState.syncLocalMediaSession();
286
- throw err;
287
- }
288
- });
289
- }
290
- setPlaybackRate(playbackRate) {
291
- return __awaiter(this, void 0, void 0, function* () {
292
- live_share_1.LiveDataObjectNotInitializedError.assert("LiveMediaSessionCoordinator:setPlaybackRate", "setPlaybackRate", this.initializeState);
293
- errors_js_1.ActionBlockedError.assert(this.canSetPlaybackRate, "LiveMediaSessionCoordinator:setPlaybackRate", "setPlaybackRate", "canSetPlaybackRate");
294
- this._logger.sendTelemetryEvent(consts_js_1.TelemetryEvents.SessionCoordinator.SetPlaybackRateCalled, null, { playbackRate });
295
- yield this._rateChangeEvent.sendEvent({ playbackRate });
296
- if (this.canSendPositionUpdates) {
297
- // User has taken initiative to send event, give priority for sending position updates
298
- this._positionUpdateInterval.hasPriority = true;
299
- }
300
- });
301
- }
302
- /**
303
- * Instructs the group to load a new track.
304
- *
305
- * @remarks
306
- * Throws an exception if the session/coordinator hasn't been initialized or `canSetTrack` is
307
- * false.
308
- * @param metadata The track to load or `null` to indicate that the end of the track is reached.
309
- * @param waitPoints Optional. List of static wait points to configure for the track. Dynamic wait points can be added via the `beginSuspension()` call.
310
- * @returns a void promise that resolves once complete, throws if user does not have proper roles
311
- */
312
- setTrack(metadata, waitPoints) {
313
- return __awaiter(this, void 0, void 0, function* () {
314
- live_share_1.LiveDataObjectNotInitializedError.assert("LiveMediaSessionCoordinator:setTrack", "setTrack", this.initializeState);
315
- errors_js_1.ActionBlockedError.assert(this.canSetTrack, "LiveMediaSessionCoordinator:setTrack", "setTrack", "canSetTrack");
316
- // Send transport command
317
- this._logger.sendTelemetryEvent(consts_js_1.TelemetryEvents.SessionCoordinator.SetTrackCalled);
318
- yield this._setTrackEvent.sendEvent({
319
- metadata: metadata,
320
- waitPoints: waitPoints || [],
321
- });
322
- if (this.canSendPositionUpdates) {
323
- // User has taken initiative to send event, give priority for sending position updates
324
- this._positionUpdateInterval.hasPriority = true;
325
- }
326
- });
327
- }
328
- /**
329
- * Updates the track data object for the current track.
330
- *
331
- * @remarks
332
- * The track data object can be used by applications to synchronize things like pitch, roll,
333
- * and yaw of a 360 video. This data object will be reset to null anytime the track changes.
334
- *
335
- * Throws an exception if the session/coordinator hasn't been initialized or `canSetTrackData` is
336
- * false.
337
- * @param data New data object to sync with the group. This value will be synchronized using a last writer wins strategy.
338
- * @returns a void promise that resolves once complete, throws if user does not have proper roles
339
- */
340
- setTrackData(data) {
341
- return __awaiter(this, void 0, void 0, function* () {
342
- live_share_1.LiveDataObjectNotInitializedError.assert("LiveMediaSessionCoordinator:setTrackData", "setTrackData", this.initializeState);
343
- errors_js_1.ActionBlockedError.assert(this.canSetTrackData, "LiveMediaSessionCoordinator:setTrackData", "setTrackData", "canSetTrackData");
344
- // Send transport command
345
- this._logger.sendTelemetryEvent(consts_js_1.TelemetryEvents.SessionCoordinator.SetTrackDataCalled);
346
- yield this._setTrackDataEvent.sendEvent({
347
- data: data,
348
- });
349
- if (this.canSendPositionUpdates) {
350
- // User has taken initiative to send event, give priority for sending position updates
351
- this._positionUpdateInterval.hasPriority = true;
352
- }
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
- var _a;
381
- live_share_1.LiveDataObjectNotInitializedError.assert("LiveMediaSessionCoordinator:beginSuspension", "beginSuspension", this.initializeState);
382
- errors_js_1.TrackMetadataNotSetError.assert(!!((_a = this._groupState) === null || _a === void 0 ? void 0 : _a.playbackTrack.current.metadata), "LiveMediaSessionCoordinator:beginSuspension", "beginSuspension");
383
- // Tell group state that suspension is started
384
- if (waitPoint) {
385
- this._logger.sendTelemetryEvent(consts_js_1.TelemetryEvents.SessionCoordinator.BeginSuspensionAndWait, null, {
386
- position: waitPoint.position,
387
- maxClients: waitPoint.maxClients,
388
- });
389
- this._lastWaitPoint = waitPoint;
390
- this._groupState.beginSuspension(waitPoint);
391
- }
392
- else {
393
- this._logger.sendTelemetryEvent(consts_js_1.TelemetryEvents.SessionCoordinator.BeginSuspension);
394
- this._groupState.beginSuspension();
395
- }
396
- // Return new suspension object
397
- return new LiveMediaSessionCoordinatorSuspension_js_1.LiveMediaSessionCoordinatorSuspension(waitPoint, (time) => {
398
- var _a, _b;
399
- if (waitPoint) {
400
- this._logger.sendTelemetryEvent(consts_js_1.TelemetryEvents.SessionCoordinator.EndSuspensionAndWait, null, {
401
- position: waitPoint.position,
402
- maxClients: waitPoint.maxClients,
403
- });
404
- }
405
- else {
406
- this._logger.sendTelemetryEvent(consts_js_1.TelemetryEvents.SessionCoordinator.EndSuspension);
407
- }
408
- this._groupState.endSuspension(time == undefined);
409
- if (time != undefined &&
410
- !((_a = this._groupState) === null || _a === void 0 ? void 0 : _a.isSuspended) &&
411
- !((_b = this._groupState) === null || _b === void 0 ? void 0 : _b.isWaiting)) {
412
- // Seek to new position
413
- this.seekTo(Math.max(time, 0.0));
414
- }
415
- });
416
- }
417
- /**
418
- * @hidden
419
- * Called by MediaSession to verify the coordinator has been initialized.
420
- */
421
- get isInitialized() {
422
- return this.initializeState === live_share_1.LiveDataObjectInitializeState.succeeded;
423
- }
424
- /**
425
- * @hidden
426
- * Called by MediaSession to start coordinator.
427
- */
428
- initialize(acceptTransportChangesFrom) {
429
- return __awaiter(this, void 0, void 0, function* () {
430
- var _a;
431
- live_share_1.LiveDataObjectInitializeNotNeededError.assert("LiveMediaSessionCoordinator:initialize", this.initializeState);
432
- this.initializeState = live_share_1.LiveDataObjectInitializeState.pending;
433
- try {
434
- // Create children
435
- yield this.createChildren(acceptTransportChangesFrom);
436
- }
437
- catch (error) {
438
- this.initializeState = live_share_1.LiveDataObjectInitializeState.needed;
439
- throw error;
440
- }
441
- this.initializeState = live_share_1.LiveDataObjectInitializeState.succeeded;
442
- try {
443
- // start needs to happen after setting initializedState to "succeeded"
444
- yield ((_a = this._synchronizer) === null || _a === void 0 ? void 0 : _a.start({
445
- initialState: undefined,
446
- updateState: (evt, sender, local) => __awaiter(this, void 0, void 0, function* () { return false; }),
447
- getLocalUserCanSend: (connecting) => __awaiter(this, void 0, void 0, function* () { return true; }),
448
- enableBackgroundUpdates: false,
449
- }));
450
- }
451
- catch (error) {
452
- // not a fatal error for LiveMediaSession, only used for "connect" event to send new clients position updates.
453
- this._logger.sendErrorEvent(consts_js_1.TelemetryEvents.SessionCoordinator
454
- .LiveObjectSynchronizerStartError, error);
455
- }
456
- });
457
- }
458
- /**
459
- * @hidden
460
- * Called by the MediaSession to detect if a wait point has been hit.
461
- */
462
- findNextWaitPoint() {
463
- var _a;
464
- return (((_a = this._groupState) === null || _a === void 0 ? void 0 : _a.playbackTrack.findNextWaitPoint(this._lastWaitPoint)) || null);
465
- }
466
- /**
467
- * @hidden
468
- * Called by MediaSession to trigger the sending of a position update.
469
- */
470
- sendPositionUpdate(state, targetClientId) {
471
- var _a, _b;
472
- live_share_1.LiveDataObjectNotInitializedError.assert("LiveMediaSessionCoordinator:sendPositionUpdate", "sendPositionUpdate", this.initializeState);
473
- if (this.canSendPositionUpdates) {
474
- // Send position update event
475
- const evt = this._groupState.createPositionUpdateEvent(state);
476
- (_a = this._positionUpdateEvent) === null || _a === void 0 ? void 0 : _a.sendEvent(evt, targetClientId).catch((err) => {
477
- this._logger.sendErrorEvent(consts_js_1.TelemetryEvents.SessionCoordinator
478
- .PositionUpdateEventError, err);
479
- });
480
- }
481
- else if (this.isSuspended) {
482
- // send a local only position update event that was not sent as a signal, and use to handle local
483
- // position update for clients that have canSendPositionUpdates==false, but are suspending
484
- const evt = this._groupState.createPositionUpdateEvent(state);
485
- (_b = this._positionUpdateEvent) === null || _b === void 0 ? void 0 : _b.sendLocalEvent(evt).catch((err) => {
486
- this._logger.sendErrorEvent(consts_js_1.TelemetryEvents.SessionCoordinator.PositionUpdateEventError, err);
487
- });
488
- }
489
- else {
490
- // make sure position is synced to position of clients who can send position updates
491
- this._groupState.syncLocalMediaSession();
492
- }
493
- }
494
- createChildren(acceptTransportChangesFrom) {
495
- return __awaiter(this, void 0, void 0, function* () {
496
- // Create event scopes
497
- const scope = new internal_1.LiveEventScope(this._runtime, this._liveRuntime, acceptTransportChangesFrom);
498
- const unrestrictedScope = new internal_1.LiveEventScope(this._runtime, this._liveRuntime);
499
- // Initialize internal coordinator state
500
- this._groupState = new GroupCoordinatorState_js_1.GroupCoordinatorState(this._runtime, this._liveRuntime, this._maxPlaybackDrift, this._positionUpdateInterval, this._getPlayerState);
501
- this._groupState.on(GroupCoordinatorState_js_1.GroupCoordinatorStateEvents.triggeraction, (evt) => this.emit(evt.name, evt));
502
- this._groupState.on(GroupCoordinatorState_js_1.GroupCoordinatorStateEvents.triggeractionignored, (evt) => this.emit(evt.name, evt));
503
- // Listen for track changes
504
- this._setTrackEvent = new internal_1.LiveEventTarget(scope, "setTrack", (event, local) => this._groupState.handleSetTrack(event, local));
505
- this._setTrackDataEvent = new internal_1.LiveEventTarget(scope, "setTrackData", (event, local) => this._groupState.handleSetTrackData(event, local));
506
- // Listen for transport commands
507
- this._playEvent = new internal_1.LiveEventTarget(scope, "play", (event, local) => this._groupState.handleTransportCommand(event, local));
508
- this._pauseEvent = new internal_1.LiveEventTarget(scope, "pause", (event, local) => this._groupState.handleTransportCommand(event, local));
509
- this._seekToEvent = new internal_1.LiveEventTarget(scope, "seekTo", (event, local) => this._groupState.handleTransportCommand(event, local));
510
- this._rateChangeEvent = new internal_1.LiveEventTarget(scope, "rateChange", (event, local) => {
511
- this._groupState.handleRateChangeCommand(event, local);
512
- });
513
- // Listen for position updates
514
- this._positionUpdateEvent = new internal_1.LiveEventTarget(unrestrictedScope, "positionUpdate", (event, local) => this._groupState.handlePositionUpdate(event, local));
515
- this._synchronizer = new internal_1.LiveObjectSynchronizer(this._id, this._runtime, this._liveRuntime);
516
- this._synchronizer.onJoinedListener = (clientId, timestamp) => {
517
- this._logger.sendTelemetryEvent(consts_js_1.TelemetryEvents.SessionCoordinator.RemoteConnectReceived, null, {
518
- correlationId: live_share_1.LiveTelemetryLogger.formatCorrelationId(clientId, timestamp),
519
- });
520
- // Immediately send a position update
521
- try {
522
- const state = this._getPlayerState();
523
- // Send only to the user that joined the session using the targetClientId prop.
524
- // This ensures that only the user that connected receives this one-time position update, minimizing costs.
525
- this.sendPositionUpdate(state, clientId);
526
- }
527
- catch (err) {
528
- // if player is not setup yet, local client might have also just joined and can't send its position.
529
- const playerNotSetup = (0, internal_1.isErrorLike)(err) &&
530
- err.message.includes("LiveMediaSession:getCurrentPlayerState");
531
- if (!playerNotSetup) {
532
- throw err;
533
- }
534
- }
535
- };
536
- });
537
- }
538
- getPlayerPosition() {
539
- const { positionState, playbackState } = this._getPlayerState();
540
- switch (playbackState) {
541
- case "none":
542
- case "ended":
543
- return 0.0;
544
- default:
545
- return positionState && positionState.position != undefined
546
- ? positionState.position
547
- : 0.0;
548
- }
549
- }
550
- }
551
- exports.LiveMediaSessionCoordinator = LiveMediaSessionCoordinator;
552
- //# 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;AAC/B,iFAA2E;AAC3E,yGAAmG;AACnG,+DAAiE;AA4CjE;;;;GAIG;AACH,MAAa,2BAA4B,SAAQ,gCAAqD;IA+ClG;;;OAGG;IACH,YACI,EAAU,EACV,OAAyB,EACzB,WAA6B,EAC7B,cAAuC;QAEvC,KAAK,EAAE,CAAC;QAnDJ,4BAAuB,GAAG,IAAI,8CAAoB,CACtD,IAAI;QACJ,oBAAoB;QACpB,GAAG,EAAE;YACD,MAAM,QAAQ,GAAG,IAAI,CAAC,YAAY,CAAC,QAAQ,CAAC;YAC5C,IAAI,CAAC,QAAQ;gBAAE,OAAO,CAAC,CAAC;YACxB,kGAAkG;YAClG,MAAM,KAAK,GAAG,QAAQ,CAAC,UAAU,EAAE,CAAC,IAAI,CAAC;YACzC,OAAO,CAAC,GAAG,KAAK,GAAG,CAAC,CAAC;QACzB,CAAC,CACJ,CAAC;QACM,sBAAiB,GAAG,IAAI,8CAAoB,CAChD,IAAI,EAAE,oBAAoB;QAC1B,GAAG,EAAE;YACD,MAAM,QAAQ,GAAG,IAAI,CAAC,YAAY,CAAC,QAAQ,CAAC;YAC5C,IAAI,CAAC,QAAQ;gBAAE,OAAO,CAAC,CAAC;YACxB,iGAAiG;YACjG,MAAM,KAAK,GAAG,QAAQ,CAAC,UAAU,EAAE,CAAC,IAAI,CAAC;YACzC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C;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;AAlwBD,kEAkwBC"}
@@ -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"}