Quality WIP
This commit is contained in:
parent
bae04a492a
commit
7965b82cca
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
128
src/js/plyr.js
128
src/js/plyr.js
@ -40,7 +40,7 @@
|
|||||||
volumeStep: 1,
|
volumeStep: 1,
|
||||||
defaultSpeed: 1.0,
|
defaultSpeed: 1.0,
|
||||||
currentSpeed: 1.0,
|
currentSpeed: 1.0,
|
||||||
speeds: [ 0.5, 1.0, 1.5, 2.0 ],
|
speeds: [0.5, 1.0, 1.5, 2.0],
|
||||||
duration: null,
|
duration: null,
|
||||||
displayDuration: true,
|
displayDuration: true,
|
||||||
loadSprite: true,
|
loadSprite: true,
|
||||||
@ -806,7 +806,7 @@
|
|||||||
// Restart button
|
// Restart button
|
||||||
if (_inArray(config.controls, 'restart')) {
|
if (_inArray(config.controls, 'restart')) {
|
||||||
html.push(
|
html.push(
|
||||||
'<button type="button" data-plyr="restart">',
|
'<button type="button" class="plyr__control" data-plyr="restart">',
|
||||||
'<svg><use xlink:href="' + iconPath + '-restart" /></svg>',
|
'<svg><use xlink:href="' + iconPath + '-restart" /></svg>',
|
||||||
'<span class="plyr__sr-only">' + config.i18n.restart + '</span>',
|
'<span class="plyr__sr-only">' + config.i18n.restart + '</span>',
|
||||||
'</button>'
|
'</button>'
|
||||||
@ -816,7 +816,7 @@
|
|||||||
// Rewind button
|
// Rewind button
|
||||||
if (_inArray(config.controls, 'rewind')) {
|
if (_inArray(config.controls, 'rewind')) {
|
||||||
html.push(
|
html.push(
|
||||||
'<button type="button" data-plyr="rewind">',
|
'<button type="button" class="plyr__control" data-plyr="rewind">',
|
||||||
'<svg><use xlink:href="' + iconPath + '-rewind" /></svg>',
|
'<svg><use xlink:href="' + iconPath + '-rewind" /></svg>',
|
||||||
'<span class="plyr__sr-only">' + config.i18n.rewind + '</span>',
|
'<span class="plyr__sr-only">' + config.i18n.rewind + '</span>',
|
||||||
'</button>'
|
'</button>'
|
||||||
@ -827,11 +827,11 @@
|
|||||||
// TODO: This should be a toggle button really?
|
// TODO: This should be a toggle button really?
|
||||||
if (_inArray(config.controls, 'play')) {
|
if (_inArray(config.controls, 'play')) {
|
||||||
html.push(
|
html.push(
|
||||||
'<button type="button" data-plyr="play">',
|
'<button type="button" class="plyr__control" data-plyr="play">',
|
||||||
'<svg><use xlink:href="' + iconPath + '-play" /></svg>',
|
'<svg><use xlink:href="' + iconPath + '-play" /></svg>',
|
||||||
'<span class="plyr__sr-only">' + config.i18n.play + '</span>',
|
'<span class="plyr__sr-only">' + config.i18n.play + '</span>',
|
||||||
'</button>',
|
'</button>',
|
||||||
'<button type="button" data-plyr="pause">',
|
'<button type="button" class="plyr__control" data-plyr="pause">',
|
||||||
'<svg><use xlink:href="' + iconPath + '-pause" /></svg>',
|
'<svg><use xlink:href="' + iconPath + '-pause" /></svg>',
|
||||||
'<span class="plyr__sr-only">' + config.i18n.pause + '</span>',
|
'<span class="plyr__sr-only">' + config.i18n.pause + '</span>',
|
||||||
'</button>'
|
'</button>'
|
||||||
@ -841,7 +841,7 @@
|
|||||||
// Fast forward button
|
// Fast forward button
|
||||||
if (_inArray(config.controls, 'fast-forward')) {
|
if (_inArray(config.controls, 'fast-forward')) {
|
||||||
html.push(
|
html.push(
|
||||||
'<button type="button" data-plyr="fast-forward">',
|
'<button type="button" class="plyr__control" data-plyr="fast-forward">',
|
||||||
'<svg><use xlink:href="' + iconPath + '-fast-forward" /></svg>',
|
'<svg><use xlink:href="' + iconPath + '-fast-forward" /></svg>',
|
||||||
'<span class="plyr__sr-only">' + config.i18n.forward + '</span>',
|
'<span class="plyr__sr-only">' + config.i18n.forward + '</span>',
|
||||||
'</button>'
|
'</button>'
|
||||||
@ -891,7 +891,7 @@
|
|||||||
// Toggle mute button
|
// Toggle mute button
|
||||||
if (_inArray(config.controls, 'mute')) {
|
if (_inArray(config.controls, 'mute')) {
|
||||||
html.push(
|
html.push(
|
||||||
'<button type="button" data-plyr="mute">',
|
'<button type="button" class="plyr__control" data-plyr="mute">',
|
||||||
'<svg class="icon--muted"><use xlink:href="' + iconPath + '-muted" /></svg>',
|
'<svg class="icon--muted"><use xlink:href="' + iconPath + '-muted" /></svg>',
|
||||||
'<svg><use xlink:href="' + iconPath + '-volume" /></svg>',
|
'<svg><use xlink:href="' + iconPath + '-volume" /></svg>',
|
||||||
'<span class="plyr__sr-only">' + config.i18n.toggleMute + '</span>',
|
'<span class="plyr__sr-only">' + config.i18n.toggleMute + '</span>',
|
||||||
@ -913,7 +913,7 @@
|
|||||||
// Toggle captions button
|
// Toggle captions button
|
||||||
if (_inArray(config.controls, 'captions')) {
|
if (_inArray(config.controls, 'captions')) {
|
||||||
html.push(
|
html.push(
|
||||||
'<button type="button" data-plyr="captions">',
|
'<button type="button" class="plyr__control" data-plyr="captions">',
|
||||||
'<svg class="icon--captions-on"><use xlink:href="' + iconPath + '-captions-on" /></svg>',
|
'<svg class="icon--captions-on"><use xlink:href="' + iconPath + '-captions-on" /></svg>',
|
||||||
'<svg><use xlink:href="' + iconPath+ '-captions-off" /></svg>',
|
'<svg><use xlink:href="' + iconPath+ '-captions-off" /></svg>',
|
||||||
'<span class="plyr__sr-only">' + config.i18n.toggleCaptions + '</span>',
|
'<span class="plyr__sr-only">' + config.i18n.toggleCaptions + '</span>',
|
||||||
@ -925,7 +925,7 @@
|
|||||||
if (_inArray(config.controls, 'settings')) {
|
if (_inArray(config.controls, 'settings')) {
|
||||||
html.push(
|
html.push(
|
||||||
'<div class="plyr__menu" data-plyr="settings">',
|
'<div class="plyr__menu" data-plyr="settings">',
|
||||||
'<button type="button" id="plyr-settings-toggle-{id}" aria-haspopup="true" aria-controls="plyr-settings-{id}" aria-expanded="false">',
|
'<button type="button" id="plyr-settings-toggle-{id}" class="plyr__control" aria-haspopup="true" aria-controls="plyr-settings-{id}" aria-expanded="false">',
|
||||||
'<svg><use xlink:href="' + iconPath + '-settings" /></svg>',
|
'<svg><use xlink:href="' + iconPath + '-settings" /></svg>',
|
||||||
'<span class="plyr__sr-only">' + config.i18n.settings + '</span>',
|
'<span class="plyr__sr-only">' + config.i18n.settings + '</span>',
|
||||||
'</button>',
|
'</button>',
|
||||||
@ -934,18 +934,18 @@
|
|||||||
'<div class="plyr__menu__primary" id="plyr-settings-{id}-primary" aria-hidden="false" aria-labelled-by="plyr-settings-toggle-{id}" role="tabpanel" tabindex="-1">',
|
'<div class="plyr__menu__primary" id="plyr-settings-{id}-primary" aria-hidden="false" aria-labelled-by="plyr-settings-toggle-{id}" role="tabpanel" tabindex="-1">',
|
||||||
'<ul>',
|
'<ul>',
|
||||||
'<li role="tab">',
|
'<li role="tab">',
|
||||||
'<button type="button" class="plyr__menu__btn plyr__menu__btn--forward" id="plyr-settings-{id}-captions-toggle" aria-haspopup="true" aria-controls="plyr-settings-{id}-captions" aria-expanded="false">',
|
'<button type="button" class="plyr__control plyr__control--forward" id="plyr-settings-{id}-captions-toggle" aria-haspopup="true" aria-controls="plyr-settings-{id}-captions" aria-expanded="false">',
|
||||||
config.i18n.captions + ' <span class="plyr__menu__btn__value">{lang}</span>',
|
config.i18n.captions + ' <span class="plyr__menu__value">{lang}</span>',
|
||||||
'</button>',
|
'</button>',
|
||||||
'</li>',
|
'</li>',
|
||||||
'<li role="tab">',
|
'<li role="tab">',
|
||||||
'<button type="button" class="plyr__menu__btn plyr__menu__btn--forward" id="plyr-settings-{id}-speed-toggle" aria-haspopup="true" aria-controls="plyr-settings-{id}-speed" aria-expanded="false">',
|
'<button type="button" class="plyr__control plyr__control--forward" id="plyr-settings-{id}-speed-toggle" aria-haspopup="true" aria-controls="plyr-settings-{id}-speed" aria-expanded="false">',
|
||||||
config.i18n.speed + ' <span class="plyr__menu__btn__value">{speed}</span>',
|
config.i18n.speed + ' <span class="plyr__menu__value">{speed}</span>',
|
||||||
'</button>',
|
'</button>',
|
||||||
'</li>',
|
'</li>',
|
||||||
'<li role="tab">',
|
'<li role="tab">',
|
||||||
'<button type="button" class="plyr__menu__btn plyr__menu__btn--forward" id="plyr-settings-{id}-quality-toggle" aria-haspopup="true" aria-controls="plyr-settings-{id}-quality" aria-expanded="false">',
|
'<button type="button" class="plyr__control plyr__control--forward" id="plyr-settings-{id}-quality-toggle" aria-haspopup="true" aria-controls="plyr-settings-{id}-quality" aria-expanded="false">',
|
||||||
config.i18n.quality + ' <span class="plyr__menu__btn__value">Auto</span>',
|
config.i18n.quality + ' <span class="plyr__menu__value">Auto</span>',
|
||||||
'</button>',
|
'</button>',
|
||||||
'</li>',
|
'</li>',
|
||||||
'</ul>',
|
'</ul>',
|
||||||
@ -953,59 +953,95 @@
|
|||||||
'<div class="plyr__menu__secondary" id="plyr-settings-{id}-captions" aria-hidden="true" aria-labelled-by="plyr-settings-{id}-captions-toggle" role="tabpanel" tabindex="-1">',
|
'<div class="plyr__menu__secondary" id="plyr-settings-{id}-captions" aria-hidden="true" aria-labelled-by="plyr-settings-{id}-captions-toggle" role="tabpanel" tabindex="-1">',
|
||||||
'<ul>',
|
'<ul>',
|
||||||
'<li role="tab">',
|
'<li role="tab">',
|
||||||
'<button type="button" class="plyr__menu__btn plyr__menu__btn--back" aria-haspopup="true" aria-controls="plyr-settings-{id}-primary" aria-expanded="false">',
|
'<button type="button" class="plyr__control plyr__control--back" aria-haspopup="true" aria-controls="plyr-settings-{id}-primary" aria-expanded="false">',
|
||||||
config.i18n.captions,
|
config.i18n.captions,
|
||||||
'</button>',
|
'</button>',
|
||||||
'</li>',
|
'</li>',
|
||||||
'<li>',
|
'<li>',
|
||||||
'<button type="button">English</button>',
|
'<button type="button" class="plyr__control">English</button>',
|
||||||
'</li>',
|
'</li>',
|
||||||
'<li>',
|
'<li>',
|
||||||
'<button type="button">Off</button>',
|
'<button type="button" class="plyr__control">Off</button>',
|
||||||
'</li>',
|
'</li>',
|
||||||
'</ul>',
|
'</ul>',
|
||||||
'</div>',
|
'</div>',
|
||||||
'<div class="plyr__menu__secondary" id="plyr-settings-{id}-speed" aria-hidden="true" aria-labelled-by="plyr-settings-{id}-speed-toggle" role="tabpanel" tabindex="-1">',
|
'<div class="plyr__menu__secondary" id="plyr-settings-{id}-speed" aria-hidden="true" aria-labelled-by="plyr-settings-{id}-speed-toggle" role="tabpanel" tabindex="-1">',
|
||||||
'<ul>',
|
'<ul>',
|
||||||
'<li role="tab">',
|
'<li role="tab">',
|
||||||
'<button type="button" class="plyr__menu__btn plyr__menu__btn--back" aria-haspopup="true" aria-controls="plyr-settings-{id}-primary" aria-expanded="false">',
|
'<button type="button" class="plyr__control plyr__control--back" aria-haspopup="true" aria-controls="plyr-settings-{id}-primary" aria-expanded="false">',
|
||||||
config.i18n.speed,
|
config.i18n.speed,
|
||||||
'</button>',
|
'</button>',
|
||||||
'</li>',
|
'</li>',
|
||||||
'<li>',
|
'<li>',
|
||||||
'<button type="button">2×</button>',
|
'<button type="button" class="plyr__control">2×</button>',
|
||||||
'</li>',
|
'</li>',
|
||||||
'<li>',
|
'<li>',
|
||||||
'<button type="button">1.5×</button>',
|
'<button type="button" class="plyr__control">1.5×</button>',
|
||||||
'</li>',
|
'</li>',
|
||||||
'<li>',
|
'<li>',
|
||||||
'<button type="button">1×</button>',
|
'<button type="button" class="plyr__control">1×</button>',
|
||||||
'</li>',
|
'</li>',
|
||||||
'<li>',
|
'<li>',
|
||||||
'<button type="button">0.5×</button>',
|
'<button type="button" class="plyr__control">0.5×</button>',
|
||||||
'</li>',
|
'</li>',
|
||||||
'</ul>',
|
'</ul>',
|
||||||
'</div>',
|
'</div>',
|
||||||
'<div class="plyr__menu__secondary" id="plyr-settings-{id}-quality" aria-hidden="true" aria-labelled-by="plyr-settings-{id}-quality-toggle" role="tabpanel" tabindex="-1">',
|
'<div class="plyr__menu__secondary" id="plyr-settings-{id}-quality" aria-hidden="true" aria-labelled-by="plyr-settings-{id}-quality-toggle" role="tabpanel" tabindex="-1">',
|
||||||
'<ul>',
|
'<ul>',
|
||||||
'<li role="tab">',
|
'<li role="tab">',
|
||||||
'<button type="button" class="plyr__menu__btn plyr__menu__btn--back" aria-haspopup="true" aria-controls="plyr-settings-{id}-primary" aria-expanded="false">',
|
'<button type="button" class="plyr__control plyr__control--back" aria-haspopup="true" aria-controls="plyr-settings-{id}-primary" aria-expanded="false">',
|
||||||
config.i18n.quality,
|
config.i18n.quality,
|
||||||
'</button>',
|
'</button>',
|
||||||
'</li>',
|
'</li>',
|
||||||
'<li>',
|
'<li>',
|
||||||
'<button type="button">1080P <span class="plyr__menu__btn__badge"><span>HD</span></span></button>',
|
'<label class="plyr__control">',
|
||||||
|
'<input type="radio" name="quality">',
|
||||||
|
'2160P',
|
||||||
|
'<span class="plyr__menu__value">',
|
||||||
|
'<span class="plyr__badge">4K</span>',
|
||||||
|
'</span>',
|
||||||
|
'</label>',
|
||||||
'</li>',
|
'</li>',
|
||||||
'<li>',
|
'<li>',
|
||||||
'<button type="button">720P <span class="plyr__menu__btn__badge"><span>HD</span></span></button>',
|
'<label class="plyr__control">',
|
||||||
|
'<input type="radio" name="quality">',
|
||||||
|
'1440P',
|
||||||
|
'<span class="plyr__menu__value">',
|
||||||
|
'<span class="plyr__badge">WQHD</span>',
|
||||||
|
'</span>',
|
||||||
|
'</label>',
|
||||||
'</li>',
|
'</li>',
|
||||||
'<li>',
|
'<li>',
|
||||||
'<button type="button">480P</button>',
|
'<label class="plyr__control">',
|
||||||
|
'<input type="radio" name="quality">',
|
||||||
|
'1080P',
|
||||||
|
'<span class="plyr__menu__value">',
|
||||||
|
'<span class="plyr__badge">HD</span>',
|
||||||
|
'</span>',
|
||||||
|
'</label>',
|
||||||
'</li>',
|
'</li>',
|
||||||
'<li>',
|
'<li>',
|
||||||
'<button type="button">320P</button>',
|
'<label class="plyr__control">',
|
||||||
|
'<input type="radio" name="quality">',
|
||||||
|
'720P',
|
||||||
|
'<span class="plyr__menu__value">',
|
||||||
|
'<span class="plyr__badge">HD</span>',
|
||||||
|
'</span>',
|
||||||
|
'</label>',
|
||||||
'</li>',
|
'</li>',
|
||||||
'</ul>',
|
'<li>',
|
||||||
|
'<label class="plyr__control">',
|
||||||
|
'<input type="radio" name="quality">',
|
||||||
|
'480P',
|
||||||
|
'</label>',
|
||||||
|
'</li>',
|
||||||
|
'<li>',
|
||||||
|
'<label class="plyr__control">',
|
||||||
|
'<input type="radio" name="quality">',
|
||||||
|
'360P',
|
||||||
|
'</label>',
|
||||||
|
'</li>',
|
||||||
|
'</ul>',
|
||||||
'</div>',
|
'</div>',
|
||||||
'</div>',
|
'</div>',
|
||||||
'</div>',
|
'</div>',
|
||||||
@ -1016,7 +1052,7 @@
|
|||||||
// Picture in picture button
|
// Picture in picture button
|
||||||
if (_inArray(config.controls, 'pip') && _support.pip) {
|
if (_inArray(config.controls, 'pip') && _support.pip) {
|
||||||
html.push(
|
html.push(
|
||||||
'<button type="button" data-plyr="pip">',
|
'<button type="button" class="plyr__control" data-plyr="pip">',
|
||||||
'<svg><use xlink:href="' + iconPath + '-pip" /></svg>',
|
'<svg><use xlink:href="' + iconPath + '-pip" /></svg>',
|
||||||
'<span class="plyr__sr-only">PIP</span>',
|
'<span class="plyr__sr-only">PIP</span>',
|
||||||
'</button>'
|
'</button>'
|
||||||
@ -1026,7 +1062,7 @@
|
|||||||
// Airplay button
|
// Airplay button
|
||||||
if (_inArray(config.controls, 'airplay') && _support.airplay) {
|
if (_inArray(config.controls, 'airplay') && _support.airplay) {
|
||||||
html.push(
|
html.push(
|
||||||
'<button type="button" data-plyr="airplay">',
|
'<button type="button" class="plyr__control" data-plyr="airplay">',
|
||||||
'<svg><use xlink:href="' + iconPath + '-airplay" /></svg>',
|
'<svg><use xlink:href="' + iconPath + '-airplay" /></svg>',
|
||||||
'<span class="plyr__sr-only">AirPlay</span>',
|
'<span class="plyr__sr-only">AirPlay</span>',
|
||||||
'</button>'
|
'</button>'
|
||||||
@ -1036,7 +1072,7 @@
|
|||||||
// Toggle fullscreen button
|
// Toggle fullscreen button
|
||||||
if (_inArray(config.controls, 'fullscreen')) {
|
if (_inArray(config.controls, 'fullscreen')) {
|
||||||
html.push(
|
html.push(
|
||||||
'<button type="button" data-plyr="fullscreen">',
|
'<button type="button" class="plyr__control" data-plyr="fullscreen">',
|
||||||
'<svg class="icon--exit-fullscreen"><use xlink:href="' + iconPath + '-exit-fullscreen" /></svg>',
|
'<svg class="icon--exit-fullscreen"><use xlink:href="' + iconPath + '-exit-fullscreen" /></svg>',
|
||||||
'<svg><use xlink:href="' + iconPath + '-enter-fullscreen" /></svg>',
|
'<svg><use xlink:href="' + iconPath + '-enter-fullscreen" /></svg>',
|
||||||
'<span class="plyr__sr-only">' + config.i18n.toggleFullscreen + '</span>',
|
'<span class="plyr__sr-only">' + config.i18n.toggleFullscreen + '</span>',
|
||||||
@ -1847,6 +1883,15 @@
|
|||||||
embed: event.target
|
embed: event.target
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
'onPlaybackQualityChange': function(event) {
|
||||||
|
// Get the instance
|
||||||
|
var instance = event.target;
|
||||||
|
|
||||||
|
var quality = instance.getPlaybackQuality();
|
||||||
|
|
||||||
|
// var set = instance.setPlaybackQuality();
|
||||||
|
console.warn(quality);
|
||||||
|
},
|
||||||
'onReady': function(event) {
|
'onReady': function(event) {
|
||||||
// Get the instance
|
// Get the instance
|
||||||
var instance = event.target;
|
var instance = event.target;
|
||||||
@ -1869,6 +1914,12 @@
|
|||||||
plyr.media.currentTime = 0;
|
plyr.media.currentTime = 0;
|
||||||
plyr.media.muted = instance.isMuted();
|
plyr.media.muted = instance.isMuted();
|
||||||
|
|
||||||
|
// Get available speeds
|
||||||
|
var speed = instance.getPlaybackRate();
|
||||||
|
var speedOptions = instance.getAvailablePlaybackRates();
|
||||||
|
//var set = instance.setPlaybackRate();
|
||||||
|
console.warn(speed, speedOptions);
|
||||||
|
|
||||||
// Set title
|
// Set title
|
||||||
config.title = instance.getVideoData().title;
|
config.title = instance.getVideoData().title;
|
||||||
|
|
||||||
@ -1960,6 +2011,10 @@
|
|||||||
_triggerEvent(plyr.media, 'durationchange');
|
_triggerEvent(plyr.media, 'durationchange');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Get quality
|
||||||
|
var qualityOptions = instance.getAvailableQualityLevels();
|
||||||
|
console.warn(qualityOptions, event.data);
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 2:
|
case 2:
|
||||||
@ -3193,6 +3248,15 @@
|
|||||||
if (pressed) {
|
if (pressed) {
|
||||||
// Which keycodes should we prevent default
|
// Which keycodes should we prevent default
|
||||||
var preventDefault = [48,49,50,51,52,53,54,56,57,32,75,38,40,77,39,37,70,67];
|
var preventDefault = [48,49,50,51,52,53,54,56,57,32,75,38,40,77,39,37,70,67];
|
||||||
|
var checkFocus = [38,40];
|
||||||
|
|
||||||
|
if (_inArray(checkFocus, code)) {
|
||||||
|
var focused = getFocusElement();
|
||||||
|
|
||||||
|
if (_is.htmlElement(focused) && getFocusElement().type === "radio") {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// If the code is found prevent default (e.g. prevent scrolling for arrows)
|
// If the code is found prevent default (e.g. prevent scrolling for arrows)
|
||||||
if (_inArray(preventDefault, code)) {
|
if (_inArray(preventDefault, code)) {
|
||||||
|
@ -285,7 +285,7 @@
|
|||||||
text-align: center;
|
text-align: center;
|
||||||
|
|
||||||
// Spacing
|
// Spacing
|
||||||
> button,
|
> .plyr__control,
|
||||||
.plyr__progress,
|
.plyr__progress,
|
||||||
.plyr__time,
|
.plyr__time,
|
||||||
.plyr__menu {
|
.plyr__menu {
|
||||||
@ -302,52 +302,19 @@
|
|||||||
margin-left: 0;
|
margin-left: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Buttons
|
|
||||||
button {
|
|
||||||
position: relative;
|
|
||||||
display: inline-block;
|
|
||||||
flex-shrink: 0;
|
|
||||||
overflow: visible; // IE11
|
|
||||||
vertical-align: middle;
|
|
||||||
padding: @plyr-control-padding;
|
|
||||||
border: 0;
|
|
||||||
background: transparent;
|
|
||||||
border-radius: 3px;
|
|
||||||
cursor: pointer;
|
|
||||||
transition: background .3s ease, color .3s ease, opacity .3s ease;
|
|
||||||
color: inherit;
|
|
||||||
|
|
||||||
svg {
|
|
||||||
width: @plyr-control-icon-size;
|
|
||||||
height: @plyr-control-icon-size;
|
|
||||||
display: block;
|
|
||||||
fill: currentColor;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Default focus
|
|
||||||
&:focus {
|
|
||||||
outline: 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Hide toggle icons by default
|
|
||||||
.icon--exit-fullscreen,
|
|
||||||
.icon--muted,
|
|
||||||
.icon--captions-on {
|
|
||||||
display: none;
|
|
||||||
}
|
|
||||||
|
|
||||||
@media (min-width: @plyr-bp-screen-sm) {
|
@media (min-width: @plyr-bp-screen-sm) {
|
||||||
> button,
|
> .plyr__control,
|
||||||
.plyr__progress,
|
.plyr__progress,
|
||||||
.plyr__time,
|
.plyr__time,
|
||||||
.plyr__menu {
|
.plyr__menu {
|
||||||
margin-left: @plyr-control-spacing;
|
margin-left: @plyr-control-spacing;
|
||||||
}
|
}
|
||||||
|
|
||||||
> button + button,
|
> .plyr__control + .plyr__control,
|
||||||
.plyr__menu + button,
|
.plyr__menu + .plyr__control,
|
||||||
> button + .plyr__menu {
|
> .plyr__control + .plyr__menu {
|
||||||
margin-left: (@plyr-control-spacing / 2);
|
margin-left: (@plyr-control-spacing / 2);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -358,6 +325,40 @@
|
|||||||
pointer-events: none;
|
pointer-events: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Buttons
|
||||||
|
.plyr__control {
|
||||||
|
position: relative;
|
||||||
|
display: inline-block;
|
||||||
|
flex-shrink: 0;
|
||||||
|
overflow: visible; // IE11
|
||||||
|
vertical-align: middle;
|
||||||
|
padding: @plyr-control-padding;
|
||||||
|
border: 0;
|
||||||
|
background: transparent;
|
||||||
|
border-radius: 3px;
|
||||||
|
cursor: pointer;
|
||||||
|
transition: background .3s ease, color .3s ease, opacity .3s ease;
|
||||||
|
color: inherit;
|
||||||
|
|
||||||
|
svg {
|
||||||
|
width: @plyr-control-icon-size;
|
||||||
|
height: @plyr-control-icon-size;
|
||||||
|
display: block;
|
||||||
|
fill: currentColor;
|
||||||
|
}
|
||||||
|
// Hide toggle icons by default
|
||||||
|
.icon--exit-fullscreen,
|
||||||
|
.icon--muted,
|
||||||
|
.icon--captions-on {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Default focus
|
||||||
|
&:focus {
|
||||||
|
outline: 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Video controls
|
// Video controls
|
||||||
.plyr--video .plyr__controls {
|
.plyr--video .plyr__controls {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
@ -371,7 +372,7 @@
|
|||||||
color: @plyr-video-control-color;
|
color: @plyr-video-control-color;
|
||||||
transition: opacity .3s ease;
|
transition: opacity .3s ease;
|
||||||
|
|
||||||
button {
|
.plyr__control {
|
||||||
// Hover and tab focus
|
// Hover and tab focus
|
||||||
&.tab-focus:focus,
|
&.tab-focus:focus,
|
||||||
&:hover,
|
&:hover,
|
||||||
@ -390,7 +391,7 @@
|
|||||||
border: @plyr-audio-controls-border;
|
border: @plyr-audio-controls-border;
|
||||||
color: @plyr-audio-control-color;
|
color: @plyr-audio-control-color;
|
||||||
|
|
||||||
button {
|
.plyr__control {
|
||||||
// Hover and tab focus
|
// Hover and tab focus
|
||||||
&.tab-focus:focus,
|
&.tab-focus:focus,
|
||||||
&:hover,
|
&:hover,
|
||||||
@ -451,9 +452,9 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Change icons on state change
|
// Change icons on state change
|
||||||
.plyr--fullscreen-active .icon--exit-fullscreen,
|
.plyr--fullscreen-active .plyr__control .icon--exit-fullscreen,
|
||||||
.plyr--muted .plyr__controls .icon--muted,
|
.plyr--muted .plyr__control .icon--muted,
|
||||||
.plyr--captions-active .plyr__controls .icon--captions-on {
|
.plyr--captions-active .plyr__control .icon--captions-on {
|
||||||
display: block;
|
display: block;
|
||||||
|
|
||||||
& + svg {
|
& + svg {
|
||||||
@ -477,10 +478,10 @@
|
|||||||
position: relative;
|
position: relative;
|
||||||
|
|
||||||
// Hide tooltip
|
// Hide tooltip
|
||||||
button svg {
|
.plyr__control svg {
|
||||||
transition: transform .3s ease;
|
transition: transform .3s ease;
|
||||||
}
|
}
|
||||||
button[aria-expanded='true'] {
|
.plyr__control[aria-expanded='true'] {
|
||||||
svg {
|
svg {
|
||||||
transform: rotate(45deg);
|
transform: rotate(45deg);
|
||||||
}
|
}
|
||||||
@ -529,94 +530,102 @@
|
|||||||
list-style: none;
|
list-style: none;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
}
|
}
|
||||||
button {
|
|
||||||
|
// Options
|
||||||
|
.plyr__control {
|
||||||
display: flex;
|
display: flex;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
padding: @plyr-control-padding (@plyr-control-padding * 2);
|
padding: @plyr-control-padding (@plyr-control-padding * 2);
|
||||||
color: @plyr-menu-color;
|
color: @plyr-menu-color;
|
||||||
font-weight: 600;
|
font-weight: 600;
|
||||||
user-select: none;
|
user-select: none;
|
||||||
}
|
|
||||||
|
|
||||||
// Buttons
|
|
||||||
.plyr__menu__btn::after {
|
|
||||||
content: "";
|
|
||||||
position: absolute;
|
|
||||||
top: 50%;
|
|
||||||
transform: translateY(-50%);
|
|
||||||
border: 5px solid transparent;
|
|
||||||
}
|
|
||||||
.plyr__menu__btn--forward {
|
|
||||||
padding-right: ceil(@plyr-control-padding * 4);
|
|
||||||
|
|
||||||
&::after {
|
&::after {
|
||||||
right: 5px;
|
|
||||||
border-left-color: fade(@plyr-menu-color, 80%);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
.plyr__menu__btn--back {
|
|
||||||
position: relative;
|
|
||||||
padding-top: floor(@plyr-control-padding * .7);
|
|
||||||
padding-bottom: floor(@plyr-control-padding * .7);
|
|
||||||
padding-left: ceil(@plyr-control-padding * 4);
|
|
||||||
margin-bottom: ceil(@plyr-control-padding * 1.3);
|
|
||||||
font-weight: 500;
|
|
||||||
|
|
||||||
&::after {
|
|
||||||
left: 5px;
|
|
||||||
border-right-color: fade(@plyr-menu-color, 80%);
|
|
||||||
}
|
|
||||||
&::before {
|
|
||||||
content: "";
|
content: "";
|
||||||
position: absolute;
|
position: absolute;
|
||||||
top: 100%;
|
top: 50%;
|
||||||
left: 0;
|
transform: translateY(-50%);
|
||||||
right: 0;
|
border: 5px solid transparent;
|
||||||
height: 1px;
|
}
|
||||||
overflow: hidden;
|
|
||||||
margin-top: ceil(@plyr-control-padding / 2);
|
&--forward {
|
||||||
background: fade(#000, 15%);
|
padding-right: ceil(@plyr-control-padding * 4);
|
||||||
box-shadow: 0 1px 0 fade(#fff, 10%);
|
|
||||||
|
&::after {
|
||||||
|
right: 5px;
|
||||||
|
border-left-color: fade(@plyr-menu-color, 80%);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
&--back {
|
||||||
|
position: relative;
|
||||||
|
padding-top: floor(@plyr-control-padding * .7);
|
||||||
|
padding-bottom: floor(@plyr-control-padding * .7);
|
||||||
|
padding-left: ceil(@plyr-control-padding * 4);
|
||||||
|
margin-bottom: ceil(@plyr-control-padding * 1.3);
|
||||||
|
font-weight: 500;
|
||||||
|
|
||||||
|
&::after {
|
||||||
|
left: 5px;
|
||||||
|
border-right-color: fade(@plyr-menu-color, 80%);
|
||||||
|
}
|
||||||
|
&::before {
|
||||||
|
content: "";
|
||||||
|
position: absolute;
|
||||||
|
top: 100%;
|
||||||
|
left: 0;
|
||||||
|
right: 0;
|
||||||
|
height: 1px;
|
||||||
|
overflow: hidden;
|
||||||
|
margin-top: ceil(@plyr-control-padding / 2);
|
||||||
|
background: fade(#000, 15%);
|
||||||
|
box-shadow: 0 1px 0 fade(#fff, 10%);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
label.plyr__control {
|
||||||
|
padding-left: ceil(@plyr-control-padding * 2.5);
|
||||||
|
|
||||||
|
input[type="radio"] {
|
||||||
|
position: relative;
|
||||||
|
left: -@plyr-control-padding;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Option value
|
// Option value
|
||||||
.plyr__menu__btn__value,
|
.plyr__menu__value {
|
||||||
.plyr__menu__btn__badge {
|
|
||||||
display: inherit;
|
display: inherit;
|
||||||
margin-left: auto;
|
margin-left: auto;
|
||||||
padding-left: ceil(@plyr-control-padding * 3.5);
|
padding-left: ceil(@plyr-control-padding * 3.5);
|
||||||
pointer-events: none;
|
pointer-events: none;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
}
|
|
||||||
|
|
||||||
// Option value
|
|
||||||
.plyr__menu__btn__value {
|
|
||||||
font-weight: 500;
|
font-weight: 500;
|
||||||
color: fade(@plyr-menu-color, 80%);
|
color: fade(@plyr-menu-color, 80%);
|
||||||
}
|
|
||||||
|
|
||||||
// Option value
|
.plyr__badge {
|
||||||
.plyr__menu__btn__badge span {
|
font-weight: 600;
|
||||||
padding: 2px 4px;
|
}
|
||||||
border-radius: 2px;
|
|
||||||
background: @plyr-menu-color;
|
|
||||||
color: @plyr-menu-bg;
|
|
||||||
font-size: 10px;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// When animating between menus
|
// When animating between menus
|
||||||
&.is-resizing {
|
&.is-resizing {
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
transition: height .35s cubic-bezier(.4,0,.2,1), width .35s cubic-bezier(.4,0,.2,1);
|
transition: height .35s cubic-bezier(.4,0,.2,1), width .35s cubic-bezier(.4,0,.2,1);
|
||||||
|
|
||||||
ul {
|
|
||||||
//opacity: 0;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Badge
|
||||||
|
// --------------------------------------------------------------
|
||||||
|
.plyr__badge {
|
||||||
|
padding: 2px 4px;
|
||||||
|
border-radius: 2px;
|
||||||
|
background: @plyr-menu-color;
|
||||||
|
color: @plyr-menu-bg;
|
||||||
|
font-size: 10px;
|
||||||
|
}
|
||||||
|
|
||||||
// Tooltips
|
// Tooltips
|
||||||
// --------------------------------------------------------------
|
// --------------------------------------------------------------
|
||||||
.plyr__tooltip {
|
.plyr__tooltip {
|
||||||
@ -657,19 +666,19 @@
|
|||||||
z-index: 2;
|
z-index: 2;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.plyr button:hover .plyr__tooltip,
|
.plyr .plyr__control:hover .plyr__tooltip,
|
||||||
.plyr button.tab-focus:focus .plyr__tooltip,
|
.plyr .plyr__control.tab-focus:focus .plyr__tooltip,
|
||||||
.plyr__tooltip--visible {
|
.plyr__tooltip--visible {
|
||||||
opacity: 1;
|
opacity: 1;
|
||||||
transform: translate(-50%, 0) scale(1);
|
transform: translate(-50%, 0) scale(1);
|
||||||
}
|
}
|
||||||
.plyr button:hover .plyr__tooltip {
|
.plyr .plyr__control:hover .plyr__tooltip {
|
||||||
z-index: 3;
|
z-index: 3;
|
||||||
}
|
}
|
||||||
|
|
||||||
// First tooltip
|
// First tooltip
|
||||||
.plyr__controls > button:first-child .plyr__tooltip,
|
.plyr__controls > .plyr__control:first-child .plyr__tooltip,
|
||||||
.plyr__controls > button:first-child + button .plyr__tooltip {
|
.plyr__controls > .plyr__control:first-child + .plyr__control .plyr__tooltip {
|
||||||
left: 0;
|
left: 0;
|
||||||
transform: translate(0, 10px) scale(.8);
|
transform: translate(0, 10px) scale(.8);
|
||||||
transform-origin: 0 100%;
|
transform-origin: 0 100%;
|
||||||
@ -680,7 +689,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Last tooltip
|
// Last tooltip
|
||||||
.plyr__controls > button:last-child .plyr__tooltip {
|
.plyr__controls > .plyr__control:last-child .plyr__tooltip {
|
||||||
right: 0;
|
right: 0;
|
||||||
transform: translate(0, 10px) scale(.8);
|
transform: translate(0, 10px) scale(.8);
|
||||||
transform-origin: 100% 100%;
|
transform-origin: 100% 100%;
|
||||||
@ -692,9 +701,9 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.plyr__controls > button:first-child,
|
.plyr__controls > .plyr__control:first-child,
|
||||||
.plyr__controls > button:first-child + button,
|
.plyr__controls > .plyr__control:first-child + .plyr__control,
|
||||||
.plyr__controls > button:last-child {
|
.plyr__controls > .plyr__control:last-child {
|
||||||
&:hover .plyr__tooltip,
|
&:hover .plyr__tooltip,
|
||||||
&.tab-focus:focus .plyr__tooltip,
|
&.tab-focus:focus .plyr__tooltip,
|
||||||
.plyr__tooltip--visible {
|
.plyr__tooltip--visible {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user