@microsoft/live-share-media 2.0.0-internal.13 → 2.0.0-internal.14

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 (82) hide show
  1. package/package.json +7 -7
  2. package/bin/IMediaPlayer.d.ts +0 -21
  3. package/bin/IMediaPlayer.d.ts.map +0 -1
  4. package/bin/IMediaPlayer.js +0 -7
  5. package/bin/IMediaPlayer.js.map +0 -1
  6. package/bin/LiveMediaSession.d.ts +0 -90
  7. package/bin/LiveMediaSession.d.ts.map +0 -1
  8. package/bin/LiveMediaSession.js +0 -255
  9. package/bin/LiveMediaSession.js.map +0 -1
  10. package/bin/LiveMediaSessionCoordinator.d.ts +0 -260
  11. package/bin/LiveMediaSessionCoordinator.d.ts.map +0 -1
  12. package/bin/LiveMediaSessionCoordinator.js +0 -472
  13. package/bin/LiveMediaSessionCoordinator.js.map +0 -1
  14. package/bin/LiveMediaSessionCoordinatorSuspension.d.ts +0 -20
  15. package/bin/LiveMediaSessionCoordinatorSuspension.d.ts.map +0 -1
  16. package/bin/LiveMediaSessionCoordinatorSuspension.js +0 -28
  17. package/bin/LiveMediaSessionCoordinatorSuspension.js.map +0 -1
  18. package/bin/MediaPlayerSynchronizer.d.ts +0 -190
  19. package/bin/MediaPlayerSynchronizer.d.ts.map +0 -1
  20. package/bin/MediaPlayerSynchronizer.js +0 -577
  21. package/bin/MediaPlayerSynchronizer.js.map +0 -1
  22. package/bin/MediaSessionActionThrottler.d.ts +0 -12
  23. package/bin/MediaSessionActionThrottler.d.ts.map +0 -1
  24. package/bin/MediaSessionActionThrottler.js +0 -14
  25. package/bin/MediaSessionActionThrottler.js.map +0 -1
  26. package/bin/MediaSessionExtensions.d.ts +0 -177
  27. package/bin/MediaSessionExtensions.d.ts.map +0 -1
  28. package/bin/MediaSessionExtensions.js +0 -26
  29. package/bin/MediaSessionExtensions.js.map +0 -1
  30. package/bin/RepeatedActionThrottler.d.ts +0 -20
  31. package/bin/RepeatedActionThrottler.d.ts.map +0 -1
  32. package/bin/RepeatedActionThrottler.js +0 -63
  33. package/bin/RepeatedActionThrottler.js.map +0 -1
  34. package/bin/VolumeManager.d.ts +0 -84
  35. package/bin/VolumeManager.d.ts.map +0 -1
  36. package/bin/VolumeManager.js +0 -175
  37. package/bin/VolumeManager.js.map +0 -1
  38. package/bin/cjs/package.json +0 -1
  39. package/bin/index.d.ts +0 -14
  40. package/bin/index.d.ts.map +0 -1
  41. package/bin/index.js +0 -30
  42. package/bin/index.js.map +0 -1
  43. package/bin/internals/GroupCoordinatorState.d.ts +0 -108
  44. package/bin/internals/GroupCoordinatorState.d.ts.map +0 -1
  45. package/bin/internals/GroupCoordinatorState.js +0 -519
  46. package/bin/internals/GroupCoordinatorState.js.map +0 -1
  47. package/bin/internals/GroupPlaybackPosition.d.ts +0 -70
  48. package/bin/internals/GroupPlaybackPosition.d.ts.map +0 -1
  49. package/bin/internals/GroupPlaybackPosition.js +0 -170
  50. package/bin/internals/GroupPlaybackPosition.js.map +0 -1
  51. package/bin/internals/GroupPlaybackRate.d.ts +0 -39
  52. package/bin/internals/GroupPlaybackRate.d.ts.map +0 -1
  53. package/bin/internals/GroupPlaybackRate.js +0 -62
  54. package/bin/internals/GroupPlaybackRate.js.map +0 -1
  55. package/bin/internals/GroupPlaybackTrack.d.ts +0 -46
  56. package/bin/internals/GroupPlaybackTrack.d.ts.map +0 -1
  57. package/bin/internals/GroupPlaybackTrack.js +0 -125
  58. package/bin/internals/GroupPlaybackTrack.js.map +0 -1
  59. package/bin/internals/GroupPlaybackTrackData.d.ts +0 -41
  60. package/bin/internals/GroupPlaybackTrackData.d.ts.map +0 -1
  61. package/bin/internals/GroupPlaybackTrackData.js +0 -73
  62. package/bin/internals/GroupPlaybackTrackData.js.map +0 -1
  63. package/bin/internals/GroupTransportState.d.ts +0 -53
  64. package/bin/internals/GroupTransportState.d.ts.map +0 -1
  65. package/bin/internals/GroupTransportState.js +0 -123
  66. package/bin/internals/GroupTransportState.js.map +0 -1
  67. package/bin/internals/consts.d.ts +0 -83
  68. package/bin/internals/consts.d.ts.map +0 -1
  69. package/bin/internals/consts.js +0 -92
  70. package/bin/internals/consts.js.map +0 -1
  71. package/bin/internals/errors.d.ts +0 -17
  72. package/bin/internals/errors.d.ts.map +0 -1
  73. package/bin/internals/errors.js +0 -34
  74. package/bin/internals/errors.js.map +0 -1
  75. package/bin/internals/index.d.ts +0 -13
  76. package/bin/internals/index.d.ts.map +0 -1
  77. package/bin/internals/index.js +0 -29
  78. package/bin/internals/index.js.map +0 -1
  79. package/bin/internals/interfaces.d.ts +0 -10
  80. package/bin/internals/interfaces.d.ts.map +0 -1
  81. package/bin/internals/interfaces.js +0 -3
  82. package/bin/internals/interfaces.js.map +0 -1
