diff -r 490d5cc509ed -r cf61fcea0001 wp/wp-includes/js/media-audiovideo.js --- a/wp/wp-includes/js/media-audiovideo.js Tue Jun 09 11:14:17 2015 +0000 +++ b/wp/wp-includes/js/media-audiovideo.js Mon Oct 14 17:39:30 2019 +0200 @@ -1,16 +1,94 @@ -(function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o' ].join(''); @@ -718,12 +833,21 @@ module.exports = VideoDetails; -},{}],9:[function(require,module,exports){ -/*global wp, jQuery, _, MediaElementPlayer */ + +/***/ }), +/* 7 */ +/***/ (function(module, exports) { + +/* global MediaElementPlayer */ +var AttachmentDisplay = wp.media.view.Settings.AttachmentDisplay, + $ = jQuery, + MediaDetails; /** * wp.media.view.MediaDetails * + * @memberOf wp.media.view + * * @class * @augments wp.media.view.Settings.AttachmentDisplay * @augments wp.media.view.Settings @@ -731,11 +855,7 @@ * @augments wp.Backbone.View * @augments Backbone.View */ -var AttachmentDisplay = wp.media.view.Settings.AttachmentDisplay, - $ = jQuery, - MediaDetails; - -MediaDetails = AttachmentDisplay.extend({ +MediaDetails = AttachmentDisplay.extend(/** @lends wp.media.view.MediaDetails.prototype */{ initialize: function() { _.bindAll(this, 'success'); this.players = []; @@ -744,14 +864,17 @@ this.on( 'media:setting:remove', wp.media.mixin.unsetPlayers, this ); this.on( 'media:setting:remove', this.render ); this.on( 'media:setting:remove', this.setPlayer ); - this.events = _.extend( this.events, { + + AttachmentDisplay.prototype.initialize.apply( this, arguments ); + }, + + events: function(){ + return _.extend( { 'click .remove-setting' : 'removeSetting', 'change .content-track' : 'setTracks', 'click .remove-track' : 'setTracks', 'click .add-media-source' : 'addSource' - } ); - - AttachmentDisplay.prototype.initialize.apply( this, arguments ); + }, AttachmentDisplay.prototype.events ); }, prepare: function() { @@ -804,19 +927,17 @@ this.scriptXhr = false; }, - /** - * @global MediaElementPlayer - */ setPlayer : function() { - var baseSettings; + var src; if ( this.players.length || ! this.media || this.scriptXhr ) { return; } - if ( this.model.get( 'src' ).indexOf( 'vimeo' ) > -1 && ! ( 'Froogaloop' in window ) ) { - baseSettings = wp.media.mixin.mejsSettings; - this.scriptXhr = $.getScript( baseSettings.pluginPath + 'froogaloop.min.js', _.bind( this.loadPlayer, this ) ); + src = this.model.get( 'src' ); + + 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(); } @@ -861,7 +982,7 @@ resetFocus: function() { this.$( '.embed-media-settings' ).scrollTop( 0 ); } -}, { +},/** @lends wp.media.view.MediaDetails */{ instances : 0, /** * When multiple players in the DOM contain the same src, things get weird. @@ -886,11 +1007,18 @@ module.exports = MediaDetails; -},{}],10:[function(require,module,exports){ -/*globals wp */ + +/***/ }), +/* 8 */ +/***/ (function(module, exports) { + +var MediaDetails = wp.media.view.MediaDetails, + AudioDetails; /** - * wp.media.view.VideoDetails + * wp.media.view.AudioDetails + * + * @memberOf wp.media.view * * @class * @augments wp.media.view.MediaDetails @@ -900,10 +1028,51 @@ * @augments wp.Backbone.View * @augments Backbone.View */ +AudioDetails = MediaDetails.extend(/** @lends wp.media.view.AudioDetails.prototype */{ + className: 'audio-details', + template: wp.template('audio-details'), + + setMedia: function() { + var audio = this.$('.wp-audio-shortcode'); + + if ( audio.find( 'source' ).length ) { + if ( audio.is(':hidden') ) { + audio.show(); + } + this.media = MediaDetails.prepareSrc( audio.get(0) ); + } else { + audio.hide(); + this.media = false; + } + + return this; + } +}); + +module.exports = AudioDetails; + + +/***/ }), +/* 9 */ +/***/ (function(module, exports) { + var MediaDetails = wp.media.view.MediaDetails, VideoDetails; -VideoDetails = MediaDetails.extend({ +/** + * wp.media.view.VideoDetails + * + * @memberOf wp.media.view + * + * @class + * @augments wp.media.view.MediaDetails + * @augments wp.media.view.Settings.AttachmentDisplay + * @augments wp.media.view.Settings + * @augments wp.media.View + * @augments wp.Backbone.View + * @augments Backbone.View + */ +VideoDetails = MediaDetails.extend(/** @lends wp.media.view.VideoDetails.prototype */{ className: 'video-details', template: wp.template('video-details'), @@ -931,4 +1100,6 @@ module.exports = VideoDetails; -},{}]},{},[1]); + +/***/ }) +/******/ ]); \ No newline at end of file