@smoud/playable-sdk 1.0.14 → 1.0.15

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/esm/index.js CHANGED
@@ -264,6 +264,10 @@ function startDapiProtocol() {
264
264
  }
265
265
  function startDefaultProtocol() {
266
266
  if (!isProtocolInitialized) {
267
+ let documentReady2 = function() {
268
+ if (document.visibilityState === "visible") bootAd();
269
+ };
270
+ var documentReady = documentReady2;
267
271
  if ("mintegral" === AD_NETWORK) {
268
272
  window.mintGameStart = function() {
269
273
  handleResume();
@@ -275,17 +279,19 @@ function startDefaultProtocol() {
275
279
  }
276
280
  document.addEventListener("visibilitychange", () => {
277
281
  if (document.visibilityState === "visible") {
278
- handleResume();
282
+ if (sdk.isReady) {
283
+ handleResume();
284
+ } else {
285
+ bootAd();
286
+ }
279
287
  } else {
280
288
  handlePause();
281
289
  }
282
290
  });
283
291
  if (document.readyState === "complete") {
284
- bootAd();
292
+ documentReady2();
285
293
  } else {
286
- window.addEventListener("load", () => {
287
- bootAd();
288
- });
294
+ window.addEventListener("load", documentReady2);
289
295
  }
290
296
  window.addEventListener("resize", function() {
291
297
  handleResize();
@@ -595,7 +601,7 @@ var _sdk = class _sdk {
595
601
  }
596
602
  };
597
603
  /** Current version of the SDK */
598
- _sdk.version = "1.0.14";
604
+ _sdk.version = "1.0.15";
599
605
  /** Current maximum width of the playable ad container in pixels */
600
606
  _sdk.maxWidth = Math.floor(window.innerWidth);
601
607
  /** Current maximum height of the playable ad container in pixels */
@@ -266,6 +266,10 @@
266
266
  }
267
267
  function startDefaultProtocol() {
268
268
  if (!isProtocolInitialized) {
269
+ let documentReady2 = function() {
270
+ if (document.visibilityState === "visible") bootAd();
271
+ };
272
+ var documentReady = documentReady2;
269
273
  if ("mintegral" === AD_NETWORK) {
270
274
  window.mintGameStart = function() {
271
275
  handleResume();
@@ -277,17 +281,19 @@
277
281
  }
278
282
  document.addEventListener("visibilitychange", () => {
279
283
  if (document.visibilityState === "visible") {
280
- handleResume();
284
+ if (sdk.isReady) {
285
+ handleResume();
286
+ } else {
287
+ bootAd();
288
+ }
281
289
  } else {
282
290
  handlePause();
283
291
  }
284
292
  });
285
293
  if (document.readyState === "complete") {
286
- bootAd();
294
+ documentReady2();
287
295
  } else {
288
- window.addEventListener("load", () => {
289
- bootAd();
290
- });
296
+ window.addEventListener("load", documentReady2);
291
297
  }
292
298
  window.addEventListener("resize", function() {
293
299
  handleResize();
@@ -597,7 +603,7 @@
597
603
  }
598
604
  };
599
605
  /** Current version of the SDK */
600
- _sdk.version = "1.0.14";
606
+ _sdk.version = "1.0.15";
601
607
  /** Current maximum width of the playable ad container in pixels */
602
608
  _sdk.maxWidth = Math.floor(window.innerWidth);
603
609
  /** Current maximum height of the playable ad container in pixels */
package/dist/index.js CHANGED
@@ -291,6 +291,10 @@ function startDapiProtocol() {
291
291
  }
292
292
  function startDefaultProtocol() {
293
293
  if (!isProtocolInitialized) {
294
+ let documentReady2 = function() {
295
+ if (document.visibilityState === "visible") bootAd();
296
+ };
297
+ var documentReady = documentReady2;
294
298
  if ("mintegral" === AD_NETWORK) {
295
299
  window.mintGameStart = function() {
296
300
  handleResume();
@@ -302,17 +306,19 @@ function startDefaultProtocol() {
302
306
  }
303
307
  document.addEventListener("visibilitychange", () => {
304
308
  if (document.visibilityState === "visible") {
305
- handleResume();
309
+ if (sdk.isReady) {
310
+ handleResume();
311
+ } else {
312
+ bootAd();
313
+ }
306
314
  } else {
307
315
  handlePause();
308
316
  }
309
317
  });
310
318
  if (document.readyState === "complete") {
311
- bootAd();
319
+ documentReady2();
312
320
  } else {
313
- window.addEventListener("load", () => {
314
- bootAd();
315
- });
321
+ window.addEventListener("load", documentReady2);
316
322
  }
317
323
  window.addEventListener("resize", function() {
318
324
  handleResize();
@@ -622,7 +628,7 @@ var _sdk = class _sdk {
622
628
  }
623
629
  };
624
630
  /** Current version of the SDK */
625
- _sdk.version = "1.0.14";
631
+ _sdk.version = "1.0.15";
626
632
  /** Current maximum width of the playable ad container in pixels */
627
633
  _sdk.maxWidth = Math.floor(window.innerWidth);
628
634
  /** Current maximum height of the playable ad container in pixels */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@smoud/playable-sdk",
3
- "version": "1.0.14",
3
+ "version": "1.0.15",
4
4
  "description": "It's unified Playable SDK that supports MRAID, Google, Facebook, Vungle, and many more Ad Networks, simplifying playable ad development with a standardized interface for seamless cross-network compatibility.",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/esm/index.js",