@thestatic-tv/dcl-sdk 2.5.8 → 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 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.
@@ -1047,6 +1049,11 @@ declare class StaticTVClient {
1047
1049
  * Returns null if no stream verification is in progress
1048
1050
  */
1049
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;
1050
1057
  /**
1051
1058
  * Internal handler for Guide video selection
1052
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.
@@ -1047,6 +1049,11 @@ declare class StaticTVClient {
1047
1049
  * Returns null if no stream verification is in progress
1048
1050
  */
1049
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;
1050
1057
  /**
1051
1058
  * Internal handler for Guide video selection
1052
1059
  * Tries to play the stream and verifies it's working (like M1D-HQ behavior)
package/dist/index.js CHANGED
@@ -1342,11 +1342,14 @@ var GuideUIModule = class {
1342
1342
  const cardH = this.s(UI_DIMENSIONS.guide.content.cardHeight);
1343
1343
  const isActive = this._currentVideoId === video.id;
1344
1344
  const isConnecting = this.client.connectingVideoId === video.id;
1345
+ const isOffline = this.client.offlineVideoId === video.id;
1345
1346
  let cardBgColor = import_math3.Color4.create(0.15, 0.15, 0.15, 0.8);
1346
- if (isActive && !isConnecting) {
1347
- cardBgColor = import_math3.Color4.create(0, 0.4, 0, 0.5);
1347
+ if (isOffline) {
1348
+ cardBgColor = import_math3.Color4.create(0.4, 0.1, 0.1, 0.5);
1348
1349
  } else if (isConnecting) {
1349
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);
1350
1353
  }
1351
1354
  return import_react_ecs2.default.createElement(import_react_ecs2.UiEntity, {
1352
1355
  key: video.id,
@@ -1380,8 +1383,17 @@ var GuideUIModule = class {
1380
1383
  color: THEME.colors.white
1381
1384
  }
1382
1385
  }),
1383
- // Status indicator: CONNECTING > PLAYING > LIVE
1384
- ...isConnecting ? [
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 ? [
1385
1397
  import_react_ecs2.default.createElement(import_react_ecs2.UiEntity, {
1386
1398
  key: "connecting",
1387
1399
  uiText: {
@@ -3581,6 +3593,10 @@ var StaticTVClient = class {
3581
3593
  // DCL timer ID
3582
3594
  this._videoEventsRegistered = false;
3583
3595
  this._verificationStartTime = 0;
3596
+ // Timestamp when verification started
3597
+ this._offlineVideoId = null;
3598
+ // Temporarily stores ID of offline stream
3599
+ this._offlineTimeoutId = null;
3584
3600
  this._featuresReadyPromise = new Promise((resolve) => {
3585
3601
  this._featuresReadyResolve = resolve;
3586
3602
  });
@@ -3752,7 +3768,7 @@ var StaticTVClient = class {
3752
3768
  getConfig() {
3753
3769
  return this.config;
3754
3770
  }
3755
- // Timestamp when verification started
3771
+ // Timer to clear offline state
3756
3772
  /**
3757
3773
  * Play a video on the configured videoScreen entity.
3758
3774
  * Called by Guide UI and Admin Panel.
@@ -3889,6 +3905,14 @@ var StaticTVClient = class {
3889
3905
  this._clearVerificationTimeout();
3890
3906
  if (videoData) {
3891
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);
3892
3916
  }
3893
3917
  this.stopVideo();
3894
3918
  }
@@ -3915,6 +3939,13 @@ var StaticTVClient = class {
3915
3939
  get connectingVideoId() {
3916
3940
  return this._pendingVideoData && !this._streamVerified ? this._pendingVideoData.id : null;
3917
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
+ }
3918
3949
  /**
3919
3950
  * Internal handler for Guide video selection
3920
3951
  * Tries to play the stream and verifies it's working (like M1D-HQ behavior)
package/dist/index.mjs CHANGED
@@ -1299,11 +1299,14 @@ var GuideUIModule = class {
1299
1299
  const cardH = this.s(UI_DIMENSIONS.guide.content.cardHeight);
1300
1300
  const isActive = this._currentVideoId === video.id;
1301
1301
  const isConnecting = this.client.connectingVideoId === video.id;
1302
+ const isOffline = this.client.offlineVideoId === video.id;
1302
1303
  let cardBgColor = Color43.create(0.15, 0.15, 0.15, 0.8);
1303
- if (isActive && !isConnecting) {
1304
- cardBgColor = Color43.create(0, 0.4, 0, 0.5);
1304
+ if (isOffline) {
1305
+ cardBgColor = Color43.create(0.4, 0.1, 0.1, 0.5);
1305
1306
  } else if (isConnecting) {
1306
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);
1307
1310
  }
1308
1311
  return ReactEcs2.createElement(UiEntity2, {
1309
1312
  key: video.id,
@@ -1337,8 +1340,17 @@ var GuideUIModule = class {
1337
1340
  color: THEME.colors.white
1338
1341
  }
1339
1342
  }),
1340
- // Status indicator: CONNECTING > PLAYING > LIVE
1341
- ...isConnecting ? [
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 ? [
1342
1354
  ReactEcs2.createElement(UiEntity2, {
1343
1355
  key: "connecting",
1344
1356
  uiText: {
@@ -3538,6 +3550,10 @@ var StaticTVClient = class {
3538
3550
  // DCL timer ID
3539
3551
  this._videoEventsRegistered = false;
3540
3552
  this._verificationStartTime = 0;
3553
+ // Timestamp when verification started
3554
+ this._offlineVideoId = null;
3555
+ // Temporarily stores ID of offline stream
3556
+ this._offlineTimeoutId = null;
3541
3557
  this._featuresReadyPromise = new Promise((resolve) => {
3542
3558
  this._featuresReadyResolve = resolve;
3543
3559
  });
@@ -3709,7 +3725,7 @@ var StaticTVClient = class {
3709
3725
  getConfig() {
3710
3726
  return this.config;
3711
3727
  }
3712
- // Timestamp when verification started
3728
+ // Timer to clear offline state
3713
3729
  /**
3714
3730
  * Play a video on the configured videoScreen entity.
3715
3731
  * Called by Guide UI and Admin Panel.
@@ -3846,6 +3862,14 @@ var StaticTVClient = class {
3846
3862
  this._clearVerificationTimeout();
3847
3863
  if (videoData) {
3848
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);
3849
3873
  }
3850
3874
  this.stopVideo();
3851
3875
  }
@@ -3872,6 +3896,13 @@ var StaticTVClient = class {
3872
3896
  get connectingVideoId() {
3873
3897
  return this._pendingVideoData && !this._streamVerified ? this._pendingVideoData.id : null;
3874
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
+ }
3875
3906
  /**
3876
3907
  * Internal handler for Guide video selection
3877
3908
  * Tries to play the stream and verifies it's working (like M1D-HQ behavior)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@thestatic-tv/dcl-sdk",
3
- "version": "2.5.8",
3
+ "version": "2.5.9",
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",