Update from Main

This commit is contained in:
Dragos 2022-12-18 13:06:11 +02:00 committed by GitHub
parent 4a4f5ae243
commit b4cf5e6768
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
12 changed files with 63 additions and 27 deletions

View File

@ -58,6 +58,7 @@
{ "code": "GY", "name": "Guyana" },
{ "code": "HT", "name": "Haiti" },
{ "code": "HN", "name": "Honduras" },
{ "code": "HK", "name": "Hongkong" },
{ "code": "IN", "name": "Indien" },
{ "code": "ID", "name": "Indonesien" },
{ "code": "IQ", "name": "Irak" },
@ -168,6 +169,7 @@
{ "code": "SR", "name": "Suriname" },
{ "code": "SY", "name": "Syrien" },
{ "code": "TJ", "name": "Tadschikistan" },
{ "code": "TW", "name": "Taiwan" },
{ "code": "TZ", "name": "Tansania" },
{ "code": "TH", "name": "Thailand" },
{ "code": "TG", "name": "Togo" },

View File

@ -176,6 +176,7 @@
{ "code": "TH", "name": "Ταϊλάνδη" },
{ "code": "TZ", "name": "Τανζανία" },
{ "code": "TJ", "name": "Τατζικιστάν" },
{ "code": "TW", "name": "Ταϊβάν" },
{ "code": "JM", "name": "Τζαμάικα" },
{ "code": "DJ", "name": "Τζιμπουτί" },
{ "code": "TO", "name": "Τόγκα" },
@ -191,5 +192,6 @@
{ "code": "PH", "name": "Φιλιππίνες" },
{ "code": "FI", "name": "Φινλανδία" },
{ "code": "FJ", "name": "Φίτζι" },
{ "code": "CL", "name": "Χιλή" }
{ "code": "CL", "name": "Χιλή" },
{ "code": "HK", "name": "Χονγκ Κονγκ" }
]

View File

@ -73,6 +73,7 @@
{ "code": "GY", "name": "Guyana" },
{ "code": "HT", "name": "Haiti" },
{ "code": "HN", "name": "Honduras" },
{ "code": "HK", "name": "Hong Kong" },
{ "code": "HU", "name": "Hungary" },
{ "code": "IS", "name": "Iceland" },
{ "code": "IN", "name": "India" },
@ -168,6 +169,7 @@
{ "code": "SE", "name": "Sweden" },
{ "code": "CH", "name": "Switzerland" },
{ "code": "SY", "name": "Syrian Arab Republic" },
{ "code": "TW", "name": "Taiwan" },
{ "code": "TJ", "name": "Tajikistan" },
{ "code": "TZ", "name": "Tanzania, United Republic of" },
{ "code": "TH", "name": "Thailand" },

View File

@ -76,6 +76,7 @@
{ "code": "GY", "name": "Guyana" },
{ "code": "HT", "name": "Haití" },
{ "code": "HN", "name": "Honduras" },
{ "code": "HK", "name": "Hong Kong" },
{ "code": "HU", "name": "Hungría" },
{ "code": "IN", "name": "India" },
{ "code": "ID", "name": "Indonesia" },
@ -171,6 +172,7 @@
{ "code": "CH", "name": "Suiza" },
{ "code": "SR", "name": "Surinam" },
{ "code": "TH", "name": "Tailandia" },
{ "code": "TW", "name": "Taiwán" },
{ "code": "TZ", "name": "Tanzania" },
{ "code": "TJ", "name": "Tayikistán" },
{ "code": "TL", "name": "Timor Oriental" },

View File

@ -77,6 +77,7 @@
{ "code": "GY", "name": "Guyana" },
{ "code": "HT", "name": "Haïti" },
{ "code": "HN", "name": "Honduras" },
{ "code": "HK", "name": "Hong Kong" },
{ "code": "HU", "name": "Hongrie" },
{ "code": "IN", "name": "Inde" },
{ "code": "ID", "name": "Indonésie" },
@ -173,6 +174,7 @@
{ "code": "SY", "name": "Syrie" },
{ "code": "TJ", "name": "Tadjikistan" },
{ "code": "TZ", "name": "Tanzanie" },
{ "code": "TW", "name": "Taïwan" },
{ "code": "TD", "name": "Tchad" },
{ "code": "CZ", "name": "Tchéquie" },
{ "code": "TH", "name": "Thaïlande" },

