WIP
This commit is contained in:
parent
e26694c322
commit
6c8d118f83
2
dist/plyr.css
vendored
2
dist/plyr.css
vendored
File diff suppressed because one or more lines are too long
2
dist/plyr.js
vendored
2
dist/plyr.js
vendored
File diff suppressed because one or more lines are too long
2
docs/dist/docs.css
vendored
2
docs/dist/docs.css
vendored
File diff suppressed because one or more lines are too long
@ -121,7 +121,10 @@
|
|||||||
<!-- Docs script -->
|
<!-- Docs script -->
|
||||||
<script src="dist/docs.js"></script>
|
<script src="dist/docs.js"></script>
|
||||||
|
|
||||||
<!-- Shr core script -->
|
<!-- Rangetouch to fix <input type="range"> on touch devices (see https://rangetouch.com) -->
|
||||||
|
<script src="https://cdn.rangetouch.com/0.0.9/rangetouch.js"></script>
|
||||||
|
|
||||||
|
<!-- Sharing libary (https://shr.one) -->
|
||||||
<script src="https://cdn.shr.one/0.1.9/shr.js"></script>
|
<script src="https://cdn.shr.one/0.1.9/shr.js"></script>
|
||||||
<script>if(window.shr) { window.shr.setup({ count: { classname: 'btn__count' } }); }</script>
|
<script>if(window.shr) { window.shr.setup({ count: { classname: 'btn__count' } }); }</script>
|
||||||
</body>
|
</body>
|
||||||
|
@ -12,44 +12,14 @@ video,
|
|||||||
max-width: 100%;
|
max-width: 100%;
|
||||||
vertical-align: middle;
|
vertical-align: middle;
|
||||||
}
|
}
|
||||||
.plyr__video-embed {
|
|
||||||
-webkit-mask-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAIAAACQd1PeAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAA5JREFUeNpiYGBgAAgwAAAEAAGbA+oJAAAAAElFTkSuQmCC);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Example players
|
// Example players
|
||||||
.plyr {
|
.plyr {
|
||||||
margin: 0 auto;
|
margin: 0 auto;
|
||||||
border-radius: @border-radius-base;
|
border-radius: @border-radius-base;
|
||||||
|
|
||||||
&--fullscreen,
|
|
||||||
&--fullscreen-active {
|
|
||||||
max-width: none;
|
|
||||||
|
|
||||||
.plyr-controls,
|
|
||||||
video,
|
|
||||||
iframe {
|
|
||||||
border-radius: 0;
|
|
||||||
}
|
|
||||||
iframe {
|
|
||||||
-webkit-mask-image: none;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
.plyr--audio {
|
.plyr--audio {
|
||||||
max-width: @example-width-audio;
|
max-width: @example-width-audio;
|
||||||
|
|
||||||
/*.plyr__controls {
|
|
||||||
border-radius: @border-radius-base;
|
|
||||||
}
|
|
||||||
.plyr__progress {
|
|
||||||
border-radius: @border-radius-base @border-radius-base 0 0;
|
|
||||||
|
|
||||||
progress,
|
|
||||||
[type='range'] {
|
|
||||||
border-radius: @border-radius-base @border-radius-base 0 0;
|
|
||||||
overflow: hidden;
|
|
||||||
}
|
|
||||||
}*/
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Style full supported player
|
// Style full supported player
|
||||||
@ -62,7 +32,7 @@ video,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.plyr--video ~ ul .plyr__cite--video,
|
.plyr--video:not(.plyr--youtube):not(.plyr--vimeo) ~ ul .plyr__cite--video,
|
||||||
.plyr--audio ~ ul .plyr__cite--audio,
|
.plyr--audio ~ ul .plyr__cite--audio,
|
||||||
.plyr--youtube ~ ul .plyr__cite--youtube,
|
.plyr--youtube ~ ul .plyr__cite--youtube,
|
||||||
.plyr--vimeo ~ ul .plyr__cite--vimeo {
|
.plyr--vimeo ~ ul .plyr__cite--vimeo {
|
||||||
|
@ -2269,7 +2269,7 @@
|
|||||||
_pause();
|
_pause();
|
||||||
|
|
||||||
// Set seek input to 0
|
// Set seek input to 0
|
||||||
if(plyr.buttons.seek) {
|
if(plyr.buttons && plyr.buttons.seek) {
|
||||||
plyr.buttons.seek.value = 0;
|
plyr.buttons.seek.value = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2559,11 +2559,20 @@
|
|||||||
_on(plyr.media, 'waiting canplay seeked', _checkLoading);
|
_on(plyr.media, 'waiting canplay seeked', _checkLoading);
|
||||||
|
|
||||||
// Click video
|
// Click video
|
||||||
if (config.clickToPlay) {
|
if (config.clickToPlay && plyr.type !== 'audio') {
|
||||||
// Set cursor
|
// Re-fetch the wrapper
|
||||||
plyr.videoContainer.style.cursor = "pointer";
|
var wrapper = _getElement('.' + config.classes.videoWrapper);
|
||||||
|
|
||||||
_on(plyr.media, 'click', function() {
|
// Bail if there's no wrapper (this should never happen)
|
||||||
|
if(!wrapper) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Set cursor
|
||||||
|
wrapper.style.cursor = "pointer";
|
||||||
|
|
||||||
|
// On click play, pause ore restart
|
||||||
|
_on(wrapper, 'click', function() {
|
||||||
if (plyr.media.paused) {
|
if (plyr.media.paused) {
|
||||||
_play();
|
_play();
|
||||||
}
|
}
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
// -------------------------------
|
// -------------------------------
|
||||||
|
|
||||||
// Colors
|
// Colors
|
||||||
@plyr-color-main: #63B4E1;
|
@plyr-color-main: #3498DB;
|
||||||
|
|
||||||
// Font sizes
|
// Font sizes
|
||||||
@plyr-font-size-small: 14px;
|
@plyr-font-size-small: 14px;
|
||||||
@ -55,9 +55,10 @@
|
|||||||
@range-thumb-width: floor(@range-track-height * 2);
|
@range-thumb-width: floor(@range-track-height * 2);
|
||||||
@range-thumb-bg: #fff;
|
@range-thumb-bg: #fff;
|
||||||
@range-thumb-border: 2px solid transparent;
|
@range-thumb-border: 2px solid transparent;
|
||||||
|
@range-thumb-shadow: 0 1px 1px fade(@plyr-video-controls-bg, 15%);
|
||||||
@range-thumb-active-border-color: #fff;
|
@range-thumb-active-border-color: #fff;
|
||||||
@range-thumb-active-bg: @plyr-video-control-bg-hover;
|
@range-thumb-active-bg: @plyr-video-control-bg-hover;
|
||||||
@range-thumb-shadow: 0 1px 1px fade(@plyr-video-controls-bg, 15%);
|
@range-thumb-active-scale: 1.25;
|
||||||
|
|
||||||
// Breakpoints
|
// Breakpoints
|
||||||
@plyr-bp-control-split: 560px; // When controls split into left/right
|
@plyr-bp-control-split: 560px; // When controls split into left/right
|
||||||
@ -72,9 +73,9 @@
|
|||||||
// Mixins
|
// Mixins
|
||||||
// -------------------------------
|
// -------------------------------
|
||||||
// <input type="range"> styling
|
// <input type="range"> styling
|
||||||
.range-track() {
|
.range-track(@background: @range-track-bg) {
|
||||||
height: @range-track-height;
|
height: @range-track-height;
|
||||||
background: @range-track-bg;
|
background: @background;
|
||||||
border: 0;
|
border: 0;
|
||||||
border-radius: (@range-track-height / 2);
|
border-radius: (@range-track-height / 2);
|
||||||
user-select: none;
|
user-select: none;
|
||||||
@ -93,7 +94,7 @@
|
|||||||
.range-thumb-active() {
|
.range-thumb-active() {
|
||||||
background: @range-thumb-active-bg;
|
background: @range-thumb-active-bg;
|
||||||
border-color: @range-thumb-active-border-color;
|
border-color: @range-thumb-active-border-color;
|
||||||
transform: scale(1.25);
|
transform: scale(@range-thumb-active-scale);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Styles
|
// Styles
|
||||||
@ -132,7 +133,7 @@
|
|||||||
// Specificity is for bootstrap compatibility
|
// Specificity is for bootstrap compatibility
|
||||||
input[type='range'] {
|
input[type='range'] {
|
||||||
display: block;
|
display: block;
|
||||||
height: @range-thumb-height;
|
height: (@range-thumb-height * @range-thumb-active-scale);
|
||||||
width: 100%;
|
width: 100%;
|
||||||
margin: 0;
|
margin: 0;
|
||||||
padding: 0;
|
padding: 0;
|
||||||
@ -171,17 +172,17 @@
|
|||||||
border: 0;
|
border: 0;
|
||||||
color: transparent;
|
color: transparent;
|
||||||
}
|
}
|
||||||
&::-ms-fill-lower,
|
|
||||||
&::-ms-fill-upper {
|
&::-ms-fill-upper {
|
||||||
.range-track();
|
.range-track();
|
||||||
}
|
}
|
||||||
|
&::-ms-fill-lower {
|
||||||
|
.range-track(@plyr-progress-playing-bg);
|
||||||
|
}
|
||||||
&::-ms-thumb {
|
&::-ms-thumb {
|
||||||
.range-thumb();
|
.range-thumb();
|
||||||
|
|
||||||
// For some reason, Edge uses the -webkit margin above
|
// For some reason, Edge uses the -webkit margin above
|
||||||
margin-top: 0;
|
margin-top: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
&::-ms-tooltip {
|
&::-ms-tooltip {
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
@ -229,6 +230,9 @@
|
|||||||
position: relative;
|
position: relative;
|
||||||
background: #000;
|
background: #000;
|
||||||
border-radius: inherit;
|
border-radius: inherit;
|
||||||
|
|
||||||
|
// Cleaner radius, also forces iframe radius
|
||||||
|
-webkit-mask-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAIAAACQd1PeAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAA5JREFUeNpiYGBgAAgwAAAEAAGbA+oJAAAAAElFTkSuQmCC);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Container for embeds
|
// Container for embeds
|
||||||
@ -277,6 +281,7 @@
|
|||||||
font-size: @plyr-font-size-captions-base;
|
font-size: @plyr-font-size-captions-base;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
font-weight: 400;
|
font-weight: 400;
|
||||||
|
-webkit-font-smoothing: subpixel-antialiased;
|
||||||
|
|
||||||
span {
|
span {
|
||||||
border-radius: 2px;
|
border-radius: 2px;
|
||||||
@ -488,6 +493,7 @@
|
|||||||
color: @plyr-tooltip-color;
|
color: @plyr-tooltip-color;
|
||||||
font-size: @plyr-font-size-small;
|
font-size: @plyr-font-size-small;
|
||||||
line-height: 1.3;
|
line-height: 1.3;
|
||||||
|
-webkit-font-smoothing: subpixel-antialiased;
|
||||||
|
|
||||||
transform: translate(-50%, 10px) scale(.8);
|
transform: translate(-50%, 10px) scale(.8);
|
||||||
transform-origin: 50% 100%;
|
transform-origin: 50% 100%;
|
||||||
@ -539,7 +545,6 @@
|
|||||||
&::-moz-range-track {
|
&::-moz-range-track {
|
||||||
background: transparent;
|
background: transparent;
|
||||||
}
|
}
|
||||||
&::-ms-fill-lower,
|
|
||||||
&::-ms-fill-upper {
|
&::-ms-fill-upper {
|
||||||
background: transparent;
|
background: transparent;
|
||||||
}
|
}
|
||||||
@ -586,6 +591,7 @@
|
|||||||
z-index: 1;
|
z-index: 1;
|
||||||
color: @plyr-progress-playing-bg;
|
color: @plyr-progress-playing-bg;
|
||||||
background: transparent;
|
background: transparent;
|
||||||
|
transition: none;
|
||||||
|
|
||||||
&::-webkit-progress-value {
|
&::-webkit-progress-value {
|
||||||
min-width: @range-track-height;
|
min-width: @range-track-height;
|
||||||
@ -598,9 +604,7 @@
|
|||||||
border-bottom-right-radius: 0;
|
border-bottom-right-radius: 0;
|
||||||
}
|
}
|
||||||
&::-ms-fill {
|
&::-ms-fill {
|
||||||
min-width: @range-track-height;
|
display: none;
|
||||||
border-top-right-radius: 0;
|
|
||||||
border-bottom-right-radius: 0;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.plyr__progress--buffer[value] {
|
.plyr__progress--buffer[value] {
|
||||||
@ -643,6 +647,7 @@
|
|||||||
vertical-align: middle;
|
vertical-align: middle;
|
||||||
font-size: @plyr-font-size-small;
|
font-size: @plyr-font-size-small;
|
||||||
line-height: .95;
|
line-height: .95;
|
||||||
|
-webkit-font-smoothing: subpixel-antialiased;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Media duration hidden on small screens
|
// Media duration hidden on small screens
|
||||||
@ -671,15 +676,10 @@
|
|||||||
// Hide sound controls on iOS
|
// Hide sound controls on iOS
|
||||||
// It's not supported to change volume using JavaScript:
|
// It's not supported to change volume using JavaScript:
|
||||||
// https://developer.apple.com/library/safari/documentation/AudioVideo/Conceptual/Using_HTML5_Audio_Video/Device-SpecificConsiderations/Device-SpecificConsiderations.html
|
// https://developer.apple.com/library/safari/documentation/AudioVideo/Conceptual/Using_HTML5_Audio_Video/Device-SpecificConsiderations/Device-SpecificConsiderations.html
|
||||||
.plyr--is-ios .plyr__volume,
|
.plyr--is-ios .plyr__volume[type='range'],
|
||||||
.plyr--is-ios [data-plyr='mute'],
|
.plyr--is-ios [data-plyr='mute'] {
|
||||||
.plyr--is-ios.plyr--audio .plyr__controls--right {
|
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
// Center buttons so it looks less odd
|
|
||||||
.plyr--is-ios.plyr--audio .plyr__controls--left {
|
|
||||||
float: none;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Fullscreen
|
// Fullscreen
|
||||||
// --------------------------------------------------------------
|
// --------------------------------------------------------------
|
||||||
@ -694,6 +694,7 @@
|
|||||||
width: 100%;
|
width: 100%;
|
||||||
z-index: 10000000;
|
z-index: 10000000;
|
||||||
background: #000;
|
background: #000;
|
||||||
|
border-radius: 0;
|
||||||
|
|
||||||
video {
|
video {
|
||||||
height: 100%;
|
height: 100%;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user