vendor/assets/javascripts/webshims/shims/combos/25.js in webshims-rails-1.12.7 vs vendor/assets/javascripts/webshims/shims/combos/25.js in webshims-rails-1.13.0

- old
+ new

@@ -5004,18 +5004,19 @@ })(); } if(hasNative && hasFlash && !options.preferFlash){ - var noSwitch = { - 1: 1 + var switchErrors = { + 3: 1, + 4: 1 }; var switchOptions = function(e){ var media, error, parent; if(!options.preferFlash && ($(e.target).is('audio, video') || ((parent = e.target.parentNode) && $('source', parent).last()[0] == e.target)) && - (media = $(e.target).closest('audio, video')) && (error = media.prop('error')) && !noSwitch[error.code] + (media = $(e.target).closest('audio, video')) && (error = media.prop('error')) && switchErrors[error.code] ){ if(!options.preferFlash){ if(!media.is('.nonnative-api-active')){ options.preferFlash = true; @@ -5032,10 +5033,10 @@ }; setTimeout(function(){ document.addEventListener('error', switchOptions, true); $('audio, video').each(function(){ var error = $.prop(this, 'error'); - if(error && !noSwitch[error]){ + if(error && switchErrors[error]){ switchOptions({target: this}); return false; } }); }, 9);