@thestatic-tv/dcl-sdk 2.5.7 → 2.5.9
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/index.d.mts +12 -0
- package/dist/index.d.ts +12 -0
- package/dist/index.js +58 -3
- package/dist/index.mjs +58 -3
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -1000,6 +1000,8 @@ declare class StaticTVClient {
|
|
|
1000
1000
|
private _verificationTimeoutId;
|
|
1001
1001
|
private _videoEventsRegistered;
|
|
1002
1002
|
private _verificationStartTime;
|
|
1003
|
+
private _offlineVideoId;
|
|
1004
|
+
private _offlineTimeoutId;
|
|
1003
1005
|
/**
|
|
1004
1006
|
* Play a video on the configured videoScreen entity.
|
|
1005
1007
|
* Called by Guide UI and Admin Panel.
|
|
@@ -1042,6 +1044,16 @@ declare class StaticTVClient {
|
|
|
1042
1044
|
* Get the currently playing video URL
|
|
1043
1045
|
*/
|
|
1044
1046
|
get currentVideoUrl(): string;
|
|
1047
|
+
/**
|
|
1048
|
+
* Get the video ID currently being connected/verified (for "CONNECTING" indicator)
|
|
1049
|
+
* Returns null if no stream verification is in progress
|
|
1050
|
+
*/
|
|
1051
|
+
get connectingVideoId(): string | null;
|
|
1052
|
+
/**
|
|
1053
|
+
* Get the video ID that was detected as offline (for "OFFLINE" indicator)
|
|
1054
|
+
* Returns null after ~5 seconds (temporary indicator)
|
|
1055
|
+
*/
|
|
1056
|
+
get offlineVideoId(): string | null;
|
|
1045
1057
|
/**
|
|
1046
1058
|
* Internal handler for Guide video selection
|
|
1047
1059
|
* Tries to play the stream and verifies it's working (like M1D-HQ behavior)
|
package/dist/index.d.ts
CHANGED
|
@@ -1000,6 +1000,8 @@ declare class StaticTVClient {
|
|
|
1000
1000
|
private _verificationTimeoutId;
|
|
1001
1001
|
private _videoEventsRegistered;
|
|
1002
1002
|
private _verificationStartTime;
|
|
1003
|
+
private _offlineVideoId;
|
|
1004
|
+
private _offlineTimeoutId;
|
|
1003
1005
|
/**
|
|
1004
1006
|
* Play a video on the configured videoScreen entity.
|
|
1005
1007
|
* Called by Guide UI and Admin Panel.
|
|
@@ -1042,6 +1044,16 @@ declare class StaticTVClient {
|
|
|
1042
1044
|
* Get the currently playing video URL
|
|
1043
1045
|
*/
|
|
1044
1046
|
get currentVideoUrl(): string;
|
|
1047
|
+
/**
|
|
1048
|
+
* Get the video ID currently being connected/verified (for "CONNECTING" indicator)
|
|
1049
|
+
* Returns null if no stream verification is in progress
|
|
1050
|
+
*/
|
|
1051
|
+
get connectingVideoId(): string | null;
|
|
1052
|
+
/**
|
|
1053
|
+
* Get the video ID that was detected as offline (for "OFFLINE" indicator)
|
|
1054
|
+
* Returns null after ~5 seconds (temporary indicator)
|
|
1055
|
+
*/
|
|
1056
|
+
get offlineVideoId(): string | null;
|
|
1045
1057
|
/**
|
|
1046
1058
|
* Internal handler for Guide video selection
|
|
1047
1059
|
* Tries to play the stream and verifies it's working (like M1D-HQ behavior)
|
package/dist/index.js
CHANGED
|
@@ -1341,6 +1341,16 @@ var GuideUIModule = class {
|
|
|
1341
1341
|
const cardW = this.s(UI_DIMENSIONS.guide.content.cardWidth);
|
|
1342
1342
|
const cardH = this.s(UI_DIMENSIONS.guide.content.cardHeight);
|
|
1343
1343
|
const isActive = this._currentVideoId === video.id;
|
|
1344
|
+
const isConnecting = this.client.connectingVideoId === video.id;
|
|
1345
|
+
const isOffline = this.client.offlineVideoId === video.id;
|
|
1346
|
+
let cardBgColor = import_math3.Color4.create(0.15, 0.15, 0.15, 0.8);
|
|
1347
|
+
if (isOffline) {
|
|
1348
|
+
cardBgColor = import_math3.Color4.create(0.4, 0.1, 0.1, 0.5);
|
|
1349
|
+
} else if (isConnecting) {
|
|
1350
|
+
cardBgColor = import_math3.Color4.create(0.4, 0.3, 0, 0.5);
|
|
1351
|
+
} else if (isActive) {
|
|
1352
|
+
cardBgColor = import_math3.Color4.create(0, 0.4, 0, 0.5);
|
|
1353
|
+
}
|
|
1344
1354
|
return import_react_ecs2.default.createElement(import_react_ecs2.UiEntity, {
|
|
1345
1355
|
key: video.id,
|
|
1346
1356
|
uiTransform: {
|
|
@@ -1353,7 +1363,7 @@ var GuideUIModule = class {
|
|
|
1353
1363
|
flexDirection: "column",
|
|
1354
1364
|
margin: 4
|
|
1355
1365
|
},
|
|
1356
|
-
uiBackground: { color:
|
|
1366
|
+
uiBackground: { color: cardBgColor },
|
|
1357
1367
|
children: [
|
|
1358
1368
|
// Main click area
|
|
1359
1369
|
import_react_ecs2.default.createElement(import_react_ecs2.UiEntity, {
|
|
@@ -1373,7 +1383,26 @@ var GuideUIModule = class {
|
|
|
1373
1383
|
color: THEME.colors.white
|
|
1374
1384
|
}
|
|
1375
1385
|
}),
|
|
1376
|
-
|
|
1386
|
+
// Status indicator: OFFLINE > CONNECTING > PLAYING > LIVE
|
|
1387
|
+
...isOffline ? [
|
|
1388
|
+
import_react_ecs2.default.createElement(import_react_ecs2.UiEntity, {
|
|
1389
|
+
key: "offline",
|
|
1390
|
+
uiText: {
|
|
1391
|
+
value: "OFFLINE",
|
|
1392
|
+
fontSize: this.s(UI_DIMENSIONS.guide.content.bodySize),
|
|
1393
|
+
color: THEME.colors.red
|
|
1394
|
+
}
|
|
1395
|
+
})
|
|
1396
|
+
] : isConnecting ? [
|
|
1397
|
+
import_react_ecs2.default.createElement(import_react_ecs2.UiEntity, {
|
|
1398
|
+
key: "connecting",
|
|
1399
|
+
uiText: {
|
|
1400
|
+
value: "CONNECTING...",
|
|
1401
|
+
fontSize: this.s(UI_DIMENSIONS.guide.content.bodySize),
|
|
1402
|
+
color: THEME.colors.yellow
|
|
1403
|
+
}
|
|
1404
|
+
})
|
|
1405
|
+
] : isActive ? [
|
|
1377
1406
|
import_react_ecs2.default.createElement(import_react_ecs2.UiEntity, {
|
|
1378
1407
|
key: "playing",
|
|
1379
1408
|
uiText: {
|
|
@@ -3564,6 +3593,10 @@ var StaticTVClient = class {
|
|
|
3564
3593
|
// DCL timer ID
|
|
3565
3594
|
this._videoEventsRegistered = false;
|
|
3566
3595
|
this._verificationStartTime = 0;
|
|
3596
|
+
// Timestamp when verification started
|
|
3597
|
+
this._offlineVideoId = null;
|
|
3598
|
+
// Temporarily stores ID of offline stream
|
|
3599
|
+
this._offlineTimeoutId = null;
|
|
3567
3600
|
this._featuresReadyPromise = new Promise((resolve) => {
|
|
3568
3601
|
this._featuresReadyResolve = resolve;
|
|
3569
3602
|
});
|
|
@@ -3735,7 +3768,7 @@ var StaticTVClient = class {
|
|
|
3735
3768
|
getConfig() {
|
|
3736
3769
|
return this.config;
|
|
3737
3770
|
}
|
|
3738
|
-
//
|
|
3771
|
+
// Timer to clear offline state
|
|
3739
3772
|
/**
|
|
3740
3773
|
* Play a video on the configured videoScreen entity.
|
|
3741
3774
|
* Called by Guide UI and Admin Panel.
|
|
@@ -3872,6 +3905,14 @@ var StaticTVClient = class {
|
|
|
3872
3905
|
this._clearVerificationTimeout();
|
|
3873
3906
|
if (videoData) {
|
|
3874
3907
|
this.showNotification(`${videoData.name} is offline`, 4e3);
|
|
3908
|
+
this._offlineVideoId = videoData.id;
|
|
3909
|
+
if (this._offlineTimeoutId) {
|
|
3910
|
+
utils.timers.clearTimeout(this._offlineTimeoutId);
|
|
3911
|
+
}
|
|
3912
|
+
this._offlineTimeoutId = utils.timers.setTimeout(() => {
|
|
3913
|
+
this._offlineVideoId = null;
|
|
3914
|
+
this._offlineTimeoutId = null;
|
|
3915
|
+
}, 5e3);
|
|
3875
3916
|
}
|
|
3876
3917
|
this.stopVideo();
|
|
3877
3918
|
}
|
|
@@ -3891,6 +3932,20 @@ var StaticTVClient = class {
|
|
|
3891
3932
|
get currentVideoUrl() {
|
|
3892
3933
|
return this._currentVideoUrl;
|
|
3893
3934
|
}
|
|
3935
|
+
/**
|
|
3936
|
+
* Get the video ID currently being connected/verified (for "CONNECTING" indicator)
|
|
3937
|
+
* Returns null if no stream verification is in progress
|
|
3938
|
+
*/
|
|
3939
|
+
get connectingVideoId() {
|
|
3940
|
+
return this._pendingVideoData && !this._streamVerified ? this._pendingVideoData.id : null;
|
|
3941
|
+
}
|
|
3942
|
+
/**
|
|
3943
|
+
* Get the video ID that was detected as offline (for "OFFLINE" indicator)
|
|
3944
|
+
* Returns null after ~5 seconds (temporary indicator)
|
|
3945
|
+
*/
|
|
3946
|
+
get offlineVideoId() {
|
|
3947
|
+
return this._offlineVideoId;
|
|
3948
|
+
}
|
|
3894
3949
|
/**
|
|
3895
3950
|
* Internal handler for Guide video selection
|
|
3896
3951
|
* Tries to play the stream and verifies it's working (like M1D-HQ behavior)
|
package/dist/index.mjs
CHANGED
|
@@ -1298,6 +1298,16 @@ var GuideUIModule = class {
|
|
|
1298
1298
|
const cardW = this.s(UI_DIMENSIONS.guide.content.cardWidth);
|
|
1299
1299
|
const cardH = this.s(UI_DIMENSIONS.guide.content.cardHeight);
|
|
1300
1300
|
const isActive = this._currentVideoId === video.id;
|
|
1301
|
+
const isConnecting = this.client.connectingVideoId === video.id;
|
|
1302
|
+
const isOffline = this.client.offlineVideoId === video.id;
|
|
1303
|
+
let cardBgColor = Color43.create(0.15, 0.15, 0.15, 0.8);
|
|
1304
|
+
if (isOffline) {
|
|
1305
|
+
cardBgColor = Color43.create(0.4, 0.1, 0.1, 0.5);
|
|
1306
|
+
} else if (isConnecting) {
|
|
1307
|
+
cardBgColor = Color43.create(0.4, 0.3, 0, 0.5);
|
|
1308
|
+
} else if (isActive) {
|
|
1309
|
+
cardBgColor = Color43.create(0, 0.4, 0, 0.5);
|
|
1310
|
+
}
|
|
1301
1311
|
return ReactEcs2.createElement(UiEntity2, {
|
|
1302
1312
|
key: video.id,
|
|
1303
1313
|
uiTransform: {
|
|
@@ -1310,7 +1320,7 @@ var GuideUIModule = class {
|
|
|
1310
1320
|
flexDirection: "column",
|
|
1311
1321
|
margin: 4
|
|
1312
1322
|
},
|
|
1313
|
-
uiBackground: { color:
|
|
1323
|
+
uiBackground: { color: cardBgColor },
|
|
1314
1324
|
children: [
|
|
1315
1325
|
// Main click area
|
|
1316
1326
|
ReactEcs2.createElement(UiEntity2, {
|
|
@@ -1330,7 +1340,26 @@ var GuideUIModule = class {
|
|
|
1330
1340
|
color: THEME.colors.white
|
|
1331
1341
|
}
|
|
1332
1342
|
}),
|
|
1333
|
-
|
|
1343
|
+
// Status indicator: OFFLINE > CONNECTING > PLAYING > LIVE
|
|
1344
|
+
...isOffline ? [
|
|
1345
|
+
ReactEcs2.createElement(UiEntity2, {
|
|
1346
|
+
key: "offline",
|
|
1347
|
+
uiText: {
|
|
1348
|
+
value: "OFFLINE",
|
|
1349
|
+
fontSize: this.s(UI_DIMENSIONS.guide.content.bodySize),
|
|
1350
|
+
color: THEME.colors.red
|
|
1351
|
+
}
|
|
1352
|
+
})
|
|
1353
|
+
] : isConnecting ? [
|
|
1354
|
+
ReactEcs2.createElement(UiEntity2, {
|
|
1355
|
+
key: "connecting",
|
|
1356
|
+
uiText: {
|
|
1357
|
+
value: "CONNECTING...",
|
|
1358
|
+
fontSize: this.s(UI_DIMENSIONS.guide.content.bodySize),
|
|
1359
|
+
color: THEME.colors.yellow
|
|
1360
|
+
}
|
|
1361
|
+
})
|
|
1362
|
+
] : isActive ? [
|
|
1334
1363
|
ReactEcs2.createElement(UiEntity2, {
|
|
1335
1364
|
key: "playing",
|
|
1336
1365
|
uiText: {
|
|
@@ -3521,6 +3550,10 @@ var StaticTVClient = class {
|
|
|
3521
3550
|
// DCL timer ID
|
|
3522
3551
|
this._videoEventsRegistered = false;
|
|
3523
3552
|
this._verificationStartTime = 0;
|
|
3553
|
+
// Timestamp when verification started
|
|
3554
|
+
this._offlineVideoId = null;
|
|
3555
|
+
// Temporarily stores ID of offline stream
|
|
3556
|
+
this._offlineTimeoutId = null;
|
|
3524
3557
|
this._featuresReadyPromise = new Promise((resolve) => {
|
|
3525
3558
|
this._featuresReadyResolve = resolve;
|
|
3526
3559
|
});
|
|
@@ -3692,7 +3725,7 @@ var StaticTVClient = class {
|
|
|
3692
3725
|
getConfig() {
|
|
3693
3726
|
return this.config;
|
|
3694
3727
|
}
|
|
3695
|
-
//
|
|
3728
|
+
// Timer to clear offline state
|
|
3696
3729
|
/**
|
|
3697
3730
|
* Play a video on the configured videoScreen entity.
|
|
3698
3731
|
* Called by Guide UI and Admin Panel.
|
|
@@ -3829,6 +3862,14 @@ var StaticTVClient = class {
|
|
|
3829
3862
|
this._clearVerificationTimeout();
|
|
3830
3863
|
if (videoData) {
|
|
3831
3864
|
this.showNotification(`${videoData.name} is offline`, 4e3);
|
|
3865
|
+
this._offlineVideoId = videoData.id;
|
|
3866
|
+
if (this._offlineTimeoutId) {
|
|
3867
|
+
utils.timers.clearTimeout(this._offlineTimeoutId);
|
|
3868
|
+
}
|
|
3869
|
+
this._offlineTimeoutId = utils.timers.setTimeout(() => {
|
|
3870
|
+
this._offlineVideoId = null;
|
|
3871
|
+
this._offlineTimeoutId = null;
|
|
3872
|
+
}, 5e3);
|
|
3832
3873
|
}
|
|
3833
3874
|
this.stopVideo();
|
|
3834
3875
|
}
|
|
@@ -3848,6 +3889,20 @@ var StaticTVClient = class {
|
|
|
3848
3889
|
get currentVideoUrl() {
|
|
3849
3890
|
return this._currentVideoUrl;
|
|
3850
3891
|
}
|
|
3892
|
+
/**
|
|
3893
|
+
* Get the video ID currently being connected/verified (for "CONNECTING" indicator)
|
|
3894
|
+
* Returns null if no stream verification is in progress
|
|
3895
|
+
*/
|
|
3896
|
+
get connectingVideoId() {
|
|
3897
|
+
return this._pendingVideoData && !this._streamVerified ? this._pendingVideoData.id : null;
|
|
3898
|
+
}
|
|
3899
|
+
/**
|
|
3900
|
+
* Get the video ID that was detected as offline (for "OFFLINE" indicator)
|
|
3901
|
+
* Returns null after ~5 seconds (temporary indicator)
|
|
3902
|
+
*/
|
|
3903
|
+
get offlineVideoId() {
|
|
3904
|
+
return this._offlineVideoId;
|
|
3905
|
+
}
|
|
3851
3906
|
/**
|
|
3852
3907
|
* Internal handler for Guide video selection
|
|
3853
3908
|
* Tries to play the stream and verifies it's working (like M1D-HQ behavior)
|
package/package.json
CHANGED