@microsoft/live-share-media 1.0.0-preview.12 → 1.0.0-preview.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 (68) hide show
  1. package/README.md +1 -1
  2. package/bin/IMediaPlayer.d.ts +20 -20
  3. package/bin/IMediaPlayer.js +6 -6
  4. package/bin/LiveMediaSession.d.ts +95 -94
  5. package/bin/LiveMediaSession.d.ts.map +1 -1
  6. package/bin/LiveMediaSession.js +235 -231
  7. package/bin/LiveMediaSession.js.map +1 -1
  8. package/bin/LiveMediaSessionCoordinator.d.ts +238 -227
  9. package/bin/LiveMediaSessionCoordinator.d.ts.map +1 -1
  10. package/bin/LiveMediaSessionCoordinator.js +476 -407
  11. package/bin/LiveMediaSessionCoordinator.js.map +1 -1
  12. package/bin/LiveMediaSessionCoordinatorSuspension.d.ts +19 -19
  13. package/bin/LiveMediaSessionCoordinatorSuspension.js +27 -27
  14. package/bin/MediaPlayerSynchronizer.d.ts +173 -163
  15. package/bin/MediaPlayerSynchronizer.d.ts.map +1 -1
  16. package/bin/MediaPlayerSynchronizer.js +491 -468
  17. package/bin/MediaPlayerSynchronizer.js.map +1 -1
  18. package/bin/MediaSessionActionThrottler.d.ts +11 -11
  19. package/bin/MediaSessionActionThrottler.js +13 -13
  20. package/bin/MediaSessionExtensions.d.ts +34 -34
  21. package/bin/MediaSessionExtensions.d.ts.map +1 -1
  22. package/bin/MediaSessionExtensions.js +12 -12
  23. package/bin/RepeatedActionThrottler.d.ts +19 -19
  24. package/bin/RepeatedActionThrottler.js +62 -62
  25. package/bin/RepeatedActionThrottler.js.map +1 -1
  26. package/bin/VolumeManager.d.ts +83 -83
  27. package/bin/VolumeManager.js +174 -174
  28. package/bin/index.d.ts +13 -13
  29. package/bin/index.js +29 -29
  30. package/bin/internals/GroupCoordinatorState.d.ts +93 -92
  31. package/bin/internals/GroupCoordinatorState.d.ts.map +1 -1
  32. package/bin/internals/GroupCoordinatorState.js +407 -404
  33. package/bin/internals/GroupCoordinatorState.js.map +1 -1
  34. package/bin/internals/GroupPlaybackPosition.d.ts +67 -66
  35. package/bin/internals/GroupPlaybackPosition.d.ts.map +1 -1
  36. package/bin/internals/GroupPlaybackPosition.js +166 -166
  37. package/bin/internals/GroupPlaybackPosition.js.map +1 -1
  38. package/bin/internals/GroupPlaybackTrack.d.ts +45 -45
  39. package/bin/internals/GroupPlaybackTrack.d.ts.map +1 -1
  40. package/bin/internals/GroupPlaybackTrack.js +121 -121
  41. package/bin/internals/GroupPlaybackTrackData.d.ts +39 -39
  42. package/bin/internals/GroupPlaybackTrackData.d.ts.map +1 -1
  43. package/bin/internals/GroupPlaybackTrackData.js +69 -69
  44. package/bin/internals/GroupTransportState.d.ts +49 -48
  45. package/bin/internals/GroupTransportState.d.ts.map +1 -1
  46. package/bin/internals/GroupTransportState.js +111 -111
  47. package/bin/internals/GroupTransportState.js.map +1 -1
  48. package/bin/internals/consts.d.ts +75 -72
  49. package/bin/internals/consts.d.ts.map +1 -1
  50. package/bin/internals/consts.js +84 -81
  51. package/bin/internals/consts.js.map +1 -1
  52. package/bin/internals/index.d.ts +10 -10
  53. package/bin/internals/index.js +26 -26
  54. package/package.json +4 -4
  55. package/src/LiveMediaSession.ts +24 -12
  56. package/src/LiveMediaSessionCoordinator.ts +101 -29
  57. package/src/MediaPlayerSynchronizer.ts +30 -14
  58. package/src/internals/GroupCoordinatorState.ts +49 -35
  59. package/src/internals/GroupPlaybackPosition.ts +6 -2
  60. package/src/internals/GroupPlaybackTrack.ts +2 -2
  61. package/src/internals/GroupPlaybackTrackData.ts +2 -2
  62. package/src/internals/GroupTransportState.ts +11 -4
  63. package/src/internals/consts.ts +4 -0
  64. package/src/test/GroupPlaybackPosition.spec.ts +0 -600
  65. package/src/test/GroupPlaybackTrack.spec.ts +0 -122
  66. package/src/test/SharedMediaSession.spec.ts +0 -149
  67. package/src/test/SharedMediaSessionCoordinator.spec.ts +0 -271
  68. package/src/test/VolumeManager.spec.ts +0 -219
