stormcloud-video-player 0.6.5 → 0.6.7

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.
@@ -994,6 +994,7 @@ function createVastAdLayer(contentVideo, options) {
994
994
  var tornDown = false;
995
995
  var trackingFired = createEmptyTrackingState();
996
996
  var adStallTimerId;
997
+ var savedContentVideoStyles;
997
998
  var currentAdEventHandlers;
998
999
  var preloadSlots = /* @__PURE__ */ new Map();
999
1000
  function emit(event, payload) {
@@ -1110,7 +1111,7 @@ function createVastAdLayer(contentVideo, options) {
1110
1111
  video.style.top = "0";
1111
1112
  video.style.width = "100%";
1112
1113
  video.style.height = "100%";
1113
- video.style.objectFit = "contain";
1114
+ video.style.objectFit = "cover";
1114
1115
  video.style.backgroundColor = "#000";
1115
1116
  video.playsInline = true;
1116
1117
  video.muted = false;
@@ -1225,12 +1226,31 @@ function createVastAdLayer(contentVideo, options) {
1225
1226
  delete contentVideo.dataset.stormcloudAdPlaying;
1226
1227
  }
1227
1228
  }
1229
+ function applyContentVideoAdCoverStyles() {
1230
+ if (!singleElementMode) return;
1231
+ savedContentVideoStyles = {
1232
+ objectFit: contentVideo.style.objectFit,
1233
+ width: contentVideo.style.width,
1234
+ height: contentVideo.style.height
1235
+ };
1236
+ contentVideo.style.objectFit = "cover";
1237
+ contentVideo.style.width = "100%";
1238
+ contentVideo.style.height = "100%";
1239
+ }
1240
+ function restoreContentVideoStyles() {
1241
+ if (!singleElementMode || !savedContentVideoStyles) return;
1242
+ contentVideo.style.objectFit = savedContentVideoStyles.objectFit;
1243
+ contentVideo.style.width = savedContentVideoStyles.width;
1244
+ contentVideo.style.height = savedContentVideoStyles.height;
1245
+ savedContentVideoStyles = void 0;
1246
+ }
1228
1247
  function handleAdComplete() {
1229
1248
  if (tornDown) return;
1230
1249
  clearAdStallTimer();
1231
1250
  if (debug) console.log("".concat(LOG, " Handling ad completion"));
1232
1251
  adPlaying = false;
1233
1252
  setAdPlayingFlag(false);
1253
+ restoreContentVideoStyles();
1234
1254
  if (adContainerEl) {
1235
1255
  adContainerEl.style.display = "none";
1236
1256
  adContainerEl.style.pointerEvents = "none";
@@ -1245,6 +1265,7 @@ function createVastAdLayer(contentVideo, options) {
1245
1265
  if (debug) console.log("".concat(LOG, " Handling ad error"));
1246
1266
  adPlaying = false;
1247
1267
  setAdPlayingFlag(false);
1268
+ restoreContentVideoStyles();
1248
1269
  if (adContainerEl) {
1249
1270
  adContainerEl.style.display = "none";
1250
1271
  adContainerEl.style.pointerEvents = "none";
@@ -1415,6 +1436,7 @@ function createVastAdLayer(contentVideo, options) {
1415
1436
  ];
1416
1437
  contentVideo.style.visibility = "visible";
1417
1438
  contentVideo.style.opacity = "1";
1439
+ applyContentVideoAdCoverStyles();
1418
1440
  emit("content_pause");
1419
1441
  setupAdEventListeners();
1420
1442
  adVolume2 = originalMutedState ? 1 : originalVolume;
@@ -1653,6 +1675,7 @@ function createVastAdLayer(contentVideo, options) {
1653
1675
  ];
1654
1676
  contentVideo.style.visibility = "visible";
1655
1677
  contentVideo.style.opacity = "1";
1678
+ applyContentVideoAdCoverStyles();
1656
1679
  emit("content_pause");
1657
1680
  setupAdEventListeners();
1658
1681
  adVolume2 = originalMutedState ? 1 : originalVolume;
@@ -1803,6 +1826,7 @@ function createVastAdLayer(contentVideo, options) {
1803
1826
  if (debug) console.log("".concat(LOG, " Stopping ad"));
1804
1827
  adPlaying = false;
1805
1828
  setAdPlayingFlag(false);
1829
+ restoreContentVideoStyles();
1806
1830
  contentVideo.muted = originalMutedState;
1807
1831
  contentVideo.volume = originalMutedState ? 0 : originalVolume;
1808
1832
  contentVideo.style.visibility = "visible";
@@ -1841,6 +1865,7 @@ function createVastAdLayer(contentVideo, options) {
1841
1865
  destroyed = true;
1842
1866
  adPlaying = false;
1843
1867
  setAdPlayingFlag(false);
1868
+ restoreContentVideoStyles();
1844
1869
  contentVideo.muted = originalMutedState;
1845
1870
  contentVideo.volume = originalVolume;
1846
1871
  var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;