View File

@ -76,6 +76,7 @@
{ "code": "GY", "name": "Guyana" },
{ "code": "HT", "name": "Haiti" },
{ "code": "HN", "name": "Honduras" },
{ "code": "HK", "name": "Hong Kong" },
{ "code": "IN", "name": "India" },
{ "code": "ID", "name": "Indonesia" },
{ "code": "IR", "name": "Iran" },
@ -171,6 +172,7 @@
{ "code": "CH", "name": "Svizzera" },
{ "code": "SZ", "name": "eSwatini" },
{ "code": "TJ", "name": "Tagikistan" },
{ "code": "TW", "name": "Taiwan" },
{ "code": "TZ", "name": "Tanzania" },
{ "code": "TH", "name": "Thailandia" },
{ "code": "TL", "name": "Timor Est" },

View File

@ -54,6 +54,7 @@
{ "code": "GY", "name": "Gajana" },
{ "code": "HT", "name": "Haitis" },
{ "code": "HN", "name": "Hondūras" },
{ "code": "HK", "name": "Honkongas" },
{ "code": "HU", "name": "Vengrija" },
{ "code": "IS", "name": "Islandija" },
{ "code": "IN", "name": "Indija" },
@ -169,6 +170,7 @@
{ "code": "TJ", "name": "Tadžikija" },
{ "code": "TZ", "name": "Tanzanija" },
{ "code": "TH", "name": "Tailandas" },
{ "code": "TW", "name": "Taivanas" },
{ "code": "TL", "name": "Rytų Timoras" },
{ "code": "TG", "name": "Togas" },
{ "code": "TO", "name": "Tonga" },

View File

@ -65,6 +65,7 @@
{ "code": "ES", "name": "Hiszpania" },
{ "code": "NL", "name": "Holandia" },
{ "code": "HN", "name": "Honduras" },
{ "code": "HK", "name": "Hongkong" },
{ "code": "IN", "name": "Indie" },
{ "code": "ID", "name": "Indonezja" },
{ "code": "IQ", "name": "Irak" },
@ -166,6 +167,7 @@
{ "code": "SE", "name": "Szwecja" },
{ "code": "TJ", "name": "Tadżykistan" },
{ "code": "TH", "name": "Tajlandia" },
{ "code": "TW", "name": "Tajwan" },
{ "code": "TZ", "name": "Tanzania" },
{ "code": "TL", "name": "Timor Wschodni" },
{ "code": "TG", "name": "Togo" },

View File

@ -58,6 +58,7 @@
{ "code": "HT", "name": "Haiti" },
{ "code": "NL", "name": "Holandsko" },
{ "code": "HN", "name": "Honduras" },
{ "code": "HK", "name": "Hongkong" },
{ "code": "HR", "name": "Chorvátsko" },
{ "code": "IN", "name": "India" },
{ "code": "ID", "name": "Indonézia" },
@ -172,6 +173,7 @@
{ "code": "CH", "name": "Švajčiarsko" },
{ "code": "SE", "name": "Švédsko" },
{ "code": "TJ", "name": "Tadžikistan" },
{ "code": "TW", "name": "Taiwan" },
{ "code": "IT", "name": "Taliansko" },
{ "code": "TZ", "name": "Tanzánia" },
{ "code": "TH", "name": "Thajsko" },

View File

@ -73,6 +73,7 @@
{ "code": "GY", "name": "Гајана" },
{ "code": "HT", "name": "Хаити" },
{ "code": "HN", "name": "Хондурас" },
{ "code": "HK", "name": "Хонгконг" },
{ "code": "HU", "name": "Мађарска" },
{ "code": "IS", "name": "Исланд" },
{ "code": "IN", "name": "Индија" },
@ -170,6 +171,7 @@
{ "code": "SY", "name": "Сиријска Арапска Република" },
{ "code": "TJ", "name": "Таџикистан" },
{ "code": "TZ", "name": "Танзанија" },
{ "code": "TW", "name": "Тајван" },
{ "code": "TH", "name": "Тајланд" },
{ "code": "TL", "name": "Тимор-Лесте" },
{ "code": "TG", "name": "Того" },

