mirror of
				https://github.com/TeamPiped/Piped.git
				synced 2024-08-14 23:57:27 +00:00 
			
		
		
		
	Update from Main
This commit is contained in:
		
							parent
							
								
									4a4f5ae243
								
							
						
					
					
						commit
						b4cf5e6768
					
				
					 12 changed files with 63 additions and 27 deletions
				
			
		| 
						 | 
					@ -58,6 +58,7 @@
 | 
				
			||||||
    { "code": "GY", "name": "Guyana" },
 | 
					    { "code": "GY", "name": "Guyana" },
 | 
				
			||||||
    { "code": "HT", "name": "Haiti" },
 | 
					    { "code": "HT", "name": "Haiti" },
 | 
				
			||||||
    { "code": "HN", "name": "Honduras" },
 | 
					    { "code": "HN", "name": "Honduras" },
 | 
				
			||||||
 | 
					    { "code": "HK", "name": "Hongkong" },
 | 
				
			||||||
    { "code": "IN", "name": "Indien" },
 | 
					    { "code": "IN", "name": "Indien" },
 | 
				
			||||||
    { "code": "ID", "name": "Indonesien" },
 | 
					    { "code": "ID", "name": "Indonesien" },
 | 
				
			||||||
    { "code": "IQ", "name": "Irak" },
 | 
					    { "code": "IQ", "name": "Irak" },
 | 
				
			||||||
| 
						 | 
					@ -168,6 +169,7 @@
 | 
				
			||||||
    { "code": "SR", "name": "Suriname" },
 | 
					    { "code": "SR", "name": "Suriname" },
 | 
				
			||||||
    { "code": "SY", "name": "Syrien" },
 | 
					    { "code": "SY", "name": "Syrien" },
 | 
				
			||||||
    { "code": "TJ", "name": "Tadschikistan" },
 | 
					    { "code": "TJ", "name": "Tadschikistan" },
 | 
				
			||||||
 | 
					    { "code": "TW", "name": "Taiwan" },
 | 
				
			||||||
    { "code": "TZ", "name": "Tansania" },
 | 
					    { "code": "TZ", "name": "Tansania" },
 | 
				
			||||||
    { "code": "TH", "name": "Thailand" },
 | 
					    { "code": "TH", "name": "Thailand" },
 | 
				
			||||||
    { "code": "TG", "name": "Togo" },
 | 
					    { "code": "TG", "name": "Togo" },
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -176,6 +176,7 @@
 | 
				
			||||||
    { "code": "TH", "name": "Ταϊλάνδη" },
 | 
					    { "code": "TH", "name": "Ταϊλάνδη" },
 | 
				
			||||||
    { "code": "TZ", "name": "Τανζανία" },
 | 
					    { "code": "TZ", "name": "Τανζανία" },
 | 
				
			||||||
    { "code": "TJ", "name": "Τατζικιστάν" },
 | 
					    { "code": "TJ", "name": "Τατζικιστάν" },
 | 
				
			||||||
 | 
					    { "code": "TW", "name": "Ταϊβάν" },
 | 
				
			||||||
    { "code": "JM", "name": "Τζαμάικα" },
 | 
					    { "code": "JM", "name": "Τζαμάικα" },
 | 
				
			||||||
    { "code": "DJ", "name": "Τζιμπουτί" },
 | 
					    { "code": "DJ", "name": "Τζιμπουτί" },
 | 
				
			||||||
    { "code": "TO", "name": "Τόγκα" },
 | 
					    { "code": "TO", "name": "Τόγκα" },
 | 
				
			||||||
