stormcloud-video-player 0.6.6 → 0.7.0

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.
@@ -120,6 +120,10 @@ declare class StormcloudVideoPlayer {
120
120
  getVolume(): number;
121
121
  isFullscreen(): boolean;
122
122
  isLive(): boolean;
123
+ getMinHlsResolution(): {
124
+ width: number;
125
+ height: number;
126
+ } | null;
123
127
  get videoElement(): HTMLVideoElement;
124
128
  resize(): void;
125
129
  destroy(): void;
@@ -6034,6 +6034,46 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
6034
6034
  return this.isLiveStream;
6035
6035
  }
6036
6036
  },
6037
+ {
6038
+ key: "getMinHlsResolution",
6039
+ value: function getMinHlsResolution() {
6040
+ var _this_hls;
6041
+ var levels = (_this_hls = this.hls) === null || _this_hls === void 0 ? void 0 : _this_hls.levels;
6042
+ if (!levels || levels.length === 0) return null;
6043
+ var min = null;
6044
+ var minPixels = Infinity;
6045
+ var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;
6046
+ try {
6047
+ for(var _iterator = levels[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true){
6048
+ var level = _step.value;
6049
+ if (level.width && level.height) {
6050
+ var pixels = level.width * level.height;
6051
+ if (pixels < minPixels) {
6052
+ minPixels = pixels;
6053
+ min = {
6054
+ width: level.width,
6055
+ height: level.height
6056
+ };
6057
+ }
6058
+ }
6059
+ }
6060
+ } catch (err) {
6061
+ _didIteratorError = true;
6062
+ _iteratorError = err;
6063
+ } finally{
6064
+ try {
6065
+ if (!_iteratorNormalCompletion && _iterator.return != null) {
6066
+ _iterator.return();
6067
+ }
6068
+ } finally{
6069
+ if (_didIteratorError) {
6070
+ throw _iteratorError;
6071
+ }
6072
+ }
6073
+ }
6074
+ return min;
6075
+ }
6076
+ },
6037
6077
  {
6038
6078
  key: "videoElement",
6039
6079
  get: function get() {