Skip to content

Commit

Permalink
Added try/catch to protect against IE with no Media Player
Browse files Browse the repository at this point in the history
  • Loading branch information
heff committed Mar 5, 2014
1 parent d47435a commit d538deb
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion src/js/media/html5.js
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,13 @@ vjs.Html5.prototype.defaultMuted = function(){ return this.el_.defaultMuted; };
/* HTML5 Support Testing ---------------------------------------------------- */

vjs.Html5.isSupported = function(){
// ie9 with no Media Player is a LIAR! (#984)
try {
vjs.TEST_VID['volume'] = 0.5;
} catch (e) {
return false;
}

return !!vjs.TEST_VID.canPlayType;
};

Expand Down Expand Up @@ -281,8 +288,13 @@ vjs.Html5.disposeMediaElement = function(el){
el.removeAttribute('src');

// force the media element to update its loading state by calling load()
// however IE on Windows 7N has a bug that throws an error so need a try/catch (#793)
if (typeof el.load === 'function') {
el.load();
try {
el.load();
}
catch(e) {
}
}
};

Expand Down

0 comments on commit d538deb

Please sign in to comment.