Skip to content

Commit

Permalink
Media: Upgrade MediaElement.js from 2.22.0 to 4.2.3.
Browse files Browse the repository at this point in the history
Props rafa8626, grosbouff, westonruter, azaozz, Plastikschnitzer for testing.
See #39686.

Built from https://develop.svn.wordpress.org/trunk@41198


git-svn-id: http://core.svn.wordpress.org/trunk@41038 1a063a9b-81f0-0310-95a4-ce76da25c4cd
  • Loading branch information
westonruter committed Aug 1, 2017
1 parent 59279ab commit 7af3b92
Show file tree
Hide file tree
Showing 71 changed files with 17,581 additions and 98 deletions.
3 changes: 3 additions & 0 deletions wp-admin/about.php
Expand Up @@ -11,9 +11,12 @@

if ( ! wp_is_mobile() ) {
wp_enqueue_style( 'wp-mediaelement' );
wp_enqueue_script( 'mediaelement-vimeo' );
wp_enqueue_script( 'wp-mediaelement' );
wp_localize_script( 'mediaelement', '_wpmejsSettings', array(
'pluginPath' => includes_url( 'js/mediaelement/', 'relative' ),
'classPrefix' => 'mejs-',
'stretching' => 'responsive',
'pauseOtherPlayers' => '',
) );
}
Expand Down
4 changes: 2 additions & 2 deletions wp-admin/includes/ajax-actions.php
Expand Up @@ -3053,7 +3053,7 @@ function wp_ajax_parse_embed() {
$wp_scripts->done = array();
}
ob_start();
wp_print_scripts( 'wp-mediaelement' );
wp_print_scripts( array( 'mediaelement-vimeo', 'wp-mediaelement' ) );
$scripts = ob_get_clean();

$parsed = $styles . $html . $scripts;
Expand Down Expand Up @@ -3144,7 +3144,7 @@ function wp_ajax_parse_media_shortcode() {

wp_print_scripts( 'wp-playlist' );
} else {
wp_print_scripts( array( 'froogaloop', 'wp-mediaelement' ) );
wp_print_scripts( array( 'mediaelement-vimeo', 'wp-mediaelement' ) );
}

