vendor/assets/javascripts/webshims/shims/combos/99.js in webshims-rails-1.14.6 vs vendor/assets/javascripts/webshims/shims/combos/99.js in webshims-rails-1.15.2

- old
+ new

@@ -473,11 +473,12 @@ return cache[template] || ''; }; })(); var ios = /iP(hone|od|ad)/i.test(navigator.platform); var ios6 = ios && parseInt(((navigator.appVersion).match(/OS (\d+)_\d+/) || ['','8'])[1], 10) < 7; - var hasYtBug = (!window.Modernizr || !Modernizr.videoautoplay) && (ios || /android/i.test(navigator.userAgent)); + var modern = window.Modernizr; + var hasYtBug = (!modern || !modern.videoautoplay) && (ios || /android/i.test(navigator.userAgent)); var loadLazy = function(){ if(!loadLazy.loaded){ loadLazy.loaded = true; webshims.loader.loadList(['mediacontrols-lazy', 'range-ui']); } @@ -594,10 +595,11 @@ } data.media.on('play playing waiting seeked seeking', function(e){ if(!e){ e.type = 'playing'; } - if(isInitial && (!isYt || !hasYtBug || e.type == 'playing' || data.media.prop('readyState') > 1)){ + + if(isInitial && (!isYt || !hasYtBug || e.type == 'playing' || data.media.prop('readyState') || data.media.prop('networkState'))){ isInitial = false; data.player.removeClass('initial-state'); } if(isEnded){