diff options
Diffstat (limited to 'src/js')
-rw-r--r-- | src/js/plyr.js | 37 |
1 files changed, 29 insertions, 8 deletions
diff --git a/src/js/plyr.js b/src/js/plyr.js index 0570e35b..8a486d93 100644 --- a/src/js/plyr.js +++ b/src/js/plyr.js @@ -257,6 +257,7 @@ isChrome: isChrome, isSafari: isSafari, isIos: /(iPad|iPhone|iPod)/g.test(navigator.platform), + isIphone: /(iPhone|iPod)/g.test(navigator.userAgent), isTouch: 'ontouchstart' in document.documentElement }; } @@ -3296,6 +3297,9 @@ // Replace the container with the original element provided plyr.container.parentNode.replaceChild(original, plyr.container); + // Allow overflow (set on fullscreen) + document.body.style.overflow = ''; + // Event _triggerEvent(original, 'destroyed', true); } @@ -3542,31 +3546,48 @@ var browser = _browserSniff(), isOldIE = (browser.isIE && browser.version <= 9), isIos = browser.isIos, - isIphone = /iPhone|iPod/i.test(navigator.userAgent), - audio = !!document.createElement('audio').canPlayType, - video = !!document.createElement('video').canPlayType, - basic, full; + isIphone = browser.isIphone, + audioSupport = !!document.createElement('audio').canPlayType, + videoSupport = !!document.createElement('video').canPlayType, + basic = false, + full = false; switch (type) { case 'video': - basic = video; + basic = videoSupport; full = (basic && (!isOldIE && !isIphone)); break; case 'audio': - basic = audio; + basic = audioSupport; full = (basic && !isOldIE); break; + // Vimeo does not seem to be supported on iOS via API + // Issue raised https://github.com/vimeo/player.js/issues/87 case 'vimeo': + basic = true; + full = (!isOldIE && !isIos); + break; + case 'youtube': + basic = true; + full = (!isOldIE && !isIos); + + // YouTube seems to work on iOS 10+ on iPad + if (isIos && !isIphone && browser.version >= 10) { + full = true; + } + + break; + case 'soundcloud': basic = true; - full = (!isOldIE && !isIos); + full = (!isOldIE && !isIphone); break; default: - basic = (audio && video); + basic = (audioSupport && videoSupport); full = (basic && !isOldIE); } |