Merge branch 'develop' into a11y-improvements
# Conflicts: # dist/plyr.js.map # dist/plyr.min.js # dist/plyr.min.js.map # dist/plyr.polyfilled.js.map # dist/plyr.polyfilled.min.js # dist/plyr.polyfilled.min.js.map
This commit is contained in:
commit
bb546fe43f
46
dist/plyr.js
vendored
46
dist/plyr.js
vendored
@ -780,22 +780,17 @@ typeof navigator === "object" && (function (global, factory) {
|
||||
|
||||
// Quality
|
||||
Object.defineProperty(player.media, 'quality', {
|
||||
get: function get$$1() {
|
||||
get: function get() {
|
||||
// Get sources
|
||||
var sources = html5.getSources.call(player);
|
||||
|
||||
var _sources$filter = sources.filter(function (source) {
|
||||
var source = sources.find(function (source) {
|
||||
return source.getAttribute('src') === player.source;
|
||||
}),
|
||||
_sources$filter2 = slicedToArray(_sources$filter, 1),
|
||||
source = _sources$filter2[0];
|
||||
});
|
||||
|
||||
// Return size, if match is found
|
||||
|
||||
|
||||
return source && Number(source.getAttribute('size'));
|
||||
},
|
||||
set: function set$$1(input) {
|
||||
set: function set(input) {
|
||||
// Get sources
|
||||
var sources = html5.getSources.call(player);
|
||||
|
||||
@ -810,25 +805,30 @@ typeof navigator === "object" && (function (global, factory) {
|
||||
}
|
||||
|
||||
// Get current state
|
||||
var currentTime = player.currentTime,
|
||||
playing = player.playing;
|
||||
var _player$media = player.media,
|
||||
currentTime = _player$media.currentTime,
|
||||
paused = _player$media.paused,
|
||||
preload = _player$media.preload,
|
||||
readyState = _player$media.readyState;
|
||||
|
||||
// Set new source
|
||||
|
||||
player.media.src = source.getAttribute('src');
|
||||
|
||||
// Restore time
|
||||
var onLoadedMetaData = function onLoadedMetaData() {
|
||||
player.currentTime = currentTime;
|
||||
};
|
||||
player.once('loadedmetadata', onLoadedMetaData);
|
||||
// Prevent loading if preload="none" and the current source isn't loaded (#1044)
|
||||
if (preload !== 'none' || readyState) {
|
||||
// Restore time
|
||||
player.once('loadedmetadata', function () {
|
||||
player.currentTime = currentTime;
|
||||
|
||||
// Load new source
|
||||
player.media.load();
|
||||
// Resume playing
|
||||
if (!paused) {
|
||||
player.play();
|
||||
}
|
||||
});
|
||||
|
||||
// Resume playing
|
||||
if (playing) {
|
||||
player.play();
|
||||
// Load new source
|
||||
player.media.load();
|
||||
}
|
||||
|
||||
// Trigger change event
|
||||
@ -5816,8 +5816,8 @@ typeof navigator === "object" && (function (global, factory) {
|
||||
return Number(instance.getCurrentTime());
|
||||
},
|
||||
set: function set(time) {
|
||||
// If paused, mute audio preventively (YouTube starts playing on seek if the video hasn't been played yet).
|
||||
if (player.paused) {
|
||||
// If paused and never played, mute audio preventively (YouTube starts playing on seek if the video hasn't been played yet).
|
||||
if (player.paused && !player.embed.hasPlayed) {
|
||||
player.embed.mute();
|
||||
}
|
||||
|
||||
|
2
dist/plyr.js.map
vendored
2
dist/plyr.js.map
vendored
File diff suppressed because one or more lines are too long
2
dist/plyr.min.js
vendored
2
dist/plyr.min.js
vendored
File diff suppressed because one or more lines are too long
2
dist/plyr.min.js.map
vendored
2
dist/plyr.min.js.map
vendored
File diff suppressed because one or more lines are too long
67
dist/plyr.polyfilled.js
vendored
67
dist/plyr.polyfilled.js
vendored
@ -2979,7 +2979,7 @@ typeof navigator === "object" && (function (global, factory) {
|
||||
|
||||
var defineProperty = _objectDp.f;
|
||||
var _wksDefine = function (name) {
|
||||
var $Symbol = _core.Symbol || (_core.Symbol = _library ? {} : _global.Symbol || {});
|
||||
var $Symbol = _core.Symbol || (_core.Symbol = _global.Symbol || {});
|
||||
if (name.charAt(0) != '_' && !(name in $Symbol)) defineProperty($Symbol, name, { value: _wksExt.f(name) });
|
||||
};
|
||||
|
||||
@ -6169,16 +6169,11 @@ typeof navigator === "object" && (function (global, factory) {
|
||||
get: function get() {
|
||||
// Get sources
|
||||
var sources = html5.getSources.call(player);
|
||||
|
||||
var _sources$filter = sources.filter(function (source) {
|
||||
var source = sources.find(function (source) {
|
||||
return source.getAttribute('src') === player.source;
|
||||
}),
|
||||
_sources$filter2 = slicedToArray(_sources$filter, 1),
|
||||
source = _sources$filter2[0];
|
||||
});
|
||||
|
||||
// Return size, if match is found
|
||||
|
||||
|
||||
return source && Number(source.getAttribute('size'));
|
||||
},
|
||||
set: function set(input) {
|
||||
@ -6196,25 +6191,30 @@ typeof navigator === "object" && (function (global, factory) {
|
||||
}
|
||||
|
||||
// Get current state
|
||||
var currentTime = player.currentTime,
|
||||
playing = player.playing;
|
||||
var _player$media = player.media,
|
||||
currentTime = _player$media.currentTime,
|
||||
paused = _player$media.paused,
|
||||
preload = _player$media.preload,
|
||||
readyState = _player$media.readyState;
|
||||
|
||||
// Set new source
|
||||
|
||||
player.media.src = source.getAttribute('src');
|
||||
|
||||
// Restore time
|
||||
var onLoadedMetaData = function onLoadedMetaData() {
|
||||
player.currentTime = currentTime;
|
||||
};
|
||||
player.once('loadedmetadata', onLoadedMetaData);
|
||||
// Prevent loading if preload="none" and the current source isn't loaded (#1044)
|
||||
if (preload !== 'none' || readyState) {
|
||||
// Restore time
|
||||
player.once('loadedmetadata', function () {
|
||||
player.currentTime = currentTime;
|
||||
|
||||
// Load new source
|
||||
player.media.load();
|
||||
// Resume playing
|
||||
if (!paused) {
|
||||
player.play();
|
||||
}
|
||||
});
|
||||
|
||||
// Resume playing
|
||||
if (playing) {
|
||||
player.play();
|
||||
// Load new source
|
||||
player.media.load();
|
||||
}
|
||||
|
||||
// Trigger change event
|
||||
@ -7343,6 +7343,7 @@ typeof navigator === "object" && (function (global, factory) {
|
||||
|
||||
// Menu required
|
||||
if (!is$1.element(this.elements.settings.panels.quality)) {
|
||||
console.warn('Not an element');
|
||||
return;
|
||||
}
|
||||
|
||||
@ -7357,6 +7358,7 @@ typeof navigator === "object" && (function (global, factory) {
|
||||
}
|
||||
|
||||
// Toggle the pane and tab
|
||||
console.warn(this.options.quality);
|
||||
var toggle = !is$1.empty(this.options.quality) && this.options.quality.length > 1;
|
||||
controls.toggleMenuButton.call(this, type, toggle);
|
||||
|
||||
@ -7773,7 +7775,10 @@ typeof navigator === "object" && (function (global, factory) {
|
||||
toggleHidden(target, false);
|
||||
|
||||
// Focus the first item
|
||||
target.querySelectorAll('[role^="menuitem"]')[0].focus();
|
||||
var firstItem = target.querySelector('[role^="menuitem"]');
|
||||
if (firstItem) {
|
||||
firstItem.focus();
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
@ -9376,11 +9381,9 @@ typeof navigator === "object" && (function (global, factory) {
|
||||
}
|
||||
|
||||
// If there's a play button, set label
|
||||
if (is$1.nodeList(this.elements.buttons.play)) {
|
||||
Array.from(this.elements.buttons.play).forEach(function (button) {
|
||||
button.setAttribute('aria-label', label);
|
||||
});
|
||||
}
|
||||
Array.from(this.elements.buttons.play || []).forEach(function (button) {
|
||||
button.setAttribute('aria-label', label);
|
||||
});
|
||||
|
||||
// Set iframe title
|
||||
// https://github.com/sampotts/plyr/issues/124
|
||||
@ -9460,11 +9463,9 @@ typeof navigator === "object" && (function (global, factory) {
|
||||
toggleClass(this.elements.container, this.config.classNames.stopped, this.stopped);
|
||||
|
||||
// Set state
|
||||
if (is$1.nodeList(this.elements.buttons.play)) {
|
||||
Array.from(this.elements.buttons.play).forEach(function (target) {
|
||||
target.pressed = _this3.playing;
|
||||
});
|
||||
}
|
||||
Array.from(this.elements.buttons.play || []).forEach(function (target) {
|
||||
target.pressed = _this3.playing;
|
||||
});
|
||||
|
||||
// Only update controls on non timeupdate events
|
||||
if (is$1.event(event) && event.type === 'timeupdate') {
|
||||
@ -11195,8 +11196,8 @@ typeof navigator === "object" && (function (global, factory) {
|
||||
return Number(instance.getCurrentTime());
|
||||
},
|
||||
set: function set(time) {
|
||||
// If paused, mute audio preventively (YouTube starts playing on seek if the video hasn't been played yet).
|
||||
if (player.paused) {
|
||||
// If paused and never played, mute audio preventively (YouTube starts playing on seek if the video hasn't been played yet).
|
||||
if (player.paused && !player.embed.hasPlayed) {
|
||||
player.embed.mute();
|
||||
}
|
||||
|
||||
|
2
dist/plyr.polyfilled.js.map
vendored
2
dist/plyr.polyfilled.js.map
vendored
File diff suppressed because one or more lines are too long
2
dist/plyr.polyfilled.min.js
vendored
2
dist/plyr.polyfilled.min.js
vendored
File diff suppressed because one or more lines are too long
2
dist/plyr.polyfilled.min.js.map
vendored
2
dist/plyr.polyfilled.min.js.map
vendored
File diff suppressed because one or more lines are too long
@ -39,7 +39,7 @@ const html5 = {
|
||||
get() {
|
||||
// Get sources
|
||||
const sources = html5.getSources.call(player);
|
||||
const [source] = sources.filter(source => source.getAttribute('src') === player.source);
|
||||
const source = sources.find(source => source.getAttribute('src') === player.source);
|
||||
|
||||
// Return size, if match is found
|
||||
return source && Number(source.getAttribute('size'));
|
||||
@ -57,23 +57,25 @@ const html5 = {
|
||||
}
|
||||
|
||||
// Get current state
|
||||
const { currentTime, playing } = player;
|
||||
const { currentTime, paused, preload, readyState } = player.media;
|
||||
|
||||
// Set new source
|
||||
player.media.src = source.getAttribute('src');
|
||||
|
||||
// Restore time
|
||||
const onLoadedMetaData = () => {
|
||||
player.currentTime = currentTime;
|
||||
};
|
||||
player.once('loadedmetadata', onLoadedMetaData);
|
||||
// Prevent loading if preload="none" and the current source isn't loaded (#1044)
|
||||
if (preload !== 'none' || readyState) {
|
||||
// Restore time
|
||||
player.once('loadedmetadata', () => {
|
||||
player.currentTime = currentTime;
|
||||
|
||||
// Load new source
|
||||
player.media.load();
|
||||
// Resume playing
|
||||
if (!paused) {
|
||||
player.play();
|
||||
}
|
||||
});
|
||||
|
||||
// Resume playing
|
||||
if (playing) {
|
||||
player.play();
|
||||
// Load new source
|
||||
player.media.load();
|
||||
}
|
||||
|
||||
// Trigger change event
|
||||
|
@ -270,8 +270,8 @@ const youtube = {
|
||||
return Number(instance.getCurrentTime());
|
||||
},
|
||||
set(time) {
|
||||
// If paused, mute audio preventively (YouTube starts playing on seek if the video hasn't been played yet).
|
||||
if (player.paused) {
|
||||
// If paused and never played, mute audio preventively (YouTube starts playing on seek if the video hasn't been played yet).
|
||||
if (player.paused && !player.embed.hasPlayed) {
|
||||
player.embed.mute();
|
||||
}
|
||||
|
||||
|
16
src/js/ui.js
16
src/js/ui.js
@ -135,11 +135,9 @@ const ui = {
|
||||
}
|
||||
|
||||
// If there's a play button, set label
|
||||
if (is.nodeList(this.elements.buttons.play)) {
|
||||
Array.from(this.elements.buttons.play).forEach(button => {
|
||||
button.setAttribute('aria-label', label);
|
||||
});
|
||||
}
|
||||
Array.from(this.elements.buttons.play || []).forEach(button => {
|
||||
button.setAttribute('aria-label', label);
|
||||
});
|
||||
|
||||
// Set iframe title
|
||||
// https://github.com/sampotts/plyr/issues/124
|
||||
@ -214,11 +212,9 @@ const ui = {
|
||||
toggleClass(this.elements.container, this.config.classNames.stopped, this.stopped);
|
||||
|
||||
// Set state
|
||||
if (is.nodeList(this.elements.buttons.play)) {
|
||||
Array.from(this.elements.buttons.play).forEach(target => {
|
||||
target.pressed = this.playing;
|
||||
});
|
||||
}
|
||||
Array.from(this.elements.buttons.play || []).forEach(target => {
|
||||
target.pressed = this.playing;
|
||||
});
|
||||
|
||||
// Only update controls on non timeupdate events
|
||||
if (is.event(event) && event.type === 'timeupdate') {
|
||||
|
Loading…
x
Reference in New Issue
Block a user