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:
@ -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
|
||||
}
|
||||
})();
|
||||
}
|
||||
};
|
||||
|
||||
|
Reference in New Issue
Block a user