@microsoft/live-share-media 1.3.0 → 1.4.0
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.
- package/.nycrc.json +10 -10
- package/LICENSE +90 -90
- package/README.md +135 -135
- package/bin/LiveMediaSession.d.ts.map +1 -1
- package/bin/LiveMediaSession.js +9 -1
- package/bin/LiveMediaSession.js.map +1 -1
- package/bin/LiveMediaSessionCoordinator.d.ts +18 -2
- package/bin/LiveMediaSessionCoordinator.d.ts.map +1 -1
- package/bin/LiveMediaSessionCoordinator.js +52 -13
- package/bin/LiveMediaSessionCoordinator.js.map +1 -1
- package/bin/MediaPlayerSynchronizer.d.ts +6 -4
- package/bin/MediaPlayerSynchronizer.d.ts.map +1 -1
- package/bin/MediaPlayerSynchronizer.js +41 -12
- package/bin/MediaPlayerSynchronizer.js.map +1 -1
- package/bin/MediaSessionExtensions.d.ts +17 -8
- package/bin/MediaSessionExtensions.d.ts.map +1 -1
- package/bin/MediaSessionExtensions.js +4 -0
- package/bin/MediaSessionExtensions.js.map +1 -1
- package/bin/internals/GroupCoordinatorState.d.ts +15 -1
- package/bin/internals/GroupCoordinatorState.d.ts.map +1 -1
- package/bin/internals/GroupCoordinatorState.js +123 -57
- package/bin/internals/GroupCoordinatorState.js.map +1 -1
- package/bin/internals/GroupPlaybackPosition.d.ts +3 -1
- package/bin/internals/GroupPlaybackPosition.d.ts.map +1 -1
- package/bin/internals/GroupPlaybackPosition.js +7 -3
- package/bin/internals/GroupPlaybackPosition.js.map +1 -1
- package/bin/internals/GroupPlaybackRate.d.ts +39 -0
- package/bin/internals/GroupPlaybackRate.d.ts.map +1 -0
- package/bin/internals/GroupPlaybackRate.js +62 -0
- package/bin/internals/GroupPlaybackRate.js.map +1 -0
- package/bin/internals/GroupPlaybackTrack.d.ts +2 -2
- package/bin/internals/GroupPlaybackTrack.d.ts.map +1 -1
- package/bin/internals/GroupPlaybackTrack.js +3 -2
- package/bin/internals/GroupPlaybackTrack.js.map +1 -1
- package/bin/internals/GroupPlaybackTrackData.d.ts +3 -3
- package/bin/internals/GroupPlaybackTrackData.d.ts.map +1 -1
- package/bin/internals/GroupPlaybackTrackData.js +12 -11
- package/bin/internals/GroupPlaybackTrackData.js.map +1 -1
- package/bin/internals/GroupTransportState.d.ts +6 -3
- package/bin/internals/GroupTransportState.d.ts.map +1 -1
- package/bin/internals/GroupTransportState.js +16 -11
- package/bin/internals/GroupTransportState.js.map +1 -1
- package/bin/internals/consts.d.ts +10 -3
- package/bin/internals/consts.d.ts.map +1 -1
- package/bin/internals/consts.js +10 -3
- package/bin/internals/consts.js.map +1 -1
- package/bin/internals/index.d.ts +1 -0
- package/bin/internals/index.d.ts.map +1 -1
- package/bin/internals/index.js +1 -0
- package/bin/internals/index.js.map +1 -1
- package/bin/internals/interfaces.d.ts +10 -0
- package/bin/internals/interfaces.d.ts.map +1 -0
- package/bin/internals/interfaces.js +3 -0
- package/bin/internals/interfaces.js.map +1 -0
- package/package.json +45 -45
- package/src/IMediaPlayer.ts +29 -29
- package/src/LiveMediaSession.ts +349 -336
- package/src/LiveMediaSessionCoordinator.ts +760 -678
- package/src/LiveMediaSessionCoordinatorSuspension.ts +39 -39
- package/src/MediaPlayerSynchronizer.ts +754 -714
- package/src/MediaSessionActionThrottler.ts +19 -19
- package/src/MediaSessionExtensions.ts +198 -187
- package/src/RepeatedActionThrottler.ts +76 -76
- package/src/VolumeManager.ts +200 -200
- package/src/index.ts +14 -14
- package/src/internals/GroupCoordinatorState.ts +802 -685
- package/src/internals/GroupPlaybackPosition.ts +235 -228
- package/src/internals/GroupPlaybackRate.ts +90 -0
- package/src/internals/GroupPlaybackTrack.ts +183 -182
- package/src/internals/GroupPlaybackTrackData.ts +105 -104
- package/src/internals/GroupTransportState.ts +179 -170
- package/src/internals/consts.ts +115 -102
- package/src/internals/errors.ts +42 -42
- package/src/internals/index.ts +13 -12
- package/src/internals/interfaces.ts +10 -0
- package/tsconfig.build.json +8 -8
- package/tsconfig.json +76 -76
- package/typedoc.json +10 -10
|
@@ -1,170 +1,179 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
3
|
-
* Licensed under the Microsoft Live Share SDK License.
|
|
4
|
-
*/
|
|
5
|
-
|
|
6
|
-
import {
|
|
7
|
-
import EventEmitter from "events";
|
|
8
|
-
import { IMediaPlayerState } from "../LiveMediaSessionCoordinator";
|
|
9
|
-
import {
|
|
10
|
-
ExtendedMediaSessionPlaybackState,
|
|
11
|
-
ExtendedMediaSessionAction,
|
|
12
|
-
ExtendedMediaSessionActionSource,
|
|
13
|
-
} from "../MediaSessionExtensions";
|
|
14
|
-
import {
|
|
15
|
-
GroupPlaybackTrack,
|
|
16
|
-
GroupPlaybackTrackEvents,
|
|
17
|
-
} from "./GroupPlaybackTrack";
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
private readonly
|
|
51
|
-
private
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
// Ignore state
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
if (
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
}
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
3
|
+
* Licensed under the Microsoft Live Share SDK License.
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import { LiveShareRuntime } from "@microsoft/live-share";
|
|
7
|
+
import EventEmitter from "events";
|
|
8
|
+
import { IMediaPlayerState } from "../LiveMediaSessionCoordinator";
|
|
9
|
+
import {
|
|
10
|
+
ExtendedMediaSessionPlaybackState,
|
|
11
|
+
ExtendedMediaSessionAction,
|
|
12
|
+
ExtendedMediaSessionActionSource,
|
|
13
|
+
} from "../MediaSessionExtensions";
|
|
14
|
+
import {
|
|
15
|
+
GroupPlaybackTrack,
|
|
16
|
+
GroupPlaybackTrackEvents,
|
|
17
|
+
} from "./GroupPlaybackTrack";
|
|
18
|
+
import { IGroupStateEvent } from "./interfaces";
|
|
19
|
+
import { GroupPlaybackRate } from "./GroupPlaybackRate";
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* @hidden
|
|
23
|
+
*/
|
|
24
|
+
export interface ITransportState {
|
|
25
|
+
playbackState: ExtendedMediaSessionPlaybackState;
|
|
26
|
+
startPosition: number;
|
|
27
|
+
timestamp: number;
|
|
28
|
+
clientId: string;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* @hidden
|
|
33
|
+
*/
|
|
34
|
+
export enum GroupTransportStateEvents {
|
|
35
|
+
transportStateChange = "transportStateChange",
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* @hidden
|
|
40
|
+
*/
|
|
41
|
+
export interface ITransportStateChangeEvent extends IGroupStateEvent {
|
|
42
|
+
action: ExtendedMediaSessionAction;
|
|
43
|
+
seekTime?: number;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
/**
|
|
47
|
+
* @hidden
|
|
48
|
+
*/
|
|
49
|
+
export class GroupTransportState extends EventEmitter {
|
|
50
|
+
private readonly _getMediaPlayerState: () => IMediaPlayerState;
|
|
51
|
+
private _track: GroupPlaybackTrack;
|
|
52
|
+
private _playbackRate: GroupPlaybackRate;
|
|
53
|
+
private readonly _liveRuntime: LiveShareRuntime;
|
|
54
|
+
private _current: ITransportState;
|
|
55
|
+
|
|
56
|
+
constructor(
|
|
57
|
+
track: GroupPlaybackTrack,
|
|
58
|
+
playbackRate: GroupPlaybackRate,
|
|
59
|
+
getMediaPlayerState: () => IMediaPlayerState,
|
|
60
|
+
liveRuntime: LiveShareRuntime
|
|
61
|
+
) {
|
|
62
|
+
super();
|
|
63
|
+
this._liveRuntime = liveRuntime;
|
|
64
|
+
this._getMediaPlayerState = getMediaPlayerState;
|
|
65
|
+
this._track = track;
|
|
66
|
+
this._playbackRate = playbackRate;
|
|
67
|
+
this._current = {
|
|
68
|
+
playbackState: "none",
|
|
69
|
+
startPosition: 0.0,
|
|
70
|
+
timestamp: 0,
|
|
71
|
+
clientId: "",
|
|
72
|
+
};
|
|
73
|
+
|
|
74
|
+
// Listen for track changes
|
|
75
|
+
this._track.on(GroupPlaybackTrackEvents.trackChange, () => {
|
|
76
|
+
// Track changed so reset state to stopped ad position 0.0
|
|
77
|
+
this._current = {
|
|
78
|
+
playbackState: "none",
|
|
79
|
+
startPosition: 0.0,
|
|
80
|
+
timestamp: this._track.current.timestamp,
|
|
81
|
+
clientId: this._track.current.clientId,
|
|
82
|
+
};
|
|
83
|
+
});
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
public get current(): Readonly<ITransportState> {
|
|
87
|
+
return this._current;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
public get playbackState(): ExtendedMediaSessionPlaybackState {
|
|
91
|
+
return this.current.playbackState;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
public get startPosition(): number {
|
|
95
|
+
return this.current.startPosition;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
public get timestamp(): number {
|
|
99
|
+
return this.current.timestamp;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
public get track(): GroupPlaybackTrack {
|
|
103
|
+
return this._track;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
public compare(state: ITransportState): boolean {
|
|
107
|
+
return (
|
|
108
|
+
this.current.playbackState == state.playbackState &&
|
|
109
|
+
this.current.startPosition == state.startPosition
|
|
110
|
+
);
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
public updateState(
|
|
114
|
+
state: ITransportState,
|
|
115
|
+
source: ExtendedMediaSessionActionSource
|
|
116
|
+
): boolean {
|
|
117
|
+
// Ignore if same playback state and start position
|
|
118
|
+
if (this.compare(state)) {
|
|
119
|
+
return false;
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
// Ignore state changes that are older
|
|
123
|
+
const originalState = this.current;
|
|
124
|
+
if (state.timestamp < originalState.timestamp) {
|
|
125
|
+
return false;
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
// Ignore state changes that have the same timestamp and the clientId sorts higher.
|
|
129
|
+
if (
|
|
130
|
+
state.timestamp == originalState.timestamp &&
|
|
131
|
+
state.clientId.localeCompare(originalState.clientId) > 0
|
|
132
|
+
) {
|
|
133
|
+
return false;
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
// Update playback state
|
|
137
|
+
this._current = state;
|
|
138
|
+
|
|
139
|
+
// Trigger transport change
|
|
140
|
+
const playerState = this._getMediaPlayerState().playbackState;
|
|
141
|
+
if (
|
|
142
|
+
originalState.playbackState == state.playbackState &&
|
|
143
|
+
playerState != "ended"
|
|
144
|
+
) {
|
|
145
|
+
const event: ITransportStateChangeEvent = {
|
|
146
|
+
name: GroupTransportStateEvents.transportStateChange,
|
|
147
|
+
action: "seekto",
|
|
148
|
+
clientId: state.clientId,
|
|
149
|
+
seekTime: state.startPosition,
|
|
150
|
+
source,
|
|
151
|
+
};
|
|
152
|
+
this.emit(GroupTransportStateEvents.transportStateChange, event);
|
|
153
|
+
} else if (state.playbackState == "playing") {
|
|
154
|
+
const now = this._liveRuntime.getTimestamp();
|
|
155
|
+
const projectedPosition =
|
|
156
|
+
state.startPosition +
|
|
157
|
+
((now - state.timestamp) / 1000) * this._playbackRate.rate;
|
|
158
|
+
const event: ITransportStateChangeEvent = {
|
|
159
|
+
name: GroupTransportStateEvents.transportStateChange,
|
|
160
|
+
action: "play",
|
|
161
|
+
clientId: state.clientId,
|
|
162
|
+
seekTime: projectedPosition,
|
|
163
|
+
source,
|
|
164
|
+
};
|
|
165
|
+
this.emit(GroupTransportStateEvents.transportStateChange, event);
|
|
166
|
+
} else {
|
|
167
|
+
const event: ITransportStateChangeEvent = {
|
|
168
|
+
name: GroupTransportStateEvents.transportStateChange,
|
|
169
|
+
action: "pause",
|
|
170
|
+
clientId: state.clientId,
|
|
171
|
+
seekTime: state.startPosition,
|
|
172
|
+
source,
|
|
173
|
+
};
|
|
174
|
+
this.emit(GroupTransportStateEvents.transportStateChange, event);
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
return true;
|
|
178
|
+
}
|
|
179
|
+
}
|
package/src/internals/consts.ts
CHANGED
|
@@ -1,102 +1,115 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
3
|
-
* Licensed under the Microsoft Live Share SDK License.
|
|
4
|
-
*/
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
* @hidden
|
|
8
|
-
* List of telemetry events. Wrap with a call to transmit() if the event should be transmitted to
|
|
9
|
-
* the telemetry service.
|
|
10
|
-
*/
|
|
11
|
-
export const TelemetryEvents = {
|
|
12
|
-
MediaPlayerSynchronizer: {
|
|
13
|
-
SynchronizationStarted:
|
|
14
|
-
"MediaPlayerSynchronizer:SynchronizationStarted",
|
|
15
|
-
PlayerEvent: "MediaPlayerSynchronizer:PlayerEvent",
|
|
16
|
-
PlayAction: "MediaPlayerSynchronizer:PlayAction",
|
|
17
|
-
PauseAction: "MediaPlayerSynchronizer:PauseAction",
|
|
18
|
-
SeekToAction: "MediaPlayerSynchronizer:SeekToAction",
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
SetTrackCalled: "MediaPlayerSynchronizer:SetTrackCalled",
|
|
40
|
-
SetTrackDataCalled: "MediaPlayerSynchronizer:SetTrackDataCalled",
|
|
41
|
-
},
|
|
42
|
-
MediaSession: {
|
|
43
|
-
PlayAction: transmit("MediaSession:PlayAction"),
|
|
44
|
-
PauseAction: transmit("MediaSession:PauseAction"),
|
|
45
|
-
SeekToAction: transmit("MediaSession:SeekToAction"),
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
"SessionCoordinator:
|
|
64
|
-
),
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
"SessionCoordinator:
|
|
68
|
-
),
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
),
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
3
|
+
* Licensed under the Microsoft Live Share SDK License.
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* @hidden
|
|
8
|
+
* List of telemetry events. Wrap with a call to transmit() if the event should be transmitted to
|
|
9
|
+
* the telemetry service.
|
|
10
|
+
*/
|
|
11
|
+
export const TelemetryEvents = {
|
|
12
|
+
MediaPlayerSynchronizer: {
|
|
13
|
+
SynchronizationStarted:
|
|
14
|
+
"MediaPlayerSynchronizer:SynchronizationStarted",
|
|
15
|
+
PlayerEvent: "MediaPlayerSynchronizer:PlayerEvent",
|
|
16
|
+
PlayAction: "MediaPlayerSynchronizer:PlayAction",
|
|
17
|
+
PauseAction: "MediaPlayerSynchronizer:PauseAction",
|
|
18
|
+
SeekToAction: "MediaPlayerSynchronizer:SeekToAction",
|
|
19
|
+
RateChangeAction: "MediaPlayerSynchronizer:RateChangeAction",
|
|
20
|
+
CatchupAction: "MediaPlayerSynchronizer:CatchupAction",
|
|
21
|
+
SetTrackAction: "MediaPlayerSynchronizer:SetTrackAction",
|
|
22
|
+
DataChangeAction: "MediaPlayerSynchronizer:DataChangeAction",
|
|
23
|
+
UserTappedVideoToPlay: transmit(
|
|
24
|
+
"MediaPlayerSynchronizer:UserTappedVideoToPlay"
|
|
25
|
+
),
|
|
26
|
+
UserTappedVideoToPlayError:
|
|
27
|
+
"MediaPlayerSynchronizer:UserTappedVideoToPlayError",
|
|
28
|
+
PlayerBlockedOperation: transmit(
|
|
29
|
+
"MediaPlayerSynchronizer:PlayerBlockedOperation"
|
|
30
|
+
),
|
|
31
|
+
SeekingPlayerToStartPosition:
|
|
32
|
+
"MediaPlayerSynchronizer:SeekingPlayerToStartPosition",
|
|
33
|
+
BeginSeekCalled: "MediaPlayerSynchronizer:BeginSeekCalled",
|
|
34
|
+
EndSeekCalled: "MediaPlayerSynchronizer:EndSeekCalled",
|
|
35
|
+
PlayCalled: "MediaPlayerSynchronizer:PlayCalled",
|
|
36
|
+
PauseCalled: "MediaPlayerSynchronizer:PauseCalled",
|
|
37
|
+
SeekToCalled: "MediaPlayerSynchronizer:SeekToCalled",
|
|
38
|
+
RateChangeCalled: "MediaSession:RateChangeCalled",
|
|
39
|
+
SetTrackCalled: "MediaPlayerSynchronizer:SetTrackCalled",
|
|
40
|
+
SetTrackDataCalled: "MediaPlayerSynchronizer:SetTrackDataCalled",
|
|
41
|
+
},
|
|
42
|
+
MediaSession: {
|
|
43
|
+
PlayAction: transmit("MediaSession:PlayAction"),
|
|
44
|
+
PauseAction: transmit("MediaSession:PauseAction"),
|
|
45
|
+
SeekToAction: transmit("MediaSession:SeekToAction"),
|
|
46
|
+
RateChangeAction: transmit("MediaSession:RateChangeAction"),
|
|
47
|
+
CatchUpAction: transmit("MediaSession:CatchUpAction"),
|
|
48
|
+
SetTrackAction: transmit("MediaSession:SetTrackAction"),
|
|
49
|
+
DataChangeAction: "MediaSession:DataChangeAction",
|
|
50
|
+
BeginPositionUpdateTimer: "MediaSession:BeginPositionUpdateTimer",
|
|
51
|
+
},
|
|
52
|
+
SessionCoordinator: {
|
|
53
|
+
PlayCalled: transmit("SessionCoordinator:PlayCalled"),
|
|
54
|
+
PauseCalled: transmit("SessionCoordinator:PauseCalled"),
|
|
55
|
+
SeekToCalled: transmit("SessionCoordinator:SeekToCalled"),
|
|
56
|
+
SetPlaybackRateCalled: transmit(
|
|
57
|
+
"SessionCoordinator:SetPlaybackRateCalled"
|
|
58
|
+
),
|
|
59
|
+
SetTrackCalled: transmit("SessionCoordinator:SetTrackCalled"),
|
|
60
|
+
SetTrackDataCalled: "SessionCoordinator:SetTrackDataCalled",
|
|
61
|
+
BeginSuspension: "SessionCoordinator:BeginSuspension",
|
|
62
|
+
BeginSuspensionAndWait: transmit(
|
|
63
|
+
"SessionCoordinator:BeginSuspensionAndWait"
|
|
64
|
+
),
|
|
65
|
+
EndSuspension: "SessionCoordinator:EndSuspension",
|
|
66
|
+
EndSuspensionAndWait: transmit(
|
|
67
|
+
"SessionCoordinator:EndSuspensionAndWait"
|
|
68
|
+
),
|
|
69
|
+
RemoteConnectReceived: "SessionCoordinator:RemoteConnectReceived",
|
|
70
|
+
RemoteSetTrackReceived: transmit(
|
|
71
|
+
"SessionCoordinator:RemoteSetTrackReceived"
|
|
72
|
+
),
|
|
73
|
+
RemoteSetTrackDataReceived: transmit(
|
|
74
|
+
"SessionCoordinator:RemoteSetTrackDataReceived"
|
|
75
|
+
),
|
|
76
|
+
RemotePlayReceived: transmit("SessionCoordinator:RemotePlayReceived"),
|
|
77
|
+
RemotePauseReceived: transmit("SessionCoordinator:RemotePauseReceived"),
|
|
78
|
+
RemoteSeekToReceived: transmit(
|
|
79
|
+
"SessionCoordinator:RemoteSeekToReceived"
|
|
80
|
+
),
|
|
81
|
+
RemoteRateChangeReceived: transmit(
|
|
82
|
+
"SessionCoordinator:RemoteRateChangeReceived"
|
|
83
|
+
),
|
|
84
|
+
PositionUpdateEventError: "SessionCoordinator:PositionUpdateEventError",
|
|
85
|
+
LiveObjectSynchronizerStartError:
|
|
86
|
+
"SessionCoordinator:LiveObjectSynchronizerStartError",
|
|
87
|
+
},
|
|
88
|
+
GroupCoordinator: {
|
|
89
|
+
TrackChanged: "GroupCoordinator:TrackChanged",
|
|
90
|
+
TrackChangeDelayed: "GroupCoordinator:TrackChangeDelayed",
|
|
91
|
+
TrackDataChanged: "GroupCoordinator:TrackDataChanged",
|
|
92
|
+
TrackDataChangeDelayed: "GroupCoordinator:TrackDataChangeDelayed",
|
|
93
|
+
TransportStateChanged: "GroupCoordinator:TransportStateChanged",
|
|
94
|
+
TransportStateChangeDelayed:
|
|
95
|
+
"GroupCoordinator:TransportStateChangeDelayed",
|
|
96
|
+
PlaybackRateChanged: "GroupCoordinator:PlaybackRateChanged",
|
|
97
|
+
PlaybackRateChangedDelayed: "GroupCoordinator:PlaybackRateChanged",
|
|
98
|
+
BeginSoftSuspension: "GroupCoordinator:BeginSoftSuspension",
|
|
99
|
+
CheckingForSyncIssues: "GroupCoordinator:CheckingForSyncIssues",
|
|
100
|
+
TrackOutOfSync: transmit("GroupCoordinator:TrackOutOfSync"),
|
|
101
|
+
TrackDataOutOfSync: transmit("GroupCoordinator:TrackDataOutOfSync"),
|
|
102
|
+
TransportOutOfSync: transmit("GroupCoordinator:TransportOutOfSync"),
|
|
103
|
+
PositionOutOfSync: transmit("GroupCoordinator:PositionOutOfSync"),
|
|
104
|
+
PlaybackRateOutOfSync: transmit(
|
|
105
|
+
"GroupCoordinator:PlaybackRateOutOfSync"
|
|
106
|
+
),
|
|
107
|
+
},
|
|
108
|
+
};
|
|
109
|
+
|
|
110
|
+
/**
|
|
111
|
+
* @hidden
|
|
112
|
+
*/
|
|
113
|
+
function transmit(eventName: string): string {
|
|
114
|
+
return `${eventName}#transmit`;
|
|
115
|
+
}
|