@thestatic-tv/dcl-sdk 2.5.23 → 2.5.25
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.js +12 -2
- package/dist/index.mjs +12 -2
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -4343,8 +4343,11 @@ var StaticTVClient = class {
|
|
|
4343
4343
|
* @internal
|
|
4344
4344
|
*/
|
|
4345
4345
|
_startCallbackVerification(video) {
|
|
4346
|
-
this.
|
|
4346
|
+
this.log(`Starting callback verification for: ${video.name}`);
|
|
4347
|
+
this.showNotification(`Connecting to ${video.name}...`, 5e3);
|
|
4348
|
+
this._verificationStartTime = Date.now();
|
|
4347
4349
|
this._verificationTimeoutId = utils.timers.setTimeout(() => {
|
|
4350
|
+
this.log(`Verification timeout check - verified: ${this._streamVerified}, pending: ${!!this._pendingVideoData}`);
|
|
4348
4351
|
if (!this._streamVerified && this._pendingVideoData) {
|
|
4349
4352
|
this.log(`Stream verification timeout (callback mode): ${video.name}`);
|
|
4350
4353
|
this._pendingVideoData = null;
|
|
@@ -4354,7 +4357,7 @@ var StaticTVClient = class {
|
|
|
4354
4357
|
}
|
|
4355
4358
|
this.stopVideo();
|
|
4356
4359
|
}
|
|
4357
|
-
},
|
|
4360
|
+
}, 5e3);
|
|
4358
4361
|
}
|
|
4359
4362
|
/**
|
|
4360
4363
|
* Call this to confirm that a video stream is playing successfully.
|
|
@@ -4369,6 +4372,13 @@ var StaticTVClient = class {
|
|
|
4369
4372
|
* ```
|
|
4370
4373
|
*/
|
|
4371
4374
|
confirmVideoPlaying() {
|
|
4375
|
+
const timeSinceStart = Date.now() - this._verificationStartTime;
|
|
4376
|
+
const MIN_DELAY = 1e3;
|
|
4377
|
+
this.log(`confirmVideoPlaying called - pending: ${!!this._pendingVideoData}, verified: ${this._streamVerified}, elapsed: ${timeSinceStart}ms`);
|
|
4378
|
+
if (timeSinceStart < MIN_DELAY) {
|
|
4379
|
+
this.log(`Ignoring early VS_PLAYING (stale event from previous video)`);
|
|
4380
|
+
return;
|
|
4381
|
+
}
|
|
4372
4382
|
if (this._pendingVideoData && !this._streamVerified) {
|
|
4373
4383
|
this._streamVerified = true;
|
|
4374
4384
|
this._clearVerificationTimeout();
|
package/dist/index.mjs
CHANGED
|
@@ -4295,8 +4295,11 @@ var StaticTVClient = class {
|
|
|
4295
4295
|
* @internal
|
|
4296
4296
|
*/
|
|
4297
4297
|
_startCallbackVerification(video) {
|
|
4298
|
-
this.
|
|
4298
|
+
this.log(`Starting callback verification for: ${video.name}`);
|
|
4299
|
+
this.showNotification(`Connecting to ${video.name}...`, 5e3);
|
|
4300
|
+
this._verificationStartTime = Date.now();
|
|
4299
4301
|
this._verificationTimeoutId = utils.timers.setTimeout(() => {
|
|
4302
|
+
this.log(`Verification timeout check - verified: ${this._streamVerified}, pending: ${!!this._pendingVideoData}`);
|
|
4300
4303
|
if (!this._streamVerified && this._pendingVideoData) {
|
|
4301
4304
|
this.log(`Stream verification timeout (callback mode): ${video.name}`);
|
|
4302
4305
|
this._pendingVideoData = null;
|
|
@@ -4306,7 +4309,7 @@ var StaticTVClient = class {
|
|
|
4306
4309
|
}
|
|
4307
4310
|
this.stopVideo();
|
|
4308
4311
|
}
|
|
4309
|
-
},
|
|
4312
|
+
}, 5e3);
|
|
4310
4313
|
}
|
|
4311
4314
|
/**
|
|
4312
4315
|
* Call this to confirm that a video stream is playing successfully.
|
|
@@ -4321,6 +4324,13 @@ var StaticTVClient = class {
|
|
|
4321
4324
|
* ```
|
|
4322
4325
|
*/
|
|
4323
4326
|
confirmVideoPlaying() {
|
|
4327
|
+
const timeSinceStart = Date.now() - this._verificationStartTime;
|
|
4328
|
+
const MIN_DELAY = 1e3;
|
|
4329
|
+
this.log(`confirmVideoPlaying called - pending: ${!!this._pendingVideoData}, verified: ${this._streamVerified}, elapsed: ${timeSinceStart}ms`);
|
|
4330
|
+
if (timeSinceStart < MIN_DELAY) {
|
|
4331
|
+
this.log(`Ignoring early VS_PLAYING (stale event from previous video)`);
|
|
4332
|
+
return;
|
|
4333
|
+
}
|
|
4324
4334
|
if (this._pendingVideoData && !this._streamVerified) {
|
|
4325
4335
|
this._streamVerified = true;
|
|
4326
4336
|
this._clearVerificationTimeout();
|
package/package.json
CHANGED