stormcloud-video-player 0.7.6 → 0.7.8
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 +425 -27
- 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 +425 -27
- package/lib/index.js.map +1 -1
- package/lib/player/StormcloudVideoPlayer.cjs +47 -22
- package/lib/player/StormcloudVideoPlayer.cjs.map +1 -1
- package/lib/player/StormcloudVideoPlayer.d.cts +1 -0
- package/lib/players/HlsPlayer.cjs +47 -22
- package/lib/players/HlsPlayer.cjs.map +1 -1
- package/lib/players/index.cjs +47 -22
- package/lib/players/index.cjs.map +1 -1
- package/lib/sdk/adstormPlayer.cjs +3 -22
- package/lib/sdk/adstormPlayer.cjs.map +1 -1
- package/lib/ui/StormcloudVideoPlayer.cjs +425 -27
- package/lib/ui/StormcloudVideoPlayer.cjs.map +1 -1
- package/package.json +1 -1
|
@@ -789,28 +789,9 @@ function createAdStormPlayer(contentVideo, options) {
|
|
|
789
789
|
adVideoElement.removeAttribute("src");
|
|
790
790
|
adVideoElement.load();
|
|
791
791
|
}
|
|
792
|
-
function buildVastUrl(durationSeconds
|
|
793
|
-
var baseUrl = "https://adstorm.co/api-adstorm-dev/adstorm/vast/
|
|
794
|
-
|
|
795
|
-
video: {
|
|
796
|
-
codec: "h264",
|
|
797
|
-
width: contentVideo.videoWidth || 1280,
|
|
798
|
-
height: contentVideo.videoHeight || 720,
|
|
799
|
-
fps: 29.97,
|
|
800
|
-
bitrate: 5e3,
|
|
801
|
-
profile: "high",
|
|
802
|
-
pix_fmt: "yuv420p",
|
|
803
|
-
has_b_frames: 0
|
|
804
|
-
},
|
|
805
|
-
audio: {
|
|
806
|
-
codec: "aac",
|
|
807
|
-
sample_rate: 48e3,
|
|
808
|
-
bitrate: 128
|
|
809
|
-
}
|
|
810
|
-
};
|
|
811
|
-
var finalMetadata = metadata || defaultMetadata;
|
|
812
|
-
var metadataStr = encodeURIComponent(JSON.stringify(finalMetadata));
|
|
813
|
-
return "".concat(baseUrl, "?duration=").concat(Math.ceil(durationSeconds), "&metadata=").concat(metadataStr);
|
|
792
|
+
function buildVastUrl(durationSeconds) {
|
|
793
|
+
var baseUrl = "https://adstorm.co/api-adstorm-dev/adstorm/nab/vast/pod";
|
|
794
|
+
return "".concat(baseUrl, "?duration=").concat(Math.ceil(durationSeconds));
|
|
814
795
|
}
|
|
815
796
|
function parseVastXml(xmlString) {
|
|
816
797
|
var ads = [];
|
|
@@ -5928,6 +5909,50 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
|
|
|
5928
5909
|
return min;
|
|
5929
5910
|
}
|
|
5930
5911
|
},
|
|
5912
|
+
{
|
|
5913
|
+
key: "getCurrentHlsSegmentDurationMs",
|
|
5914
|
+
value: function getCurrentHlsSegmentDurationMs() {
|
|
5915
|
+
var fallbackMs = 4e3;
|
|
5916
|
+
if (this.nativeHlsMode) {
|
|
5917
|
+
return fallbackMs;
|
|
5918
|
+
}
|
|
5919
|
+
var hls = this.hls;
|
|
5920
|
+
if (!hls) return null;
|
|
5921
|
+
var levelCandidates = [
|
|
5922
|
+
hls.currentLevel,
|
|
5923
|
+
hls.nextLoadLevel,
|
|
5924
|
+
hls.loadLevel
|
|
5925
|
+
];
|
|
5926
|
+
var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;
|
|
5927
|
+
try {
|
|
5928
|
+
for(var _iterator = levelCandidates[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true){
|
|
5929
|
+
var levelIndex = _step.value;
|
|
5930
|
+
var _hls_levels_levelIndex, _hls_levels;
|
|
5931
|
+
if (typeof levelIndex !== "number" || levelIndex < 0) continue;
|
|
5932
|
+
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;
|
|
5933
|
+
if (!details) continue;
|
|
5934
|
+
var targetDurationSec = typeof details.partTarget === "number" && details.partTarget > 0 ? details.partTarget : typeof details.targetduration === "number" && details.targetduration > 0 ? details.targetduration : void 0;
|
|
5935
|
+
if (targetDurationSec !== void 0) {
|
|
5936
|
+
return Math.max(800, Math.floor(targetDurationSec * 1e3));
|
|
5937
|
+
}
|
|
5938
|
+
}
|
|
5939
|
+
} catch (err) {
|
|
5940
|
+
_didIteratorError = true;
|
|
5941
|
+
_iteratorError = err;
|
|
5942
|
+
} finally{
|
|
5943
|
+
try {
|
|
5944
|
+
if (!_iteratorNormalCompletion && _iterator.return != null) {
|
|
5945
|
+
_iterator.return();
|
|
5946
|
+
}
|
|
5947
|
+
} finally{
|
|
5948
|
+
if (_didIteratorError) {
|
|
5949
|
+
throw _iteratorError;
|
|
5950
|
+
}
|
|
5951
|
+
}
|
|
5952
|
+
}
|
|
5953
|
+
return fallbackMs;
|
|
5954
|
+
}
|
|
5955
|
+
},
|
|
5931
5956
|
{
|
|
5932
5957
|
key: "videoElement",
|
|
5933
5958
|
get: function get() {
|