Media: fix undefined error that prevents showing a preview in the media modal when replacing video or audio.

Fixes #35363.

git-svn-id: https://develop.svn.wordpress.org/trunk@36233 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Andrew Ozz 2016-01-09 02:21:28 +00:00
parent 021401424b
commit 3fba1e59d7
2 changed files with 8 additions and 4 deletions

View File

@ -792,13 +792,15 @@ MediaDetails = AttachmentDisplay.extend({
* @global MediaElementPlayer
*/
setPlayer : function() {
var baseSettings;
var baseSettings, src;
if ( this.players.length || ! this.media || this.scriptXhr ) {
return;
}
if ( this.model.get( 'src' ).indexOf( 'vimeo' ) > -1 && ! ( 'Froogaloop' in window ) ) {
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 ) );
} else {

View File

@ -87,13 +87,15 @@ MediaDetails = AttachmentDisplay.extend({
* @global MediaElementPlayer
*/
setPlayer : function() {
var baseSettings;
var baseSettings, src;
if ( this.players.length || ! this.media || this.scriptXhr ) {
return;
}
if ( this.model.get( 'src' ).indexOf( 'vimeo' ) > -1 && ! ( 'Froogaloop' in window ) ) {
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 ) );
} else {