diff --git a/source/UI/js/Video/VideoElement.js b/source/UI/js/Video/VideoElement.js index 2184d9ed..c4321721 100644 --- a/source/UI/js/Video/VideoElement.js +++ b/source/UI/js/Video/VideoElement.js @@ -17,6 +17,13 @@ Ox.VideoElement VideoElement Object ended ended @*/ +(function() { + var queue = [], + queueSize = 100, + restrictedElements = [], + requiresUserGesture = mediaPlaybackRequiresUserGesture(), + unblock = []; + Ox.VideoElement = function(options, self) { self = self || {}; @@ -113,10 +120,8 @@ Ox.VideoElement = function(options, self) { }, 30); // mobile browsers only allow playing media elements after user interaction - if (mediaPlaybackRequiresUserGesture()) { - window.addEventListener('keydown', removeBehaviorsRestrictions); - window.addEventListener('mousedown', removeBehaviorsRestrictions); - window.addEventListener('touchstart', removeBehaviorsRestrictions); + if (restrictedElements.length > 0) { + unblock.push(setSource); setTimeout(function() { that.triggerEvent('requiresusergesture'); }) @@ -143,7 +148,7 @@ Ox.VideoElement = function(options, self) { } function getVideo() { - return $('