Make WordPress Core

Ticket #24449: 24449.5.diff

File 24449.5.diff, 710 bytes (added by nacin, 13 years ago)
  • wp-includes/js/media-views.js

     
    462462                },
    463463
    464464                canEmbed: function( attachment ) {
    465                         var type = attachment.get('type');
    466                         if ( type !== 'audio' && type !== 'video' )
    467                                 return false;
     465                        // If uploading, we know the filename but not the mime type.
     466                        if ( ! attachment.get('uploading') ) {
     467                                var type = attachment.get('type');
     468                                if ( type !== 'audio' && type !== 'video' )
     469                                        return false;
     470                        }
    468471
    469472                        return _.contains( media.view.settings.embedExts, attachment.get('filename').split('.').pop() );
    470473                },