@@ -1,260 +0,0 @@
1
- /**
2
- * Copyright (c) Microsoft Corporation. All rights reserved.
3
- * Licensed under the Microsoft Live Share SDK License.
4
- */
5
- /// <reference types="node" />
6
- import { IRuntimeSignaler, UserMeetingRole, LiveShareRuntime } from "@microsoft/live-share";
7
- import { CoordinationWaitPoint, ExtendedMediaMetadata, ExtendedMediaSessionPlaybackState, MediaSessionCoordinatorSuspension } from "./MediaSessionExtensions";
8
- import EventEmitter from "events";
9
- /**
10
- * Most recent state of the media session.
11
- */
12
- export interface IMediaPlayerState {
13
- /**
14
- * Metadata for the sessions current track.
15
- */
16
- metadata: ExtendedMediaMetadata | null;
17
- /**
18
- * Optional track data object being synchronized.
19
- *
20
- * @remarks
21
- * This can be used to sync things like pitch, roll, and yaw when watching 360 videos together.
22
- */
23
- trackData: object | null;
24
- /**
25
- * Sessions current playback state.
26
- */
27
- playbackState: ExtendedMediaSessionPlaybackState;
28
- /**
29
- * Sessions current position state if known.
30
- */
31
- positionState?: MediaPositionState;
32
- }
33
- /**
34
- * The `LiveMediaSessionCoordinator` tracks the playback & position state of all other
35
- * clients being synchronized with. It is responsible for keeping the local media player
36
- * in sync with the group.
37
- */
38
- export declare class LiveMediaSessionCoordinator extends EventEmitter {
39
- private readonly _id;
40
- private readonly _runtime;
41
- private readonly _liveRuntime;
42
- private readonly _logger;
43
- private readonly _getPlayerState;
44
- private _positionUpdateInterval;
45
- private _maxPlaybackDrift;
46
- private _lastWaitPoint?;
47
- private initializeState;
48
- private _playEvent?;
49
- private _pauseEvent?;
50
- private _seekToEvent?;
51
- private _rateChangeEvent?;
52
- private _setTrackEvent?;
53
- private _setTrackDataEvent?;
54
- private _positionUpdateEvent?;
55
- private _synchronizer?;
56
- private _groupState?;
57
- /**
58
- * @hidden
59
- * Applications shouldn't directly create new coordinator instances.
60
- */
61
- constructor(id: string, runtime: IRuntimeSignaler, liveRuntime: LiveShareRuntime, getPlayerState: () => IMediaPlayerState);
62
- /**
63
- * Controls whether or not the local client is allowed to instruct the group to play or pause.
64
- *
65
- * @remarks
66
- * This flag largely meant to influence decisions made by the coordinator and can be used by
67
- * the UI to determine what controls should be shown to the user. It does not provide any
68
- * security in itself.
69
- *
70
- * If your app is running in a semi-trusted environment where only some clients are allowed
71
- * to play/pause media, you should use "role based verification" to enforce those policies.
72
- */
73
- canPlayPause: boolean;
74
- /**
75
- * Controls whether or not the local client is allowed to seek the group to a new playback
76
- * position.
77
- *
78
- * @remarks
79
- * This flag largely meant to influence decisions made by the coordinator and can be used by
80
- * the UI to determine what controls should be shown to the user. It does not provide any
81
- * security in itself.
82
- *
83
- * If your app is running in a semi-trusted environment where only some clients are allowed
84
- * to change the playback position, you should use "role based verification" to enforce those policies.
85
- */
86
- canSeek: boolean;
87
- /**
88
- * Controls whether or not the local client is allowed to change tracks.
89
- *
90
- * @remarks
91
- * This flag largely meant to influence decisions made by the coordinator and can be used by
92
- * the UI to determine what controls should be shown to the user. It does not provide any
93
- * security in itself.
94
- *
95
- * If your app is running in a semi-trusted environment where only some clients are allowed
96
- * to change tracks, you should use "role based verification" to enforce those policies.
97
- */
98
- canSetTrack: boolean;
99
- /**
100
- * Controls whether or not the local client is allowed to change the tracks custom data object.
101
- *
102
- * @remarks
103
- * This flag largely meant to influence decisions made by the coordinator and can be used by
104
- * the UI to determine what controls should be shown to the user. It does not provide any
105
- * security in itself.
106
- *
107
- * If your app is running in a semi-trusted environment where only some clients are allowed
108
- * to change the tracks data object, you should use "role based verification" to enforce those
109
- * policies.
110
- */
111
- canSetTrackData: boolean;
112
- /**
113
- * Controls whether or not the local client is allowed to change the playback rate.
114
- *
115
- * @remarks
116
- * This flag largely meant to influence decisions made by the coordinator and can be used by
117
- * the UI to determine what controls should be shown to the user. It does not provide any
118
- * security in itself.
119
- *
120
- * If your app is running in a semi-trusted environment where only some clients are allowed
121
- * to change the tracks data object, you should use "role based verification" to enforce those
122
- * policies.
123
- */
124
- canSetPlaybackRate: boolean;
125
- /**
126
- * Controls whether or not the local client is allowed to send position updates to the group.
127
- *
128
- * @remarks
129
- * This flag largely meant to limit the number of signals sent to the group for performance reasons.
130
- * It does not provide any security in itself.
131
- */
132
- canSendPositionUpdates: boolean;
133
- /**
134
- * Returns true if the local client is in a suspended state.
135
- */
136
- get isSuspended(): boolean;
137
- /**
138
- * Max amount of playback drift allowed in seconds.
139
- *
140
- * @remarks
141
- * Should the local clients playback position lag by more than the specified value, the
142
- * coordinator will trigger a `catchup` action.
143
- *
144
- * Defaults to a value of `1` second.
145
- */
146
- get maxPlaybackDrift(): number;
147
- set maxPlaybackDrift(value: number);
148
- /**
149
- * Frequency with which position updates are broadcast to the rest of the group in
150
- * seconds.
151
- *
152
- * @remarks
153
- * Defaults to a value of `2` seconds.
154
- */
155
- get positionUpdateInterval(): number;
156
- set positionUpdateInterval(value: number);
157
- /**
158
- * Instructs the group to play the current track.
159
- *
160
- * @remarks
161
- * Throws an exception if the session/coordinator hasn't been initialized, no track has been
162
- * loaded, or `canPlayPause` is false.
163
- *
164
- * @returns a void promise that resolves once complete, throws if user does not have proper roles
165
- */
166
- play(): Promise<void>;
167
- /**
168
- * Instructs the group to pause the current track.
169
- *
170
- * @remarks
171
- * Throws an exception if the session/coordinator hasn't been initialized, no track has been
172
- * loaded, or `canPlayPause` is false.
173
- *
174
- * @returns a void promise that resolves once complete, throws if user does not have proper roles
175
- */
176
- pause(): Promise<void>;
177
- /**
178
- * Instructs the group to seek to a new position within the current track.
179
- *
180
- * @remarks
181
- * Throws an exception if the session/coordinator hasn't been initialized, no track has been
182
- * loaded, or `canSeek` is false.
183
- * @param time Playback position in seconds to seek to.
184
- * @returns a void promise that resolves once complete, throws if user does not have proper roles
185
- */
186
- seekTo(time: number): Promise<void>;
187
- setPlaybackRate(playbackRate: number): Promise<void>;
188
- /**
189
- * Instructs the group to load a new track.
190
- *
191
- * @remarks
192
- * Throws an exception if the session/coordinator hasn't been initialized or `canSetTrack` is
193
- * false.
194
- * @param metadata The track to load or `null` to indicate that the end of the track is reached.
195
- * @param waitPoints Optional. List of static wait points to configure for the track. Dynamic wait points can be added via the `beginSuspension()` call.
196
- * @returns a void promise that resolves once complete, throws if user does not have proper roles
197
- */
198
- setTrack(metadata: ExtendedMediaMetadata | null, waitPoints?: CoordinationWaitPoint[]): Promise<void>;
199
- /**
200
- * Updates the track data object for the current track.
201
- *
202
- * @remarks
203
- * The track data object can be used by applications to synchronize things like pitch, roll,
204
- * and yaw of a 360 video. This data object will be reset to null anytime the track changes.
205
- *
206
- * Throws an exception if the session/coordinator hasn't been initialized or `canSetTrackData` is
207
- * false.
208
- * @param data New data object to sync with the group. This value will be synchronized using a last writer wins strategy.
209
- * @returns a void promise that resolves once complete, throws if user does not have proper roles
210
- */
211
- setTrackData(data: object | null): Promise<void>;
212
- /**
213
- * Begins a new local suspension.
214
- *
215
- * @remarks
216
- * Suspension temporarily suspend the clients local synchronization with the group. This can
217
- * be useful for displaying ads to users or temporarily disconnecting from the session while
218
- * the user seeks the video using a timeline scrubber.
219
- *
220
- * Multiple simultaneous suspensions are allowed and when the last suspension ends the local
221
- * client will be immediately re-synchronized with the group.
222
- *
223
- * A "Dynamic Wait Point" can be specified when `beginSuspension()` is called and the wait
224
- * point will be broadcast to all other clients in the group. Those clients will then
225
- * automatically enter a suspension state once they reach the positions specified by the
226
- * wait point. Clients that are passed the wait point will immediately suspend.
227
- *
228
- * Any wait point based suspension (dynamic or static) will result in all clients remaining
229
- * in a suspension state until the list client ends their suspension. This behavior can be
230
- * conditionally bypassed by settings the wait points `maxClients` value.
231
- *
232
- * Throws an exception if the session/coordinator hasn't been initialized.
233
- * @param waitPoint Optional. Dynamic wait point to broadcast to all of the clients.
234
- * @returns The suspension object. Call `end()` on the returned suspension to end the suspension.
235
- */
236
- beginSuspension(waitPoint?: CoordinationWaitPoint): MediaSessionCoordinatorSuspension;
237
- /**
238
- * @hidden
239
- * Called by MediaSession to verify the coordinator has been initialized.
240
- */
241
- get isInitialized(): boolean;
242
- /**
243
- * @hidden
244
- * Called by MediaSession to start coordinator.
245
- */
246
- initialize(acceptTransportChangesFrom?: UserMeetingRole[]): Promise<void>;
247
- /**
248
- * @hidden
249
- * Called by the MediaSession to detect if a wait point has been hit.
250
- */
251
- findNextWaitPoint(): CoordinationWaitPoint | null;
252
- /**
253
- * @hidden
254
- * Called by MediaSession to trigger the sending of a position update.
255
- */
256
- sendPositionUpdate(state: IMediaPlayerState): void;
257
- protected createChildren(acceptTransportChangesFrom?: UserMeetingRole[]): Promise<void>;
258
- private getPlayerPosition;
259
- }
260
- //# sourceMappingURL=LiveMediaSessionCoordinator.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"LiveMediaSessionCoordinator.d.ts","sourceRoot":"","sources":["../src/LiveMediaSessionCoordinator.ts"],"names":[],"mappings":"AAAA;;;GAGG;;AAEH,OAAO,EAIH,gBAAgB,EAEhB,eAAe,EACf,gBAAgB,EAMnB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EACH,qBAAqB,EACrB,qBAAqB,EACrB,iCAAiC,EACjC,iCAAiC,EACpC,MAAM,0BAA0B,CAAC;AAclC,OAAO,YAAY,MAAM,QAAQ,CAAC;AAGlC;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAC9B;;OAEG;IACH,QAAQ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