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.
package/lib/index.js CHANGED
@@ -5779,6 +5779,59 @@ function swirlProjectHasNabDemoMixedWithOther(overlays) {
5779
5779
  }
5780
5780
  return hasNab && hasOther;
5781
5781
  }
5782
+ var STANDARD_16_9_LADDER = [
5783
+ {
5784
+ width: 384,
5785
+ height: 216
5786
+ },
5787
+ {
5788
+ width: 640,
5789
+ height: 360
5790
+ },
5791
+ {
5792
+ width: 854,
5793
+ height: 480
5794
+ },
5795
+ {
5796
+ width: 1280,
5797
+ height: 720
5798
+ },
5799
+ {
5800
+ width: 1920,
5801
+ height: 1080
5802
+ },
5803
+ {
5804
+ width: 2560,
5805
+ height: 1440
5806
+ },
5807
+ {
5808
+ width: 3840,
5809
+ height: 2160
5810
+ }
5811
+ ];
5812
+ function smallestLadderRungContaining(maxR, maxB, eps) {
5813
+ var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;
5814
+ try {
5815
+ for(var _iterator = STANDARD_16_9_LADDER[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true){
5816
+ var rung = _step.value;
5817
+ if (maxR <= rung.width + eps && maxB <= rung.height + eps) return rung;
5818
+ }
5819
+ } catch (err) {
5820
+ _didIteratorError = true;
5821
+ _iteratorError = err;
5822
+ } finally{
5823
+ try {
5824
+ if (!_iteratorNormalCompletion && _iterator.return != null) {
5825
+ _iterator.return();
5826
+ }
5827
+ } finally{
5828
+ if (_didIteratorError) {
5829
+ throw _iteratorError;
5830
+ }
5831
+ }
5832
+ }
5833
+ return null;
5834
+ }
5782
5835
  function inferSwirlOverlayCoordinateSpace(overlays, videoWidth, videoHeight) {
5783
5836
  if (!videoWidth || !videoHeight) {
5784
5837
  return {
@@ -5794,9 +5847,15 @@ function inferSwirlOverlayCoordinateSpace(overlays, videoWidth, videoHeight) {
5794
5847
  }
5795
5848
  var _overlayExtents = overlayExtents(overlays), maxR = _overlayExtents.maxR, maxB = _overlayExtents.maxB;
5796
5849
  var EPS = 1;
5797
- var exceedsDecode = maxR > videoWidth + EPS || maxB > videoHeight + EPS;
5798
- var fitsHdCanvas = maxR <= SWIRL_HD_AUTHORING_WIDTH + EPS && maxB <= SWIRL_HD_AUTHORING_HEIGHT + EPS;
5850
+ if (maxR <= 0 || maxB <= 0) {
5851
+ return {
5852
+ width: videoWidth,
5853
+ height: videoHeight
5854
+ };
5855
+ }
5799
5856
  var mixed = swirlProjectHasNabDemoMixedWithOther(overlays);
5857
+ var fitsHdCanvas = maxR <= SWIRL_HD_AUTHORING_WIDTH + EPS && maxB <= SWIRL_HD_AUTHORING_HEIGHT + EPS;
5858
+ var exceedsDecode = maxR > videoWidth + EPS || maxB > videoHeight + EPS;
5800
5859
  var decodeLargerThanHd = videoWidth > SWIRL_HD_AUTHORING_WIDTH + EPS || videoHeight > SWIRL_HD_AUTHORING_HEIGHT + EPS;
5801
5860
  if (fitsHdCanvas && (decodeLargerThanHd || exceedsDecode && !mixed)) {
5802
5861
  return {
@@ -5804,6 +5863,19 @@ function inferSwirlOverlayCoordinateSpace(overlays, videoWidth, videoHeight) {
5804
5863
  height: SWIRL_HD_AUTHORING_HEIGHT
5805
5864
  };
5806
5865
  }
5866
+ if (mixed) {
5867
+ return {
5868
+ width: videoWidth,
5869
+ height: videoHeight
5870
+ };
5871
+ }
5872
+ var rung = smallestLadderRungContaining(maxR, maxB, EPS);
5873
+ if (rung && rung.width < videoWidth - EPS && rung.height < videoHeight - EPS) {
5874
+ return {
5875
+ width: rung.width,
5876
+ height: rung.height
5877
+ };
5878
+ }
5807
5879
  return {
5808
5880
  width: videoWidth,
5809
5881
  height: videoHeight