@thestatic-tv/dcl-sdk 2.5.18 → 2.5.20
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 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +24 -9
- package/dist/index.mjs +24 -9
- package/package.json +1 -1
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
|
-
*
|
|
1125
|
+
* Auto-verifies after 2 seconds since we can't detect VS_PLAYING in callback mode
|
|
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
|
-
*
|
|
1125
|
+
* Auto-verifies after 2 seconds since we can't detect VS_PLAYING in callback mode
|
|
1126
1126
|
* @internal
|
|
1127
1127
|
*/
|
|
1128
1128
|
private _startCallbackVerification;
|
package/dist/index.js
CHANGED
|
@@ -4217,10 +4217,23 @@ 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
|
-
|
|
4222
|
-
|
|
4223
|
-
|
|
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
|
+
}
|
|
4224
4237
|
}
|
|
4225
4238
|
}
|
|
4226
4239
|
if (videoEvent.state === import_ecs4.VideoState.VS_ERROR) {
|
|
@@ -4336,17 +4349,19 @@ var StaticTVClient = class {
|
|
|
4336
4349
|
}
|
|
4337
4350
|
/**
|
|
4338
4351
|
* Start stream verification for callback-based video playback
|
|
4339
|
-
*
|
|
4352
|
+
* Auto-verifies after 2 seconds since we can't detect VS_PLAYING in callback mode
|
|
4340
4353
|
* @internal
|
|
4341
4354
|
*/
|
|
4342
4355
|
_startCallbackVerification(video) {
|
|
4343
|
-
this.
|
|
4356
|
+
this._verificationStartTime = Date.now();
|
|
4357
|
+
this.showNotification(`Connecting to ${video.name}...`, 3e3);
|
|
4344
4358
|
this._verificationTimeoutId = utils.timers.setTimeout(() => {
|
|
4345
4359
|
if (!this._streamVerified && this._pendingVideoData) {
|
|
4346
|
-
this.
|
|
4347
|
-
this.
|
|
4360
|
+
this._streamVerified = true;
|
|
4361
|
+
this._clearVerificationTimeout();
|
|
4362
|
+
this.log(`Stream auto-verified (callback mode): ${video.name}`);
|
|
4348
4363
|
}
|
|
4349
|
-
},
|
|
4364
|
+
}, 2e3);
|
|
4350
4365
|
}
|
|
4351
4366
|
/**
|
|
4352
4367
|
* Call this to confirm that a video stream is playing successfully.
|
package/dist/index.mjs
CHANGED
|
@@ -4169,10 +4169,23 @@ 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
|
-
|
|
4174
|
-
|
|
4175
|
-
|
|
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
|
+
}
|
|
4176
4189
|
}
|
|
4177
4190
|
}
|
|
4178
4191
|
if (videoEvent.state === VideoState.VS_ERROR) {
|
|
@@ -4288,17 +4301,19 @@ var StaticTVClient = class {
|
|
|
4288
4301
|
}
|
|
4289
4302
|
/**
|
|
4290
4303
|
* Start stream verification for callback-based video playback
|
|
4291
|
-
*
|
|
4304
|
+
* Auto-verifies after 2 seconds since we can't detect VS_PLAYING in callback mode
|
|
4292
4305
|
* @internal
|
|
4293
4306
|
*/
|
|
4294
4307
|
_startCallbackVerification(video) {
|
|
4295
|
-
this.
|
|
4308
|
+
this._verificationStartTime = Date.now();
|
|
4309
|
+
this.showNotification(`Connecting to ${video.name}...`, 3e3);
|
|
4296
4310
|
this._verificationTimeoutId = utils.timers.setTimeout(() => {
|
|
4297
4311
|
if (!this._streamVerified && this._pendingVideoData) {
|
|
4298
|
-
this.
|
|
4299
|
-
this.
|
|
4312
|
+
this._streamVerified = true;
|
|
4313
|
+
this._clearVerificationTimeout();
|
|
4314
|
+
this.log(`Stream auto-verified (callback mode): ${video.name}`);
|
|
4300
4315
|
}
|
|
4301
|
-
},
|
|
4316
|
+
}, 2e3);
|
|
4302
4317
|
}
|
|
4303
4318
|
/**
|
|
4304
4319
|
* Call this to confirm that a video stream is playing successfully.
|
package/package.json
CHANGED