| 
						 | 
					@ -191,5 +192,6 @@
 | 
				
			||||||
    { "code": "PH", "name": "Φιλιππίνες" },
 | 
					    { "code": "PH", "name": "Φιλιππίνες" },
 | 
				
			||||||
    { "code": "FI", "name": "Φινλανδία" },
 | 
					    { "code": "FI", "name": "Φινλανδία" },
 | 
				
			||||||
    { "code": "FJ", "name": "Φίτζι" },
 | 
					    { "code": "FJ", "name": "Φίτζι" },
 | 
				
			||||||
    { "code": "CL", "name": "Χιλή" }
 | 
					    { "code": "CL", "name": "Χιλή" },
 | 
				
			||||||
 | 
					    { "code": "HK", "name": "Χονγκ Κονγκ" }
 | 
				
			||||||
]
 | 
					]
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -73,6 +73,7 @@
 | 
				
			||||||
    { "code": "GY", "name": "Guyana" },
 | 
					    { "code": "GY", "name": "Guyana" },
 | 
				
			||||||
    { "code": "HT", "name": "Haiti" },
 | 
					    { "code": "HT", "name": "Haiti" },
 | 
				
			||||||
    { "code": "HN", "name": "Honduras" },
 | 
					    { "code": "HN", "name": "Honduras" },
 | 
				
			||||||
 | 
					    { "code": "HK", "name": "Hong Kong" },
 | 
				
			||||||
    { "code": "HU", "name": "Hungary" },
 | 
					    { "code": "HU", "name": "Hungary" },
 | 
				
			||||||
    { "code": "IS", "name": "Iceland" },
 | 
					    { "code": "IS", "name": "Iceland" },
 | 
				
			||||||
    { "code": "IN", "name": "India" },
 | 
					    { "code": "IN", "name": "India" },
 | 
				
			||||||
| 
						 | 
					@ -168,6 +169,7 @@
 | 
				
			||||||
    { "code": "SE", "name": "Sweden" },
 | 
					    { "code": "SE", "name": "Sweden" },
 | 
				
			||||||
    { "code": "CH", "name": "Switzerland" },
 | 
					    { "code": "CH", "name": "Switzerland" },
 | 
				
			||||||
    { "code": "SY", "name": "Syrian Arab Republic" },
 | 
					    { "code": "SY", "name": "Syrian Arab Republic" },
 | 
				
			||||||
 | 
					    { "code": "TW", "name": "Taiwan" },
 | 
				
			||||||
    { "code": "TJ", "name": "Tajikistan" },
 | 
					    { "code": "TJ", "name": "Tajikistan" },
 | 
				
			||||||
    { "code": "TZ", "name": "Tanzania, United Republic of" },
 | 
					    { "code": "TZ", "name": "Tanzania, United Republic of" },
 | 
				
			||||||
    { "code": "TH", "name": "Thailand" },
 | 
					    { "code": "TH", "name": "Thailand" },
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -76,6 +76,7 @@
 | 
				
			||||||
    { "code": "GY", "name": "Guyana" },
 | 
					    { "code": "GY", "name": "Guyana" },
 | 
				
			||||||
    { "code": "HT", "name": "Haití" },
 | 
					    { "code": "HT", "name": "Haití" },
 | 
				
			||||||
    { "code": "HN", "name": "Honduras" },
 | 
					    { "code": "HN", "name": "Honduras" },
 | 
				
			||||||
 | 
					    { "code": "HK", "name": "Hong Kong" },
 | 
				
			||||||
    { "code": "HU", "name": "Hungría" },
 | 
					    { "code": "HU", "name": "Hungría" },
 | 
				
			||||||
    { "code": "IN", "name": "India" },
 | 
					    { "code": "IN", "name": "India" },
 | 
				
			||||||
    { "code": "ID", "name": "Indonesia" },
 | 
					    { "code": "ID", "name": "Indonesia" },
 | 
				
			||||||
