1
0
mirror of https://github.com/videojs/video.js.git synced 2025-07-05 00:58:52 +02:00

Added an IIFE to prevent deoptimization

This commit is contained in:
Steve Heffernan
2014-03-06 12:36:36 -08:00
parent d538debb1d
commit e4b269e294

View File

@ -290,11 +290,14 @@ vjs.Html5.disposeMediaElement = function(el){
// 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') {
try {
el.load();
}
catch(e) {
}
// wrapping in an iife so it's not deoptimized (#1060#discussion_r10324473)
(function() {
try {
el.load();
} catch (e) {
// not supported
}
})();
}
};