package/README.md CHANGED
@@ -113,7 +113,7 @@ The Live Share SDK contains dependencies for [@microsoft/teams-js](https://www.n
113
113
 
114
114
  | @microsoft/live-share | @microsoft/teams-js | fluid-framework | @microsoft/live-share-\* | @fluidframework/azure-client | @microsoft/TeamsFx | @microsoft/TeamsFx-react |
115
115
  | --------------------- | -------------------- | --------------- | -------------------------- | ---------------------------- | ------------------------------- | ------------------------------- |
116
- | 1.0.0-preview.12 | ^2.11.0 | ^1.2.3 | 1.0.0-preview.12 (optional) | ^1.0.0 (optional) | ^2.5.0 (optional) | ^2.5.0 (optional) |
116
+ | 1.0.0-preview.14 | ^2.11.0 | ^1.2.3 | 1.0.0-preview.14 (optional) | ^1.0.0 (optional) | ^2.5.0 (optional) | ^2.5.0 (optional) |
117
117
  | 1.0.0-preview.10 | ^2.10.1 | ~1.2.3 | 1.0.0-preview.10 (optional) | ~1.0.2 (optional) | ^2.5.0 (optional) | ^2.5.0 (optional) |
118
118
  | 1.0.0-preview.8 | ^2.5.0 | ~1.2.3 | 1.0.0-preview.10 (optional) | ~1.0.2 (optional) | ^2.5.0 (optional) | ^2.5.0 (optional) |
119
119
  | 1.0.0-preview.3 | 2.0.0-experimental.1 | ~1.2.3 | 1.0.0-preview.3 (optional) | ~1.0.2 (optional) | 2.0.0-experimental.0 (optional) | 2.0.0-experimental.0 (optional) |
@@ -1,21 +1,21 @@
1
- /**
2
- * Copyright (c) Microsoft Corporation. All rights reserved.
3
- * Licensed under the Microsoft Live Share SDK License.
4
- */
5
- export interface IMediaPlayer {
6
- readonly currentSrc: string;
7
- currentTime: number;
8
- readonly duration: number;
9
- readonly ended: boolean;
10
- muted: boolean;
11
- readonly paused: boolean;
12
- playbackRate: number;
13
- src: string;
14
- volume: number;
15
- load(): void;
16
- pause(): void;
17
- play(): Promise<void>;
18
- addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
19
- removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;
20
- }
1
+ /**
2
+ * Copyright (c) Microsoft Corporation. All rights reserved.
3
+ * Licensed under the Microsoft Live Share SDK License.
4
+ */
5
+ export interface IMediaPlayer {
6
+ readonly currentSrc: string;
7
+ currentTime: number;
8
+ readonly duration: number;
9
+ readonly ended: boolean;
10
+ muted: boolean;
11
+ readonly paused: boolean;
12
+ playbackRate: number;
13
+ src: string;
14
+ volume: number;
15
+ load(): void;
16
+ pause(): void;
17
+ play(): Promise<void>;
18
+ addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
19
+ removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;
20
+ }
21
21
  //# sourceMappingURL=IMediaPlayer.d.ts.map
@@ -1,7 +1,7 @@
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 });
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
7
  //# sourceMappingURL=IMediaPlayer.js.map