wp_send_json_success( array(
Expand Down
1 change: 1 addition & 0 deletions wp-content/themes/twentyfourteen/inc/widgets.php
Expand Up @@ -54,6 +54,7 @@ public function enqueue_scripts() {
$video_library = apply_filters( 'wp_video_shortcode_library', 'mediaelement' );
if ( in_array( 'mediaelement', array( $video_library, $audio_library ), true ) ) {
wp_enqueue_style( 'wp-mediaelement' );
wp_enqueue_script( 'mediaelement-vimeo' );
wp_enqueue_script( 'wp-mediaelement' );
}
}
Expand Down
7 changes: 3 additions & 4 deletions wp-includes/js/media-audiovideo.js
Expand Up @@ -795,17 +795,16 @@ MediaDetails = AttachmentDisplay.extend({
* @global MediaElementPlayer
*/
setPlayer : function() {
var baseSettings, src;
var src;

if ( this.players.length || ! this.media || this.scriptXhr ) {
return;
}

src = this.model.get( 'src' );

if ( src && src.indexOf( 'vimeo' ) > -1 && ! ( 'Froogaloop' in window ) ) {
baseSettings = wp.media.mixin.mejsSettings;
this.scriptXhr = $.getScript( baseSettings.pluginPath + 'froogaloop.min.js', _.bind( this.loadPlayer, this ) );
if ( src && src.indexOf( 'vimeo' ) > -1 && ! ( 'Vimeo' in window ) ) {
this.scriptXhr = $.getScript( 'https://player.vimeo.com/api/player.js', _.bind( this.loadPlayer, this ) );
} else {
this.loadPlayer();
}
Expand Down
2 changes: 1 addition & 1 deletion wp-includes/js/media-audiovideo.min.js

Large diffs are not rendered by default.

Binary file removed wp-includes/js/mediaelement/background.png
Binary file not shown.
Binary file removed wp-includes/js/mediaelement/bigplay.png
Binary file not shown.
14 changes: 0 additions & 14 deletions wp-includes/js/mediaelement/bigplay.svg

This file was deleted.

Binary file removed wp-includes/js/mediaelement/controls.png
Binary file not shown.
1 change: 0 additions & 1 deletion wp-includes/js/mediaelement/controls.svg

This file was deleted.

Binary file removed wp-includes/js/mediaelement/flashmediaelement.swf
Binary file not shown.
4 changes: 0 additions & 4 deletions wp-includes/js/mediaelement/froogaloop.min.js

This file was deleted.

Binary file removed wp-includes/js/mediaelement/jumpforward.png
Binary file not shown.
89 changes: 89 additions & 0 deletions wp-includes/js/mediaelement/lang/ca.js
@@ -0,0 +1,89 @@
'use strict';/*!
* This is a `i18n` language object.
*
* Catalan
*
* @author
* Tongro
*
* @see core/i18n.js
*/
(function (exports) {
if (exports.ca === undefined) {
exports.ca = {
"mejs.plural-form": 1,
"mejs.download-file": "Descarregar arxiu",
// "mejs.install-flash": "You are using a browser that does not have Flash player enabled or installed. Please turn on your Flash player plugin or download the latest version from https://get.adobe.com/flashplayer/",
"mejs.fullscreen": "Pantalla completa",
"mejs.play": "Reproducció",
"mejs.pause": "Pausa",
// "mejs.time-slider": "Time Slider",
// "mejs.time-help-text": "Use Left/Right Arrow keys to advance one second, Up/Down arrows to advance ten seconds.",
//"mejs.live-broadcast" : "Live Broadcast",
// "mejs.volume-help-text": "Use Up/Down Arrow keys to increase or decrease volume.",
"mejs.unmute": "Reactivar silenci",
"mejs.mute": "Silenci",
// "mejs.volume-slider": "Volume Slider",
"mejs.video-player": "Reproductor de vídeo",
"mejs.audio-player": "Reproductor d'àudio",
"mejs.captions-subtitles": "Llegendes/Subtítols",
// "mejs.captions-chapters": "Chapters",
"mejs.none": "Ningú"
// "mejs.afrikaans": "Afrikaans",
// "mejs.albanian": "Albanian",
// "mejs.arabic": "Arabic",
// "mejs.belarusian": "Belarusian",
// "mejs.bulgarian": "Bulgarian",
// "mejs.catalan": "Catalan",
// "mejs.chinese": "Chinese",
// "mejs.chinese-simplified": "Chinese (Simplified)",
// "mejs.chinese-traditional": "Chinese (Traditional)",
// "mejs.croatian": "Croatian",
// "mejs.czech": "Czech",
// "mejs.danish": "Danish",
// "mejs.dutch": "Dutch",
// "mejs.english": "English",
// "mejs.estonian": "Estonian",
// "mejs.filipino": "Filipino",
// "mejs.finnish": "Finnish",
// "mejs.french": "French",
// "mejs.galician": "Galician",
// "mejs.german": "German",
// "mejs.greek": "Greek",
// "mejs.haitian-creole": "Haitian Creole",
// "mejs.hebrew": "Hebrew",
// "mejs.hindi": "Hindi",
// "mejs.hungarian": "Hungarian",
// "mejs.icelandic": "Icelandic",
// "mejs.indonesian": "Indonesian",
// "mejs.irish": "Irish",
// "mejs.italian": "Italian",
// "mejs.japanese": "Japanese",
// "mejs.korean": "Korean",
// "mejs.latvian": "Latvian",
// "mejs.lithuanian": "Lithuanian",
// "mejs.macedonian": "Macedonian",
// "mejs.malay": "Malay",
// "mejs.maltese": "Maltese",
// "mejs.norwegian": "Norwegian",
// "mejs.persian": "Persian",
// "mejs.polish": "Polish",
// "mejs.portuguese": "Portuguese",
// "mejs.romanian": "Romanian",
// "mejs.russian": "Russian",
// "mejs.serbian": "Serbian",
// "mejs.slovak": "Slovak",
// "mejs.slovenian": "Slovenian",
// "mejs.spanish": "Spanish",
// "mejs.swahili": "Swahili",
// "mejs.swedish": "Swedish",
// "mejs.tagalog": "Tagalog",
// "mejs.thai": "Thai",
// "mejs.turkish": "Turkish",
// "mejs.ukrainian": "Ukrainian",
// "mejs.vietnamese": "Vietnamese",
// "mejs.welsh": "Welsh",
// "mejs.yiddish": "Yiddish"
};
}
})(mejs.i18n);

0 comments on commit 7af3b92

Please sign in to comment.