@microsoft/live-share-media 0.5.1 → 1.0.0-preview.1

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 (68) hide show
  1. package/.nycrc.json +10 -10
  2. package/.vscode/launch.json +29 -0
  3. package/.vscode/settings.json +2 -0
  4. package/LICENSE +86 -86
  5. package/README.md +138 -137
  6. package/bin/LiveMediaSession.d.ts +95 -0
  7. package/bin/LiveMediaSession.d.ts.map +1 -0
  8. package/bin/LiveMediaSession.js +217 -0
  9. package/bin/LiveMediaSession.js.map +1 -0
  10. package/bin/LiveMediaSessionCoordinator.d.ts +228 -0
  11. package/bin/LiveMediaSessionCoordinator.d.ts.map +1 -0
  12. package/bin/LiveMediaSessionCoordinator.js +396 -0
  13. package/bin/LiveMediaSessionCoordinator.js.map +1 -0
  14. package/bin/LiveMediaSessionCoordinatorSuspension.d.ts +20 -0
  15. package/bin/LiveMediaSessionCoordinatorSuspension.d.ts.map +1 -0
  16. package/bin/LiveMediaSessionCoordinatorSuspension.js +28 -0
  17. package/bin/LiveMediaSessionCoordinatorSuspension.js.map +1 -0
  18. package/bin/MediaPlayerSynchronizer.d.ts +6 -6
  19. package/bin/MediaPlayerSynchronizer.d.ts.map +1 -1
  20. package/bin/MediaPlayerSynchronizer.js +12 -7
  21. package/bin/MediaPlayerSynchronizer.js.map +1 -1
  22. package/bin/VolumeManager.d.ts +84 -0
  23. package/bin/VolumeManager.d.ts.map +1 -0
  24. package/bin/VolumeManager.js +173 -0
  25. package/bin/VolumeManager.js.map +1 -0
  26. package/bin/index.d.ts +4 -4
  27. package/bin/index.d.ts.map +1 -1
  28. package/bin/index.js +4 -4
  29. package/bin/index.js.map +1 -1
  30. package/bin/internals/GroupCoordinatorState.d.ts +6 -6
  31. package/bin/internals/GroupCoordinatorState.d.ts.map +1 -1
  32. package/bin/internals/GroupCoordinatorState.js +6 -6
  33. package/bin/internals/GroupCoordinatorState.js.map +1 -1
  34. package/bin/internals/GroupPlaybackPosition.d.ts.map +1 -1
  35. package/bin/internals/GroupPlaybackPosition.js +2 -2
  36. package/bin/internals/GroupPlaybackPosition.js.map +1 -1
  37. package/bin/internals/GroupPlaybackTrack.d.ts +1 -1
  38. package/bin/internals/GroupPlaybackTrack.d.ts.map +1 -1
  39. package/bin/internals/GroupTransportState.d.ts +1 -1
  40. package/bin/internals/GroupTransportState.d.ts.map +1 -1
  41. package/bin/internals/GroupTransportState.js +1 -1
  42. package/bin/internals/GroupTransportState.js.map +1 -1
  43. package/package.json +38 -38
  44. package/src/IMediaPlayer.ts +21 -21
  45. package/src/{EphemeralMediaSession.ts → LiveMediaSession.ts} +238 -248
  46. package/src/{EphemeralMediaSessionCoordinator.ts → LiveMediaSessionCoordinator.ts} +461 -461
  47. package/src/{EphemeralMediaSessionCoordinatorSuspension.ts → LiveMediaSessionCoordinatorSuspension.ts} +30 -30
  48. package/src/MediaPlayerSynchronizer.ts +455 -449
  49. package/src/MediaSessionActionThrottler.ts +14 -14
  50. package/src/MediaSessionExtensions.ts +42 -42
  51. package/src/RepeatedActionThrottler.ts +55 -55
  52. package/src/VolumeManager.ts +185 -0
  53. package/src/index.ts +15 -15
  54. package/src/internals/GroupCoordinatorState.ts +445 -445
  55. package/src/internals/GroupPlaybackPosition.ts +193 -193
  56. package/src/internals/GroupPlaybackTrack.ts +147 -147
  57. package/src/internals/GroupPlaybackTrackData.ts +90 -90
  58. package/src/internals/GroupTransportState.ts +127 -127
  59. package/src/internals/consts.ts +80 -80
  60. package/src/internals/index.ts +10 -10
  61. package/src/test/GroupPlaybackPosition.spec.ts +339 -339
  62. package/src/test/GroupPlaybackTrack.spec.ts +65 -65
  63. package/src/test/SharedMediaSession.spec.ts +113 -113
  64. package/src/test/SharedMediaSessionCoordinator.spec.ts +230 -230
  65. package/src/test/VolumeManager.spec.ts +212 -0
  66. package/tsconfig.build.json +8 -8
  67. package/tsconfig.json +75 -75
  68. package/src/VolumeLimiter.ts +0 -182
@@ -1,31 +1,31 @@
1
- /**
2
- * Copyright (c) Microsoft Corporation. All rights reserved.
3
- * Licensed under the Microsoft Live Share SDK License.
4
- */
5
-
6
- import { MediaSessionCoordinatorSuspension, CoordinationWaitPoint } from './MediaSessionExtensions';
7
-
8
- export class EphemeralMediaSessionCoordinatorSuspension implements MediaSessionCoordinatorSuspension {
9
- private _waitPoint?: CoordinationWaitPoint;
10
- private _onEnd: (seekTo?: number) => void;
11
-
12
- constructor(waitPoint: CoordinationWaitPoint|undefined, onEnd: (seekTo?: number) => void) {
13
- this._waitPoint = waitPoint;
14
- this._onEnd = onEnd;
15
- }
16
-
17
- /**
18
- * Returns an optional wait point associated with the suspension.
19
- */
20
- public get waitPoint(): CoordinationWaitPoint|undefined {
21
- return this._waitPoint;
22
- }
23
-
24
- /**
25
- * Ends the suspension and optionally proposes a time to seek to.
26
- * @param seekTo Optional. Proposed time to seek to. Ignored for suspensions at wait points.
27
- */
28
- public end(seekTo?: number): void {
29
- this._onEnd(seekTo);
30
- }
1
+ /**
2
+ * Copyright (c) Microsoft Corporation. All rights reserved.
3
+ * Licensed under the Microsoft Live Share SDK License.
4
+ */
5
+
6
+ import { MediaSessionCoordinatorSuspension, CoordinationWaitPoint } from './MediaSessionExtensions';
7
+
8
+ export class LiveMediaSessionCoordinatorSuspension implements MediaSessionCoordinatorSuspension {
9
+ private _waitPoint?: CoordinationWaitPoint;
10
+ private _onEnd: (seekTo?: number) => void;
11
+
12
+ constructor(waitPoint: CoordinationWaitPoint|undefined, onEnd: (seekTo?: number) => void) {
13
+ this._waitPoint = waitPoint;
14
+ this._onEnd = onEnd;
15
+ }
16
+
17
+ /**
18
+ * Returns an optional wait point associated with the suspension.
19
+ */
20
+ public get waitPoint(): CoordinationWaitPoint|undefined {
21
+ return this._waitPoint;
22
+ }
23
+
24
+ /**
25
+ * Ends the suspension and optionally proposes a time to seek to.
26
+ * @param seekTo Optional. Proposed time to seek to. Ignored for suspensions at wait points.
27
+ */
28
+ public end(seekTo?: number): void {
29
+ this._onEnd(seekTo);
30
+ }
31
31
  }