@@ -1,95 +1,96 @@
1
- /**
2
- * Copyright (c) Microsoft Corporation. All rights reserved.
3
- * Licensed under the Microsoft Live Share SDK License.
4
- */
5
- import { DataObject, DataObjectFactory } from "@fluidframework/aqueduct";
6
- import { LiveTelemetryLogger, UserMeetingRole } from "@microsoft/live-share";
7
- import { MediaPlayerSynchronizer } from "./MediaPlayerSynchronizer";
8
- import { ExtendedMediaSessionAction } from "./MediaSessionExtensions";
9
- import { LiveMediaSessionCoordinator, IMediaPlayerState } from "./LiveMediaSessionCoordinator";
10
- import { MediaSessionActionThrottler } from "./MediaSessionActionThrottler";
11
- import { IMediaPlayer } from "./IMediaPlayer";
12
- /**
13
- * Live fluid object that synchronizes media playback across multiple clients.
14
- */
15
- export declare class LiveMediaSession extends DataObject {
16
- private _actionThrottler;
17
- private _logger?;
18
- private _requestPlayerStateHandler?;
19
- private _coordinator?;
20
- private readonly _actionHandlers;
21
- private _synchronizing?;
22
- private _updateTimer;
23
- private _lastUpdateTime;
24
- /**
25
- * The objects fluid type name.
26
- */
27
- static readonly TypeName = "@microsoft/fluid-media:SharedMediaSession";
28
- /**
29
- * The objects fluid type factory.
30
- */
31
- static readonly factory: DataObjectFactory<LiveMediaSession, import("@fluidframework/aqueduct").DataObjectTypes>;
32
- /**
33
- * Extension point that lets applications replace the default logic for throttling the sessions
34
- * local sync behavior.
35
- *
36
- * @remarks
37
- * The `LiveMediaCoordinator` is fairly aggressive at wanting to keep the local media player
38
- * in sync with the rest of the group. This aggressiveness can result in the coordinator sending
39
- * new sync actions before the local player has finished responding to the previous sync action.
40
- * The `ActionThrottler` gives apps fine grain control over how aggressive they want sync to be.
41
- *
42
- * By default, a `RepeatedAction` throttler is used which prevents the same sync action from
43
- * being sent within an adjustable time period.
44
- */
45
- get actionThrottler(): MediaSessionActionThrottler;
46
- set actionThrottler(value: MediaSessionActionThrottler);
47
- /**
48
- * Returns true if the object has been initialized.
49
- */
50
- get isInitialized(): boolean;
51
- /**
52
- * @deprecated isInitialized should be used instead
53
- * Returns true if the object has been initialized.
54
- */
55
- get isStarted(): boolean;
56
- /**
57
- * The group coordinator for the session.
58
- */
59
- get coordinator(): LiveMediaSessionCoordinator;
60
- /**
61
- * Returns the logger used by the session and coordinator.
62
- *
63
- * @remarks
64
- * This is used by the `MediaPlayerSynchronizer` to log events.
65
- */
66
- get logger(): LiveTelemetryLogger;
67
- /**
68
- * initialize the object.
69
- * @param acceptTransportChangesFrom Optional. List of roles allowed to group transport
70
- * operations like play/pause/seek/setTrack.
71
- */
72
- initialize(acceptTransportChangesFrom?: UserMeetingRole[]): Promise<void>;
73
- /**
74
- * Registers an action handler with the session.
75
- * @param action Name of the action to register a handler for.
76
- * @param handler Function called when the action is triggered.
77
- */
78
- setActionHandler(action: ExtendedMediaSessionAction, handler: MediaSessionActionHandler | null): void;
79
- /**
80
- * Registers a handler that will be queried anytime the group coordinate needs to know the
81
- * local players transport state and position.
82
- */
83
- setRequestPlayerStateHandler(handler: () => IMediaPlayerState): void;
84
- /**
85
- * Begins synchronizing the playback of a media element.
86
- * @param player Something that "looks like" and HTML Media Element.
87
- * @returns A new synchronizer instance. Call `synchronizer.end()` to stop synchronizing the elements playback.
88
- */
89
- synchronize(player: IMediaPlayer): MediaPlayerSynchronizer;
90
- protected hasInitialized(): Promise<void>;
91
- private checkWaitPointHit;
92
- private getCurrentPlayerState;
93
- private dispatchAction;
94
- }
1
+ /**
2
+ * Copyright (c) Microsoft Corporation. All rights reserved.
3
+ * Licensed under the Microsoft Live Share SDK License.
4
+ */
5
+ import { DataObjectFactory } from "@fluidframework/aqueduct";
6
+ import { LiveDataObject, LiveTelemetryLogger, UserMeetingRole } from "@microsoft/live-share";
7
+ import { MediaPlayerSynchronizer } from "./MediaPlayerSynchronizer";
8
+ import { ExtendedMediaSessionAction } from "./MediaSessionExtensions";
9
+ import { LiveMediaSessionCoordinator, IMediaPlayerState } from "./LiveMediaSessionCoordinator";
10
+ import { MediaSessionActionThrottler } from "./MediaSessionActionThrottler";
11
+ import { IMediaPlayer } from "./IMediaPlayer";
12
+ /**
13
+ * Live fluid object that synchronizes media playback across multiple clients.
14
+ */
15
+ export declare class LiveMediaSession extends LiveDataObject {
16
+ private _actionThrottler;
17
+ private _logger?;
18
+ private _requestPlayerStateHandler?;
19
+ private _coordinator?;
20
+ private readonly _actionHandlers;
21
+ private _synchronizing?;
22
+ private _updateTimer;
23
+ private _lastUpdateTime;
24
+ /**
25
+ * The objects fluid type name.
26
+ */
27
+ static readonly TypeName = "@microsoft/fluid-media:SharedMediaSession";
28
+ /**
29
+ * The objects fluid type factory.
30
+ */
31
+ static readonly factory: DataObjectFactory<LiveMediaSession, import("@fluidframework/aqueduct").DataObjectTypes>;
32
+ /**
33
+ * Extension point that lets applications replace the default logic for throttling the sessions
34
+ * local sync behavior.
35
+ *
36
+ * @remarks
37
+ * The `LiveMediaCoordinator` is fairly aggressive at wanting to keep the local media player
38
+ * in sync with the rest of the group. This aggressiveness can result in the coordinator sending
39
+ * new sync actions before the local player has finished responding to the previous sync action.
40
+ * The `ActionThrottler` gives apps fine grain control over how aggressive they want sync to be.
41
+ *
42
+ * By default, a `RepeatedAction` throttler is used which prevents the same sync action from
43
+ * being sent within an adjustable time period.
44
+ */
45
+ get actionThrottler(): MediaSessionActionThrottler;
46
+ set actionThrottler(value: MediaSessionActionThrottler);
47
+ /**
48
+ * Returns true if the object has been initialized.
49
+ */
50
+ get isInitialized(): boolean;
51
+ /**
52
+ * @deprecated isInitialized should be used instead
53
+ * Returns true if the object has been initialized.
54
+ */
55
+ get isStarted(): boolean;
56
+ /**
57
+ * The group coordinator for the session.
58
+ */
59
+ get coordinator(): LiveMediaSessionCoordinator;
60
+ /**
61
+ * Returns the logger used by the session and coordinator.
62
+ *
63
+ * @remarks
64
+ * This is used by the `MediaPlayerSynchronizer` to log events.
65
+ */
66
+ get logger(): LiveTelemetryLogger;
67
+ /**
68
+ * initialize the object.
69
+ * @param allowedRoles Optional. List of roles allowed to group transport
70
+ * operations like play/pause/seek/setTrack.
71
+ * @returns a void promise that resolves once complete
72
+ */
73
+ initialize(allowedRoles?: UserMeetingRole[]): Promise<void>;
74
+ /**
75
+ * Registers an action handler with the session.
76
+ * @param action Name of the action to register a handler for.
77
+ * @param handler Function called when the action is triggered.
78
+ */
79
+ setActionHandler(action: ExtendedMediaSessionAction, handler: MediaSessionActionHandler | null): void;
80
+ /**
81
+ * Registers a handler that will be queried anytime the group coordinate needs to know the
82
+ * local players transport state and position.
83
+ */
84
+ setRequestPlayerStateHandler(handler: () => IMediaPlayerState): void;
85
+ /**
86
+ * Begins synchronizing the playback of a media element.
87
+ * @param player Something that "looks like" and HTML Media Element.
88
+ * @returns A new synchronizer instance. Call `synchronizer.end()` to stop synchronizing the elements playback.
89
+ */
90
+ synchronize(player: IMediaPlayer): MediaPlayerSynchronizer;
91
+ protected hasInitialized(): Promise<void>;
92
+ private checkWaitPointHit;
93
+ private getCurrentPlayerState;
94
+ private dispatchAction;
95
+ }
95
96
  //# sourceMappingURL=LiveMediaSession.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"LiveMediaSession.d.ts","sourceRoot":"","sources":["../src/LiveMediaSession.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,UAAU,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AACzE,OAAO,EAAyB,mBAAmB,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AACpG,OAAO,EAAE,uBAAuB,EAAE,MAAM,2BAA2B,CAAC;AAEpE,OAAO,EAEH,0BAA0B,EAE7B,MAAM,0BAA0B,CAAC;AAClC,OAAO,EACH,2BAA2B,EAC3B,iBAAiB,EACpB,MAAM,+BAA+B,CAAC;AACvC,OAAO,EAAE,2BAA2B,EAAE,MAAM,+BAA+B,CAAC;AAE5E,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAE9C;;GAEG;AACH,qBAAa,gBAAiB,SAAQ,UAAU;IAC5C,OAAO,CAAC,gBAAgB,CACU;IAClC,OAAO,CAAC,OAAO,CAAC,CAAsB;IACtC,OAAO,CAAC,0BAA0B,CAAC,CAA0B;IAC7D,OAAO,CAAC,YAAY,CAAC,CAA8B;IACnD,OAAO,CAAC,QAAQ,CAAC,eAAe,CAClB;IACd,OAAO,CAAC,cAAc,CAAC,CAA0B;IAGjD,OAAO,CAAC,YAAY,CAAM;IAC1B,OAAO,CAAC,eAAe,CAAa;IAEpC;;OAEG;IACH,gBAAuB,QAAQ,+CAA+C;IAE9E;;OAEG;IACH,gBAAuB,OAAO,0FAK5B;IAEF;;;;;;;;;;;;OAYG;IACH,IAAW,eAAe,IAAI,2BAA2B,CAExD;IAED,IAAW,eAAe,CAAC,KAAK,EAAE,2BAA2B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