| 
						 | 
					@ -171,6 +172,7 @@
 | 
				
			||||||
    { "code": "CH", "name": "Suiza" },
 | 
					    { "code": "CH", "name": "Suiza" },
 | 
				
			||||||
    { "code": "SR", "name": "Surinam" },
 | 
					    { "code": "SR", "name": "Surinam" },
 | 
				
			||||||
    { "code": "TH", "name": "Tailandia" },
 | 
					    { "code": "TH", "name": "Tailandia" },
 | 
				
			||||||
 | 
					    { "code": "TW", "name": "Taiwán" }, 
 | 
				
			||||||
    { "code": "TZ", "name": "Tanzania" },
 | 
					    { "code": "TZ", "name": "Tanzania" },
 | 
				
			||||||
    { "code": "TJ", "name": "Tayikistán" },
 | 
					    { "code": "TJ", "name": "Tayikistán" },
 | 
				
			||||||
    { "code": "TL", "name": "Timor Oriental" },
 | 
					    { "code": "TL", "name": "Timor Oriental" },
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -77,6 +77,7 @@
 | 
				
			||||||
    { "code": "GY", "name": "Guyana" },
 | 
					    { "code": "GY", "name": "Guyana" },
 | 
				
			||||||
    { "code": "HT", "name": "Haïti" },
 | 
					    { "code": "HT", "name": "Haïti" },
 | 
				
			||||||
    { "code": "HN", "name": "Honduras" },
 | 
					    { "code": "HN", "name": "Honduras" },
 | 
				
			||||||
 | 
					    { "code": "HK", "name": "Hong Kong" },
 | 
				
			||||||
    { "code": "HU", "name": "Hongrie" },
 | 
					    { "code": "HU", "name": "Hongrie" },
 | 
				
			||||||
    { "code": "IN", "name": "Inde" },
 | 
					    { "code": "IN", "name": "Inde" },
 | 
				
			||||||
    { "code": "ID", "name": "Indonésie" },
 | 
					    { "code": "ID", "name": "Indonésie" },
 | 
				
			||||||
| 
						 | 
					@ -173,6 +174,7 @@
 | 
				
			||||||
    { "code": "SY", "name": "Syrie" },
 | 
					    { "code": "SY", "name": "Syrie" },
 | 
				
			||||||
    { "code": "TJ", "name": "Tadjikistan" },
 | 
					    { "code": "TJ", "name": "Tadjikistan" },
 | 
				
			||||||
    { "code": "TZ", "name": "Tanzanie" },
 | 
					    { "code": "TZ", "name": "Tanzanie" },
 | 
				
			||||||
 | 
					    { "code": "TW", "name": "Taïwan" },
 | 
				
			||||||
    { "code": "TD", "name": "Tchad" },
 | 
					    { "code": "TD", "name": "Tchad" },
 | 
				
			||||||
    { "code": "CZ", "name": "Tchéquie" },
 | 
					    { "code": "CZ", "name": "Tchéquie" },
 | 
				
			||||||
    { "code": "TH", "name": "Thaïlande" },
 | 
					    { "code": "TH", "name": "Thaïlande" },
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -76,6 +76,7 @@
 | 
				
			||||||
    { "code": "GY", "name": "Guyana" },
 | 
					    { "code": "GY", "name": "Guyana" },
 | 
				
			||||||
    { "code": "HT", "name": "Haiti" },
 | 
					    { "code": "HT", "name": "Haiti" },
 | 
				
			||||||
    { "code": "HN", "name": "Honduras" },
 | 
					    { "code": "HN", "name": "Honduras" },
 | 
				
			||||||
 | 
					    { "code": "HK", "name": "Hong Kong" },
 | 
				
			||||||
    { "code": "IN", "name": "India" },
 | 
					    { "code": "IN", "name": "India" },
 | 
				
			||||||
    { "code": "ID", "name": "Indonesia" },
 | 
					    { "code": "ID", "name": "Indonesia" },
 | 
				
			||||||
    { "code": "IR", "name": "Iran" },
 | 
					    { "code": "IR", "name": "Iran" },
 | 
				
			||||||
