p2p-media-loader-dashjs 5.0.0-alpha.6 → 5.0.0-alpha.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.
|
@@ -1879,70 +1879,6 @@ this.p2pml.dashjs = (function(exports) {
|
|
|
1879
1879
|
if (typeof target.values === "function") return;
|
|
1880
1880
|
target.values = (source) => Object.keys(source).map((key) => source[key]);
|
|
1881
1881
|
}
|
|
1882
|
-
// ../../node_modules/.pnpm/@videojs+vhs-utils@4.1.3/node_modules/@videojs/vhs-utils/es/codecs.js
|
|
1883
|
-
var regexs = {
|
|
1884
|
-
mp4: /^(av0?1|avc0?[1234]|vp0?9|flac|opus|mp3|mp4a|mp4v|stpp.ttml.im1t)/,
|
|
1885
|
-
webm: /^(vp0?[89]|av0?1|opus|vorbis)/,
|
|
1886
|
-
ogg: /^(vp0?[89]|theora|flac|opus|vorbis)/,
|
|
1887
|
-
video: /^(av0?1|avc0?[1234]|vp0?[89]|hvc1|hev1|theora|mp4v)/,
|
|
1888
|
-
audio: /^(mp4a|flac|vorbis|opus|ac-[34]|ec-3|alac|mp3|speex|aac)/,
|
|
1889
|
-
text: /^(stpp.ttml.im1t)/,
|
|
1890
|
-
muxerVideo: /^(avc0?1)/,
|
|
1891
|
-
muxerAudio: /^(mp4a)/,
|
|
1892
|
-
muxerText: /a^/
|
|
1893
|
-
};
|
|
1894
|
-
var mediaTypes = [
|
|
1895
|
-
"video",
|
|
1896
|
-
"audio",
|
|
1897
|
-
"text"
|
|
1898
|
-
];
|
|
1899
|
-
/**
|
|
1900
|
-
* @typedef {Object} ParsedCodecInfo
|
|
1901
|
-
* @property {number} codecCount
|
|
1902
|
-
* Number of codecs parsed
|
|
1903
|
-
* @property {string} [videoCodec]
|
|
1904
|
-
* Parsed video codec (if found)
|
|
1905
|
-
* @property {string} [videoObjectTypeIndicator]
|
|
1906
|
-
* Video object type indicator (if found)
|
|
1907
|
-
* @property {string|null} audioProfile
|
|
1908
|
-
* Audio profile
|
|
1909
|
-
*/
|
|
1910
|
-
/**
|
|
1911
|
-
* Parses a codec string to retrieve the number of codecs specified, the video codec and
|
|
1912
|
-
* object type indicator, and the audio profile.
|
|
1913
|
-
*
|
|
1914
|
-
* @param {string} [codecString]
|
|
1915
|
-
* The codec string to parse
|
|
1916
|
-
* @return {ParsedCodecInfo}
|
|
1917
|
-
* Parsed codec info
|
|
1918
|
-
*/
|
|
1919
|
-
var parseCodecs = function parseCodecs(codecString) {
|
|
1920
|
-
if (codecString === void 0) codecString = "";
|
|
1921
|
-
var codecs = codecString.split(",");
|
|
1922
|
-
var result = [];
|
|
1923
|
-
codecs.forEach(function(codec) {
|
|
1924
|
-
codec = codec.trim();
|
|
1925
|
-
var codecType;
|
|
1926
|
-
mediaTypes.forEach(function(name) {
|
|
1927
|
-
var match = regexs[name].exec(codec.toLowerCase());
|
|
1928
|
-
if (!match || match.length <= 1) return;
|
|
1929
|
-
codecType = name;
|
|
1930
|
-
var type = codec.substring(0, match[1].length);
|
|
1931
|
-
var details = codec.replace(type, "");
|
|
1932
|
-
result.push({
|
|
1933
|
-
type,
|
|
1934
|
-
details,
|
|
1935
|
-
mediaType: name
|
|
1936
|
-
});
|
|
1937
|
-
});
|
|
1938
|
-
if (!codecType) result.push({
|
|
1939
|
-
type: codec,
|
|
1940
|
-
details: "",
|
|
1941
|
-
mediaType: "unknown"
|
|
1942
|
-
});
|
|
1943
|
-
});
|
|
1944
|
-
return result;
|
|
1945
|
-
};
|
|
1946
1882
|
// \0@oxc-project+runtime@0.156.0/helpers/esm/typeof.js
|
|
1947
1883
|
function _typeof(o) {
|
|
1948
1884
|
"@babel/helpers - typeof";
|
|
@@ -2000,19 +1936,6 @@ this.p2pml.dashjs = (function(exports) {
|
|
|
2000
1936
|
return e;
|
|
2001
1937
|
}
|
|
2002
1938
|
// ../p2p-media-loader-core/src/manifest/properties.ts
|
|
2003
|
-
function codecsOfType(codecs, mediaType) {
|
|
2004
|
-
if (!codecs) return void 0;
|
|
2005
|
-
const matching = parseCodecs(codecs).filter((c) => c.mediaType === mediaType).map((c) => `${c.type}${c.details}`);
|
|
2006
|
-
return matching.length ? matching.join(",") : void 0;
|
|
2007
|
-
}
|
|
2008
|
-
/** The video codecs out of a mixed `CODECS` list; audio and text are dropped. */
|
|
2009
|
-
function videoCodecs(codecs) {
|
|
2010
|
-
return codecsOfType(codecs, "video");
|
|
2011
|
-
}
|
|
2012
|
-
/** The audio codecs out of a mixed `CODECS` list. */
|
|
2013
|
-
function audioCodecs(codecs) {
|
|
2014
|
-
return codecsOfType(codecs, "audio");
|
|
2015
|
-
}
|
|
2016
1939
|
/**
|
|
2017
1940
|
* A variant's properties, each as the manifest states it. A missing
|
|
2018
1941
|
* `BANDWIDTH` says nothing about the rest: a resolution or a codec string is
|
|
@@ -2020,10 +1943,10 @@ this.p2pml.dashjs = (function(exports) {
|
|
|
2020
1943
|
* specs/segment-identity.md.
|
|
2021
1944
|
*/
|
|
2022
1945
|
function videoStreamProperties(a) {
|
|
2023
|
-
var _a$bandwidth
|
|
1946
|
+
var _a$bandwidth;
|
|
2024
1947
|
return {
|
|
2025
1948
|
bitrate: (_a$bandwidth = a.bandwidth) !== null && _a$bandwidth !== void 0 ? _a$bandwidth : 0,
|
|
2026
|
-
codecs:
|
|
1949
|
+
codecs: a.codecs,
|
|
2027
1950
|
width: a.width,
|
|
2028
1951
|
height: a.height,
|
|
2029
1952
|
frameRate: a.frameRate,
|
|
@@ -7501,7 +7424,8 @@ this.p2pml.dashjs = (function(exports) {
|
|
|
7501
7424
|
this._status = "succeed";
|
|
7502
7425
|
this.engineCallbacks.onSuccess({
|
|
7503
7426
|
data: data.slice(0),
|
|
7504
|
-
bandwidth
|
|
7427
|
+
bandwidth,
|
|
7428
|
+
streamType: this.segment.stream.type
|
|
7505
7429
|
});
|
|
7506
7430
|
}
|
|
7507
7431
|
reject() {
|
|
@@ -9057,8 +8981,11 @@ this.p2pml.dashjs = (function(exports) {
|
|
|
9057
8981
|
/**
|
|
9058
8982
|
* Applies one parsed manifest. Idempotent: re-applying an unchanged
|
|
9059
8983
|
* manifest changes nothing and reports no updates.
|
|
8984
|
+
*
|
|
8985
|
+
* @param text - The manifest as fetched, which a `streamIdBuilder` reads
|
|
8986
|
+
* for a stream this manifest declares.
|
|
9060
8987
|
*/
|
|
9061
|
-
apply(manifest) {
|
|
8988
|
+
apply(manifest, text = "") {
|
|
9062
8989
|
var _manifest$excludedPla;
|
|
9063
8990
|
const updates = [];
|
|
9064
8991
|
const ignored = [];
|
|
@@ -9069,6 +8996,7 @@ this.p2pml.dashjs = (function(exports) {
|
|
|
9069
8996
|
var _declaration, _manifest$requestedUr;
|
|
9070
8997
|
return (_declaration = declaration) !== null && _declaration !== void 0 ? _declaration : declaration = {
|
|
9071
8998
|
url: (_manifest$requestedUr = manifest.requestedUrl) !== null && _manifest$requestedUr !== void 0 ? _manifest$requestedUr : manifest.url,
|
|
8999
|
+
text,
|
|
9072
9000
|
streams: manifest.streams.map((s) => {
|
|
9073
9001
|
var _s$streamId;
|
|
9074
9002
|
return {
|
|
@@ -9807,7 +9735,7 @@ this.p2pml.dashjs = (function(exports) {
|
|
|
9807
9735
|
};
|
|
9808
9736
|
_defineProperty(SegmentMemoryStorage, "probeSequence", 0);
|
|
9809
9737
|
// ../p2p-media-loader-core/src/utils/peer.ts
|
|
9810
|
-
var TRACKER_CLIENT_VERSION_PREFIX = `-PM${formatVersion("5.0.0-alpha.
|
|
9738
|
+
var TRACKER_CLIENT_VERSION_PREFIX = `-PM${formatVersion("5.0.0-alpha.8")}-`;
|
|
9811
9739
|
var HASH_SYMBOLS = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
|
|
9812
9740
|
var PEER_ID_LENGTH = 20;
|
|
9813
9741
|
function generatePeerId(trackerClientVersionPrefix) {
|
|
@@ -10440,7 +10368,7 @@ this.p2pml.dashjs = (function(exports) {
|
|
|
10440
10368
|
let applied;
|
|
10441
10369
|
try {
|
|
10442
10370
|
parsed = parser.parse(text, url, { now });
|
|
10443
|
-
applied = this.manifestRegistry.apply(requestedUrl !== void 0 && requestedUrl !== url ? _objectSpread2(_objectSpread2({}, parsed), {}, { requestedUrl }) : parsed);
|
|
10371
|
+
applied = this.manifestRegistry.apply(requestedUrl !== void 0 && requestedUrl !== url ? _objectSpread2(_objectSpread2({}, parsed), {}, { requestedUrl }) : parsed, this.mainStreamConfig.streamIdBuilder || this.secondaryStreamConfig.streamIdBuilder ? text : void 0);
|
|
10444
10372
|
} catch (error) {
|
|
10445
10373
|
this.manifestLogger("failed to parse %s: %O", url, error);
|
|
10446
10374
|
return;
|
|
@@ -11223,7 +11151,7 @@ this.p2pml.dashjs = (function(exports) {
|
|
|
11223
11151
|
constructor(binding, parent) {
|
|
11224
11152
|
_defineProperty(this, "binding", void 0);
|
|
11225
11153
|
_defineProperty(this, "parent", void 0);
|
|
11226
|
-
_defineProperty(this, "logger", (0, import_browser.
|
|
11154
|
+
_defineProperty(this, "logger", (0, import_browser.default)("p2pml-dashjs:loader"));
|
|
11227
11155
|
_defineProperty(
|
|
11228
11156
|
this,
|
|
11229
11157
|
/** The request the core is serving through this loader, while it is. */
|
|
@@ -11477,7 +11405,7 @@ this.p2pml.dashjs = (function(exports) {
|
|
|
11477
11405
|
"liveTarget",
|
|
11478
11406
|
void 0
|
|
11479
11407
|
);
|
|
11480
|
-
_defineProperty(this, "debug", (0, import_browser.
|
|
11408
|
+
_defineProperty(this, "debug", (0, import_browser.default)("p2pml-dashjs:engine"));
|
|
11481
11409
|
_defineProperty(
|
|
11482
11410
|
this,
|
|
11483
11411
|
/** This engine's handlers on the bound player; see specs/diagnostics.md. */
|