Streaming: Avoid infinite loop when no representation is found.

This commit is contained in:
Jaroslav Polakovič 2021-04-01 18:08:21 +02:00
Родитель 064e5c4140
Коммит d6b08bab37
3 изменённых файлов: 4 добавлений и 7 удалений

Просмотреть файл

@ -4,7 +4,7 @@ description: 'Encode your streams in a universal format to ensure your media can
date: 4th March, 2017
length: '7:43'
video-sources:
- src: https://storage.googleapis.com/wdm-assets/media/04/index.mpd
- src: https://storage.googleapis.com/wdm-assets/media/04/manifest.mpd
type: application/dash+xml
- src: https://storage.googleapis.com/wdm-assets/media/04/master.m3u8
type: application/x-mpegURL

Просмотреть файл

@ -252,7 +252,7 @@ export default class {
*
* @returns {RepresentationObject[]} Representation objects.
*/
queryRepresentations(representationQuery, contentType, lang = '') {
queryRepresentations(representationQuery, contentType, lang = null) {
let adaptationSetsQuery = `AdaptationSet[contentType="${contentType}"]`;
if (lang) adaptationSetsQuery += `[lang="${lang}"]`;

Просмотреть файл

@ -45,12 +45,9 @@ export default (parser, opts = {}) => {
do {
query = priorities[contentType].shift() || '';
/**
* @todo Support languages other than the hardcoded English.
*/
representations[contentType] = parser.queryRepresentations(query, contentType, 'eng');
representations[contentType] = parser.queryRepresentations(query, contentType);
representations[contentType] = representations[contentType].filter(canPlayFilter);
} while (representations[contentType].length === 0);
} while (representations[contentType].length === 0 && query);
},
);