| 
						 | 
					@ -171,6 +172,7 @@
 | 
				
			||||||
    { "code": "CH", "name": "Svizzera" },
 | 
					    { "code": "CH", "name": "Svizzera" },
 | 
				
			||||||
    { "code": "SZ", "name": "eSwatini" },
 | 
					    { "code": "SZ", "name": "eSwatini" },
 | 
				
			||||||
    { "code": "TJ", "name": "Tagikistan" },
 | 
					    { "code": "TJ", "name": "Tagikistan" },
 | 
				
			||||||
 | 
					    { "code": "TW", "name": "Taiwan" },
 | 
				
			||||||
    { "code": "TZ", "name": "Tanzania" },
 | 
					    { "code": "TZ", "name": "Tanzania" },
 | 
				
			||||||
    { "code": "TH", "name": "Thailandia" },
 | 
					    { "code": "TH", "name": "Thailandia" },
 | 
				
			||||||
    { "code": "TL", "name": "Timor Est" },
 | 
					    { "code": "TL", "name": "Timor Est" },
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -54,6 +54,7 @@
 | 
				
			||||||
    { "code": "GY", "name": "Gajana" },
 | 
					    { "code": "GY", "name": "Gajana" },
 | 
				
			||||||
    { "code": "HT", "name": "Haitis" },
 | 
					    { "code": "HT", "name": "Haitis" },
 | 
				
			||||||
    { "code": "HN", "name": "Hondūras" },
 | 
					    { "code": "HN", "name": "Hondūras" },
 | 
				
			||||||
 | 
					    { "code": "HK", "name": "Honkongas" },
 | 
				
			||||||
    { "code": "HU", "name": "Vengrija" },
 | 
					    { "code": "HU", "name": "Vengrija" },
 | 
				
			||||||
    { "code": "IS", "name": "Islandija" },
 | 
					    { "code": "IS", "name": "Islandija" },
 | 
				
			||||||
    { "code": "IN", "name": "Indija" },
 | 
					    { "code": "IN", "name": "Indija" },
 | 
				
			||||||
| 
						 | 
					@ -169,6 +170,7 @@
 | 
				
			||||||
    { "code": "TJ", "name": "Tadžikija" },
 | 
					    { "code": "TJ", "name": "Tadžikija" },
 | 
				
			||||||
    { "code": "TZ", "name": "Tanzanija" },
 | 
					    { "code": "TZ", "name": "Tanzanija" },
 | 
				
			||||||
    { "code": "TH", "name": "Tailandas" },
 | 
					    { "code": "TH", "name": "Tailandas" },
 | 
				
			||||||
 | 
					    { "code": "TW", "name": "Taivanas" },
 | 
				
			||||||
    { "code": "TL", "name": "Rytų Timoras" },
 | 
					    { "code": "TL", "name": "Rytų Timoras" },
 | 
				
			||||||
    { "code": "TG", "name": "Togas" },
 | 
					    { "code": "TG", "name": "Togas" },
 | 
				
			||||||
    { "code": "TO", "name": "Tonga" },
 | 
					    { "code": "TO", "name": "Tonga" },
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -65,6 +65,7 @@
 | 
				
			||||||
    { "code": "ES", "name": "Hiszpania" },
 | 
					    { "code": "ES", "name": "Hiszpania" },
 | 
				
			||||||
    { "code": "NL", "name": "Holandia" },
 | 
					    { "code": "NL", "name": "Holandia" },
 | 
				
			||||||
    { "code": "HN", "name": "Honduras" },
 | 
					    { "code": "HN", "name": "Honduras" },
 | 
				
			||||||
 | 
					    { "code": "HK", "name": "Hongkong" },
 | 
				
			||||||
    { "code": "IN", "name": "Indie" },
 | 
					    { "code": "IN", "name": "Indie" },
 | 
				
			||||||
    { "code": "ID", "name": "Indonezja" },
 | 
					    { "code": "ID", "name": "Indonezja" },
 | 
				
			||||||
    { "code": "IQ", "name": "Irak" },
 | 
					    { "code": "IQ", "name": "Irak" },
 | 
				
			||||||
