Looping menu (WIP)
This commit is contained in:
parent
60e51b7077
commit
f2bbe4eb12
4
dist/plyr.js
vendored
4
dist/plyr.js
vendored
File diff suppressed because one or more lines are too long
@ -203,10 +203,10 @@
|
|||||||
speed: 'Speed',
|
speed: 'Speed',
|
||||||
quality: 'Quality',
|
quality: 'Quality',
|
||||||
loop: 'Loop',
|
loop: 'Loop',
|
||||||
loopStart: 'Loop start',
|
start: 'Start',
|
||||||
loopEnd: 'Loop end',
|
end: 'End',
|
||||||
loopAll: 'Loop all',
|
all: 'All',
|
||||||
loopNone: 'No Loop',
|
reset: 'Reset',
|
||||||
},
|
},
|
||||||
types: {
|
types: {
|
||||||
embed: ['youtube', 'vimeo', 'soundcloud'],
|
embed: ['youtube', 'vimeo', 'soundcloud'],
|
||||||
@ -981,7 +981,7 @@
|
|||||||
args.unshift(config.logPrefix);
|
args.unshift(config.logPrefix);
|
||||||
}
|
}
|
||||||
|
|
||||||
console[type].apply(console, args);
|
window.console[type].apply(window.console, args);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
var log = function() {
|
var log = function() {
|
||||||
@ -1690,11 +1690,13 @@
|
|||||||
|
|
||||||
player.elements.controls = controls;
|
player.elements.controls = controls;
|
||||||
|
|
||||||
|
setLoopMenu();
|
||||||
|
|
||||||
return controls;
|
return controls;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Set the YouTube quality menu
|
// Set the YouTube quality menu
|
||||||
// Later this will work for HTML5 also
|
// TODO: Support for HTML5
|
||||||
// YouTube: "hd2160", "hd1440", "hd1080", "hd720", "large", "medium", "small", "tiny", "auto"
|
// YouTube: "hd2160", "hd1440", "hd1080", "hd720", "large", "medium", "small", "tiny", "auto"
|
||||||
function setQualityMenu(available, current) {
|
function setQualityMenu(available, current) {
|
||||||
if (is.object(player.quality)) {
|
if (is.object(player.quality)) {
|
||||||
@ -1794,6 +1796,32 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Set the looping options
|
||||||
|
function setLoopMenu() {
|
||||||
|
var options = ['start', 'end', 'all', 'reset'];
|
||||||
|
var list = player.elements.settings.panes.loop.querySelector('ul');
|
||||||
|
|
||||||
|
options.forEach(function(option) {
|
||||||
|
var item = createElement('li');
|
||||||
|
|
||||||
|
var button = createElement('button', {
|
||||||
|
type: 'button',
|
||||||
|
class: config.classes.control,
|
||||||
|
'data-plyr': 'loop',
|
||||||
|
'data-plyr-loop-action': option
|
||||||
|
}, config.i18n[option]);
|
||||||
|
|
||||||
|
if (inArray(['start', 'end'], option)) {
|
||||||
|
var badge = createBadge('0:00');
|
||||||
|
button.appendChild(badge);
|
||||||
|
}
|
||||||
|
|
||||||
|
item.appendChild(button);
|
||||||
|
|
||||||
|
list.appendChild(item);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
// Setup fullscreen
|
// Setup fullscreen
|
||||||
function setupFullscreen() {
|
function setupFullscreen() {
|
||||||
if (!player.supported.full) {
|
if (!player.supported.full) {
|
||||||
@ -3980,13 +4008,6 @@
|
|||||||
var trigger = player.elements.buttons[play ? 'play' : 'pause'];
|
var trigger = player.elements.buttons[play ? 'play' : 'pause'];
|
||||||
var target = player.elements.buttons[play ? 'pause' : 'play'];
|
var target = player.elements.buttons[play ? 'pause' : 'play'];
|
||||||
|
|
||||||
// Get the last play button to account for the large play button
|
|
||||||
if (target && target.length > 1) {
|
|
||||||
target = target[target.length - 1];
|
|
||||||
} else {
|
|
||||||
target = target[0];
|
|
||||||
}
|
|
||||||
|
|
||||||
// Setup focus and tab focus
|
// Setup focus and tab focus
|
||||||
if (target) {
|
if (target) {
|
||||||
var hadTabFocus = hasClass(trigger, config.classes.tabFocus);
|
var hadTabFocus = hasClass(trigger, config.classes.tabFocus);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user