@thestatic-tv/dcl-sdk 2.5.3 → 2.5.5

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 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.
@@ -3791,15 +3793,19 @@ var StaticTVClient = class {
3791
3793
  this._clearVerificationTimeout();
3792
3794
  this._streamVerified = false;
3793
3795
  if (import_ecs3.VideoPlayer.has(screen)) {
3794
- import_ecs3.VideoPlayer.deleteFrom(screen);
3796
+ const player = import_ecs3.VideoPlayer.getMutable(screen);
3797
+ player.src = url;
3798
+ player.playing = true;
3799
+ player.loop = isFallback;
3800
+ player.volume = 1;
3801
+ } else {
3802
+ import_ecs3.VideoPlayer.create(screen, {
3803
+ src: url,
3804
+ playing: true,
3805
+ loop: isFallback,
3806
+ volume: 1
3807
+ });
3795
3808
  }
3796
- import_ecs3.VideoPlayer.create(screen, {
3797
- src: url,
3798
- playing: true,
3799
- loop: isFallback,
3800
- // Loop fallback videos
3801
- volume: 1
3802
- });
3803
3809
  import_ecs3.Material.setBasicMaterial(screen, {
3804
3810
  texture: import_ecs3.Material.Texture.Video({ videoPlayerEntity: screen })
3805
3811
  });
@@ -3819,11 +3825,13 @@ var StaticTVClient = class {
3819
3825
  if (screen === void 0) return;
3820
3826
  this._videoEventsRegistered = true;
3821
3827
  import_ecs3.videoEventsSystem.registerVideoEventsEntity(screen, (videoEvent) => {
3822
- if (videoEvent.state === import_ecs3.VideoState.VS_READY || videoEvent.state === import_ecs3.VideoState.VS_PLAYING) {
3823
- if (this._pendingVideoData && !this._streamVerified) {
3828
+ if (videoEvent.state === import_ecs3.VideoState.VS_PLAYING) {
3829
+ const timeSinceStart = Date.now() - this._verificationStartTime;
3830
+ const MIN_VERIFICATION_DELAY = 2e3;
3831
+ if (this._pendingVideoData && !this._streamVerified && timeSinceStart >= MIN_VERIFICATION_DELAY) {
3824
3832
  this._streamVerified = true;
3825
3833
  this._clearVerificationTimeout();
3826
- this.log(`Stream verified: ${this._pendingVideoData.name}`);
3834
+ this.log(`Stream verified: ${this._pendingVideoData.name} (after ${timeSinceStart}ms)`);
3827
3835
  }
3828
3836
  }
3829
3837
  if (videoEvent.state === import_ecs3.VideoState.VS_ERROR) {
@@ -3839,6 +3847,7 @@ var StaticTVClient = class {
3839
3847
  * @internal
3840
3848
  */
3841
3849
  _startStreamVerification() {
3850
+ this._verificationStartTime = Date.now();
3842
3851
  if (this._pendingVideoData) {
3843
3852
  this.showNotification(`Connecting to ${this._pendingVideoData.name}...`, 1e4);
3844
3853
  }
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.
@@ -3748,15 +3750,19 @@ var StaticTVClient = class {
3748
3750
  this._clearVerificationTimeout();
3749
3751
  this._streamVerified = false;
3750
3752
  if (VideoPlayer.has(screen)) {
3751
- VideoPlayer.deleteFrom(screen);
3753
+ const player = VideoPlayer.getMutable(screen);
3754
+ player.src = url;
3755
+ player.playing = true;
3756
+ player.loop = isFallback;
3757
+ player.volume = 1;
3758
+ } else {
3759
+ VideoPlayer.create(screen, {
3760
+ src: url,
3761
+ playing: true,
3762
+ loop: isFallback,
3763
+ volume: 1
3764
+ });
3752
3765
  }
3753
- VideoPlayer.create(screen, {
3754
- src: url,
3755
- playing: true,
3756
- loop: isFallback,
3757
- // Loop fallback videos
3758
- volume: 1
3759
- });
3760
3766
  Material.setBasicMaterial(screen, {
3761
3767
  texture: Material.Texture.Video({ videoPlayerEntity: screen })
3762
3768
  });
@@ -3776,11 +3782,13 @@ var StaticTVClient = class {
3776
3782
  if (screen === void 0) return;
3777
3783
  this._videoEventsRegistered = true;
3778
3784
  videoEventsSystem.registerVideoEventsEntity(screen, (videoEvent) => {
3779
- if (videoEvent.state === VideoState.VS_READY || videoEvent.state === VideoState.VS_PLAYING) {
3780
- if (this._pendingVideoData && !this._streamVerified) {
3785
+ if (videoEvent.state === VideoState.VS_PLAYING) {
3786
+ const timeSinceStart = Date.now() - this._verificationStartTime;
3787
+ const MIN_VERIFICATION_DELAY = 2e3;
3788
+ if (this._pendingVideoData && !this._streamVerified && timeSinceStart >= MIN_VERIFICATION_DELAY) {
3781
3789
  this._streamVerified = true;
3782
3790
  this._clearVerificationTimeout();
3783
- this.log(`Stream verified: ${this._pendingVideoData.name}`);
3791
+ this.log(`Stream verified: ${this._pendingVideoData.name} (after ${timeSinceStart}ms)`);
3784
3792
  }
3785
3793
  }
3786
3794
  if (videoEvent.state === VideoState.VS_ERROR) {
@@ -3796,6 +3804,7 @@ var StaticTVClient = class {
3796
3804
  * @internal
3797
3805
  */
3798
3806
  _startStreamVerification() {
3807
+ this._verificationStartTime = Date.now();
3799
3808
  if (this._pendingVideoData) {
3800
3809
  this.showNotification(`Connecting to ${this._pendingVideoData.name}...`, 1e4);
3801
3810
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@thestatic-tv/dcl-sdk",
3
- "version": "2.5.3",
3
+ "version": "2.5.5",
4
4
  "description": "Connect your Decentraland scene to thestatic.tv - full channel lineup, metrics tracking, and interactions",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",