@smoud/playable-sdk 1.0.15 → 1.0.16
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 +14 -14
- package/dist/esm/index.js +127 -134
- package/dist/iife/index.js +127 -134
- package/dist/index.js +127 -134
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -330,20 +330,20 @@ sdk.off('eventName', [callback], [context]);
|
|
|
330
330
|
|
|
331
331
|
#### Available Events
|
|
332
332
|
|
|
333
|
-
| Event | Parameters | Description
|
|
334
|
-
| ------------- | --------------- |
|
|
335
|
-
| `init` | - | SDK initialization started
|
|
336
|
-
| `boot` | - | Ad container is ready `pre` init callback
|
|
337
|
-
| `ready` | - | Ad container is ready `post` init callback
|
|
338
|
-
| `start` | - | Playable experience started
|
|
339
|
-
| `interaction` | `count` | User interaction occurred
|
|
340
|
-
| `resize` | `width, height` | Container size changed
|
|
341
|
-
| `pause` | - | Playable entered pause state
|
|
342
|
-
| `resume` | - | Playable resumed from pause
|
|
343
|
-
| `volume` | `level` | Volume level changed (0-1)
|
|
344
|
-
| `retry` | - | Retry/restart triggered
|
|
345
|
-
| `finish` | - | Playable marked as complete
|
|
346
|
-
| `install` | - | Install action triggered
|
|
333
|
+
| Event | Parameters | Description | Typical Usage |
|
|
334
|
+
| ------------- | --------------- | ------------------------------------------------- | ------------------------ |
|
|
335
|
+
| `init` | - | DOM Content loaded and SDK initialization started | Setup loading screen |
|
|
336
|
+
| `boot` | - | Ad container is ready `pre` init callback | Initialize core systems |
|
|
337
|
+
| `ready` | - | Ad container is ready `post` init callback | Start resource loading |
|
|
338
|
+
| `start` | - | Playable experience started | Begin gameplay/animation |
|
|
339
|
+
| `interaction` | `count` | User interaction occurred | Track engagement |
|
|
340
|
+
| `resize` | `width, height` | Container size changed | Update layout |
|
|
341
|
+
| `pause` | - | Playable entered pause state | Pause gameplay |
|
|
342
|
+
| `resume` | - | Playable resumed from pause | Resume gameplay |
|
|
343
|
+
| `volume` | `level` | Volume level changed (0-1) | Adjust audio |
|
|
344
|
+
| `retry` | - | Retry/restart triggered | Reset game state |
|
|
345
|
+
| `finish` | - | Playable marked as complete | Show end screen |
|
|
346
|
+
| `install` | - | Install action triggered | Track conversion |
|
|
347
347
|
|
|
348
348
|
### Properties
|
|
349
349
|
|
package/dist/esm/index.js
CHANGED
|
@@ -160,156 +160,152 @@ function handleResume() {
|
|
|
160
160
|
sdk.isPaused = false;
|
|
161
161
|
emitEvent("resume");
|
|
162
162
|
}
|
|
163
|
-
function
|
|
163
|
+
function fireResizeEvent(width, height) {
|
|
164
|
+
handleResize(width, height);
|
|
165
|
+
}
|
|
166
|
+
function startMraidProtocol() {
|
|
164
167
|
if ("mraid" !== AD_PROTOCOL) return;
|
|
165
|
-
if (
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
if (
|
|
168
|
+
if (isProtocolInitialized) return;
|
|
169
|
+
mraid.removeEventListener("ready", startMraidProtocol);
|
|
170
|
+
function mraidStateChanged(viewable) {
|
|
171
|
+
if (viewable) {
|
|
172
|
+
if (sdk.isReady) {
|
|
173
|
+
handleResume();
|
|
174
|
+
} else {
|
|
170
175
|
const maxSize = mraid.getMaxSize();
|
|
171
176
|
sdk.maxWidth = Math.floor(maxSize.width);
|
|
172
177
|
sdk.maxHeight = Math.floor(maxSize.height);
|
|
178
|
+
bootAd();
|
|
173
179
|
}
|
|
174
|
-
|
|
180
|
+
} else {
|
|
181
|
+
handlePause();
|
|
175
182
|
}
|
|
176
|
-
} else {
|
|
177
|
-
handlePause();
|
|
178
183
|
}
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
184
|
+
function isViewable() {
|
|
185
|
+
return mraid.isViewable() && "hidden" !== mraid.getState();
|
|
186
|
+
}
|
|
187
|
+
function stateChanged() {
|
|
188
|
+
mraidStateChanged(isViewable());
|
|
189
|
+
}
|
|
190
|
+
mraid.addEventListener("viewableChange", stateChanged);
|
|
191
|
+
mraid.addEventListener("stateChange", stateChanged);
|
|
192
|
+
if (isViewable()) {
|
|
193
|
+
mraidStateChanged(true);
|
|
194
|
+
}
|
|
195
|
+
if (mraid.getAudioVolume) {
|
|
196
|
+
const isAudioEnabled = mraid.getAudioVolume();
|
|
197
|
+
if (isAudioEnabled) {
|
|
198
|
+
handleVolumeChange(1);
|
|
185
199
|
} else {
|
|
186
|
-
|
|
187
|
-
screenSize.width = Math.floor(screenSize.width);
|
|
188
|
-
screenSize.height = Math.floor(screenSize.height);
|
|
189
|
-
bootAd();
|
|
200
|
+
handleVolumeChange(0);
|
|
190
201
|
}
|
|
191
|
-
} else {
|
|
192
|
-
handlePause();
|
|
193
202
|
}
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
}
|
|
198
|
-
function startMraidProtocol() {
|
|
199
|
-
if ("mraid" !== AD_PROTOCOL) return;
|
|
200
|
-
if (!isProtocolInitialized) {
|
|
201
|
-
mraid.removeEventListener("ready", startMraidProtocol);
|
|
202
|
-
mraid.addEventListener("viewableChange", function() {
|
|
203
|
-
const isViewable = mraid.isViewable();
|
|
204
|
-
mraidIsViewable(isViewable);
|
|
205
|
-
});
|
|
206
|
-
if (mraid.isViewable() || AD_NETWORK == "adcolony") {
|
|
207
|
-
mraidIsViewable(true);
|
|
208
|
-
}
|
|
209
|
-
if (mraid.getAudioVolume) {
|
|
210
|
-
const isAudioEnabled = mraid.getAudioVolume();
|
|
211
|
-
if (isAudioEnabled) {
|
|
203
|
+
mraid.addEventListener("audioVolumeChange", function(newVolume) {
|
|
204
|
+
if (newVolume !== null) {
|
|
205
|
+
if (newVolume > 0) {
|
|
212
206
|
handleVolumeChange(1);
|
|
213
207
|
} else {
|
|
214
208
|
handleVolumeChange(0);
|
|
215
209
|
}
|
|
216
210
|
}
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
mraid.addEventListener("error", function(t, e) {
|
|
227
|
-
console.log("mraid error: " + t + " action: " + e);
|
|
228
|
-
});
|
|
229
|
-
mraid.addEventListener("sizeChange", function() {
|
|
230
|
-
const maxSize = mraid.getMaxSize();
|
|
231
|
-
fireResizeEvent(maxSize.width, maxSize.height);
|
|
232
|
-
});
|
|
233
|
-
isProtocolInitialized = true;
|
|
234
|
-
}
|
|
211
|
+
});
|
|
212
|
+
mraid.addEventListener("error", function(t, e) {
|
|
213
|
+
console.log("mraid error: " + t + " action: " + e);
|
|
214
|
+
});
|
|
215
|
+
mraid.addEventListener("sizeChange", function() {
|
|
216
|
+
const maxSize = mraid.getMaxSize();
|
|
217
|
+
fireResizeEvent(maxSize.width, maxSize.height);
|
|
218
|
+
});
|
|
219
|
+
isProtocolInitialized = true;
|
|
235
220
|
}
|
|
236
221
|
function startDapiProtocol() {
|
|
237
222
|
if ("dapi" !== AD_PROTOCOL) return;
|
|
238
|
-
if (
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
223
|
+
if (isProtocolInitialized) return;
|
|
224
|
+
function dapiIsViewable(event) {
|
|
225
|
+
if (event.isViewable) {
|
|
226
|
+
if (sdk.isReady) {
|
|
227
|
+
handleResume();
|
|
228
|
+
} else {
|
|
229
|
+
const screenSize = dapi.getScreenSize();
|
|
230
|
+
screenSize.width = Math.floor(screenSize.width);
|
|
231
|
+
screenSize.height = Math.floor(screenSize.height);
|
|
232
|
+
bootAd();
|
|
233
|
+
}
|
|
234
|
+
} else {
|
|
235
|
+
handlePause();
|
|
236
|
+
}
|
|
237
|
+
}
|
|
238
|
+
dapi.removeEventListener("ready", startDapiProtocol);
|
|
239
|
+
const isAudioEnabled = dapi.getAudioVolume();
|
|
240
|
+
if (isAudioEnabled) {
|
|
241
|
+
handleVolumeChange(1);
|
|
242
|
+
} else {
|
|
243
|
+
handleVolumeChange(0);
|
|
244
|
+
}
|
|
245
|
+
dapi.addEventListener("audioVolumeChange", function(volume) {
|
|
246
|
+
const isAudioEnabled2 = !!volume;
|
|
247
|
+
if (isAudioEnabled2) {
|
|
242
248
|
handleVolumeChange(1);
|
|
243
249
|
} else {
|
|
244
250
|
handleVolumeChange(0);
|
|
245
251
|
}
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
});
|
|
254
|
-
dapi.addEventListener("adResized", function(event) {
|
|
255
|
-
const maxSize = dapi.getScreenSize();
|
|
256
|
-
fireResizeEvent(event.width || maxSize.width, event.height || maxSize.height);
|
|
257
|
-
});
|
|
258
|
-
if (dapi.isViewable()) {
|
|
259
|
-
dapiIsViewable({ isViewable: true });
|
|
260
|
-
}
|
|
261
|
-
dapi.addEventListener("viewableChange", dapiIsViewable);
|
|
262
|
-
isProtocolInitialized = true;
|
|
252
|
+
});
|
|
253
|
+
dapi.addEventListener("adResized", function(event) {
|
|
254
|
+
const maxSize = dapi.getScreenSize();
|
|
255
|
+
fireResizeEvent(event.width || maxSize.width, event.height || maxSize.height);
|
|
256
|
+
});
|
|
257
|
+
if (dapi.isViewable()) {
|
|
258
|
+
dapiIsViewable({ isViewable: true });
|
|
263
259
|
}
|
|
260
|
+
dapi.addEventListener("viewableChange", dapiIsViewable);
|
|
261
|
+
isProtocolInitialized = true;
|
|
264
262
|
}
|
|
265
263
|
function startDefaultProtocol() {
|
|
266
|
-
if (
|
|
267
|
-
|
|
268
|
-
|
|
264
|
+
if (isProtocolInitialized) return;
|
|
265
|
+
if ("mintegral" === AD_NETWORK) {
|
|
266
|
+
window.mintGameStart = function() {
|
|
267
|
+
handleResume();
|
|
268
|
+
handleResize(sdk.maxWidth, sdk.maxHeight);
|
|
269
|
+
};
|
|
270
|
+
window.mintGameClose = function() {
|
|
271
|
+
handlePause();
|
|
269
272
|
};
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
+
}
|
|
274
|
+
document.addEventListener("visibilitychange", () => {
|
|
275
|
+
if (document.visibilityState === "visible") {
|
|
276
|
+
if (sdk.isReady) {
|
|
273
277
|
handleResume();
|
|
274
|
-
handleResize(sdk.maxWidth, sdk.maxHeight);
|
|
275
|
-
};
|
|
276
|
-
window.mintGameClose = function() {
|
|
277
|
-
handlePause();
|
|
278
|
-
};
|
|
279
|
-
}
|
|
280
|
-
document.addEventListener("visibilitychange", () => {
|
|
281
|
-
if (document.visibilityState === "visible") {
|
|
282
|
-
if (sdk.isReady) {
|
|
283
|
-
handleResume();
|
|
284
|
-
} else {
|
|
285
|
-
bootAd();
|
|
286
|
-
}
|
|
287
278
|
} else {
|
|
288
|
-
|
|
279
|
+
bootAd();
|
|
289
280
|
}
|
|
290
|
-
});
|
|
291
|
-
if (document.readyState === "complete") {
|
|
292
|
-
documentReady2();
|
|
293
281
|
} else {
|
|
294
|
-
|
|
282
|
+
handlePause();
|
|
295
283
|
}
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
284
|
+
});
|
|
285
|
+
function documentIsReady() {
|
|
286
|
+
if (document.visibilityState === "visible") bootAd();
|
|
287
|
+
}
|
|
288
|
+
if (document.readyState === "complete") {
|
|
289
|
+
documentIsReady();
|
|
290
|
+
} else {
|
|
291
|
+
window.addEventListener("load", documentIsReady);
|
|
292
|
+
}
|
|
293
|
+
window.addEventListener("resize", function() {
|
|
294
|
+
handleResize();
|
|
295
|
+
});
|
|
296
|
+
if ("tapjoy" === AD_NETWORK && isTapjoy()) {
|
|
297
|
+
const tapjoyApi = {
|
|
298
|
+
skipAd: function() {
|
|
299
|
+
try {
|
|
300
|
+
sdk.finish();
|
|
301
|
+
} catch (e) {
|
|
302
|
+
console.warn("Could not skip ad! | " + e);
|
|
307
303
|
}
|
|
308
|
-
}
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
isProtocolInitialized = true;
|
|
304
|
+
}
|
|
305
|
+
};
|
|
306
|
+
window.TJ_API.setPlayableAPI && window.TJ_API.setPlayableAPI(tapjoyApi);
|
|
312
307
|
}
|
|
308
|
+
isProtocolInitialized = true;
|
|
313
309
|
}
|
|
314
310
|
function finishTapjoy() {
|
|
315
311
|
window.TJ_API.objectiveComplete && window.TJ_API.objectiveComplete();
|
|
@@ -339,6 +335,18 @@ function registerTouchHandlers() {
|
|
|
339
335
|
isTouchEventRegistered = true;
|
|
340
336
|
}
|
|
341
337
|
}
|
|
338
|
+
function initSDK() {
|
|
339
|
+
destinationUrl = /android/i.test(navigator.userAgent) ? GOOGLE_PLAY_URL : APP_STORE_URL;
|
|
340
|
+
ensureProtocol();
|
|
341
|
+
if ("mraid" === AD_PROTOCOL && isMraid()) {
|
|
342
|
+
mraid.getState() === "loading" ? mraid.addEventListener("ready", startMraidProtocol) : startMraidProtocol();
|
|
343
|
+
} else if ("dapi" === AD_PROTOCOL && isDapi()) {
|
|
344
|
+
dapi.isReady() ? startDapiProtocol() : dapi.addEventListener("ready", startDapiProtocol);
|
|
345
|
+
} else {
|
|
346
|
+
startDefaultProtocol();
|
|
347
|
+
}
|
|
348
|
+
emitEvent("init");
|
|
349
|
+
}
|
|
342
350
|
var _sdk = class _sdk {
|
|
343
351
|
/**
|
|
344
352
|
* Initializes the SDK and sets up protocol-specific handlers.
|
|
@@ -360,23 +368,8 @@ var _sdk = class _sdk {
|
|
|
360
368
|
*/
|
|
361
369
|
static init(callback) {
|
|
362
370
|
if (isSDKInitialized) return;
|
|
363
|
-
destinationUrl = /android/i.test(navigator.userAgent) ? GOOGLE_PLAY_URL : APP_STORE_URL;
|
|
364
|
-
ensureProtocol();
|
|
365
371
|
if (callback) initCallback = callback;
|
|
366
|
-
|
|
367
|
-
if (mraid.getState() !== "ready") {
|
|
368
|
-
mraid.addEventListener("ready", startMraidProtocol);
|
|
369
|
-
} else {
|
|
370
|
-
startMraidProtocol();
|
|
371
|
-
}
|
|
372
|
-
} else if ("dapi" === AD_PROTOCOL && isDapi()) {
|
|
373
|
-
window.addEventListener("load", function() {
|
|
374
|
-
dapi.isReady() ? startDapiProtocol() : dapi.addEventListener("ready", startDapiProtocol);
|
|
375
|
-
});
|
|
376
|
-
} else {
|
|
377
|
-
startDefaultProtocol();
|
|
378
|
-
}
|
|
379
|
-
emitEvent("init");
|
|
372
|
+
document.readyState === "loading" ? window.addEventListener("DOMContentLoaded", initSDK) : initSDK();
|
|
380
373
|
isSDKInitialized = true;
|
|
381
374
|
}
|
|
382
375
|
/**
|
|
@@ -601,7 +594,7 @@ var _sdk = class _sdk {
|
|
|
601
594
|
}
|
|
602
595
|
};
|
|
603
596
|
/** Current version of the SDK */
|
|
604
|
-
_sdk.version = "1.0.
|
|
597
|
+
_sdk.version = "1.0.16";
|
|
605
598
|
/** Current maximum width of the playable ad container in pixels */
|
|
606
599
|
_sdk.maxWidth = Math.floor(window.innerWidth);
|
|
607
600
|
/** Current maximum height of the playable ad container in pixels */
|
package/dist/iife/index.js
CHANGED
|
@@ -162,156 +162,152 @@
|
|
|
162
162
|
sdk.isPaused = false;
|
|
163
163
|
emitEvent("resume");
|
|
164
164
|
}
|
|
165
|
-
function
|
|
165
|
+
function fireResizeEvent(width, height) {
|
|
166
|
+
handleResize(width, height);
|
|
167
|
+
}
|
|
168
|
+
function startMraidProtocol() {
|
|
166
169
|
if ("mraid" !== AD_PROTOCOL) return;
|
|
167
|
-
if (
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
if (
|
|
170
|
+
if (isProtocolInitialized) return;
|
|
171
|
+
mraid.removeEventListener("ready", startMraidProtocol);
|
|
172
|
+
function mraidStateChanged(viewable) {
|
|
173
|
+
if (viewable) {
|
|
174
|
+
if (sdk.isReady) {
|
|
175
|
+
handleResume();
|
|
176
|
+
} else {
|
|
172
177
|
const maxSize = mraid.getMaxSize();
|
|
173
178
|
sdk.maxWidth = Math.floor(maxSize.width);
|
|
174
179
|
sdk.maxHeight = Math.floor(maxSize.height);
|
|
180
|
+
bootAd();
|
|
175
181
|
}
|
|
176
|
-
|
|
182
|
+
} else {
|
|
183
|
+
handlePause();
|
|
177
184
|
}
|
|
178
|
-
} else {
|
|
179
|
-
handlePause();
|
|
180
185
|
}
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
186
|
+
function isViewable() {
|
|
187
|
+
return mraid.isViewable() && "hidden" !== mraid.getState();
|
|
188
|
+
}
|
|
189
|
+
function stateChanged() {
|
|
190
|
+
mraidStateChanged(isViewable());
|
|
191
|
+
}
|
|
192
|
+
mraid.addEventListener("viewableChange", stateChanged);
|
|
193
|
+
mraid.addEventListener("stateChange", stateChanged);
|
|
194
|
+
if (isViewable()) {
|
|
195
|
+
mraidStateChanged(true);
|
|
196
|
+
}
|
|
197
|
+
if (mraid.getAudioVolume) {
|
|
198
|
+
const isAudioEnabled = mraid.getAudioVolume();
|
|
199
|
+
if (isAudioEnabled) {
|
|
200
|
+
handleVolumeChange(1);
|
|
187
201
|
} else {
|
|
188
|
-
|
|
189
|
-
screenSize.width = Math.floor(screenSize.width);
|
|
190
|
-
screenSize.height = Math.floor(screenSize.height);
|
|
191
|
-
bootAd();
|
|
202
|
+
handleVolumeChange(0);
|
|
192
203
|
}
|
|
193
|
-
} else {
|
|
194
|
-
handlePause();
|
|
195
204
|
}
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
}
|
|
200
|
-
function startMraidProtocol() {
|
|
201
|
-
if ("mraid" !== AD_PROTOCOL) return;
|
|
202
|
-
if (!isProtocolInitialized) {
|
|
203
|
-
mraid.removeEventListener("ready", startMraidProtocol);
|
|
204
|
-
mraid.addEventListener("viewableChange", function() {
|
|
205
|
-
const isViewable = mraid.isViewable();
|
|
206
|
-
mraidIsViewable(isViewable);
|
|
207
|
-
});
|
|
208
|
-
if (mraid.isViewable() || AD_NETWORK == "adcolony") {
|
|
209
|
-
mraidIsViewable(true);
|
|
210
|
-
}
|
|
211
|
-
if (mraid.getAudioVolume) {
|
|
212
|
-
const isAudioEnabled = mraid.getAudioVolume();
|
|
213
|
-
if (isAudioEnabled) {
|
|
205
|
+
mraid.addEventListener("audioVolumeChange", function(newVolume) {
|
|
206
|
+
if (newVolume !== null) {
|
|
207
|
+
if (newVolume > 0) {
|
|
214
208
|
handleVolumeChange(1);
|
|
215
209
|
} else {
|
|
216
210
|
handleVolumeChange(0);
|
|
217
211
|
}
|
|
218
212
|
}
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
mraid.addEventListener("error", function(t, e) {
|
|
229
|
-
console.log("mraid error: " + t + " action: " + e);
|
|
230
|
-
});
|
|
231
|
-
mraid.addEventListener("sizeChange", function() {
|
|
232
|
-
const maxSize = mraid.getMaxSize();
|
|
233
|
-
fireResizeEvent(maxSize.width, maxSize.height);
|
|
234
|
-
});
|
|
235
|
-
isProtocolInitialized = true;
|
|
236
|
-
}
|
|
213
|
+
});
|
|
214
|
+
mraid.addEventListener("error", function(t, e) {
|
|
215
|
+
console.log("mraid error: " + t + " action: " + e);
|
|
216
|
+
});
|
|
217
|
+
mraid.addEventListener("sizeChange", function() {
|
|
218
|
+
const maxSize = mraid.getMaxSize();
|
|
219
|
+
fireResizeEvent(maxSize.width, maxSize.height);
|
|
220
|
+
});
|
|
221
|
+
isProtocolInitialized = true;
|
|
237
222
|
}
|
|
238
223
|
function startDapiProtocol() {
|
|
239
224
|
if ("dapi" !== AD_PROTOCOL) return;
|
|
240
|
-
if (
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
225
|
+
if (isProtocolInitialized) return;
|
|
226
|
+
function dapiIsViewable(event) {
|
|
227
|
+
if (event.isViewable) {
|
|
228
|
+
if (sdk.isReady) {
|
|
229
|
+
handleResume();
|
|
230
|
+
} else {
|
|
231
|
+
const screenSize = dapi.getScreenSize();
|
|
232
|
+
screenSize.width = Math.floor(screenSize.width);
|
|
233
|
+
screenSize.height = Math.floor(screenSize.height);
|
|
234
|
+
bootAd();
|
|
235
|
+
}
|
|
236
|
+
} else {
|
|
237
|
+
handlePause();
|
|
238
|
+
}
|
|
239
|
+
}
|
|
240
|
+
dapi.removeEventListener("ready", startDapiProtocol);
|
|
241
|
+
const isAudioEnabled = dapi.getAudioVolume();
|
|
242
|
+
if (isAudioEnabled) {
|
|
243
|
+
handleVolumeChange(1);
|
|
244
|
+
} else {
|
|
245
|
+
handleVolumeChange(0);
|
|
246
|
+
}
|
|
247
|
+
dapi.addEventListener("audioVolumeChange", function(volume) {
|
|
248
|
+
const isAudioEnabled2 = !!volume;
|
|
249
|
+
if (isAudioEnabled2) {
|
|
244
250
|
handleVolumeChange(1);
|
|
245
251
|
} else {
|
|
246
252
|
handleVolumeChange(0);
|
|
247
253
|
}
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
});
|
|
256
|
-
dapi.addEventListener("adResized", function(event) {
|
|
257
|
-
const maxSize = dapi.getScreenSize();
|
|
258
|
-
fireResizeEvent(event.width || maxSize.width, event.height || maxSize.height);
|
|
259
|
-
});
|
|
260
|
-
if (dapi.isViewable()) {
|
|
261
|
-
dapiIsViewable({ isViewable: true });
|
|
262
|
-
}
|
|
263
|
-
dapi.addEventListener("viewableChange", dapiIsViewable);
|
|
264
|
-
isProtocolInitialized = true;
|
|
254
|
+
});
|
|
255
|
+
dapi.addEventListener("adResized", function(event) {
|
|
256
|
+
const maxSize = dapi.getScreenSize();
|
|
257
|
+
fireResizeEvent(event.width || maxSize.width, event.height || maxSize.height);
|
|
258
|
+
});
|
|
259
|
+
if (dapi.isViewable()) {
|
|
260
|
+
dapiIsViewable({ isViewable: true });
|
|
265
261
|
}
|
|
262
|
+
dapi.addEventListener("viewableChange", dapiIsViewable);
|
|
263
|
+
isProtocolInitialized = true;
|
|
266
264
|
}
|
|
267
265
|
function startDefaultProtocol() {
|
|
268
|
-
if (
|
|
269
|
-
|
|
270
|
-
|
|
266
|
+
if (isProtocolInitialized) return;
|
|
267
|
+
if ("mintegral" === AD_NETWORK) {
|
|
268
|
+
window.mintGameStart = function() {
|
|
269
|
+
handleResume();
|
|
270
|
+
handleResize(sdk.maxWidth, sdk.maxHeight);
|
|
271
|
+
};
|
|
272
|
+
window.mintGameClose = function() {
|
|
273
|
+
handlePause();
|
|
271
274
|
};
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
+
}
|
|
276
|
+
document.addEventListener("visibilitychange", () => {
|
|
277
|
+
if (document.visibilityState === "visible") {
|
|
278
|
+
if (sdk.isReady) {
|
|
275
279
|
handleResume();
|
|
276
|
-
handleResize(sdk.maxWidth, sdk.maxHeight);
|
|
277
|
-
};
|
|
278
|
-
window.mintGameClose = function() {
|
|
279
|
-
handlePause();
|
|
280
|
-
};
|
|
281
|
-
}
|
|
282
|
-
document.addEventListener("visibilitychange", () => {
|
|
283
|
-
if (document.visibilityState === "visible") {
|
|
284
|
-
if (sdk.isReady) {
|
|
285
|
-
handleResume();
|
|
286
|
-
} else {
|
|
287
|
-
bootAd();
|
|
288
|
-
}
|
|
289
280
|
} else {
|
|
290
|
-
|
|
281
|
+
bootAd();
|
|
291
282
|
}
|
|
292
|
-
});
|
|
293
|
-
if (document.readyState === "complete") {
|
|
294
|
-
documentReady2();
|
|
295
283
|
} else {
|
|
296
|
-
|
|
284
|
+
handlePause();
|
|
297
285
|
}
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
286
|
+
});
|
|
287
|
+
function documentIsReady() {
|
|
288
|
+
if (document.visibilityState === "visible") bootAd();
|
|
289
|
+
}
|
|
290
|
+
if (document.readyState === "complete") {
|
|
291
|
+
documentIsReady();
|
|
292
|
+
} else {
|
|
293
|
+
window.addEventListener("load", documentIsReady);
|
|
294
|
+
}
|
|
295
|
+
window.addEventListener("resize", function() {
|
|
296
|
+
handleResize();
|
|
297
|
+
});
|
|
298
|
+
if ("tapjoy" === AD_NETWORK && isTapjoy()) {
|
|
299
|
+
const tapjoyApi = {
|
|
300
|
+
skipAd: function() {
|
|
301
|
+
try {
|
|
302
|
+
sdk.finish();
|
|
303
|
+
} catch (e) {
|
|
304
|
+
console.warn("Could not skip ad! | " + e);
|
|
309
305
|
}
|
|
310
|
-
}
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
isProtocolInitialized = true;
|
|
306
|
+
}
|
|
307
|
+
};
|
|
308
|
+
window.TJ_API.setPlayableAPI && window.TJ_API.setPlayableAPI(tapjoyApi);
|
|
314
309
|
}
|
|
310
|
+
isProtocolInitialized = true;
|
|
315
311
|
}
|
|
316
312
|
function finishTapjoy() {
|
|
317
313
|
window.TJ_API.objectiveComplete && window.TJ_API.objectiveComplete();
|
|
@@ -341,6 +337,18 @@
|
|
|
341
337
|
isTouchEventRegistered = true;
|
|
342
338
|
}
|
|
343
339
|
}
|
|
340
|
+
function initSDK() {
|
|
341
|
+
destinationUrl = /android/i.test(navigator.userAgent) ? GOOGLE_PLAY_URL : APP_STORE_URL;
|
|
342
|
+
ensureProtocol();
|
|
343
|
+
if ("mraid" === AD_PROTOCOL && isMraid()) {
|
|
344
|
+
mraid.getState() === "loading" ? mraid.addEventListener("ready", startMraidProtocol) : startMraidProtocol();
|
|
345
|
+
} else if ("dapi" === AD_PROTOCOL && isDapi()) {
|
|
346
|
+
dapi.isReady() ? startDapiProtocol() : dapi.addEventListener("ready", startDapiProtocol);
|
|
347
|
+
} else {
|
|
348
|
+
startDefaultProtocol();
|
|
349
|
+
}
|
|
350
|
+
emitEvent("init");
|
|
351
|
+
}
|
|
344
352
|
var _sdk = class _sdk {
|
|
345
353
|
/**
|
|
346
354
|
* Initializes the SDK and sets up protocol-specific handlers.
|
|
@@ -362,23 +370,8 @@
|
|
|
362
370
|
*/
|
|
363
371
|
static init(callback) {
|
|
364
372
|
if (isSDKInitialized) return;
|
|
365
|
-
destinationUrl = /android/i.test(navigator.userAgent) ? GOOGLE_PLAY_URL : APP_STORE_URL;
|
|
366
|
-
ensureProtocol();
|
|
367
373
|
if (callback) initCallback = callback;
|
|
368
|
-
|
|
369
|
-
if (mraid.getState() !== "ready") {
|
|
370
|
-
mraid.addEventListener("ready", startMraidProtocol);
|
|
371
|
-
} else {
|
|
372
|
-
startMraidProtocol();
|
|
373
|
-
}
|
|
374
|
-
} else if ("dapi" === AD_PROTOCOL && isDapi()) {
|
|
375
|
-
window.addEventListener("load", function() {
|
|
376
|
-
dapi.isReady() ? startDapiProtocol() : dapi.addEventListener("ready", startDapiProtocol);
|
|
377
|
-
});
|
|
378
|
-
} else {
|
|
379
|
-
startDefaultProtocol();
|
|
380
|
-
}
|
|
381
|
-
emitEvent("init");
|
|
374
|
+
document.readyState === "loading" ? window.addEventListener("DOMContentLoaded", initSDK) : initSDK();
|
|
382
375
|
isSDKInitialized = true;
|
|
383
376
|
}
|
|
384
377
|
/**
|
|
@@ -603,7 +596,7 @@
|
|
|
603
596
|
}
|
|
604
597
|
};
|
|
605
598
|
/** Current version of the SDK */
|
|
606
|
-
_sdk.version = "1.0.
|
|
599
|
+
_sdk.version = "1.0.16";
|
|
607
600
|
/** Current maximum width of the playable ad container in pixels */
|
|
608
601
|
_sdk.maxWidth = Math.floor(window.innerWidth);
|
|
609
602
|
/** Current maximum height of the playable ad container in pixels */
|
package/dist/index.js
CHANGED
|
@@ -187,156 +187,152 @@ function handleResume() {
|
|
|
187
187
|
sdk.isPaused = false;
|
|
188
188
|
emitEvent("resume");
|
|
189
189
|
}
|
|
190
|
-
function
|
|
190
|
+
function fireResizeEvent(width, height) {
|
|
191
|
+
handleResize(width, height);
|
|
192
|
+
}
|
|
193
|
+
function startMraidProtocol() {
|
|
191
194
|
if ("mraid" !== AD_PROTOCOL) return;
|
|
192
|
-
if (
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
if (
|
|
195
|
+
if (isProtocolInitialized) return;
|
|
196
|
+
mraid.removeEventListener("ready", startMraidProtocol);
|
|
197
|
+
function mraidStateChanged(viewable) {
|
|
198
|
+
if (viewable) {
|
|
199
|
+
if (sdk.isReady) {
|
|
200
|
+
handleResume();
|
|
201
|
+
} else {
|
|
197
202
|
const maxSize = mraid.getMaxSize();
|
|
198
203
|
sdk.maxWidth = Math.floor(maxSize.width);
|
|
199
204
|
sdk.maxHeight = Math.floor(maxSize.height);
|
|
205
|
+
bootAd();
|
|
200
206
|
}
|
|
201
|
-
|
|
207
|
+
} else {
|
|
208
|
+
handlePause();
|
|
202
209
|
}
|
|
203
|
-
} else {
|
|
204
|
-
handlePause();
|
|
205
210
|
}
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
211
|
+
function isViewable() {
|
|
212
|
+
return mraid.isViewable() && "hidden" !== mraid.getState();
|
|
213
|
+
}
|
|
214
|
+
function stateChanged() {
|
|
215
|
+
mraidStateChanged(isViewable());
|
|
216
|
+
}
|
|
217
|
+
mraid.addEventListener("viewableChange", stateChanged);
|
|
218
|
+
mraid.addEventListener("stateChange", stateChanged);
|
|
219
|
+
if (isViewable()) {
|
|
220
|
+
mraidStateChanged(true);
|
|
221
|
+
}
|
|
222
|
+
if (mraid.getAudioVolume) {
|
|
223
|
+
const isAudioEnabled = mraid.getAudioVolume();
|
|
224
|
+
if (isAudioEnabled) {
|
|
225
|
+
handleVolumeChange(1);
|
|
212
226
|
} else {
|
|
213
|
-
|
|
214
|
-
screenSize.width = Math.floor(screenSize.width);
|
|
215
|
-
screenSize.height = Math.floor(screenSize.height);
|
|
216
|
-
bootAd();
|
|
227
|
+
handleVolumeChange(0);
|
|
217
228
|
}
|
|
218
|
-
} else {
|
|
219
|
-
handlePause();
|
|
220
229
|
}
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
}
|
|
225
|
-
function startMraidProtocol() {
|
|
226
|
-
if ("mraid" !== AD_PROTOCOL) return;
|
|
227
|
-
if (!isProtocolInitialized) {
|
|
228
|
-
mraid.removeEventListener("ready", startMraidProtocol);
|
|
229
|
-
mraid.addEventListener("viewableChange", function() {
|
|
230
|
-
const isViewable = mraid.isViewable();
|
|
231
|
-
mraidIsViewable(isViewable);
|
|
232
|
-
});
|
|
233
|
-
if (mraid.isViewable() || AD_NETWORK == "adcolony") {
|
|
234
|
-
mraidIsViewable(true);
|
|
235
|
-
}
|
|
236
|
-
if (mraid.getAudioVolume) {
|
|
237
|
-
const isAudioEnabled = mraid.getAudioVolume();
|
|
238
|
-
if (isAudioEnabled) {
|
|
230
|
+
mraid.addEventListener("audioVolumeChange", function(newVolume) {
|
|
231
|
+
if (newVolume !== null) {
|
|
232
|
+
if (newVolume > 0) {
|
|
239
233
|
handleVolumeChange(1);
|
|
240
234
|
} else {
|
|
241
235
|
handleVolumeChange(0);
|
|
242
236
|
}
|
|
243
237
|
}
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
mraid.addEventListener("error", function(t, e) {
|
|
254
|
-
console.log("mraid error: " + t + " action: " + e);
|
|
255
|
-
});
|
|
256
|
-
mraid.addEventListener("sizeChange", function() {
|
|
257
|
-
const maxSize = mraid.getMaxSize();
|
|
258
|
-
fireResizeEvent(maxSize.width, maxSize.height);
|
|
259
|
-
});
|
|
260
|
-
isProtocolInitialized = true;
|
|
261
|
-
}
|
|
238
|
+
});
|
|
239
|
+
mraid.addEventListener("error", function(t, e) {
|
|
240
|
+
console.log("mraid error: " + t + " action: " + e);
|
|
241
|
+
});
|
|
242
|
+
mraid.addEventListener("sizeChange", function() {
|
|
243
|
+
const maxSize = mraid.getMaxSize();
|
|
244
|
+
fireResizeEvent(maxSize.width, maxSize.height);
|
|
245
|
+
});
|
|
246
|
+
isProtocolInitialized = true;
|
|
262
247
|
}
|
|
263
248
|
function startDapiProtocol() {
|
|
264
249
|
if ("dapi" !== AD_PROTOCOL) return;
|
|
265
|
-
if (
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
250
|
+
if (isProtocolInitialized) return;
|
|
251
|
+
function dapiIsViewable(event) {
|
|
252
|
+
if (event.isViewable) {
|
|
253
|
+
if (sdk.isReady) {
|
|
254
|
+
handleResume();
|
|
255
|
+
} else {
|
|
256
|
+
const screenSize = dapi.getScreenSize();
|
|
257
|
+
screenSize.width = Math.floor(screenSize.width);
|
|
258
|
+
screenSize.height = Math.floor(screenSize.height);
|
|
259
|
+
bootAd();
|
|
260
|
+
}
|
|
261
|
+
} else {
|
|
262
|
+
handlePause();
|
|
263
|
+
}
|
|
264
|
+
}
|
|
265
|
+
dapi.removeEventListener("ready", startDapiProtocol);
|
|
266
|
+
const isAudioEnabled = dapi.getAudioVolume();
|
|
267
|
+
if (isAudioEnabled) {
|
|
268
|
+
handleVolumeChange(1);
|
|
269
|
+
} else {
|
|
270
|
+
handleVolumeChange(0);
|
|
271
|
+
}
|
|
272
|
+
dapi.addEventListener("audioVolumeChange", function(volume) {
|
|
273
|
+
const isAudioEnabled2 = !!volume;
|
|
274
|
+
if (isAudioEnabled2) {
|
|
269
275
|
handleVolumeChange(1);
|
|
270
276
|
} else {
|
|
271
277
|
handleVolumeChange(0);
|
|
272
278
|
}
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
});
|
|
281
|
-
dapi.addEventListener("adResized", function(event) {
|
|
282
|
-
const maxSize = dapi.getScreenSize();
|
|
283
|
-
fireResizeEvent(event.width || maxSize.width, event.height || maxSize.height);
|
|
284
|
-
});
|
|
285
|
-
if (dapi.isViewable()) {
|
|
286
|
-
dapiIsViewable({ isViewable: true });
|
|
287
|
-
}
|
|
288
|
-
dapi.addEventListener("viewableChange", dapiIsViewable);
|
|
289
|
-
isProtocolInitialized = true;
|
|
279
|
+
});
|
|
280
|
+
dapi.addEventListener("adResized", function(event) {
|
|
281
|
+
const maxSize = dapi.getScreenSize();
|
|
282
|
+
fireResizeEvent(event.width || maxSize.width, event.height || maxSize.height);
|
|
283
|
+
});
|
|
284
|
+
if (dapi.isViewable()) {
|
|
285
|
+
dapiIsViewable({ isViewable: true });
|
|
290
286
|
}
|
|
287
|
+
dapi.addEventListener("viewableChange", dapiIsViewable);
|
|
288
|
+
isProtocolInitialized = true;
|
|
291
289
|
}
|
|
292
290
|
function startDefaultProtocol() {
|
|
293
|
-
if (
|
|
294
|
-
|
|
295
|
-
|
|
291
|
+
if (isProtocolInitialized) return;
|
|
292
|
+
if ("mintegral" === AD_NETWORK) {
|
|
293
|
+
window.mintGameStart = function() {
|
|
294
|
+
handleResume();
|
|
295
|
+
handleResize(sdk.maxWidth, sdk.maxHeight);
|
|
296
|
+
};
|
|
297
|
+
window.mintGameClose = function() {
|
|
298
|
+
handlePause();
|
|
296
299
|
};
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
+
}
|
|
301
|
+
document.addEventListener("visibilitychange", () => {
|
|
302
|
+
if (document.visibilityState === "visible") {
|
|
303
|
+
if (sdk.isReady) {
|
|
300
304
|
handleResume();
|
|
301
|
-
handleResize(sdk.maxWidth, sdk.maxHeight);
|
|
302
|
-
};
|
|
303
|
-
window.mintGameClose = function() {
|
|
304
|
-
handlePause();
|
|
305
|
-
};
|
|
306
|
-
}
|
|
307
|
-
document.addEventListener("visibilitychange", () => {
|
|
308
|
-
if (document.visibilityState === "visible") {
|
|
309
|
-
if (sdk.isReady) {
|
|
310
|
-
handleResume();
|
|
311
|
-
} else {
|
|
312
|
-
bootAd();
|
|
313
|
-
}
|
|
314
305
|
} else {
|
|
315
|
-
|
|
306
|
+
bootAd();
|
|
316
307
|
}
|
|
317
|
-
});
|
|
318
|
-
if (document.readyState === "complete") {
|
|
319
|
-
documentReady2();
|
|
320
308
|
} else {
|
|
321
|
-
|
|
309
|
+
handlePause();
|
|
322
310
|
}
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
311
|
+
});
|
|
312
|
+
function documentIsReady() {
|
|
313
|
+
if (document.visibilityState === "visible") bootAd();
|
|
314
|
+
}
|
|
315
|
+
if (document.readyState === "complete") {
|
|
316
|
+
documentIsReady();
|
|
317
|
+
} else {
|
|
318
|
+
window.addEventListener("load", documentIsReady);
|
|
319
|
+
}
|
|
320
|
+
window.addEventListener("resize", function() {
|
|
321
|
+
handleResize();
|
|
322
|
+
});
|
|
323
|
+
if ("tapjoy" === AD_NETWORK && isTapjoy()) {
|
|
324
|
+
const tapjoyApi = {
|
|
325
|
+
skipAd: function() {
|
|
326
|
+
try {
|
|
327
|
+
sdk.finish();
|
|
328
|
+
} catch (e) {
|
|
329
|
+
console.warn("Could not skip ad! | " + e);
|
|
334
330
|
}
|
|
335
|
-
}
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
isProtocolInitialized = true;
|
|
331
|
+
}
|
|
332
|
+
};
|
|
333
|
+
window.TJ_API.setPlayableAPI && window.TJ_API.setPlayableAPI(tapjoyApi);
|
|
339
334
|
}
|
|
335
|
+
isProtocolInitialized = true;
|
|
340
336
|
}
|
|
341
337
|
function finishTapjoy() {
|
|
342
338
|
window.TJ_API.objectiveComplete && window.TJ_API.objectiveComplete();
|
|
@@ -366,6 +362,18 @@ function registerTouchHandlers() {
|
|
|
366
362
|
isTouchEventRegistered = true;
|
|
367
363
|
}
|
|
368
364
|
}
|
|
365
|
+
function initSDK() {
|
|
366
|
+
destinationUrl = /android/i.test(navigator.userAgent) ? GOOGLE_PLAY_URL : APP_STORE_URL;
|
|
367
|
+
ensureProtocol();
|
|
368
|
+
if ("mraid" === AD_PROTOCOL && isMraid()) {
|
|
369
|
+
mraid.getState() === "loading" ? mraid.addEventListener("ready", startMraidProtocol) : startMraidProtocol();
|
|
370
|
+
} else if ("dapi" === AD_PROTOCOL && isDapi()) {
|
|
371
|
+
dapi.isReady() ? startDapiProtocol() : dapi.addEventListener("ready", startDapiProtocol);
|
|
372
|
+
} else {
|
|
373
|
+
startDefaultProtocol();
|
|
374
|
+
}
|
|
375
|
+
emitEvent("init");
|
|
376
|
+
}
|
|
369
377
|
var _sdk = class _sdk {
|
|
370
378
|
/**
|
|
371
379
|
* Initializes the SDK and sets up protocol-specific handlers.
|
|
@@ -387,23 +395,8 @@ var _sdk = class _sdk {
|
|
|
387
395
|
*/
|
|
388
396
|
static init(callback) {
|
|
389
397
|
if (isSDKInitialized) return;
|
|
390
|
-
destinationUrl = /android/i.test(navigator.userAgent) ? GOOGLE_PLAY_URL : APP_STORE_URL;
|
|
391
|
-
ensureProtocol();
|
|
392
398
|
if (callback) initCallback = callback;
|
|
393
|
-
|
|
394
|
-
if (mraid.getState() !== "ready") {
|
|
395
|
-
mraid.addEventListener("ready", startMraidProtocol);
|
|
396
|
-
} else {
|
|
397
|
-
startMraidProtocol();
|
|
398
|
-
}
|
|
399
|
-
} else if ("dapi" === AD_PROTOCOL && isDapi()) {
|
|
400
|
-
window.addEventListener("load", function() {
|
|
401
|
-
dapi.isReady() ? startDapiProtocol() : dapi.addEventListener("ready", startDapiProtocol);
|
|
402
|
-
});
|
|
403
|
-
} else {
|
|
404
|
-
startDefaultProtocol();
|
|
405
|
-
}
|
|
406
|
-
emitEvent("init");
|
|
399
|
+
document.readyState === "loading" ? window.addEventListener("DOMContentLoaded", initSDK) : initSDK();
|
|
407
400
|
isSDKInitialized = true;
|
|
408
401
|
}
|
|
409
402
|
/**
|
|
@@ -628,7 +621,7 @@ var _sdk = class _sdk {
|
|
|
628
621
|
}
|
|
629
622
|
};
|
|
630
623
|
/** Current version of the SDK */
|
|
631
|
-
_sdk.version = "1.0.
|
|
624
|
+
_sdk.version = "1.0.16";
|
|
632
625
|
/** Current maximum width of the playable ad container in pixels */
|
|
633
626
|
_sdk.maxWidth = Math.floor(window.innerWidth);
|
|
634
627
|
/** 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.
|
|
3
|
+
"version": "1.0.16",
|
|
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",
|