@smoud/playable-sdk 1.0.22 → 1.0.23

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/defines.d.ts CHANGED
@@ -40,6 +40,7 @@ declare const NUC: {
40
40
  };
41
41
  };
42
42
 
43
+ declare const ScPlayableAd: { onCTAClick: () => void };
43
44
  declare const FbPlayableAd: { onCTAClick: () => void };
44
45
  declare const smxTracking: { redirect: () => void };
45
46
  declare const ExitApi: { exit: () => void };
package/dist/esm/index.js CHANGED
@@ -52,6 +52,7 @@ var MINTEGRAL = uid++;
52
52
  var TAPJOY = uid++;
53
53
  var TIKTOK = uid++;
54
54
  var SMADEX = uid++;
55
+ var SNAPCHAT = uid++;
55
56
  var actualProtocol = NONE;
56
57
  function isMraid() {
57
58
  return actualProtocol === MRAID;
@@ -80,6 +81,9 @@ function isTapjoy() {
80
81
  function isTikTok() {
81
82
  return actualProtocol === TIKTOK;
82
83
  }
84
+ function isSnapchat() {
85
+ return actualProtocol === SNAPCHAT;
86
+ }
83
87
  function ensureProtocol() {
84
88
  if ("mraid" === AD_PROTOCOL) {
85
89
  try {
@@ -114,6 +118,11 @@ function ensureProtocol() {
114
118
  if (smxTracking) actualProtocol = SMADEX;
115
119
  } catch (error) {
116
120
  }
121
+ } else if ("snapchat" === AD_NETWORK) {
122
+ try {
123
+ if (ScPlayableAd) actualProtocol = SNAPCHAT;
124
+ } catch (error) {
125
+ }
117
126
  }
118
127
  }
119
128
 
@@ -526,6 +535,8 @@ var _sdk = class _sdk {
526
535
  NUC.trigger.convert(destinationUrl);
527
536
  } else if ("facebook" == AD_NETWORK && isFacebook()) {
528
537
  FbPlayableAd.onCTAClick();
538
+ } else if ("snapchat" == AD_NETWORK && isSnapchat()) {
539
+ ScPlayableAd.onCTAClick();
529
540
  } else if ("smadex" == AD_NETWORK && isSmadex()) {
530
541
  smxTracking.redirect();
531
542
  } else if ("vungle" == AD_NETWORK) {
@@ -642,7 +653,7 @@ var _sdk = class _sdk {
642
653
  }
643
654
  };
644
655
  /** Current version of the SDK */
645
- _sdk.version = "1.0.22";
656
+ _sdk.version = "1.0.23";
646
657
  /** Current maximum width of the playable ad container in pixels */
647
658
  _sdk.maxWidth = Math.floor(window.innerWidth);
648
659
  /** Current maximum height of the playable ad container in pixels */
@@ -54,6 +54,7 @@
54
54
  var TAPJOY = uid++;
55
55
  var TIKTOK = uid++;
56
56
  var SMADEX = uid++;
57
+ var SNAPCHAT = uid++;
57
58
  var actualProtocol = NONE;
58
59
  function isMraid() {
59
60
  return actualProtocol === MRAID;
@@ -82,6 +83,9 @@
82
83
  function isTikTok() {
83
84
  return actualProtocol === TIKTOK;
84
85
  }
86
+ function isSnapchat() {
87
+ return actualProtocol === SNAPCHAT;
88
+ }
85
89
  function ensureProtocol() {
86
90
  if ("mraid" === AD_PROTOCOL) {
87
91
  try {
@@ -116,6 +120,11 @@
116
120
  if (smxTracking) actualProtocol = SMADEX;
117
121
  } catch (error) {
118
122
  }
123
+ } else if ("snapchat" === AD_NETWORK) {
124
+ try {
125
+ if (ScPlayableAd) actualProtocol = SNAPCHAT;
126
+ } catch (error) {
127
+ }
119
128
  }
120
129
  }
121
130
 
@@ -528,6 +537,8 @@
528
537
  NUC.trigger.convert(destinationUrl);
529
538
  } else if ("facebook" == AD_NETWORK && isFacebook()) {
530
539
  FbPlayableAd.onCTAClick();
540
+ } else if ("snapchat" == AD_NETWORK && isSnapchat()) {
541
+ ScPlayableAd.onCTAClick();
531
542
  } else if ("smadex" == AD_NETWORK && isSmadex()) {
532
543
  smxTracking.redirect();
533
544
  } else if ("vungle" == AD_NETWORK) {
@@ -644,7 +655,7 @@
644
655
  }
645
656
  };
646
657
  /** Current version of the SDK */
647
- _sdk.version = "1.0.22";
658
+ _sdk.version = "1.0.23";
648
659
  /** Current maximum width of the playable ad container in pixels */
649
660
  _sdk.maxWidth = Math.floor(window.innerWidth);
650
661
  /** Current maximum height of the playable ad container in pixels */
package/dist/index.js CHANGED
@@ -79,6 +79,7 @@ var MINTEGRAL = uid++;
79
79
  var TAPJOY = uid++;
80
80
  var TIKTOK = uid++;
81
81
  var SMADEX = uid++;
82
+ var SNAPCHAT = uid++;
82
83
  var actualProtocol = NONE;
83
84
  function isMraid() {
84
85
  return actualProtocol === MRAID;
@@ -107,6 +108,9 @@ function isTapjoy() {
107
108
  function isTikTok() {
108
109
  return actualProtocol === TIKTOK;
109
110
  }
111
+ function isSnapchat() {
112
+ return actualProtocol === SNAPCHAT;
113
+ }
110
114
  function ensureProtocol() {
111
115
  if ("mraid" === AD_PROTOCOL) {
112
116
  try {
@@ -141,6 +145,11 @@ function ensureProtocol() {
141
145
  if (smxTracking) actualProtocol = SMADEX;
142
146
  } catch (error) {
143
147
  }
148
+ } else if ("snapchat" === AD_NETWORK) {
149
+ try {
150
+ if (ScPlayableAd) actualProtocol = SNAPCHAT;
151
+ } catch (error) {
152
+ }
144
153
  }
145
154
  }
146
155
 
@@ -553,6 +562,8 @@ var _sdk = class _sdk {
553
562
  NUC.trigger.convert(destinationUrl);
554
563
  } else if ("facebook" == AD_NETWORK && isFacebook()) {
555
564
  FbPlayableAd.onCTAClick();
565
+ } else if ("snapchat" == AD_NETWORK && isSnapchat()) {
566
+ ScPlayableAd.onCTAClick();
556
567
  } else if ("smadex" == AD_NETWORK && isSmadex()) {
557
568
  smxTracking.redirect();
558
569
  } else if ("vungle" == AD_NETWORK) {
@@ -669,7 +680,7 @@ var _sdk = class _sdk {
669
680
  }
670
681
  };
671
682
  /** Current version of the SDK */
672
- _sdk.version = "1.0.22";
683
+ _sdk.version = "1.0.23";
673
684
  /** Current maximum width of the playable ad container in pixels */
674
685
  _sdk.maxWidth = Math.floor(window.innerWidth);
675
686
  /** 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.22",
3
+ "version": "1.0.23",
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",