stormcloud-video-player 0.7.5 → 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.
- package/dist/stormcloud-vp.min.js +1 -1
- package/lib/index.cjs +461 -29
- package/lib/index.cjs.map +1 -1
- package/lib/index.d.cts +1 -0
- package/lib/index.d.ts +1 -0
- package/lib/index.js +461 -29
- package/lib/index.js.map +1 -1
- package/lib/player/StormcloudVideoPlayer.cjs +44 -0
- package/lib/player/StormcloudVideoPlayer.cjs.map +1 -1
- package/lib/player/StormcloudVideoPlayer.d.cts +1 -0
- package/lib/players/HlsPlayer.cjs +44 -0
- package/lib/players/HlsPlayer.cjs.map +1 -1
- package/lib/players/index.cjs +44 -0
- package/lib/players/index.cjs.map +1 -1
- package/lib/ui/StormcloudVideoPlayer.cjs +461 -29
- package/lib/ui/StormcloudVideoPlayer.cjs.map +1 -1
- package/package.json +1 -1
- package/lib/types-BII_CKbE.d.cts +0 -105
package/lib/players/index.cjs
CHANGED
|
@@ -5964,6 +5964,50 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
|
|
|
5964
5964
|
return min;
|
|
5965
5965
|
}
|
|
5966
5966
|
},
|
|
5967
|
+
{
|
|
5968
|
+
key: "getCurrentHlsSegmentDurationMs",
|
|
5969
|
+
value: function getCurrentHlsSegmentDurationMs() {
|
|
5970
|
+
var fallbackMs = 4e3;
|
|
5971
|
+
if (this.nativeHlsMode) {
|
|
5972
|
+
return fallbackMs;
|
|
5973
|
+
}
|
|
5974
|
+
var hls = this.hls;
|
|
5975
|
+
if (!hls) return null;
|
|
5976
|
+
var levelCandidates = [
|
|
5977
|
+
hls.currentLevel,
|
|
5978
|
+
hls.nextLoadLevel,
|
|
5979
|
+
hls.loadLevel
|
|
5980
|
+
];
|
|
5981
|
+
var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;
|
|
5982
|
+
try {
|
|
5983
|
+
for(var _iterator = levelCandidates[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true){
|
|
5984
|
+
var levelIndex = _step.value;
|
|
5985
|
+
var _hls_levels_levelIndex, _hls_levels;
|
|
5986
|
+
if (typeof levelIndex !== "number" || levelIndex < 0) continue;
|
|
5987
|
+
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;
|
|
5988
|
+
if (!details) continue;
|
|
5989
|
+
var targetDurationSec = typeof details.partTarget === "number" && details.partTarget > 0 ? details.partTarget : typeof details.targetduration === "number" && details.targetduration > 0 ? details.targetduration : void 0;
|
|
5990
|
+
if (targetDurationSec !== void 0) {
|
|
5991
|
+
return Math.max(800, Math.floor(targetDurationSec * 1e3));
|
|
5992
|
+
}
|
|
5993
|
+
}
|
|
5994
|
+
} catch (err) {
|
|
5995
|
+
_didIteratorError = true;
|
|
5996
|
+
_iteratorError = err;
|
|
5997
|
+
} finally{
|
|
5998
|
+
try {
|
|
5999
|
+
if (!_iteratorNormalCompletion && _iterator.return != null) {
|
|
6000
|
+
_iterator.return();
|
|
6001
|
+
}
|
|
6002
|
+
} finally{
|
|
6003
|
+
if (_didIteratorError) {
|
|
6004
|
+
throw _iteratorError;
|
|
6005
|
+
}
|
|
6006
|
+
}
|
|
6007
|
+
}
|
|
6008
|
+
return fallbackMs;
|
|
6009
|
+
}
|
|
6010
|
+
},
|
|
5967
6011
|
{
|
|
5968
6012
|
key: "videoElement",
|
|
5969
6013
|
get: function get() {
|