stormcloud-video-player 0.7.43 → 0.7.44

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.
@@ -5767,6 +5767,59 @@ function swirlProjectHasNabDemoMixedWithOther(overlays) {
5767
5767
  }
5768
5768
  return hasNab && hasOther;
5769
5769
  }
5770
+ var STANDARD_16_9_LADDER = [
5771
+ {
5772
+ width: 384,
5773
+ height: 216
5774
+ },
5775
+ {
5776
+ width: 640,
5777
+ height: 360
5778
+ },
5779
+ {
5780
+ width: 854,
5781
+ height: 480
5782
+ },
5783
+ {
5784
+ width: 1280,
5785
+ height: 720
5786
+ },
5787
+ {
5788
+ width: 1920,
5789
+ height: 1080
5790
+ },
5791
+ {
5792
+ width: 2560,
5793
+ height: 1440
5794
+ },
5795
+ {
5796
+ width: 3840,
5797
+ height: 2160
5798
+ }
5799
+ ];
5800
+ function smallestLadderRungContaining(maxR, maxB, eps) {
5801
+ var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;
5802
+ try {
5803
+ for(var _iterator = STANDARD_16_9_LADDER[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true){
5804
+ var rung = _step.value;
5805
+ if (maxR <= rung.width + eps && maxB <= rung.height + eps) return rung;
5806
+ }
5807
+ } catch (err) {
5808
+ _didIteratorError = true;
5809
+ _iteratorError = err;
5810
+ } finally{
5811
+ try {
5812
+ if (!_iteratorNormalCompletion && _iterator.return != null) {
5813
+ _iterator.return();
5814
+ }
5815
+ } finally{
5816
+ if (_didIteratorError) {
5817
+ throw _iteratorError;
5818
+ }
5819
+ }
5820
+ }
5821
+ return null;
5822
+ }
5770
5823
  function inferSwirlOverlayCoordinateSpace(overlays, videoWidth, videoHeight) {
5771
5824
  if (!videoWidth || !videoHeight) {
5772
5825
  return {
@@ -5782,9 +5835,15 @@ function inferSwirlOverlayCoordinateSpace(overlays, videoWidth, videoHeight) {
5782
5835
  }
5783
5836
  var _overlayExtents = overlayExtents(overlays), maxR = _overlayExtents.maxR, maxB = _overlayExtents.maxB;
5784
5837
  var EPS = 1;
5785
- var exceedsDecode = maxR > videoWidth + EPS || maxB > videoHeight + EPS;
5786
- var fitsHdCanvas = maxR <= SWIRL_HD_AUTHORING_WIDTH + EPS && maxB <= SWIRL_HD_AUTHORING_HEIGHT + EPS;
5838
+ if (maxR <= 0 || maxB <= 0) {
5839
+ return {
5840
+ width: videoWidth,
5841
+ height: videoHeight
5842
+ };
5843
+ }
5787
5844
  var mixed = swirlProjectHasNabDemoMixedWithOther(overlays);
5845
+ var fitsHdCanvas = maxR <= SWIRL_HD_AUTHORING_WIDTH + EPS && maxB <= SWIRL_HD_AUTHORING_HEIGHT + EPS;
5846
+ var exceedsDecode = maxR > videoWidth + EPS || maxB > videoHeight + EPS;
5788
5847
  var decodeLargerThanHd = videoWidth > SWIRL_HD_AUTHORING_WIDTH + EPS || videoHeight > SWIRL_HD_AUTHORING_HEIGHT + EPS;
5789
5848
  if (fitsHdCanvas && (decodeLargerThanHd || exceedsDecode && !mixed)) {
5790
5849
  return {
@@ -5792,6 +5851,19 @@ function inferSwirlOverlayCoordinateSpace(overlays, videoWidth, videoHeight) {
5792
5851
  height: SWIRL_HD_AUTHORING_HEIGHT
5793
5852
  };
5794
5853
  }
5854
+ if (mixed) {
5855
+ return {
5856
+ width: videoWidth,
5857
+ height: videoHeight
5858
+ };
5859
+ }
5860
+ var rung = smallestLadderRungContaining(maxR, maxB, EPS);
5861
+ if (rung && rung.width < videoWidth - EPS && rung.height < videoHeight - EPS) {
5862
+ return {
5863
+ width: rung.width,
5864
+ height: rung.height
5865
+ };
5866
+ }
5795
5867
  return {
5796
5868
  width: videoWidth,
5797
5869
  height: videoHeight