Fix for iPad and YouTube issues
This commit is contained in:
parent
73a1391f2f
commit
a44c7ecc3a
2
dist/plyr.css
vendored
2
dist/plyr.css
vendored
File diff suppressed because one or more lines are too long
4
dist/plyr.js
vendored
4
dist/plyr.js
vendored
File diff suppressed because one or more lines are too long
@ -257,6 +257,7 @@
|
|||||||
isChrome: isChrome,
|
isChrome: isChrome,
|
||||||
isSafari: isSafari,
|
isSafari: isSafari,
|
||||||
isIos: /(iPad|iPhone|iPod)/g.test(navigator.platform),
|
isIos: /(iPad|iPhone|iPod)/g.test(navigator.platform),
|
||||||
|
isIphone: /(iPhone|iPod)/g.test(navigator.userAgent),
|
||||||
isTouch: 'ontouchstart' in document.documentElement
|
isTouch: 'ontouchstart' in document.documentElement
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
@ -3294,6 +3295,9 @@
|
|||||||
// Replace the container with the original element provided
|
// Replace the container with the original element provided
|
||||||
plyr.container.parentNode.replaceChild(original, plyr.container);
|
plyr.container.parentNode.replaceChild(original, plyr.container);
|
||||||
|
|
||||||
|
// Allow overflow (set on fullscreen)
|
||||||
|
document.body.style.overflow = '';
|
||||||
|
|
||||||
// Event
|
// Event
|
||||||
_triggerEvent(original, 'destroyed', true);
|
_triggerEvent(original, 'destroyed', true);
|
||||||
}
|
}
|
||||||
@ -3540,31 +3544,48 @@
|
|||||||
var browser = _browserSniff(),
|
var browser = _browserSniff(),
|
||||||
isOldIE = (browser.isIE && browser.version <= 9),
|
isOldIE = (browser.isIE && browser.version <= 9),
|
||||||
isIos = browser.isIos,
|
isIos = browser.isIos,
|
||||||
isIphone = /iPhone|iPod/i.test(navigator.userAgent),
|
isIphone = browser.isIphone,
|
||||||
audio = !!document.createElement('audio').canPlayType,
|
audioSupport = !!document.createElement('audio').canPlayType,
|
||||||
video = !!document.createElement('video').canPlayType,
|
videoSupport = !!document.createElement('video').canPlayType,
|
||||||
basic, full;
|
basic = false,
|
||||||
|
full = false;
|
||||||
|
|
||||||
switch (type) {
|
switch (type) {
|
||||||
case 'video':
|
case 'video':
|
||||||
basic = video;
|
basic = videoSupport;
|
||||||
full = (basic && (!isOldIE && !isIphone));
|
full = (basic && (!isOldIE && !isIphone));
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'audio':
|
case 'audio':
|
||||||
basic = audio;
|
basic = audioSupport;
|
||||||
full = (basic && !isOldIE);
|
full = (basic && !isOldIE);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
// Vimeo does not seem to be supported on iOS via API
|
||||||
|
// Issue raised https://github.com/vimeo/player.js/issues/87
|
||||||
case 'vimeo':
|
case 'vimeo':
|
||||||
case 'youtube':
|
|
||||||
case 'soundcloud':
|
|
||||||
basic = true;
|
basic = true;
|
||||||
full = (!isOldIE && !isIos);
|
full = (!isOldIE && !isIos);
|
||||||
break;
|
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 && !isIphone);
|
||||||
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
basic = (audio && video);
|
basic = (audioSupport && videoSupport);
|
||||||
full = (basic && !isOldIE);
|
full = (basic && !isOldIE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -179,9 +179,10 @@
|
|||||||
.plyr__video-embed {
|
.plyr__video-embed {
|
||||||
padding-bottom: 56.25%; /* 16:9 */
|
padding-bottom: 56.25%; /* 16:9 */
|
||||||
height: 0;
|
height: 0;
|
||||||
overflow: hidden;
|
border-radius: inherit;
|
||||||
|
|
||||||
// Require z-index to force border-radius
|
// Require overflow and z-index to force border-radius
|
||||||
|
overflow: hidden;
|
||||||
z-index: 0;
|
z-index: 0;
|
||||||
|
|
||||||
iframe {
|
iframe {
|
||||||
@ -192,7 +193,6 @@
|
|||||||
height: 100%;
|
height: 100%;
|
||||||
border: 0;
|
border: 0;
|
||||||
user-select: none;
|
user-select: none;
|
||||||
z-index: 1;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Vimeo hack
|
// Vimeo hack
|
||||||
@ -341,6 +341,7 @@
|
|||||||
left: 0;
|
left: 0;
|
||||||
right: 0;
|
right: 0;
|
||||||
bottom: 0;
|
bottom: 0;
|
||||||
|
z-index: 2;
|
||||||
padding: (@plyr-control-spacing * 5) @plyr-control-spacing @plyr-control-spacing;
|
padding: (@plyr-control-spacing * 5) @plyr-control-spacing @plyr-control-spacing;
|
||||||
background: linear-gradient(fade(@plyr-video-controls-bg, 0%), fade(@plyr-video-controls-bg, 50%));
|
background: linear-gradient(fade(@plyr-video-controls-bg, 0%), fade(@plyr-video-controls-bg, 50%));
|
||||||
border-bottom-left-radius: inherit;
|
border-bottom-left-radius: inherit;
|
||||||
@ -740,6 +741,10 @@
|
|||||||
height: 100%;
|
height: 100%;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
}
|
}
|
||||||
|
.plyr__video-embed {
|
||||||
|
// Revert overflow change
|
||||||
|
overflow: visible;
|
||||||
|
}
|
||||||
.plyr__controls {
|
.plyr__controls {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
bottom: 0;
|
bottom: 0;
|
||||||
|
@ -178,10 +178,10 @@
|
|||||||
.plyr__video-embed {
|
.plyr__video-embed {
|
||||||
padding-bottom: 56.25%; /* 16:9 */
|
padding-bottom: 56.25%; /* 16:9 */
|
||||||
height: 0;
|
height: 0;
|
||||||
overflow: hidden;
|
|
||||||
border-radius: inherit;
|
border-radius: inherit;
|
||||||
|
|
||||||
// Require z-index to force border-radius
|
// Require overflow and z-index to force border-radius
|
||||||
|
overflow: hidden;
|
||||||
z-index: 0;
|
z-index: 0;
|
||||||
|
|
||||||
iframe {
|
iframe {
|
||||||
@ -738,6 +738,10 @@
|
|||||||
height: 100%;
|
height: 100%;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
}
|
}
|
||||||
|
.plyr__video-embed {
|
||||||
|
// Revert overflow change
|
||||||
|
overflow: visible;
|
||||||
|
}
|
||||||
.plyr__controls {
|
.plyr__controls {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
bottom: 0;
|
bottom: 0;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user