@thestatic-tv/dcl-sdk 2.5.18 → 2.5.19

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 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 && timeSinceStart >= MIN_VERIFICATION_DELAY) {
4221
- this._streamVerified = true;
4222
- this._clearVerificationTimeout();
4223
- this.log(`Stream verified: ${this._pendingVideoData.name} (after ${timeSinceStart}ms)`);
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) {
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 && timeSinceStart >= MIN_VERIFICATION_DELAY) {
4173
- this._streamVerified = true;
4174
- this._clearVerificationTimeout();
4175
- this.log(`Stream verified: ${this._pendingVideoData.name} (after ${timeSinceStart}ms)`);
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) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@thestatic-tv/dcl-sdk",
3
- "version": "2.5.18",
3
+ "version": "2.5.19",
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",