Make WordPress Core

Changeset 36233


Ignore:
Timestamp:
01/09/2016 02:21:28 AM (8 years ago)
Author:
azaozz
Message:

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

Fixes #35363.

Location:
trunk/src/wp-includes/js
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/js/media-audiovideo.js

    r33337 r36233  
    793793     */
    794794    setPlayer : function() {
    795         var baseSettings;
     795        var baseSettings, src;
    796796
    797797        if ( this.players.length || ! this.media || this.scriptXhr ) {
     
    799799        }
    800800
    801         if ( this.model.get( 'src' ).indexOf( 'vimeo' ) > -1 && ! ( 'Froogaloop' in window ) ) {
     801        src = this.model.get( 'src' );
     802
     803        if ( src && src.indexOf( 'vimeo' ) > -1 && ! ( 'Froogaloop' in window ) ) {
    802804            baseSettings = wp.media.mixin.mejsSettings;
    803805            this.scriptXhr = $.getScript( baseSettings.pluginPath + 'froogaloop.min.js', _.bind( this.loadPlayer, this ) );
  • trunk/src/wp-includes/js/media/views/media-details.js

    r33337 r36233  
    8888     */
    8989    setPlayer : function() {
    90         var baseSettings;
     90        var baseSettings, src;
    9191
    9292        if ( this.players.length || ! this.media || this.scriptXhr ) {
     
    9494        }
    9595
    96         if ( this.model.get( 'src' ).indexOf( 'vimeo' ) > -1 && ! ( 'Froogaloop' in window ) ) {
     96        src = this.model.get( 'src' );
     97
     98        if ( src && src.indexOf( 'vimeo' ) > -1 && ! ( 'Froogaloop' in window ) ) {
    9799            baseSettings = wp.media.mixin.mejsSettings;
    98100            this.scriptXhr = $.getScript( baseSettings.pluginPath + 'froogaloop.min.js', _.bind( this.loadPlayer, this ) );
Note: See TracChangeset for help on using the changeset viewer.