stormcloud-video-player 0.6.9 → 0.6.10

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.
@@ -614,6 +614,7 @@ function createVastAdLayer(contentVideo, options) {
614
614
  var adHls;
615
615
  var adContainerEl;
616
616
  var currentAd;
617
+ var currentMediaFile;
617
618
  var sessionId;
618
619
  var destroyed = false;
619
620
  var tornDown = false;
@@ -860,7 +861,12 @@ function createVastAdLayer(contentVideo, options) {
860
861
  adContainerEl.style.display = "none";
861
862
  adContainerEl.style.pointerEvents = "none";
862
863
  }
863
- emit("ad_impression");
864
+ emit("ad_impression", {
865
+ adId: currentAd === null || currentAd === void 0 ? void 0 : currentAd.id,
866
+ adTitle: currentAd === null || currentAd === void 0 ? void 0 : currentAd.title,
867
+ adUrl: currentMediaFile === null || currentMediaFile === void 0 ? void 0 : currentMediaFile.url,
868
+ mediaType: currentMediaFile === null || currentMediaFile === void 0 ? void 0 : currentMediaFile.type
869
+ });
864
870
  emit("content_resume");
865
871
  }
866
872
  function handleAdError() {
@@ -882,6 +888,7 @@ function createVastAdLayer(contentVideo, options) {
882
888
  adHls.destroy();
883
889
  adHls = void 0;
884
890
  }
891
+ currentMediaFile = void 0;
885
892
  if (adVideoElement) {
886
893
  if (singleElementMode && adVideoElement === contentVideo) {
887
894
  contentVideo.pause();
@@ -1046,6 +1053,7 @@ function createVastAdLayer(contentVideo, options) {
1046
1053
  adVideoElement.volume = Math.max(0, Math.min(1, adVolume2));
1047
1054
  adVideoElement.muted = false;
1048
1055
  mediaFile2 = selectBestMediaFile(ad.mediaFiles);
1056
+ currentMediaFile = mediaFile2;
1049
1057
  if (debug) console.log("".concat(LOG, " Loading ad from: ").concat(mediaFile2.url));
1050
1058
  startPlayback(mediaFile2);
1051
1059
  return [
@@ -1092,6 +1100,7 @@ function createVastAdLayer(contentVideo, options) {
1092
1100
  }
1093
1101
  emit("content_pause");
1094
1102
  mediaFile = selectBestMediaFile(ad.mediaFiles);
1103
+ currentMediaFile = mediaFile;
1095
1104
  if (debug) console.log("".concat(LOG, " Loading ad from: ").concat(mediaFile.url));
1096
1105
  startPlayback(mediaFile);
1097
1106
  return [
@@ -1257,6 +1266,7 @@ function createVastAdLayer(contentVideo, options) {
1257
1266
  ];
1258
1267
  mainHlsInstance === null || mainHlsInstance === void 0 ? void 0 : mainHlsInstance.detachMedia();
1259
1268
  teardownCurrentPlayback();
1269
+ currentMediaFile = slot.mediaFile;
1260
1270
  adVideoElement = contentVideo;
1261
1271
  adHls = void 0;
1262
1272
  adPlaying = true;
@@ -1291,6 +1301,7 @@ function createVastAdLayer(contentVideo, options) {
1291
1301
  case 2:
1292
1302
  if (smartTVMode && !slot.videoEl) {
1293
1303
  teardownCurrentPlayback();
1304
+ currentMediaFile = slot.mediaFile;
1294
1305
  if (adVideoElement) {
1295
1306
  adVideoElement.remove();
1296
1307
  adVideoElement = void 0;
@@ -1322,6 +1333,7 @@ function createVastAdLayer(contentVideo, options) {
1322
1333
  ];
1323
1334
  }
1324
1335
  teardownCurrentPlayback();
1336
+ currentMediaFile = slot.mediaFile;
1325
1337
  if (adVideoElement && adVideoElement !== slot.videoEl) {
1326
1338
  adVideoElement.remove();
1327
1339
  }
@@ -1453,6 +1465,7 @@ function createVastAdLayer(contentVideo, options) {
1453
1465
  }
1454
1466
  }
1455
1467
  currentAd = void 0;
1468
+ currentMediaFile = void 0;
1456
1469
  tornDown = false;
1457
1470
  return [
1458
1471
  2
@@ -1505,6 +1518,7 @@ function createVastAdLayer(contentVideo, options) {
1505
1518
  }
1506
1519
  adContainerEl = void 0;
1507
1520
  currentAd = void 0;
1521
+ currentMediaFile = void 0;
1508
1522
  listeners.clear();
1509
1523
  },
1510
1524
  isAdPlaying: function isAdPlaying() {