stormcloud-video-player 0.7.2 → 0.7.3

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/lib/index.js CHANGED
@@ -964,7 +964,6 @@ function createVastAdLayer(contentVideo, options) {
964
964
  var tornDown = false;
965
965
  var trackingFired = createEmptyTrackingState();
966
966
  var adStallTimerId;
967
- var savedContentVideoStyles;
968
967
  var currentAdEventHandlers;
969
968
  var preloadSlots = /* @__PURE__ */ new Map();
970
969
  function emit(event, payload) {
@@ -1081,7 +1080,7 @@ function createVastAdLayer(contentVideo, options) {
1081
1080
  video.style.top = "0";
1082
1081
  video.style.width = "100%";
1083
1082
  video.style.height = "100%";
1084
- video.style.objectFit = "cover";
1083
+ video.style.objectFit = "contain";
1085
1084
  video.style.backgroundColor = "#000";
1086
1085
  video.playsInline = true;
1087
1086
  video.muted = false;
@@ -1196,31 +1195,12 @@ function createVastAdLayer(contentVideo, options) {
1196
1195
  delete contentVideo.dataset.stormcloudAdPlaying;
1197
1196
  }
1198
1197
  }
1199
- function applyContentVideoAdCoverStyles() {
1200
- if (!singleElementMode) return;
1201
- savedContentVideoStyles = {
1202
- objectFit: contentVideo.style.objectFit,
1203
- width: contentVideo.style.width,
1204
- height: contentVideo.style.height
1205
- };
1206
- contentVideo.style.objectFit = "cover";
1207
- contentVideo.style.width = "100%";
1208
- contentVideo.style.height = "100%";
1209
- }
1210
- function restoreContentVideoStyles() {
1211
- if (!singleElementMode || !savedContentVideoStyles) return;
1212
- contentVideo.style.objectFit = savedContentVideoStyles.objectFit;
1213
- contentVideo.style.width = savedContentVideoStyles.width;
1214
- contentVideo.style.height = savedContentVideoStyles.height;
1215
- savedContentVideoStyles = void 0;
1216
- }
1217
1198
  function handleAdComplete() {
1218
1199
  if (tornDown) return;
1219
1200
  clearAdStallTimer();
1220
1201
  if (debug) console.log("".concat(LOG, " Handling ad completion"));
1221
1202
  adPlaying = false;
1222
1203
  setAdPlayingFlag(false);
1223
- restoreContentVideoStyles();
1224
1204
  if (adContainerEl) {
1225
1205
  adContainerEl.style.display = "none";
1226
1206
  adContainerEl.style.pointerEvents = "none";
@@ -1235,7 +1215,6 @@ function createVastAdLayer(contentVideo, options) {
1235
1215
  if (debug) console.log("".concat(LOG, " Handling ad error"));
1236
1216
  adPlaying = false;
1237
1217
  setAdPlayingFlag(false);
1238
- restoreContentVideoStyles();
1239
1218
  if (adContainerEl) {
1240
1219
  adContainerEl.style.display = "none";
1241
1220
  adContainerEl.style.pointerEvents = "none";
@@ -1406,7 +1385,6 @@ function createVastAdLayer(contentVideo, options) {
1406
1385
  ];
1407
1386
  contentVideo.style.visibility = "visible";
1408
1387
  contentVideo.style.opacity = "1";
1409
- applyContentVideoAdCoverStyles();
1410
1388
  emit("content_pause");
1411
1389
  setupAdEventListeners();
1412
1390
  adVolume2 = originalMutedState ? 1 : originalVolume;
@@ -1645,7 +1623,6 @@ function createVastAdLayer(contentVideo, options) {
1645
1623
  ];
1646
1624
  contentVideo.style.visibility = "visible";
1647
1625
  contentVideo.style.opacity = "1";
1648
- applyContentVideoAdCoverStyles();
1649
1626
  emit("content_pause");
1650
1627
  setupAdEventListeners();
1651
1628
  adVolume2 = originalMutedState ? 1 : originalVolume;
@@ -1796,7 +1773,6 @@ function createVastAdLayer(contentVideo, options) {
1796
1773
  if (debug) console.log("".concat(LOG, " Stopping ad"));
1797
1774
  adPlaying = false;
1798
1775
  setAdPlayingFlag(false);
1799
- restoreContentVideoStyles();
1800
1776
  contentVideo.muted = originalMutedState;
1801
1777
  contentVideo.volume = originalMutedState ? 0 : originalVolume;
1802
1778
  contentVideo.style.visibility = "visible";
@@ -1835,7 +1811,6 @@ function createVastAdLayer(contentVideo, options) {
1835
1811
  destroyed = true;
1836
1812
  adPlaying = false;
1837
1813
  setAdPlayingFlag(false);
1838
- restoreContentVideoStyles();
1839
1814
  contentVideo.muted = originalMutedState;
1840
1815
  contentVideo.volume = originalVolume;
1841
1816
  var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;