senza-sdk 4.4.3 → 4.4.4
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/dist/bundle.js +1 -1
- package/dist/implementation.bundle.js +1 -1
- package/package.json +1 -1
- package/src/api.js +16 -2
- package/src/implementation/api.js +7 -5
- package/src/implementation/deviceManager.js +0 -141
- package/src/implementation/displayManager.js +181 -0
- package/src/implementation/edidParser.js +125 -0
- package/src/implementation/remotePlayer.js +5 -2
- package/src/interface/api.js +1 -0
- package/src/interface/deviceManager.js +0 -33
- package/src/interface/displayManager.js +126 -0
- package/src/interface/version.js +1 -1
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @event DisplayManager#displayinfochanged
|
|
3
|
+
* @description Fired when the display information changes.
|
|
4
|
+
* @property {DisplayInfoChanged} [detail.displayInfo] - the updated display information.
|
|
5
|
+
* @example
|
|
6
|
+
* @private
|
|
7
|
+
* displayManager.addEventListener("displayinfochanged", (e) => {
|
|
8
|
+
* console.info("Display information changed:", e.detail.displayInfo);
|
|
9
|
+
* });
|
|
10
|
+
*/
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* @typedef {Object} DisplayInfoChanged
|
|
14
|
+
* @property {DisplayConnectionStatus | undefined} connection Display connection status.
|
|
15
|
+
* @property {DisplaySelectedStatus | undefined} selected Display selected status.
|
|
16
|
+
* @property {DisplayResolution | undefined} resolution Display resolution information.
|
|
17
|
+
* @property {number | undefined} framerate Display frame rate.
|
|
18
|
+
* @property {string | undefined} security Display HDCP / security level.
|
|
19
|
+
* @property {string | undefined} make Display vendor (make) information.
|
|
20
|
+
* @property {string | undefined} model Display model information.
|
|
21
|
+
* @private
|
|
22
|
+
*/
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* DisplayManager exposes information about the connected display / sink device.
|
|
26
|
+
* It allows querying several negotiated HDMI parameters and (for a subset) receiving change notifications.
|
|
27
|
+
* @private
|
|
28
|
+
* @fires displayinfochanged
|
|
29
|
+
*/
|
|
30
|
+
export class DisplayManager extends EventTarget {
|
|
31
|
+
/**
|
|
32
|
+
* @typedef {Object} DisplayConnectionStatus
|
|
33
|
+
* @property {string} CONNECTED Display is connected and communication established.
|
|
34
|
+
* @property {string} DISCONNECTED Display cable removed / not detected.
|
|
35
|
+
* @property {string} UNKNOWN The platform cannot determine (e.g. unsupported).
|
|
36
|
+
* @private
|
|
37
|
+
*/
|
|
38
|
+
DisplayConnectionStatus = Object.freeze({
|
|
39
|
+
CONNECTED: "connected",
|
|
40
|
+
DISCONNECTED: "disconnected",
|
|
41
|
+
UNKNOWN: "unknown"
|
|
42
|
+
});
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* @typedef {Object} DisplaySelectedStatus
|
|
46
|
+
* @property {string} ACTIVE The display input where the device is connected is currently active.
|
|
47
|
+
* @property {string} INACTIVE The device is connected but another source is active / TV in standby.
|
|
48
|
+
* @property {string} UNKNOWN The platform cannot determine (e.g. unsupported).
|
|
49
|
+
* @private
|
|
50
|
+
*/
|
|
51
|
+
DisplaySelectedStatus = Object.freeze({
|
|
52
|
+
ACTIVE: "active",
|
|
53
|
+
INACTIVE: "inactive",
|
|
54
|
+
UNKNOWN: "unknown"
|
|
55
|
+
});
|
|
56
|
+
|
|
57
|
+
/**
|
|
58
|
+
* @typedef {Object} DisplayResolution
|
|
59
|
+
* @property {number} width Negotiated active horizontal pixels
|
|
60
|
+
* @property {number} height Negotiated active vertical pixels
|
|
61
|
+
* @property {boolean} interlace True if the negotiated mode is interlaced
|
|
62
|
+
* @private
|
|
63
|
+
*/
|
|
64
|
+
|
|
65
|
+
/**
|
|
66
|
+
* Display connection status.
|
|
67
|
+
* @property {DisplayConnectionStatus} connection
|
|
68
|
+
*/
|
|
69
|
+
connection = this.DisplayConnectionStatus.DISCONNECTED;
|
|
70
|
+
|
|
71
|
+
/**
|
|
72
|
+
* Whether the display input this device is connected to is currently active.
|
|
73
|
+
* undefined when the display is not connected.
|
|
74
|
+
* @property {DisplaySelectedStatus} selected
|
|
75
|
+
*/
|
|
76
|
+
selected;
|
|
77
|
+
|
|
78
|
+
/**
|
|
79
|
+
* Negotiated resolution information.
|
|
80
|
+
* undefined when the display is not connected.
|
|
81
|
+
* @property {DisplayResolution} resolution
|
|
82
|
+
*/
|
|
83
|
+
resolution;
|
|
84
|
+
|
|
85
|
+
/**
|
|
86
|
+
* Negotiated frame rate (frames per second).
|
|
87
|
+
* undefined when the display is not connected.
|
|
88
|
+
* @property {number} framerate
|
|
89
|
+
*/
|
|
90
|
+
framerate;
|
|
91
|
+
|
|
92
|
+
/**
|
|
93
|
+
* Negotiated HDCP / security level.
|
|
94
|
+
* undefined when the display is not connected.
|
|
95
|
+
* @property {string} security
|
|
96
|
+
*/
|
|
97
|
+
security;
|
|
98
|
+
|
|
99
|
+
/**
|
|
100
|
+
* Vendor (make) information parsed from EDID.
|
|
101
|
+
* undefined when the display is not connected.
|
|
102
|
+
* @property {string} make
|
|
103
|
+
*/
|
|
104
|
+
make;
|
|
105
|
+
|
|
106
|
+
/**
|
|
107
|
+
* Model information parsed from EDID.
|
|
108
|
+
* undefined when the display is not connected.
|
|
109
|
+
* @property {string} model
|
|
110
|
+
*/
|
|
111
|
+
model;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
|
|
115
|
+
/**
|
|
116
|
+
* @module
|
|
117
|
+
* @type {DisplayManager}
|
|
118
|
+
* @private
|
|
119
|
+
* @example
|
|
120
|
+
* import { displayManager } from "senza-sdk";
|
|
121
|
+
* const connection = await displayManager.connection;
|
|
122
|
+
* console.info(connection);
|
|
123
|
+
*
|
|
124
|
+
* @return {DisplayManager} pointer to the DisplayManager singleton
|
|
125
|
+
*/
|
|
126
|
+
"needed for the module doc comment to be recognized";
|
package/src/interface/version.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const version = "4.4.
|
|
1
|
+
export const version = "4.4.4";
|