External Libraries: Update MediaElement.js to version 4.2.17.

This is a minor bug fix release and the latest in the 4.x branch.

A full list of changes can be found on the library’s GitHub: https://github.com/mediaelement/mediaelement/releases/tag/4.2.17.

While this is not the latest version (the 5.x branch is), further testing needs to be done to confirm compatibility in WordPress. #56320 has been opened to explore this.

Props cdbessig, desrosj.
Fixes #56319.
Built from https://develop.svn.wordpress.org/trunk@54354


git-svn-id: http://core.svn.wordpress.org/trunk@53913 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
desrosj 2022-09-29 14:21:11 +00:00
parent 6824b4dcbd
commit 0084598e3b
6 changed files with 46 additions and 30 deletions

View File

@ -1018,7 +1018,7 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
var mejs = {};
mejs.version = '4.2.16';
mejs.version = '4.2.17';
mejs.html5media = {
properties: ['volume', 'src', 'currentTime', 'muted', 'duration', 'paused', 'ended', 'buffered', 'error', 'networkState', 'readyState', 'seeking', 'seekable', 'currentSrc', 'preload', 'bufferedBytes', 'bufferedTime', 'initialTime', 'startOffsetTime', 'defaultPlaybackRate', 'playbackRate', 'played', 'autoplay', 'loop', 'controls'],
@ -1307,7 +1307,7 @@ Object.assign(_player2.default.prototype, {
return;
}
if (t.options.useFakeFullscreen === false && Features.IS_IOS && Features.HAS_IOS_FULLSCREEN && typeof t.media.originalNode.webkitEnterFullscreen === 'function' && t.media.originalNode.canPlayType((0, _media.getTypeFromFile)(t.media.getSrc()))) {
if (t.options.useFakeFullscreen === false && (Features.IS_IOS || Features.IS_SAFARI) && Features.HAS_IOS_FULLSCREEN && typeof t.media.originalNode.webkitEnterFullscreen === 'function' && t.media.originalNode.canPlayType((0, _media.getTypeFromFile)(t.media.getSrc()))) {
t.media.originalNode.webkitEnterFullscreen();
return;
}
@ -2943,15 +2943,15 @@ _mejs2.default.TrackFormatParser = {
dfxp: {
parse: function parse(trackText) {
trackText = $(trackText).filter('tt');
var container = trackText.firstChild,
var trackElem = _document2.default.adoptNode(new DOMParser().parseFromString(trackText, 'application/xml').documentElement),
container = trackElem.querySelector('div'),
lines = container.querySelectorAll('p'),
styleNode = trackText.getElementById('' + container.attr('style')),
styleNode = _document2.default.getElementById(container.getAttribute('style')),
entries = [];
var styles = void 0;
if (styleNode.length) {
if (styleNode) {
styleNode.removeAttribute('id');
var attributes = styleNode.attributes;
if (attributes.length) {
@ -2971,23 +2971,23 @@ _mejs2.default.TrackFormatParser = {
text: null
};
if (lines.eq(_i16).attr('begin')) {
_temp.start = (0, _time.convertSMPTEtoSeconds)(lines.eq(_i16).attr('begin'));
if (lines[_i16].getAttribute('begin')) {
_temp.start = (0, _time.convertSMPTEtoSeconds)(lines[_i16].getAttribute('begin'));
}
if (!_temp.start && lines.eq(_i16 - 1).attr('end')) {
_temp.start = (0, _time.convertSMPTEtoSeconds)(lines.eq(_i16 - 1).attr('end'));
if (!_temp.start && lines[_i16 - 1].getAttribute('end')) {
_temp.start = (0, _time.convertSMPTEtoSeconds)(lines[_i16 - 1].getAttribute('end'));
}
if (lines.eq(_i16).attr('end')) {
_temp.stop = (0, _time.convertSMPTEtoSeconds)(lines.eq(_i16).attr('end'));
if (lines[_i16].getAttribute('end')) {
_temp.stop = (0, _time.convertSMPTEtoSeconds)(lines[_i16].getAttribute('end'));
}
if (!_temp.stop && lines.eq(_i16 + 1).attr('begin')) {
_temp.stop = (0, _time.convertSMPTEtoSeconds)(lines.eq(_i16 + 1).attr('begin'));
if (!_temp.stop && lines[_i16 + 1].getAttribute('begin')) {
_temp.stop = (0, _time.convertSMPTEtoSeconds)(lines[_i16 + 1].getAttribute('begin'));
}
if (styles) {
style = '';
for (var _style in styles) {
style += _style + ':' + styles[_style] + ';';
style += _style + ': ' + styles[_style] + ';';
}
}
if (style) {
@ -2996,7 +2996,7 @@ _mejs2.default.TrackFormatParser = {
if (_temp.start === 0) {
_temp.start = 0.200;
}
_temp.text = lines.eq(_i16).innerHTML.trim().replace(/(\b(https?|ftp|file):\/\/[-A-Z0-9+&@#\/%?=~_|!:,.;]*[-A-Z0-9+&@#\/%=~_|])/ig, "<a href='$1' target='_blank'>$1</a>");
_temp.text = lines[_i16].innerHTML.trim().replace(/(\b(https?|ftp|file):\/\/[-A-Z0-9+&@#\/%?=~_| !:, .; ]*[-A-Z0-9+&@#\/%=~_|])/ig, "<a href='$1' target='_blank'>$1</a>");
entries.push(_temp);
}
return entries;
@ -3224,6 +3224,7 @@ Object.assign(_player2.default.prototype, {
(0, _dom.removeClass)(mute, t.options.classPrefix + 'mute');
(0, _dom.addClass)(mute, t.options.classPrefix + 'unmute');
} else {
positionVolumeHandle(media.volume);
(0, _dom.removeClass)(mute, t.options.classPrefix + 'unmute');
(0, _dom.addClass)(mute, t.options.classPrefix + 'mute');
@ -3344,7 +3345,6 @@ Object.assign(_player2.default.prototype, {
rendered = true;
if (player.options.startVolume === 0 || media.originalNode.muted) {
media.setMuted(true);
player.options.startVolume = 0;
}
media.setVolume(player.options.startVolume);
t.setControlsSize();
@ -3358,6 +3358,9 @@ Object.assign(_player2.default.prototype, {
if (player.options.startVolume === 0 || media.originalNode.muted) {
media.setMuted(true);
}
if (player.options.startVolume === 0) {
player.options.startVolume = 0;
}
media.setVolume(player.options.startVolume);
t.setControlsSize();
}
@ -3367,7 +3370,9 @@ Object.assign(_player2.default.prototype, {
if (player.options.startVolume === 0 || media.originalNode.muted) {
media.setMuted(true);
player.options.startVolume = 0;
if (player.options.startVolume === 0) {
player.options.startVolume = 0;
}
toggleMute();
}
@ -3994,7 +3999,7 @@ var MediaElementPlayer = function () {
var t = this,
autoplayAttr = domNode.getAttribute('autoplay'),
autoplay = !(autoplayAttr === undefined || autoplayAttr === null || autoplayAttr === 'false'),
isNative = media.rendererName !== null && /(native|html5)/i.test(t.media.rendererName);
isNative = media.rendererName !== null && /(native|html5)/i.test(media.rendererName);
if (t.getElement(t.controls)) {
t.enableControls();
@ -4433,6 +4438,9 @@ var MediaElementPlayer = function () {
}
}(),
aspectRatio = function () {
if (!t.options.enableAutosize) {
return t.initialAspectRatio;
}
var ratio = 1;
if (!t.isVideo) {
return ratio;
@ -5230,7 +5238,9 @@ var MediaElementPlayer = function () {
if (_typeof(t.getElement(t.container)) === 'object') {
var offscreen = t.getElement(t.container).parentNode.querySelector('.' + t.options.classPrefix + 'offscreen');
offscreen.remove();
if (offscreen) {
offscreen.remove();
}
t.getElement(t.container).remove();
}
t.globalUnbind('resize', t.globalResizeCallback);
@ -7255,6 +7265,7 @@ var YouTubeIframeRenderer = {
videoId: videoId,
height: height,
width: width,
host: youtube.options.youtube && youtube.options.youtube.nocookie ? 'https://www.youtube-nocookie.com' : undefined,
playerVars: Object.assign({
controls: 0,
rel: 0,
@ -8065,8 +8076,10 @@ function getTypeFromFile(url) {
var mime = 'video/mp4';
if (normalizedExt) {
if (~['mp4', 'm4v', 'ogg', 'ogv', 'webm', 'flv', 'mpeg', 'mov'].indexOf(normalizedExt)) {
if (~['mp4', 'm4v', 'ogg', 'ogv', 'webm', 'flv', 'mpeg'].indexOf(normalizedExt)) {
mime = 'video/' + normalizedExt;
} else if ('mov' === normalizedExt) {
mime = 'video/quicktime';
} else if (~['mp3', 'oga', 'wav', 'mid', 'midi'].indexOf(normalizedExt)) {
mime = 'audio/' + normalizedExt;
}

File diff suppressed because one or more lines are too long

View File

@ -1018,7 +1018,7 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
var mejs = {};
mejs.version = '4.2.16';
mejs.version = '4.2.17';
mejs.html5media = {
properties: ['volume', 'src', 'currentTime', 'muted', 'duration', 'paused', 'ended', 'buffered', 'error', 'networkState', 'readyState', 'seeking', 'seekable', 'currentSrc', 'preload', 'bufferedBytes', 'bufferedTime', 'initialTime', 'startOffsetTime', 'defaultPlaybackRate', 'playbackRate', 'played', 'autoplay', 'loop', 'controls'],
@ -2962,6 +2962,7 @@ var YouTubeIframeRenderer = {
videoId: videoId,
height: height,
width: width,
host: youtube.options.youtube && youtube.options.youtube.nocookie ? 'https://www.youtube-nocookie.com' : undefined,
playerVars: Object.assign({
controls: 0,
rel: 0,
@ -3772,8 +3773,10 @@ function getTypeFromFile(url) {
var mime = 'video/mp4';
if (normalizedExt) {
if (~['mp4', 'm4v', 'ogg', 'ogv', 'webm', 'flv', 'mpeg', 'mov'].indexOf(normalizedExt)) {
if (~['mp4', 'm4v', 'ogg', 'ogv', 'webm', 'flv', 'mpeg'].indexOf(normalizedExt)) {
mime = 'video/' + normalizedExt;
} else if ('mov' === normalizedExt) {
mime = 'video/quicktime';
} else if (~['mp3', 'oga', 'wav', 'mid', 'midi'].indexOf(normalizedExt)) {
mime = 'audio/' + normalizedExt;
}

File diff suppressed because one or more lines are too long

View File

@ -996,8 +996,8 @@ function wp_default_scripts( $scripts ) {
$scripts->add( 'imgareaselect', "/wp-includes/js/imgareaselect/jquery.imgareaselect$suffix.js", array( 'jquery' ), false, 1 );
$scripts->add( 'mediaelement', false, array( 'jquery', 'mediaelement-core', 'mediaelement-migrate' ), '4.2.16', 1 );
$scripts->add( 'mediaelement-core', "/wp-includes/js/mediaelement/mediaelement-and-player$suffix.js", array(), '4.2.16', 1 );
$scripts->add( 'mediaelement', false, array( 'jquery', 'mediaelement-core', 'mediaelement-migrate' ), '4.2.17', 1 );
$scripts->add( 'mediaelement-core', "/wp-includes/js/mediaelement/mediaelement-and-player$suffix.js", array(), '4.2.17', 1 );
$scripts->add( 'mediaelement-migrate', "/wp-includes/js/mediaelement/mediaelement-migrate$suffix.js", array(), false, 1 );
did_action( 'init' ) && $scripts->add_inline_script(
@ -1087,7 +1087,7 @@ function wp_default_scripts( $scripts ) {
'before'
);
$scripts->add( 'mediaelement-vimeo', '/wp-includes/js/mediaelement/renderers/vimeo.min.js', array( 'mediaelement' ), '4.2.16', 1 );
$scripts->add( 'mediaelement-vimeo', '/wp-includes/js/mediaelement/renderers/vimeo.min.js', array( 'mediaelement' ), '4.2.17', 1 );
$scripts->add( 'wp-mediaelement', "/wp-includes/js/mediaelement/wp-mediaelement$suffix.js", array( 'mediaelement' ), false, 1 );
$mejs_settings = array(
'pluginPath' => includes_url( 'js/mediaelement/', 'relative' ),
@ -1550,7 +1550,7 @@ function wp_default_styles( $styles ) {
// External libraries and friends.
$styles->add( 'imgareaselect', '/wp-includes/js/imgareaselect/imgareaselect.css', array(), '0.9.8' );
$styles->add( 'wp-jquery-ui-dialog', "/wp-includes/css/jquery-ui-dialog$suffix.css", array( 'dashicons' ) );
$styles->add( 'mediaelement', '/wp-includes/js/mediaelement/mediaelementplayer-legacy.min.css', array(), '4.2.16' );
$styles->add( 'mediaelement', '/wp-includes/js/mediaelement/mediaelementplayer-legacy.min.css', array(), '4.2.17' );
$styles->add( 'wp-mediaelement', "/wp-includes/js/mediaelement/wp-mediaelement$suffix.css", array( 'mediaelement' ) );
$styles->add( 'thickbox', '/wp-includes/js/thickbox/thickbox.css', array( 'dashicons' ) );
$styles->add( 'wp-codemirror', '/wp-includes/js/codemirror/codemirror.min.css', array(), '5.29.1-alpha-ee20357' );

View File

@ -16,7 +16,7 @@
*
* @global string $wp_version
*/
$wp_version = '6.1-beta2-54353';
$wp_version = '6.1-beta2-54354';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.