@smoud/playable-sdk 1.0.24 → 1.1.1

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/README.md CHANGED
@@ -410,6 +410,7 @@ Get started quickly with our template projects:
410
410
  - [Google HTML5 Validator](https://h5validator.appspot.com/adwords/asset)
411
411
  - [IronSource - Submit an HTML asset for review](https://developers.is.com/ironsource-mobile/general/html-upload/)
412
412
  - [Mintegral Testing Tool](https://www.playturbo.com/review)
413
+ - Moloco - Test your creatives [Info](https://help.moloco.com/hc/en-us/articles/22553113373335-Test-your-creatives) / [iOS](https://apps.apple.com/us/app/creative-lab/id6474686021) / [Android](https://play.google.com/store/apps/details?id=com.moloco.peeker&pli=1)
413
414
 
414
415
  ## Issues
415
416
 
package/dist/esm/index.js CHANGED
@@ -268,10 +268,17 @@ function startMraidProtocol() {
268
268
  mraid.addEventListener("error", function(t, e) {
269
269
  console.log("mraid error: " + t + " action: " + e);
270
270
  });
271
- mraid.addEventListener("sizeChange", function() {
272
- const maxSize = mraid.getMaxSize();
273
- fireResizeEvent(maxSize.width, maxSize.height);
274
- });
271
+ if (AD_NETWORK === "unity") {
272
+ window.addEventListener("resize", function() {
273
+ const maxSize = mraid.getMaxSize();
274
+ fireResizeEvent(maxSize.width, maxSize.height);
275
+ });
276
+ } else {
277
+ mraid.addEventListener("sizeChange", function() {
278
+ const maxSize = mraid.getMaxSize();
279
+ fireResizeEvent(maxSize.width, maxSize.height);
280
+ });
281
+ }
275
282
  isProtocolInitialized = true;
276
283
  }
277
284
  function startDapiProtocol() {
@@ -509,13 +516,9 @@ var _sdk = class _sdk {
509
516
  */
510
517
  static install() {
511
518
  if (!_sdk.isFinished) {
512
- _sdk.isFinished = true;
513
519
  let timeout = 0;
514
- if ("tapjoy" === AD_NETWORK && isTapjoy()) {
515
- finishTapjoy();
516
- timeout = 300;
517
- }
518
- emitEvent("finish");
520
+ if ("tapjoy" === AD_NETWORK) timeout = 300;
521
+ _sdk.finish();
519
522
  setTimeout(function() {
520
523
  _sdk.install();
521
524
  }, timeout);
@@ -653,7 +656,7 @@ var _sdk = class _sdk {
653
656
  }
654
657
  };
655
658
  /** Current version of the SDK */
656
- _sdk.version = "1.0.24";
659
+ _sdk.version = "1.1.1";
657
660
  /** Current maximum width of the playable ad container in pixels */
658
661
  _sdk.maxWidth = Math.floor(window.innerWidth);
659
662
  /** Current maximum height of the playable ad container in pixels */
@@ -270,10 +270,17 @@
270
270
  mraid.addEventListener("error", function(t, e) {
271
271
  console.log("mraid error: " + t + " action: " + e);
272
272
  });
273
- mraid.addEventListener("sizeChange", function() {
274
- const maxSize = mraid.getMaxSize();
275
- fireResizeEvent(maxSize.width, maxSize.height);
276
- });
273
+ if (AD_NETWORK === "unity") {
274
+ window.addEventListener("resize", function() {
275
+ const maxSize = mraid.getMaxSize();
276
+ fireResizeEvent(maxSize.width, maxSize.height);
277
+ });
278
+ } else {
279
+ mraid.addEventListener("sizeChange", function() {
280
+ const maxSize = mraid.getMaxSize();
281
+ fireResizeEvent(maxSize.width, maxSize.height);
282
+ });
283
+ }
277
284
  isProtocolInitialized = true;
278
285
  }
279
286
  function startDapiProtocol() {
@@ -511,13 +518,9 @@
511
518
  */
512
519
  static install() {
513
520
  if (!_sdk.isFinished) {
514
- _sdk.isFinished = true;
515
521
  let timeout = 0;
516
- if ("tapjoy" === AD_NETWORK && isTapjoy()) {
517
- finishTapjoy();
518
- timeout = 300;
519
- }
520
- emitEvent("finish");
522
+ if ("tapjoy" === AD_NETWORK) timeout = 300;
523
+ _sdk.finish();
521
524
  setTimeout(function() {
522
525
  _sdk.install();
523
526
  }, timeout);
@@ -655,7 +658,7 @@
655
658
  }
656
659
  };
657
660
  /** Current version of the SDK */
658
- _sdk.version = "1.0.24";
661
+ _sdk.version = "1.1.1";
659
662
  /** Current maximum width of the playable ad container in pixels */
660
663
  _sdk.maxWidth = Math.floor(window.innerWidth);
661
664
  /** Current maximum height of the playable ad container in pixels */
package/dist/index.js CHANGED
@@ -295,10 +295,17 @@ function startMraidProtocol() {
295
295
  mraid.addEventListener("error", function(t, e) {
296
296
  console.log("mraid error: " + t + " action: " + e);
297
297
  });
298
- mraid.addEventListener("sizeChange", function() {
299
- const maxSize = mraid.getMaxSize();
300
- fireResizeEvent(maxSize.width, maxSize.height);
301
- });
298
+ if (AD_NETWORK === "unity") {
299
+ window.addEventListener("resize", function() {
300
+ const maxSize = mraid.getMaxSize();
301
+ fireResizeEvent(maxSize.width, maxSize.height);
302
+ });
303
+ } else {
304
+ mraid.addEventListener("sizeChange", function() {
305
+ const maxSize = mraid.getMaxSize();
306
+ fireResizeEvent(maxSize.width, maxSize.height);
307
+ });
308
+ }
302
309
  isProtocolInitialized = true;
303
310
  }
304
311
  function startDapiProtocol() {
@@ -536,13 +543,9 @@ var _sdk = class _sdk {
536
543
  */
537
544
  static install() {
538
545
  if (!_sdk.isFinished) {
539
- _sdk.isFinished = true;
540
546
  let timeout = 0;
541
- if ("tapjoy" === AD_NETWORK && isTapjoy()) {
542
- finishTapjoy();
543
- timeout = 300;
544
- }
545
- emitEvent("finish");
547
+ if ("tapjoy" === AD_NETWORK) timeout = 300;
548
+ _sdk.finish();
546
549
  setTimeout(function() {
547
550
  _sdk.install();
548
551
  }, timeout);
@@ -680,7 +683,7 @@ var _sdk = class _sdk {
680
683
  }
681
684
  };
682
685
  /** Current version of the SDK */
683
- _sdk.version = "1.0.24";
686
+ _sdk.version = "1.1.1";
684
687
  /** Current maximum width of the playable ad container in pixels */
685
688
  _sdk.maxWidth = Math.floor(window.innerWidth);
686
689
  /** 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.24",
3
+ "version": "1.1.1",
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",