@thestatic-tv/dcl-sdk 2.5.20 → 2.5.22

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
@@ -1122,7 +1122,7 @@ declare class StaticTVClient {
1122
1122
  private _playVideoWithVerification;
1123
1123
  /**
1124
1124
  * Start stream verification for callback-based video playback
1125
- * Auto-verifies after 2 seconds since we can't detect VS_PLAYING in callback mode
1125
+ * Shows CONNECTING state and triggers fallback if verification times out
1126
1126
  * @internal
1127
1127
  */
1128
1128
  private _startCallbackVerification;
package/dist/index.d.ts CHANGED
@@ -1122,7 +1122,7 @@ declare class StaticTVClient {
1122
1122
  private _playVideoWithVerification;
1123
1123
  /**
1124
1124
  * Start stream verification for callback-based video playback
1125
- * Auto-verifies after 2 seconds since we can't detect VS_PLAYING in callback mode
1125
+ * Shows CONNECTING state and triggers fallback if verification times out
1126
1126
  * @internal
1127
1127
  */
1128
1128
  private _startCallbackVerification;
package/dist/index.js CHANGED
@@ -4217,23 +4217,10 @@ var StaticTVClient = class {
4217
4217
  if (videoEvent.state === import_ecs4.VideoState.VS_PLAYING) {
4218
4218
  const timeSinceStart = Date.now() - this._verificationStartTime;
4219
4219
  const MIN_VERIFICATION_DELAY = 2e3;
4220
- if (this._pendingVideoData && !this._streamVerified) {
4221
- if (timeSinceStart >= MIN_VERIFICATION_DELAY) {
4222
- this._streamVerified = true;
4223
- this._clearVerificationTimeout();
4224
- this.log(`Stream verified: ${this._pendingVideoData.name} (after ${timeSinceStart}ms)`);
4225
- } else {
4226
- const remainingDelay = MIN_VERIFICATION_DELAY - timeSinceStart;
4227
- this.log(`VS_PLAYING received early, scheduling verification in ${remainingDelay}ms`);
4228
- this._clearVerificationTimeout();
4229
- this._verificationTimeoutId = utils.timers.setTimeout(() => {
4230
- if (this._pendingVideoData && !this._streamVerified) {
4231
- this._streamVerified = true;
4232
- this._clearVerificationTimeout();
4233
- this.log(`Stream verified (delayed): ${this._pendingVideoData.name}`);
4234
- }
4235
- }, remainingDelay);
4236
- }
4220
+ if (this._pendingVideoData && !this._streamVerified && timeSinceStart >= MIN_VERIFICATION_DELAY) {
4221
+ this._streamVerified = true;
4222
+ this._clearVerificationTimeout();
4223
+ this.log(`Stream verified: ${this._pendingVideoData.name} (after ${timeSinceStart}ms)`);
4237
4224
  }
4238
4225
  }
4239
4226
  if (videoEvent.state === import_ecs4.VideoState.VS_ERROR) {
@@ -4339,9 +4326,8 @@ var StaticTVClient = class {
4339
4326
  }
4340
4327
  if (hasCallback) {
4341
4328
  this.config.onVideoPlay(video.src);
4342
- if (isLiveStream) {
4343
- this._startCallbackVerification(video);
4344
- }
4329
+ this._streamVerified = true;
4330
+ this._pendingVideoData = null;
4345
4331
  }
4346
4332
  if (this.guideUI) {
4347
4333
  this.guideUI.currentVideoId = video.id;
@@ -4349,19 +4335,17 @@ var StaticTVClient = class {
4349
4335
  }
4350
4336
  /**
4351
4337
  * Start stream verification for callback-based video playback
4352
- * Auto-verifies after 2 seconds since we can't detect VS_PLAYING in callback mode
4338
+ * Shows CONNECTING state and triggers fallback if verification times out
4353
4339
  * @internal
4354
4340
  */
4355
4341
  _startCallbackVerification(video) {
4356
- this._verificationStartTime = Date.now();
4357
- this.showNotification(`Connecting to ${video.name}...`, 3e3);
4342
+ this.showNotification(`Connecting to ${video.name}...`, 6e3);
4358
4343
  this._verificationTimeoutId = utils.timers.setTimeout(() => {
4359
4344
  if (!this._streamVerified && this._pendingVideoData) {
4360
- this._streamVerified = true;
4361
- this._clearVerificationTimeout();
4362
- this.log(`Stream auto-verified (callback mode): ${video.name}`);
4345
+ this.log(`Stream verification timeout (callback mode): ${video.name}`);
4346
+ this._handleStreamOffline();
4363
4347
  }
4364
- }, 2e3);
4348
+ }, 5e3);
4365
4349
  }
4366
4350
  /**
4367
4351
  * Call this to confirm that a video stream is playing successfully.
package/dist/index.mjs CHANGED
@@ -4169,23 +4169,10 @@ var StaticTVClient = class {
4169
4169
  if (videoEvent.state === VideoState.VS_PLAYING) {
4170
4170
  const timeSinceStart = Date.now() - this._verificationStartTime;
4171
4171
  const MIN_VERIFICATION_DELAY = 2e3;
4172
- if (this._pendingVideoData && !this._streamVerified) {
4173
- if (timeSinceStart >= MIN_VERIFICATION_DELAY) {
4174
- this._streamVerified = true;
4175
- this._clearVerificationTimeout();
4176
- this.log(`Stream verified: ${this._pendingVideoData.name} (after ${timeSinceStart}ms)`);
4177
- } else {
4178
- const remainingDelay = MIN_VERIFICATION_DELAY - timeSinceStart;
4179
- this.log(`VS_PLAYING received early, scheduling verification in ${remainingDelay}ms`);
4180
- this._clearVerificationTimeout();
4181
- this._verificationTimeoutId = utils.timers.setTimeout(() => {
4182
- if (this._pendingVideoData && !this._streamVerified) {
4183
- this._streamVerified = true;
4184
- this._clearVerificationTimeout();
4185
- this.log(`Stream verified (delayed): ${this._pendingVideoData.name}`);
4186
- }
4187
- }, remainingDelay);
4188
- }
4172
+ if (this._pendingVideoData && !this._streamVerified && timeSinceStart >= MIN_VERIFICATION_DELAY) {
4173
+ this._streamVerified = true;
4174
+ this._clearVerificationTimeout();
4175
+ this.log(`Stream verified: ${this._pendingVideoData.name} (after ${timeSinceStart}ms)`);
4189
4176
  }
4190
4177
  }
4191
4178
  if (videoEvent.state === VideoState.VS_ERROR) {
@@ -4291,9 +4278,8 @@ var StaticTVClient = class {
4291
4278
  }
4292
4279
  if (hasCallback) {
4293
4280
  this.config.onVideoPlay(video.src);
4294
- if (isLiveStream) {
4295
- this._startCallbackVerification(video);
4296
- }
4281
+ this._streamVerified = true;
4282
+ this._pendingVideoData = null;
4297
4283
  }
4298
4284
  if (this.guideUI) {
4299
4285
  this.guideUI.currentVideoId = video.id;
@@ -4301,19 +4287,17 @@ var StaticTVClient = class {
4301
4287
  }
4302
4288
  /**
4303
4289
  * Start stream verification for callback-based video playback
4304
- * Auto-verifies after 2 seconds since we can't detect VS_PLAYING in callback mode
4290
+ * Shows CONNECTING state and triggers fallback if verification times out
4305
4291
  * @internal
4306
4292
  */
4307
4293
  _startCallbackVerification(video) {
4308
- this._verificationStartTime = Date.now();
4309
- this.showNotification(`Connecting to ${video.name}...`, 3e3);
4294
+ this.showNotification(`Connecting to ${video.name}...`, 6e3);
4310
4295
  this._verificationTimeoutId = utils.timers.setTimeout(() => {
4311
4296
  if (!this._streamVerified && this._pendingVideoData) {
4312
- this._streamVerified = true;
4313
- this._clearVerificationTimeout();
4314
- this.log(`Stream auto-verified (callback mode): ${video.name}`);
4297
+ this.log(`Stream verification timeout (callback mode): ${video.name}`);
4298
+ this._handleStreamOffline();
4315
4299
  }
4316
- }, 2e3);
4300
+ }, 5e3);
4317
4301
  }
4318
4302
  /**
4319
4303
  * Call this to confirm that a video stream is playing successfully.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@thestatic-tv/dcl-sdk",
3
- "version": "2.5.20",
3
+ "version": "2.5.22",
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",