| 
						 | 
					@ -166,6 +167,7 @@
 | 
				
			||||||
    { "code": "SE", "name": "Szwecja" },
 | 
					    { "code": "SE", "name": "Szwecja" },
 | 
				
			||||||
    { "code": "TJ", "name": "Tadżykistan" },
 | 
					    { "code": "TJ", "name": "Tadżykistan" },
 | 
				
			||||||
    { "code": "TH", "name": "Tajlandia" },
 | 
					    { "code": "TH", "name": "Tajlandia" },
 | 
				
			||||||
 | 
					    { "code": "TW", "name": "Tajwan" },
 | 
				
			||||||
    { "code": "TZ", "name": "Tanzania" },
 | 
					    { "code": "TZ", "name": "Tanzania" },
 | 
				
			||||||
    { "code": "TL", "name": "Timor Wschodni" },
 | 
					    { "code": "TL", "name": "Timor Wschodni" },
 | 
				
			||||||
    { "code": "TG", "name": "Togo" },
 | 
					    { "code": "TG", "name": "Togo" },
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -58,6 +58,7 @@
 | 
				
			||||||
    { "code": "HT", "name": "Haiti" },
 | 
					    { "code": "HT", "name": "Haiti" },
 | 
				
			||||||
    { "code": "NL", "name": "Holandsko" },
 | 
					    { "code": "NL", "name": "Holandsko" },
 | 
				
			||||||
    { "code": "HN", "name": "Honduras" },
 | 
					    { "code": "HN", "name": "Honduras" },
 | 
				
			||||||
 | 
					    { "code": "HK", "name": "Hongkong" },
 | 
				
			||||||
    { "code": "HR", "name": "Chorvátsko" },
 | 
					    { "code": "HR", "name": "Chorvátsko" },
 | 
				
			||||||
    { "code": "IN", "name": "India" },
 | 
					    { "code": "IN", "name": "India" },
 | 
				
			||||||
    { "code": "ID", "name": "Indonézia" },
 | 
					    { "code": "ID", "name": "Indonézia" },
 | 
				
			||||||
| 
						 | 
					@ -172,6 +173,7 @@
 | 
				
			||||||
    { "code": "CH", "name": "Švajčiarsko" },
 | 
					    { "code": "CH", "name": "Švajčiarsko" },
 | 
				
			||||||
    { "code": "SE", "name": "Švédsko" },
 | 
					    { "code": "SE", "name": "Švédsko" },
 | 
				
			||||||
    { "code": "TJ", "name": "Tadžikistan" },
 | 
					    { "code": "TJ", "name": "Tadžikistan" },
 | 
				
			||||||
 | 
					    { "code": "TW", "name": "Taiwan" },
 | 
				
			||||||
    { "code": "IT", "name": "Taliansko" },
 | 
					    { "code": "IT", "name": "Taliansko" },
 | 
				
			||||||
    { "code": "TZ", "name": "Tanzánia" },
 | 
					    { "code": "TZ", "name": "Tanzánia" },
 | 
				
			||||||
    { "code": "TH", "name": "Thajsko" },
 | 
					    { "code": "TH", "name": "Thajsko" },
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -73,6 +73,7 @@
 | 
				
			||||||
    { "code": "GY", "name": "Гајана" },
 | 
					    { "code": "GY", "name": "Гајана" },
 | 
				
			||||||
    { "code": "HT", "name": "Хаити" },
 | 
					    { "code": "HT", "name": "Хаити" },
 | 
				
			||||||
    { "code": "HN", "name": "Хондурас" },
 | 
					    { "code": "HN", "name": "Хондурас" },
 | 
				
			||||||
 | 
					    { "code": "HK", "name": "Хонгконг" },
 | 
				
			||||||
    { "code": "HU", "name": "Мађарска" },
 | 
					    { "code": "HU", "name": "Мађарска" },
 | 
				
			||||||
    { "code": "IS", "name": "Исланд" },
 | 
					    { "code": "IS", "name": "Исланд" },
 | 
				
			||||||
    { "code": "IN", "name": "Индија" },
 | 
					    { "code": "IN", "name": "Индија" },
 | 
				
			||||||