View File

@ -73,6 +73,7 @@
{ "code": "GY", "name": "蓋亞那" },
{ "code": "HT", "name": "海地" },
{ "code": "HN", "name": "宏都拉斯" },
{ "code": "HK", "name": "香港" },
{ "code": "HU", "name": "匈牙利" },
{ "code": "IS", "name": "冰島" },
{ "code": "IN", "name": "印度" },
@ -179,6 +180,7 @@
{ "code": "TR", "name": "土耳其" },
{ "code": "TM", "name": "土庫曼" },
{ "code": "TV", "name": "吐瓦魯" },
{ "code": "TW", "name": "台灣" },
{ "code": "UG", "name": "烏干達" },
{ "code": "UA", "name": "烏克蘭" },
{ "code": "AE", "name": "阿聯" },

View File

@ -42,55 +42,69 @@ const DashUtils = {
},
generate_adaptation_set(VideoFormatArray) {
const adaptationSets = [];
const mimeTypes = [];
const mimeObjects = [[]];
// sort the formats by mime types
let mimeAudioObjs = [];
VideoFormatArray.forEach(videoFormat => {
// the dual formats should not be used
if (videoFormat.mimeType.indexOf("video") != -1 && !videoFormat.videoOnly) {
return;
}
// if these properties are not available, then we skip it because we cannot set these properties
//if (!(videoFormat.hasOwnProperty('initRange') && videoFormat.hasOwnProperty('indexRange'))) {
// return
//}
const audioTrackId = videoFormat.audioTrackId;
const mimeType = videoFormat.mimeType;
const mimeTypeIndex = mimeTypes.indexOf(mimeType);
if (mimeTypeIndex > -1) {
mimeObjects[mimeTypeIndex].push(videoFormat);
} else {
mimeTypes.push(mimeType);
mimeObjects.push([]);
mimeObjects[mimeTypes.length - 1].push(videoFormat);
for (let i = 0; i < mimeAudioObjs.length; i++) {
const mimeAudioObj = mimeAudioObjs[i];
if (mimeAudioObj.audioTrackId == audioTrackId && mimeAudioObj.mimeType == mimeType) {
mimeAudioObj.videoFormats.push(videoFormat);
return;
}
}
mimeAudioObjs.push({
audioTrackId,
mimeType,
videoFormats: [videoFormat],
});
// for each MimeType generate a new Adaptation set with Representations as sub elements
for (let i = 0; i < mimeTypes.length; i++) {
let isVideoFormat = false;
});
mimeAudioObjs.forEach(mimeAudioObj => {
const adapSet = {
type: "element",
name: "AdaptationSet",
attributes: {
id: i,
mimeType: mimeTypes[i],
id: mimeAudioObj.audioTrackId,
lang: mimeAudioObj.audioTrackId?.substr(0, 2),
mimeType: mimeAudioObj.mimeType,
startWithSAP: "1",
subsegmentAlignment: "true",
},
elements: [],
};
if (!mimeTypes[i].includes("audio")) {
adapSet.attributes.scanType = "progressive";
let isVideoFormat = false;
if (mimeAudioObj.mimeType.includes("video")) {
isVideoFormat = true;
}
mimeObjects[i].forEach(format => {
if (isVideoFormat) {
adapSet.elements.push(this.generate_representation_video(format));
adapSet.attributes.scanType = "progressive";
}
for (var i = 0; i < mimeAudioObj.videoFormats.length; i++) {
const videoFormat = mimeAudioObj.videoFormats[i];
if (isVideoFormat) {
adapSet.elements.push(this.generate_representation_video(videoFormat));
} else {
adapSet.elements.push(this.generate_representation_audio(format));
adapSet.elements.push(this.generate_representation_audio(videoFormat));
}
});
}
adaptationSets.push(adapSet);
}
});
return adaptationSets;
},
generate_representation_audio(Format) {