Skip to content

Commit

Permalink
[ONEM-26034] Use |innerText| for accessing dash.js subs content (#17)
Browse files Browse the repository at this point in the history
HTML node property |textContent| returns text without any whitespaces.
It leads to |DASH-FMP4-AVC1-AAC-TTML Subtitles| failures on dash.js,
because the returned value is verified against expected text which
inluced '\n' character.

Usage of |innerText| property solves the above issue.
  • Loading branch information
maciej-kolanski-red authored Jul 12, 2022
1 parent 0195e13 commit 25d2ff3
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 2 deletions.
2 changes: 1 addition & 1 deletion src/engines.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ function extractSubtitleCue(content, callback) {
var subtitlesDiv = document.getElementById("subtitles");
var elements = subtitlesDiv.getElementsByTagName("div");
for (var i = 0; i < elements.length; i++) {
callback(elements[i].textContent);
callback(elements[i].innerText);
}
} else {
for (var i = 0; i < cues.length; i++) {
Expand Down
1 change: 0 additions & 1 deletion src/filterTest.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ var FilterTestList = {
"DASH-MULTIPERIOD Playback": FilterTestEnum.OPTIONAL, // TODO(ONEM-26036)
"DASH-MULTIPERIOD Pause": FilterTestEnum.OPTIONAL, // TODO(ONEM-26036)
"DASH-MULTIPERIOD Position": FilterTestEnum.OPTIONAL, // TODO(ONEM-26036)
"DASH-FMP4-AVC1-AAC-TTML Subtitles": FilterTestEnum.OPTIONAL, // TODO(ONEM-26034)
"DASH-FMP4-MULTIAUDIO AudioTracks": FilterTestEnum.OPTIONAL, // TODO(ONEM-26279)
"PROG-MKV-EAC3 Position": FilterTestEnum.OPTIONAL,
'audio/mp2t; codecs="mp4a.40.29"(aac)': FilterTestEnum.HIDDEN,
Expand Down

0 comments on commit 25d2ff3

Please sign in to comment.