PiP
This commit is contained in:
@ -686,8 +686,7 @@
|
||||
// Picture-in-picture support
|
||||
// Safari only currently
|
||||
pip: (function() {
|
||||
var video = document.createElement('video');
|
||||
return _is.function(video.webkitSetPresentationMode);
|
||||
return _is.function(document.createElement('video').webkitSetPresentationMode);
|
||||
})(),
|
||||
// Airplay support
|
||||
// Safari only currently
|
||||
@ -700,21 +699,30 @@
|
||||
mime: function(plyr, type) {
|
||||
var media = plyr.media;
|
||||
|
||||
if (plyr.type === 'video') {
|
||||
// Check type
|
||||
switch (type) {
|
||||
case 'video/webm': return !!(media.canPlayType && media.canPlayType('video/webm; codecs="vp8, vorbis"').replace(/no/, ''));
|
||||
case 'video/mp4': return !!(media.canPlayType && media.canPlayType('video/mp4; codecs="avc1.42E01E, mp4a.40.2"').replace(/no/, ''));
|
||||
case 'video/ogg': return !!(media.canPlayType && media.canPlayType('video/ogg; codecs="theora"').replace(/no/, ''));
|
||||
try {
|
||||
// Bail if no checking function
|
||||
if (!_is.function(media.canPlayType)) {
|
||||
return false;
|
||||
}
|
||||
} else if (plyr.type === 'audio') {
|
||||
// Check type
|
||||
switch (type) {
|
||||
case 'audio/mpeg': return !!(media.canPlayType && media.canPlayType('audio/mpeg;').replace(/no/, ''));
|
||||
case 'audio/ogg': return !!(media.canPlayType && media.canPlayType('audio/ogg; codecs="vorbis"').replace(/no/, ''));
|
||||
case 'audio/wav': return !!(media.canPlayType && media.canPlayType('audio/wav; codecs="1"').replace(/no/, ''));
|
||||
|
||||
// Type specific checks
|
||||
if (plyr.type === 'video') {
|
||||
switch (type) {
|
||||
case 'video/webm': return media.canPlayType('video/webm; codecs="vp8, vorbis"').replace(/no/, '');
|
||||
case 'video/mp4': return media.canPlayType('video/mp4; codecs="avc1.42E01E, mp4a.40.2"').replace(/no/, '');
|
||||
case 'video/ogg': return media.canPlayType('video/ogg; codecs="theora"').replace(/no/, '');
|
||||
}
|
||||
} else if (plyr.type === 'audio') {
|
||||
switch (type) {
|
||||
case 'audio/mpeg': return media.canPlayType('audio/mpeg;').replace(/no/, '');
|
||||
case 'audio/ogg': return media.canPlayType('audio/ogg; codecs="vorbis"').replace(/no/, '');
|
||||
case 'audio/wav': return media.canPlayType('audio/wav; codecs="1"').replace(/no/, '');
|
||||
}
|
||||
}
|
||||
}
|
||||
catch(e) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// If we got this far, we're stuffed
|
||||
return false;
|
||||
|
@ -668,7 +668,8 @@
|
||||
}
|
||||
|
||||
// First tooltip
|
||||
.plyr__controls > button:first-child .plyr__tooltip {
|
||||
.plyr__controls > button:first-child .plyr__tooltip,
|
||||
.plyr__controls > button:first-child + button .plyr__tooltip {
|
||||
left: 0;
|
||||
transform: translate(0, 10px) scale(.8);
|
||||
transform-origin: 0 100%;
|
||||
@ -692,6 +693,7 @@
|
||||
}
|
||||
|
||||
.plyr__controls > button:first-child,
|
||||
.plyr__controls > button:first-child + button,
|
||||
.plyr__controls > button:last-child {
|
||||
&:hover .plyr__tooltip,
|
||||
&.tab-focus:focus .plyr__tooltip,
|
||||
|
@ -27,7 +27,7 @@
|
||||
@plyr-control-icon-size: 18px;
|
||||
@plyr-control-spacing: 10px;
|
||||
@plyr-control-padding: (@plyr-control-spacing * .7);
|
||||
@plyr-video-controls-bg: #343f4a;
|
||||
@plyr-video-controls-bg: #000;
|
||||
@plyr-video-control-color: #fff;
|
||||
@plyr-video-control-color-hover: #fff;
|
||||
@plyr-video-control-bg-hover: @plyr-color-main;
|
||||
|
@ -495,7 +495,8 @@
|
||||
}
|
||||
|
||||
// First tooltip
|
||||
.plyr__controls button:first-child .plyr__tooltip {
|
||||
.plyr__controls > button:first-child .plyr__tooltip,
|
||||
.plyr__controls > button:first-child + button .plyr__tooltip {
|
||||
left: 0;
|
||||
transform: translate(0, 10px) scale(.8);
|
||||
transform-origin: 0 100%;
|
||||
@ -506,7 +507,7 @@
|
||||
}
|
||||
|
||||
// Last tooltip
|
||||
.plyr__controls button:last-child .plyr__tooltip {
|
||||
.plyr__controls > button:last-child .plyr__tooltip {
|
||||
right: 0;
|
||||
transform: translate(0, 10px) scale(.8);
|
||||
transform-origin: 100% 100%;
|
||||
@ -518,8 +519,9 @@
|
||||
}
|
||||
}
|
||||
|
||||
.plyr__controls button:first-child,
|
||||
.plyr__controls button:last-child {
|
||||
.plyr__controls > button:first-child,
|
||||
.plyr__controls > button:first-child + button,
|
||||
.plyr__controls > button:last-child {
|
||||
&:hover .plyr__tooltip,
|
||||
&.tab-focus:focus .plyr__tooltip,
|
||||
.plyr__tooltip--visible {
|
||||
|
Reference in New Issue
Block a user