Skip to content

Commit

Permalink
bug fix for AdaptationSet with no Id (optional parameter)
Browse files Browse the repository at this point in the history
  • Loading branch information
nicosang committed Jun 7, 2018
1 parent 3ed1bc2 commit 39e381f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/streaming/text/TextController.js
Expand Up @@ -264,7 +264,7 @@ function TextController() {

if (streamProcessor && mediaInfosArr) {
for (let i = 0; i < mediaInfosArr.length; i++) {
if (mediaInfosArr[i].lang === currentTrackInfo.lang) {
if (mediaInfosArr[i].index === currentTrackInfo.index && mediaInfosArr[i].lang === currentTrackInfo.lang) {
streamProcessor.selectMediaInfo(mediaInfosArr[i]);
break;
}
Expand Down
2 changes: 1 addition & 1 deletion src/streaming/text/TextSourceBuffer.js
Expand Up @@ -301,7 +301,7 @@ function TextSourceBuffer() {

textTrackInfo.captionData = captionData;
textTrackInfo.lang = mediaInfo.lang;
textTrackInfo.label = mediaInfo.id; // AdaptationSet id (an unsigned int)
textTrackInfo.label = mediaInfo.id ? mediaInfo.id : mediaInfo.index; // AdaptationSet id (an unsigned int) as it's optionnal parameter, use mediaInfo.index
textTrackInfo.index = mediaInfo.index; // AdaptationSet index in manifest
textTrackInfo.isTTML = checkTTML();
textTrackInfo.defaultTrack = getIsDefault(mediaInfo);
Expand Down

0 comments on commit 39e381f

Please sign in to comment.