@thestatic-tv/dcl-sdk 2.5.3 → 2.5.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/index.d.mts +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +8 -3
- package/dist/index.mjs +8 -3
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -999,6 +999,7 @@ declare class StaticTVClient {
|
|
|
999
999
|
private _streamVerified;
|
|
1000
1000
|
private _verificationTimeoutId;
|
|
1001
1001
|
private _videoEventsRegistered;
|
|
1002
|
+
private _verificationStartTime;
|
|
1002
1003
|
/**
|
|
1003
1004
|
* Play a video on the configured videoScreen entity.
|
|
1004
1005
|
* Called by Guide UI and Admin Panel.
|
package/dist/index.d.ts
CHANGED
|
@@ -999,6 +999,7 @@ declare class StaticTVClient {
|
|
|
999
999
|
private _streamVerified;
|
|
1000
1000
|
private _verificationTimeoutId;
|
|
1001
1001
|
private _videoEventsRegistered;
|
|
1002
|
+
private _verificationStartTime;
|
|
1002
1003
|
/**
|
|
1003
1004
|
* Play a video on the configured videoScreen entity.
|
|
1004
1005
|
* Called by Guide UI and Admin Panel.
|
package/dist/index.js
CHANGED
|
@@ -3563,6 +3563,7 @@ var StaticTVClient = class {
|
|
|
3563
3563
|
this._verificationTimeoutId = null;
|
|
3564
3564
|
// DCL timer ID
|
|
3565
3565
|
this._videoEventsRegistered = false;
|
|
3566
|
+
this._verificationStartTime = 0;
|
|
3566
3567
|
this._featuresReadyPromise = new Promise((resolve) => {
|
|
3567
3568
|
this._featuresReadyResolve = resolve;
|
|
3568
3569
|
});
|
|
@@ -3727,6 +3728,7 @@ var StaticTVClient = class {
|
|
|
3727
3728
|
getConfig() {
|
|
3728
3729
|
return this.config;
|
|
3729
3730
|
}
|
|
3731
|
+
// Timestamp when verification started
|
|
3730
3732
|
/**
|
|
3731
3733
|
* Play a video on the configured videoScreen entity.
|
|
3732
3734
|
* Called by Guide UI and Admin Panel.
|
|
@@ -3819,11 +3821,13 @@ var StaticTVClient = class {
|
|
|
3819
3821
|
if (screen === void 0) return;
|
|
3820
3822
|
this._videoEventsRegistered = true;
|
|
3821
3823
|
import_ecs3.videoEventsSystem.registerVideoEventsEntity(screen, (videoEvent) => {
|
|
3822
|
-
if (videoEvent.state === import_ecs3.VideoState.
|
|
3823
|
-
|
|
3824
|
+
if (videoEvent.state === import_ecs3.VideoState.VS_PLAYING) {
|
|
3825
|
+
const timeSinceStart = Date.now() - this._verificationStartTime;
|
|
3826
|
+
const MIN_VERIFICATION_DELAY = 2e3;
|
|
3827
|
+
if (this._pendingVideoData && !this._streamVerified && timeSinceStart >= MIN_VERIFICATION_DELAY) {
|
|
3824
3828
|
this._streamVerified = true;
|
|
3825
3829
|
this._clearVerificationTimeout();
|
|
3826
|
-
this.log(`Stream verified: ${this._pendingVideoData.name}`);
|
|
3830
|
+
this.log(`Stream verified: ${this._pendingVideoData.name} (after ${timeSinceStart}ms)`);
|
|
3827
3831
|
}
|
|
3828
3832
|
}
|
|
3829
3833
|
if (videoEvent.state === import_ecs3.VideoState.VS_ERROR) {
|
|
@@ -3839,6 +3843,7 @@ var StaticTVClient = class {
|
|
|
3839
3843
|
* @internal
|
|
3840
3844
|
*/
|
|
3841
3845
|
_startStreamVerification() {
|
|
3846
|
+
this._verificationStartTime = Date.now();
|
|
3842
3847
|
if (this._pendingVideoData) {
|
|
3843
3848
|
this.showNotification(`Connecting to ${this._pendingVideoData.name}...`, 1e4);
|
|
3844
3849
|
}
|
package/dist/index.mjs
CHANGED
|
@@ -3520,6 +3520,7 @@ var StaticTVClient = class {
|
|
|
3520
3520
|
this._verificationTimeoutId = null;
|
|
3521
3521
|
// DCL timer ID
|
|
3522
3522
|
this._videoEventsRegistered = false;
|
|
3523
|
+
this._verificationStartTime = 0;
|
|
3523
3524
|
this._featuresReadyPromise = new Promise((resolve) => {
|
|
3524
3525
|
this._featuresReadyResolve = resolve;
|
|
3525
3526
|
});
|
|
@@ -3684,6 +3685,7 @@ var StaticTVClient = class {
|
|
|
3684
3685
|
getConfig() {
|
|
3685
3686
|
return this.config;
|
|
3686
3687
|
}
|
|
3688
|
+
// Timestamp when verification started
|
|
3687
3689
|
/**
|
|
3688
3690
|
* Play a video on the configured videoScreen entity.
|
|
3689
3691
|
* Called by Guide UI and Admin Panel.
|
|
@@ -3776,11 +3778,13 @@ var StaticTVClient = class {
|
|
|
3776
3778
|
if (screen === void 0) return;
|
|
3777
3779
|
this._videoEventsRegistered = true;
|
|
3778
3780
|
videoEventsSystem.registerVideoEventsEntity(screen, (videoEvent) => {
|
|
3779
|
-
if (videoEvent.state === VideoState.
|
|
3780
|
-
|
|
3781
|
+
if (videoEvent.state === VideoState.VS_PLAYING) {
|
|
3782
|
+
const timeSinceStart = Date.now() - this._verificationStartTime;
|
|
3783
|
+
const MIN_VERIFICATION_DELAY = 2e3;
|
|
3784
|
+
if (this._pendingVideoData && !this._streamVerified && timeSinceStart >= MIN_VERIFICATION_DELAY) {
|
|
3781
3785
|
this._streamVerified = true;
|
|
3782
3786
|
this._clearVerificationTimeout();
|
|
3783
|
-
this.log(`Stream verified: ${this._pendingVideoData.name}`);
|
|
3787
|
+
this.log(`Stream verified: ${this._pendingVideoData.name} (after ${timeSinceStart}ms)`);
|
|
3784
3788
|
}
|
|
3785
3789
|
}
|
|
3786
3790
|
if (videoEvent.state === VideoState.VS_ERROR) {
|
|
@@ -3796,6 +3800,7 @@ var StaticTVClient = class {
|
|
|
3796
3800
|
* @internal
|
|
3797
3801
|
*/
|
|
3798
3802
|
_startStreamVerification() {
|
|
3803
|
+
this._verificationStartTime = Date.now();
|
|
3799
3804
|
if (this._pendingVideoData) {
|
|
3800
3805
|
this.showNotification(`Connecting to ${this._pendingVideoData.name}...`, 1e4);
|
|
3801
3806
|
}
|
package/package.json
CHANGED