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.cjs CHANGED
@@ -5966,6 +5966,59 @@ function swirlProjectHasNabDemoMixedWithOther(overlays) {
5966
5966
  }
5967
5967
  return hasNab && hasOther;
5968
5968
  }
5969
+ var STANDARD_16_9_LADDER = [
5970
+ {
5971
+ width: 384,
5972
+ height: 216
5973
+ },
5974
+ {
5975
+ width: 640,
5976
+ height: 360
5977
+ },
5978
+ {
5979
+ width: 854,
5980
+ height: 480
5981
+ },
5982
+ {
5983
+ width: 1280,
5984
+ height: 720
5985
+ },
5986
+ {
5987
+ width: 1920,
5988
+ height: 1080
5989
+ },
5990
+ {
5991
+ width: 2560,
5992
+ height: 1440
5993
+ },
5994
+ {
5995
+ width: 3840,
5996
+ height: 2160
5997
+ }
5998
+ ];
5999
+ function smallestLadderRungContaining(maxR, maxB, eps) {
6000
+ var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;
6001
+ try {
6002
+ for(var _iterator = STANDARD_16_9_LADDER[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true){
6003
+ var rung = _step.value;
6004
+ if (maxR <= rung.width + eps && maxB <= rung.height + eps) return rung;
6005
+ }
6006
+ } catch (err) {
6007
+ _didIteratorError = true;
6008
+ _iteratorError = err;
6009
+ } finally{
6010
+ try {
6011
+ if (!_iteratorNormalCompletion && _iterator.return != null) {
6012
+ _iterator.return();
6013
+ }
6014
+ } finally{
6015
+ if (_didIteratorError) {
6016
+ throw _iteratorError;
6017
+ }
6018
+ }
6019
+ }
6020
+ return null;
6021
+ }
5969
6022
  function inferSwirlOverlayCoordinateSpace(overlays, videoWidth, videoHeight) {
5970
6023
  if (!videoWidth || !videoHeight) {
5971
6024
  return {
@@ -5981,9 +6034,15 @@ function inferSwirlOverlayCoordinateSpace(overlays, videoWidth, videoHeight) {
5981
6034
  }
5982
6035
  var _overlayExtents = overlayExtents(overlays), maxR = _overlayExtents.maxR, maxB = _overlayExtents.maxB;
5983
6036
  var EPS = 1;
5984
- var exceedsDecode = maxR > videoWidth + EPS || maxB > videoHeight + EPS;
5985
- var fitsHdCanvas = maxR <= SWIRL_HD_AUTHORING_WIDTH + EPS && maxB <= SWIRL_HD_AUTHORING_HEIGHT + EPS;
6037
+ if (maxR <= 0 || maxB <= 0) {
6038
+ return {
6039
+ width: videoWidth,
6040
+ height: videoHeight
6041
+ };
6042
+ }
5986
6043
  var mixed = swirlProjectHasNabDemoMixedWithOther(overlays);
6044
+ var fitsHdCanvas = maxR <= SWIRL_HD_AUTHORING_WIDTH + EPS && maxB <= SWIRL_HD_AUTHORING_HEIGHT + EPS;
6045
+ var exceedsDecode = maxR > videoWidth + EPS || maxB > videoHeight + EPS;
5987
6046
  var decodeLargerThanHd = videoWidth > SWIRL_HD_AUTHORING_WIDTH + EPS || videoHeight > SWIRL_HD_AUTHORING_HEIGHT + EPS;
5988
6047
  if (fitsHdCanvas && (decodeLargerThanHd || exceedsDecode && !mixed)) {
5989
6048
  return {
@@ -5991,6 +6050,19 @@ function inferSwirlOverlayCoordinateSpace(overlays, videoWidth, videoHeight) {
5991
6050
  height: SWIRL_HD_AUTHORING_HEIGHT
5992
6051
  };
5993
6052
  }
6053
+ if (mixed) {
6054
+ return {
6055
+ width: videoWidth,
6056
+ height: videoHeight
6057
+ };
6058
+ }
6059
+ var rung = smallestLadderRungContaining(maxR, maxB, EPS);
6060
+ if (rung && rung.width < videoWidth - EPS && rung.height < videoHeight - EPS) {
6061
+ return {
6062
+ width: rung.width,
6063
+ height: rung.height
6064
+ };
6065
+ }
5994
6066
  return {
5995
6067
  width: videoWidth,
5996
6068
  height: videoHeight