-
Notifications
You must be signed in to change notification settings - Fork 5
/
test-emitter.js
41 lines (34 loc) · 1.13 KB
/
test-emitter.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
const winPlayer = require("./emitter").default;
async function main() {
const playerManager = await winPlayer();
if (playerManager) {
playerManager.on("SystemSessionChanged", (aumid) => {
console.log("manager event: SystemSessionChanged");
console.log("system session:", aumid);
});
playerManager.on("ActiveSessionChanged", (aumid) => {
console.log("manager event: ActiveSessionChanged");
console.log("active session:", aumid);
});
playerManager.on("SessionsChanged", (keys) => {
console.log("manager event: SessionsChanged");
console.log("tracked sessions:", keys);
});
playerManager.on("MediaPropertiesChanged", (status) => {
console.log("player event: MediaPropertiesChanged");
console.log("status:", status);
});
playerManager.on("PlaybackInfoChanged", (status) => {
console.log("player event: PlaybackInfoChanged");
console.log("status:", status);
});
playerManager.on("TimelinePropertiesChanged", (position) => {
console.log("player event: TimelinePropertiesChanged");
console.log("position:", position);
});
} else {
console.error("whoops try again");
process.exit(1);
}
}
main();