stormcloud-video-player 0.7.6 → 0.7.7

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.
@@ -5876,6 +5876,50 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
5876
5876
  return min;
5877
5877
  }
5878
5878
  },
5879
+ {
5880
+ key: "getCurrentHlsSegmentDurationMs",
5881
+ value: function getCurrentHlsSegmentDurationMs() {
5882
+ var fallbackMs = 4e3;
5883
+ if (this.nativeHlsMode) {
5884
+ return fallbackMs;
5885
+ }
5886
+ var hls = this.hls;
5887
+ if (!hls) return null;
5888
+ var levelCandidates = [
5889
+ hls.currentLevel,
5890
+ hls.nextLoadLevel,
5891
+ hls.loadLevel
5892
+ ];
5893
+ var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;
5894
+ try {
5895
+ for(var _iterator = levelCandidates[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true){
5896
+ var levelIndex = _step.value;
5897
+ var _hls_levels_levelIndex, _hls_levels;
5898
+ if (typeof levelIndex !== "number" || levelIndex < 0) continue;
5899
+ var details = (_hls_levels = hls.levels) === null || _hls_levels === void 0 ? void 0 : (_hls_levels_levelIndex = _hls_levels[levelIndex]) === null || _hls_levels_levelIndex === void 0 ? void 0 : _hls_levels_levelIndex.details;
5900
+ if (!details) continue;
5901
+ var targetDurationSec = typeof details.partTarget === "number" && details.partTarget > 0 ? details.partTarget : typeof details.targetduration === "number" && details.targetduration > 0 ? details.targetduration : void 0;
5902
+ if (targetDurationSec !== void 0) {
5903
+ return Math.max(800, Math.floor(targetDurationSec * 1e3));
5904
+ }
5905
+ }
5906
+ } catch (err) {
5907
+ _didIteratorError = true;
5908
+ _iteratorError = err;
5909
+ } finally{
5910
+ try {
5911
+ if (!_iteratorNormalCompletion && _iterator.return != null) {
5912
+ _iterator.return();
5913
+ }
5914
+ } finally{
5915
+ if (_didIteratorError) {
5916
+ throw _iteratorError;
5917
+ }
5918
+ }
5919
+ }
5920
+ return fallbackMs;
5921
+ }
5922
+ },
5879
5923
  {
5880
5924
  key: "videoElement",
5881
5925
  get: function get() {