| 
						 | 
					@ -170,6 +171,7 @@
 | 
				
			||||||
    { "code": "SY", "name": "Сиријска Арапска Република" },
 | 
					    { "code": "SY", "name": "Сиријска Арапска Република" },
 | 
				
			||||||
    { "code": "TJ", "name": "Таџикистан" },
 | 
					    { "code": "TJ", "name": "Таџикистан" },
 | 
				
			||||||
    { "code": "TZ", "name": "Танзанија" },
 | 
					    { "code": "TZ", "name": "Танзанија" },
 | 
				
			||||||
 | 
					    { "code": "TW", "name": "Тајван" },
 | 
				
			||||||
    { "code": "TH", "name": "Тајланд" },
 | 
					    { "code": "TH", "name": "Тајланд" },
 | 
				
			||||||
    { "code": "TL", "name": "Тимор-Лесте" },
 | 
					    { "code": "TL", "name": "Тимор-Лесте" },
 | 
				
			||||||
    { "code": "TG", "name": "Того" },
 | 
					    { "code": "TG", "name": "Того" },
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -73,6 +73,7 @@
 | 
				
			||||||
    { "code": "GY", "name": "蓋亞那" },
 | 
					    { "code": "GY", "name": "蓋亞那" },
 | 
				
			||||||
    { "code": "HT", "name": "海地" },
 | 
					    { "code": "HT", "name": "海地" },
 | 
				
			||||||
    { "code": "HN", "name": "宏都拉斯" },
 | 
					    { "code": "HN", "name": "宏都拉斯" },
 | 
				
			||||||
 | 
					    { "code": "HK", "name": "香港" },
 | 
				
			||||||
    { "code": "HU", "name": "匈牙利" },
 | 
					    { "code": "HU", "name": "匈牙利" },
 | 
				
			||||||
    { "code": "IS", "name": "冰島" },
 | 
					    { "code": "IS", "name": "冰島" },
 | 
				
			||||||
    { "code": "IN", "name": "印度" },
 | 
					    { "code": "IN", "name": "印度" },
 | 
				
			||||||
