@titan-os/sdk 1.10.2 → 1.11.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/dist/cjs/sdk.js +1 -1
- package/dist/esm/sdk.js +76 -44
- package/dist/types/sdk.d.ts +37 -0
- package/dist/umd/sdk.js +1 -1
- package/package.json +1 -1
package/dist/esm/sdk.js
CHANGED
|
@@ -641,7 +641,7 @@ const matchBrandFromUserAgent = (userAgent, regex) => {
|
|
|
641
641
|
const match = userAgent.match(regex);
|
|
642
642
|
return match ? match[1] : null;
|
|
643
643
|
};
|
|
644
|
-
const VERSION = "1.
|
|
644
|
+
const VERSION = "1.11.0";
|
|
645
645
|
var ErrorCode = /* @__PURE__ */ ((ErrorCode2) => {
|
|
646
646
|
ErrorCode2["NOT_INITIALIZED"] = "NOT_INITIALIZED";
|
|
647
647
|
ErrorCode2["NOT_SUPPORTED"] = "NOT_SUPPORTED";
|
|
@@ -3257,6 +3257,45 @@ class BrowserAccessibilityService {
|
|
|
3257
3257
|
log$t.info("TM settings updated:", this.tmSettings);
|
|
3258
3258
|
}
|
|
3259
3259
|
}
|
|
3260
|
+
const BASE_KEY_CODES = {
|
|
3261
|
+
BACK: { key: "Backspace", keyCode: 8 },
|
|
3262
|
+
ENTER: { key: "Enter", keyCode: 13 },
|
|
3263
|
+
LEFT: { key: "ArrowLeft", keyCode: 37 },
|
|
3264
|
+
DOWN: { key: "ArrowDown", keyCode: 40 },
|
|
3265
|
+
RIGHT: { key: "ArrowRight", keyCode: 39 },
|
|
3266
|
+
UP: { key: "ArrowUp", keyCode: 38 },
|
|
3267
|
+
DIGIT_0: { key: "Numpad0", keyCode: 48 },
|
|
3268
|
+
DIGIT_1: { key: "Numpad1", keyCode: 49 },
|
|
3269
|
+
DIGIT_2: { key: "Numpad2", keyCode: 50 },
|
|
3270
|
+
DIGIT_3: { key: "Numpad3", keyCode: 51 },
|
|
3271
|
+
DIGIT_4: { key: "Numpad4", keyCode: 52 },
|
|
3272
|
+
DIGIT_5: { key: "Numpad5", keyCode: 53 },
|
|
3273
|
+
DIGIT_6: { key: "Numpad6", keyCode: 54 },
|
|
3274
|
+
DIGIT_7: { key: "Numpad7", keyCode: 55 },
|
|
3275
|
+
DIGIT_8: { key: "Numpad8", keyCode: 56 },
|
|
3276
|
+
DIGIT_9: { key: "Numpad9", keyCode: 57 },
|
|
3277
|
+
RED: { key: "ColorF0Red", keyCode: 403 },
|
|
3278
|
+
GREEN: { key: "ColorF1Green", keyCode: 404 },
|
|
3279
|
+
YELLOW: { key: "ColorF2Yellow", keyCode: 405 },
|
|
3280
|
+
BLUE: { key: "ColorF3Blue", keyCode: 406 },
|
|
3281
|
+
PLAY: { key: "MediaPlay", keyCode: 415 },
|
|
3282
|
+
PAUSE: { key: "MediaPause", keyCode: 19 },
|
|
3283
|
+
PLAY_PAUSE: { key: "MediaPlayPause", keyCode: 179 },
|
|
3284
|
+
STOP: { key: "MediaStop", keyCode: 413 },
|
|
3285
|
+
FAST_FWD: { key: "MediaTrackNext", keyCode: 417 },
|
|
3286
|
+
REWIND: { key: "MediaRewind", keyCode: 412 },
|
|
3287
|
+
CHANNEL_UP: { key: "PageUp", keyCode: 33 },
|
|
3288
|
+
CHANNEL_DOWN: { key: "PageDown", keyCode: 34 }
|
|
3289
|
+
};
|
|
3290
|
+
const TPV_KEY_CODES = {
|
|
3291
|
+
...BASE_KEY_CODES
|
|
3292
|
+
// BACK keyCode: 8 (default)
|
|
3293
|
+
};
|
|
3294
|
+
const VESTEL_KEY_CODES = {
|
|
3295
|
+
...BASE_KEY_CODES,
|
|
3296
|
+
BACK: { key: "Backspace", keyCode: 461 }
|
|
3297
|
+
};
|
|
3298
|
+
const BROWSER_KEY_CODES = TPV_KEY_CODES;
|
|
3260
3299
|
class BasePlatform {
|
|
3261
3300
|
constructor(config) {
|
|
3262
3301
|
__publicField(this, "config");
|
|
@@ -3402,6 +3441,9 @@ class BrowserDeviceInfoService {
|
|
|
3402
3441
|
throw error;
|
|
3403
3442
|
}
|
|
3404
3443
|
}
|
|
3444
|
+
getKeyCodes() {
|
|
3445
|
+
return BROWSER_KEY_CODES;
|
|
3446
|
+
}
|
|
3405
3447
|
}
|
|
3406
3448
|
const log$r = getLogger("BrowserAppControlService");
|
|
3407
3449
|
class BrowserAppControlService {
|
|
@@ -3528,7 +3570,8 @@ class BrowserSDK {
|
|
|
3528
3570
|
__publicField(this, "appControlService");
|
|
3529
3571
|
__publicField(this, "deviceInfo", {
|
|
3530
3572
|
getDeviceInfo: () => this.deviceInfoService.getDeviceInfo(),
|
|
3531
|
-
getCapabilities: () => this.deviceInfoService.getCapabilities()
|
|
3573
|
+
getCapabilities: () => this.deviceInfoService.getCapabilities(),
|
|
3574
|
+
getKeyCodes: () => this.deviceInfoService.getKeyCodes()
|
|
3532
3575
|
});
|
|
3533
3576
|
__publicField(this, "accessibility", {
|
|
3534
3577
|
enableReader: (config) => this.accessibilityService.enableReader(config),
|
|
@@ -3746,27 +3789,6 @@ function detectStreamingSupport() {
|
|
|
3746
3789
|
supportMPEG_DASH: "unknown"
|
|
3747
3790
|
};
|
|
3748
3791
|
}
|
|
3749
|
-
function detect3DUHDSupport() {
|
|
3750
|
-
try {
|
|
3751
|
-
const sysinfoElement = document.createElement("object");
|
|
3752
|
-
sysinfoElement.style.display = "none";
|
|
3753
|
-
sysinfoElement.setAttribute("id", "sysinfo");
|
|
3754
|
-
sysinfoElement.setAttribute("type", "systeminfoobject");
|
|
3755
|
-
document.body.appendChild(sysinfoElement);
|
|
3756
|
-
const sysinfo = sysinfoElement;
|
|
3757
|
-
const result = {
|
|
3758
|
-
support3d: Boolean(sysinfo.has3D),
|
|
3759
|
-
supportUHD: sysinfo.panelinfo?.toLowerCase() === "3840x2160"
|
|
3760
|
-
};
|
|
3761
|
-
return { ...result, supportFHD: true };
|
|
3762
|
-
} catch (error) {
|
|
3763
|
-
return {
|
|
3764
|
-
support3d: false,
|
|
3765
|
-
supportUHD: false,
|
|
3766
|
-
supportFHD: true
|
|
3767
|
-
};
|
|
3768
|
-
}
|
|
3769
|
-
}
|
|
3770
3792
|
function detectOIPFSupport() {
|
|
3771
3793
|
try {
|
|
3772
3794
|
if (oipfWindow.get("oipfObjectFactory") !== void 0) {
|
|
@@ -4118,15 +4140,7 @@ class BaseBridge {
|
|
|
4118
4140
|
callback(data);
|
|
4119
4141
|
};
|
|
4120
4142
|
this.eventHandlers.get(type)?.add(handler);
|
|
4121
|
-
window.addEventListener(
|
|
4122
|
-
"message",
|
|
4123
|
-
(event) => handler(event.data.data)
|
|
4124
|
-
);
|
|
4125
4143
|
return () => {
|
|
4126
|
-
window.removeEventListener(
|
|
4127
|
-
"message",
|
|
4128
|
-
(event) => handler(event.data?.data)
|
|
4129
|
-
);
|
|
4130
4144
|
this.eventHandlers.get(type)?.delete(handler);
|
|
4131
4145
|
};
|
|
4132
4146
|
}
|
|
@@ -5446,6 +5460,9 @@ class TPVLegacyDeviceInfoService {
|
|
|
5446
5460
|
}
|
|
5447
5461
|
return this.info.Capability;
|
|
5448
5462
|
}
|
|
5463
|
+
getKeyCodes() {
|
|
5464
|
+
return TPV_KEY_CODES;
|
|
5465
|
+
}
|
|
5449
5466
|
}
|
|
5450
5467
|
class TPVLegacySDK {
|
|
5451
5468
|
constructor(options) {
|
|
@@ -5454,7 +5471,8 @@ class TPVLegacySDK {
|
|
|
5454
5471
|
__publicField(this, "appControlService");
|
|
5455
5472
|
__publicField(this, "deviceInfo", {
|
|
5456
5473
|
getDeviceInfo: () => this.deviceInfoService.getDeviceInfo(),
|
|
5457
|
-
getCapabilities: () => this.deviceInfoService.getCapabilities()
|
|
5474
|
+
getCapabilities: () => this.deviceInfoService.getCapabilities(),
|
|
5475
|
+
getKeyCodes: () => this.deviceInfoService.getKeyCodes()
|
|
5458
5476
|
});
|
|
5459
5477
|
__publicField(this, "accessibility", {
|
|
5460
5478
|
enableReader: (config) => this.accessibilityService.enableReader(config),
|
|
@@ -5491,7 +5509,6 @@ class TPVLegacySDK {
|
|
|
5491
5509
|
}
|
|
5492
5510
|
}
|
|
5493
5511
|
function getCapabilities(_platform) {
|
|
5494
|
-
const uhdSupport = detect3DUHDSupport();
|
|
5495
5512
|
const browserCapabilities = detectBrowserCapabilities();
|
|
5496
5513
|
const streamingSupport = detectStreamingSupport();
|
|
5497
5514
|
const drmMethodSupport = detectDRMMethodSupport();
|
|
@@ -5536,10 +5553,10 @@ function getCapabilities(_platform) {
|
|
|
5536
5553
|
capabilities.supportHDR_DV = false;
|
|
5537
5554
|
capabilities.supportDolbyAtmos = false;
|
|
5538
5555
|
capabilities.supportHDR_HDR10Plus = false;
|
|
5556
|
+
capabilities.supportUHD = false;
|
|
5539
5557
|
}
|
|
5540
5558
|
return {
|
|
5541
5559
|
...capabilities,
|
|
5542
|
-
...uhdSupport,
|
|
5543
5560
|
...browserCapabilities,
|
|
5544
5561
|
...streamingSupport,
|
|
5545
5562
|
...drmMethodSupport,
|
|
@@ -6075,6 +6092,9 @@ class VestelLegacyDeviceInfoService extends BaseDeviceInfoService {
|
|
|
6075
6092
|
getLogger() {
|
|
6076
6093
|
return log$h;
|
|
6077
6094
|
}
|
|
6095
|
+
getKeyCodes() {
|
|
6096
|
+
return VESTEL_KEY_CODES;
|
|
6097
|
+
}
|
|
6078
6098
|
}
|
|
6079
6099
|
const log$g = getLogger("VestelLegacyAccessibilityService");
|
|
6080
6100
|
class VestelLegacyAccessibilityService {
|
|
@@ -6153,7 +6173,8 @@ class VestelLegacySDK {
|
|
|
6153
6173
|
__publicField(this, "loggingService");
|
|
6154
6174
|
__publicField(this, "deviceInfo", {
|
|
6155
6175
|
getDeviceInfo: () => this.deviceInfoService.getDeviceInfo(),
|
|
6156
|
-
getCapabilities: () => this.deviceInfoService.getCapabilities()
|
|
6176
|
+
getCapabilities: () => this.deviceInfoService.getCapabilities(),
|
|
6177
|
+
getKeyCodes: () => this.deviceInfoService.getKeyCodes()
|
|
6157
6178
|
});
|
|
6158
6179
|
__publicField(this, "accessibility", {
|
|
6159
6180
|
enableReader: (config) => this.accessibilityService.enableReader(config),
|
|
@@ -6278,14 +6299,15 @@ class AnalyticsService {
|
|
|
6278
6299
|
}
|
|
6279
6300
|
}
|
|
6280
6301
|
const log$c = getLogger("WrapperUtils");
|
|
6281
|
-
function createDeviceInfoWrapper(initProvider, onDeviceInfoFetched) {
|
|
6302
|
+
function createDeviceInfoWrapper(initProvider, keyCodes, onDeviceInfoFetched) {
|
|
6282
6303
|
return {
|
|
6283
6304
|
getDeviceInfo: async () => {
|
|
6284
6305
|
const instance = await initProvider();
|
|
6285
6306
|
const deviceInfo = await instance.deviceInfo.getDeviceInfo();
|
|
6286
6307
|
onDeviceInfoFetched?.(deviceInfo);
|
|
6287
6308
|
return deviceInfo;
|
|
6288
|
-
}
|
|
6309
|
+
},
|
|
6310
|
+
getKeyCodes: () => keyCodes
|
|
6289
6311
|
};
|
|
6290
6312
|
}
|
|
6291
6313
|
function createAccessibilityWrapper(initProvider) {
|
|
@@ -6770,6 +6792,9 @@ class TPVDeviceInfoService {
|
|
|
6770
6792
|
}
|
|
6771
6793
|
return this.info.Capability;
|
|
6772
6794
|
}
|
|
6795
|
+
getKeyCodes() {
|
|
6796
|
+
return TPV_KEY_CODES;
|
|
6797
|
+
}
|
|
6773
6798
|
}
|
|
6774
6799
|
const log$8 = getLogger("TPVAppControlService");
|
|
6775
6800
|
class TPVAppControlService {
|
|
@@ -6800,7 +6825,8 @@ class BaseSDK {
|
|
|
6800
6825
|
__publicField(this, "appControlService");
|
|
6801
6826
|
__publicField(this, "deviceInfo", {
|
|
6802
6827
|
getDeviceInfo: () => this.deviceInfoService.getDeviceInfo(),
|
|
6803
|
-
getCapabilities: () => this.deviceInfoService.getCapabilities()
|
|
6828
|
+
getCapabilities: () => this.deviceInfoService.getCapabilities(),
|
|
6829
|
+
getKeyCodes: () => this.deviceInfoService.getKeyCodes()
|
|
6804
6830
|
});
|
|
6805
6831
|
__publicField(this, "accessibility", {
|
|
6806
6832
|
enableReader: (config) => this.accessibilityService.enableReader(config),
|
|
@@ -6888,10 +6914,9 @@ class VestelBridge extends EnhancedBaseBridge {
|
|
|
6888
6914
|
if (config?.gatewayUrl) {
|
|
6889
6915
|
super({ gatewayUrl: config.gatewayUrl });
|
|
6890
6916
|
} else {
|
|
6891
|
-
const
|
|
6892
|
-
const isDevEnv = window.location.hostname.startsWith("dev");
|
|
6917
|
+
const isDevEnv = /dev\d{2}\./.test(window.location.hostname);
|
|
6893
6918
|
super({
|
|
6894
|
-
gatewayUrl: `http://localhost:4660/gateway/${
|
|
6919
|
+
gatewayUrl: `http://localhost:4660/gateway/${isDevEnv ? "dev01" : "index"}.html`
|
|
6895
6920
|
});
|
|
6896
6921
|
}
|
|
6897
6922
|
}
|
|
@@ -7360,6 +7385,9 @@ class VestelDeviceInfoService {
|
|
|
7360
7385
|
}
|
|
7361
7386
|
return this.info.Capability;
|
|
7362
7387
|
}
|
|
7388
|
+
getKeyCodes() {
|
|
7389
|
+
return VESTEL_KEY_CODES;
|
|
7390
|
+
}
|
|
7363
7391
|
}
|
|
7364
7392
|
const log$2 = getLogger("VestelAppControlService");
|
|
7365
7393
|
class VestelAppControlService {
|
|
@@ -7524,9 +7552,13 @@ const getTitanSDK = (options) => {
|
|
|
7524
7552
|
const sdkWrapper = {
|
|
7525
7553
|
VERSION,
|
|
7526
7554
|
isReady: initPromise,
|
|
7527
|
-
deviceInfo: createDeviceInfoWrapper(
|
|
7528
|
-
|
|
7529
|
-
|
|
7555
|
+
deviceInfo: createDeviceInfoWrapper(
|
|
7556
|
+
ensureInitialized,
|
|
7557
|
+
sdkInstance.deviceInfo.getKeyCodes(),
|
|
7558
|
+
(info) => {
|
|
7559
|
+
cachedDeviceInfo = info;
|
|
7560
|
+
}
|
|
7561
|
+
),
|
|
7530
7562
|
accessibility: createAccessibilityWrapper(ensureInitialized),
|
|
7531
7563
|
apps: createAppsWrapper(ensureInitialized)
|
|
7532
7564
|
};
|
package/dist/types/sdk.d.ts
CHANGED
|
@@ -70,6 +70,42 @@ export declare const getDeviceInfo: () => Promise<DeviceInfo>;
|
|
|
70
70
|
|
|
71
71
|
export declare const getTitanSDK: (options?: SDKOptions) => TitanSDK;
|
|
72
72
|
|
|
73
|
+
declare interface KeyCodeEntry {
|
|
74
|
+
key: string;
|
|
75
|
+
keyCode: number;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
declare interface KeyCodesMap {
|
|
79
|
+
BACK: KeyCodeEntry;
|
|
80
|
+
ENTER: KeyCodeEntry;
|
|
81
|
+
LEFT: KeyCodeEntry;
|
|
82
|
+
DOWN: KeyCodeEntry;
|
|
83
|
+
RIGHT: KeyCodeEntry;
|
|
84
|
+
UP: KeyCodeEntry;
|
|
85
|
+
DIGIT_0: KeyCodeEntry;
|
|
86
|
+
DIGIT_1: KeyCodeEntry;
|
|
87
|
+
DIGIT_2: KeyCodeEntry;
|
|
88
|
+
DIGIT_3: KeyCodeEntry;
|
|
89
|
+
DIGIT_4: KeyCodeEntry;
|
|
90
|
+
DIGIT_5: KeyCodeEntry;
|
|
91
|
+
DIGIT_6: KeyCodeEntry;
|
|
92
|
+
DIGIT_7: KeyCodeEntry;
|
|
93
|
+
DIGIT_8: KeyCodeEntry;
|
|
94
|
+
DIGIT_9: KeyCodeEntry;
|
|
95
|
+
RED: KeyCodeEntry;
|
|
96
|
+
GREEN: KeyCodeEntry;
|
|
97
|
+
YELLOW: KeyCodeEntry;
|
|
98
|
+
BLUE: KeyCodeEntry;
|
|
99
|
+
PLAY: KeyCodeEntry;
|
|
100
|
+
PAUSE: KeyCodeEntry;
|
|
101
|
+
PLAY_PAUSE: KeyCodeEntry;
|
|
102
|
+
STOP: KeyCodeEntry;
|
|
103
|
+
FAST_FWD: KeyCodeEntry;
|
|
104
|
+
REWIND: KeyCodeEntry;
|
|
105
|
+
CHANNEL_UP: KeyCodeEntry;
|
|
106
|
+
CHANNEL_DOWN: KeyCodeEntry;
|
|
107
|
+
}
|
|
108
|
+
|
|
73
109
|
/**
|
|
74
110
|
* Platform detection types
|
|
75
111
|
*/
|
|
@@ -154,6 +190,7 @@ export declare interface TitanSDK {
|
|
|
154
190
|
isReady: Promise<boolean>;
|
|
155
191
|
deviceInfo: {
|
|
156
192
|
getDeviceInfo(): Promise<DeviceInfo>;
|
|
193
|
+
getKeyCodes(): KeyCodesMap;
|
|
157
194
|
};
|
|
158
195
|
accessibility: PublicAccessibilitySettings;
|
|
159
196
|
apps: {
|