Skip to content

Commit

Permalink
Fix playback when IE11 modifies the XML DOM (#611)
Browse files Browse the repository at this point in the history
When there is a hypen contained inside manifest Location/BaseUri element and the application uses MutationObserver, IE11 can change the XML DOM of the manifest and break playback.

This changes the way the document is parsed so that it is resilient to these unintended changes.

Related IE bug: https://connect.microsoft.com/IE/feedback/details/1398926/ie11-does-not-parse-cdata-containing-hyphens-correctly

Closes #608
  • Loading branch information
Ross-cz authored and joeyparrish committed Nov 29, 2016
1 parent aa00166 commit 3b7328b
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 1 deletion.
1 change: 1 addition & 0 deletions AUTHORS
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ Oskar Arvidsson <oskar@irock.se>
Philo Inc. <*@philo.com>
Robert Colantuoni <rgc@colantuoni.com>
Roi Lipman <roilipman@gmail.com>
Rostislav Hejduk <Ross-cz@users.noreply.github.com>
SameGoal Inc. <*@samegoal.com>
Sanborn Hilland <sanbornh@rogers.com>
TalkTalk Plc <*@talktalkplc.com>
Expand Down
1 change: 1 addition & 0 deletions CONTRIBUTORS
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ Oskar Arvidsson <oskar@irock.se>
Robert Colantuoni <rgc@colantuoni.com>
Rohit Makasana <rohitbm@google.com>
Roi Lipman <roilipman@gmail.com>
Rostislav Hejduk <Ross-cz@users.noreply.github.com>
Sam Dutton <dutton@google.com>
Sanborn Hilland <sanbornh@rogers.com>
Seth Madison <seth@philo.com>
Expand Down
5 changes: 4 additions & 1 deletion lib/util/xml_utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,10 +66,13 @@ shaka.util.XmlUtils.findChildren = function(elem, name) {
*/
shaka.util.XmlUtils.getContents = function(elem) {
var contents = elem.firstChild;

// check content
if (!contents || contents.nodeType != Node.TEXT_NODE)
return null;

return contents.nodeValue.trim();
// read merged text content from all text nodes (fixes MSIE 11 bug)
return elem.textContent.trim();
};


Expand Down

0 comments on commit 3b7328b

Please sign in to comment.