dasha 2.2.3 → 2.2.6
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/lib/manifest.js +12 -10
- package/package.json +4 -4
package/lib/manifest.js
CHANGED
|
@@ -49,22 +49,22 @@ class Manifest {
|
|
|
49
49
|
}
|
|
50
50
|
|
|
51
51
|
getAudioTracks(languages) {
|
|
52
|
-
const
|
|
52
|
+
const filterAudio = (adaptationSet) =>
|
|
53
53
|
(adaptationSet.contentType === CONTENT_TYPE.audio ||
|
|
54
|
-
adaptationSet.mimeType?.includes('audio')
|
|
54
|
+
adaptationSet.mimeType?.includes('audio') ||
|
|
55
|
+
adaptationSet.representations.some((r) => r.mimeType?.includes('audio'))) &&
|
|
55
56
|
!adaptationSet.maxWidth;
|
|
57
|
+
const filterLanguages = (adaptationSet) =>
|
|
58
|
+
languages?.length ? languages.some((lang) => adaptationSet.lang.includes(lang)) : true;
|
|
56
59
|
const adaptationSets = this.periods
|
|
57
60
|
.map((p) => p.adaptationSets)
|
|
58
61
|
.flat(1)
|
|
59
|
-
.filter(
|
|
60
|
-
|
|
61
|
-
const representations = adaptationSets.map((a) => a.representations).flat(2);
|
|
62
|
-
const matches = representations.filter((r) => languages?.some((lang) => r.lang.includes(lang)));
|
|
63
|
-
const selectedRepresentations = matches?.length ? matches : representations;
|
|
62
|
+
.filter(filterAudio)
|
|
63
|
+
.filter(filterLanguages);
|
|
64
64
|
|
|
65
65
|
const tracks = [];
|
|
66
|
-
for (const
|
|
67
|
-
const
|
|
66
|
+
for (const adaptationSet of adaptationSets) {
|
|
67
|
+
const representation = this.findBestRepresentation(adaptationSet.representations);
|
|
68
68
|
const track = {
|
|
69
69
|
id: tracks.length,
|
|
70
70
|
type: CONTENT_TYPE.audio,
|
|
@@ -94,7 +94,9 @@ class Manifest {
|
|
|
94
94
|
.filter(isSubtitleAdaptationSet);
|
|
95
95
|
|
|
96
96
|
const representations = adaptationSets.map((a) => a.representations).flat(2);
|
|
97
|
-
const matches = representations.filter((r) =>
|
|
97
|
+
const matches = representations.filter((r) =>
|
|
98
|
+
languages?.length ? languages?.some((lang) => r.lang.includes(lang)) : true
|
|
99
|
+
);
|
|
98
100
|
const selectedRepresentations = matches?.length ? matches : representations;
|
|
99
101
|
|
|
100
102
|
const tracks = [];
|
package/package.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dasha",
|
|
3
|
-
"version": "2.2.
|
|
3
|
+
"version": "2.2.6",
|
|
4
4
|
"author": "Vitaliy Gashkov <vitnore@gmail.com>",
|
|
5
|
-
"description": "
|
|
5
|
+
"description": "Parser of MPD-manifests for MPEG DASH",
|
|
6
6
|
"license": "Apache-2.0",
|
|
7
7
|
"keywords": [
|
|
8
8
|
"mpeg",
|
|
@@ -22,8 +22,8 @@
|
|
|
22
22
|
"url": "git+https://github.com/vitnore/dasha.git"
|
|
23
23
|
},
|
|
24
24
|
"funding": {
|
|
25
|
-
"type": "
|
|
26
|
-
"url": "https://
|
|
25
|
+
"type": "individual",
|
|
26
|
+
"url": "https://boosty.to/vitnore"
|
|
27
27
|
},
|
|
28
28
|
"scripts": {
|
|
29
29
|
"test": "jest",
|