| 
						 | 
					@ -179,6 +180,7 @@
 | 
				
			||||||
    { "code": "TR", "name": "土耳其" },
 | 
					    { "code": "TR", "name": "土耳其" },
 | 
				
			||||||
    { "code": "TM", "name": "土庫曼" },
 | 
					    { "code": "TM", "name": "土庫曼" },
 | 
				
			||||||
    { "code": "TV", "name": "吐瓦魯" },
 | 
					    { "code": "TV", "name": "吐瓦魯" },
 | 
				
			||||||
 | 
					    { "code": "TW", "name": "台灣" },
 | 
				
			||||||
    { "code": "UG", "name": "烏干達" },
 | 
					    { "code": "UG", "name": "烏干達" },
 | 
				
			||||||
    { "code": "UA", "name": "烏克蘭" },
 | 
					    { "code": "UA", "name": "烏克蘭" },
 | 
				
			||||||
    { "code": "AE", "name": "阿聯" },
 | 
					    { "code": "AE", "name": "阿聯" },
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -42,55 +42,69 @@ const DashUtils = {
 | 
				
			||||||
    },
 | 
					    },
 | 
				
			||||||
    generate_adaptation_set(VideoFormatArray) {
 | 
					    generate_adaptation_set(VideoFormatArray) {
 | 
				
			||||||
        const adaptationSets = [];
 | 
					        const adaptationSets = [];
 | 
				
			||||||
        const mimeTypes = [];
 | 
					
 | 
				
			||||||
        const mimeObjects = [[]];
 | 
					        let mimeAudioObjs = [];
 | 
				
			||||||
        // sort the formats by mime types
 | 
					
 | 
				
			||||||
        VideoFormatArray.forEach(videoFormat => {
 | 
					        VideoFormatArray.forEach(videoFormat => {
 | 
				
			||||||
            // the dual formats should not be used
 | 
					            // the dual formats should not be used
 | 
				
			||||||
            if (videoFormat.mimeType.indexOf("video") != -1 && !videoFormat.videoOnly) {
 | 
					            if (videoFormat.mimeType.indexOf("video") != -1 && !videoFormat.videoOnly) {
 | 
				
			||||||
                return;
 | 
					                return;
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
            // if these properties are not available, then we skip it because we cannot set these properties
 | 
					
 | 
				
			||||||
            //if (!(videoFormat.hasOwnProperty('initRange') && videoFormat.hasOwnProperty('indexRange'))) {
 | 
					            const audioTrackId = videoFormat.audioTrackId;
 | 
				
			||||||
            //   return
 | 
					 | 
				
			||||||
            //}
 | 
					 | 
				
			||||||
            const mimeType = videoFormat.mimeType;
 | 
					            const mimeType = videoFormat.mimeType;
 | 
				
			||||||
            const mimeTypeIndex = mimeTypes.indexOf(mimeType);
 | 
					
 | 
				
			||||||
            if (mimeTypeIndex > -1) {
 | 
					            for (let i = 0; i < mimeAudioObjs.length; i++) {
 | 
				
			||||||
                mimeObjects[mimeTypeIndex].push(videoFormat);
 | 
					                const mimeAudioObj = mimeAudioObjs[i];
 | 
				
			||||||
            } else {
 | 
					
 | 
				
			||||||
                mimeTypes.push(mimeType);
 | 
					                if (mimeAudioObj.audioTrackId == audioTrackId && mimeAudioObj.mimeType == mimeType) {
 | 
				
			||||||
                mimeObjects.push([]);
 | 
					                    mimeAudioObj.videoFormats.push(videoFormat);
 | 
				
			||||||
                mimeObjects[mimeTypes.length - 1].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++) {
 | 
					        mimeAudioObjs.forEach(mimeAudioObj => {
 | 
				
			||||||
            let isVideoFormat = false;
 | 
					 | 
				
			||||||
            const adapSet = {
 | 
					            const adapSet = {
 | 
				
			||||||
                type: "element",
 | 
					                type: "element",
 | 
				
			||||||
                name: "AdaptationSet",
 | 
					                name: "AdaptationSet",
 | 
				
			||||||
                attributes: {
 | 
					                attributes: {
 | 
				
			||||||
                    id: i,
 | 
					                    id: mimeAudioObj.audioTrackId,
 | 
				
			||||||
                    mimeType: mimeTypes[i],
 | 
					                    lang: mimeAudioObj.audioTrackId?.substr(0, 2),
 | 
				
			||||||
 | 
					                    mimeType: mimeAudioObj.mimeType,
 | 
				
			||||||
                    startWithSAP: "1",
 | 
					                    startWithSAP: "1",
 | 
				
			||||||
                    subsegmentAlignment: "true",
 | 
					                    subsegmentAlignment: "true",
 | 
				
			||||||
                },
 | 
					                },
 | 
				
			||||||
                elements: [],
 | 
					                elements: [],
 | 
				
			||||||
            };
 | 
					            };
 | 
				
			||||||
            if (!mimeTypes[i].includes("audio")) {
 | 
					
 | 
				
			||||||
                adapSet.attributes.scanType = "progressive";
 | 
					            let isVideoFormat = false;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					            if (mimeAudioObj.mimeType.includes("video")) {
 | 
				
			||||||
                isVideoFormat = true;
 | 
					                isVideoFormat = true;
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
            mimeObjects[i].forEach(format => {
 | 
					
 | 
				
			||||||
 | 
					            if (isVideoFormat) {
 | 
				
			||||||
 | 
					                adapSet.attributes.scanType = "progressive";
 | 
				
			||||||
 | 
					            }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					            for (var i = 0; i < mimeAudioObj.videoFormats.length; i++) {
 | 
				
			||||||
 | 
					                const videoFormat = mimeAudioObj.videoFormats[i];
 | 
				
			||||||
                if (isVideoFormat) {
 | 
					                if (isVideoFormat) {
 | 
				
			||||||
                    adapSet.elements.push(this.generate_representation_video(format));
 | 
					                    adapSet.elements.push(this.generate_representation_video(videoFormat));
 | 
				
			||||||
                } else {
 | 
					                } else {
 | 
				
			||||||
                    adapSet.elements.push(this.generate_representation_audio(format));
 | 
					                    adapSet.elements.push(this.generate_representation_audio(videoFormat));
 | 
				
			||||||
                }
 | 
					                }
 | 
				
			||||||
            });
 | 
					            }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            adaptationSets.push(adapSet);
 | 
					            adaptationSets.push(adapSet);
 | 
				
			||||||
        }
 | 
					        });
 | 
				
			||||||
        return adaptationSets;
 | 
					        return adaptationSets;
 | 
				
			||||||
    },
 | 
					    },
 | 
				
			||||||
    generate_representation_audio(Format) {
 | 
					    generate_representation_audio(Format) {
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue