Make WordPress Core

Changeset 23870


Ignore:
Timestamp:
03/29/2013 08:35:23 PM (12 years ago)
Author:
markjaquith
Message:

Fix some Insert-into-Post for Audio/Video bugs.

props wonderboymusic. see #23831.

File:
1 edited

Legend:

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

    r23729 r23870  
    101101
    102102            props = wp.media.string.props( props, attachment );
    103 
    104103            shortcode = {};
    105104
     
    107106                switch ( props.mime ) {
    108107                case 'audio/mpeg':
    109                     if ( props.linkUrl.indexOf( 'mp3' ) )
    110                         shortcode.mp3 = props.linkUrl;
    111                     else if ( props.linkUrl.indexOf( 'm4a' ) )
    112                         shortcode.m4a = props.linkUrl;
     108                    if ( attachment.url.indexOf( 'mp3' ) )
     109                        shortcode.mp3 = attachment.url;
     110                    else if ( attachment.url.indexOf( 'm4a' ) )
     111                        shortcode.m4a = attachment.url;
    113112                    break;
    114113                case 'audio/mp3':
    115                     shortcode.mp3 = props.linkUrl;
     114                    shortcode.mp3 = attachment.url;
    116115                    break;
    117116                case 'audio/m4a':
    118                     shortcode.m4a = props.linkUrl;
     117                    shortcode.m4a = attachment.url;
    119118                    break;
    120119                case 'audio/wav':
    121                     shortcode.wav = props.linkUrl;
     120                    shortcode.wav = attachment.url;
    122121                    break;
    123122                case 'audio/ogg':
    124                     shortcode.ogg = props.linkUrl;
     123                    shortcode.ogg = attachment.url;
    125124                    break;
    126125                case 'audio/x-ms-wma':
    127126                case 'audio/wma':
    128                     shortcode.wma = props.linkUrl;
     127                    shortcode.wma = attachment.url;
    129128                    break;
    130129                }
     
    149148                switch ( props.mime ) {
    150149                case 'video/mp4':
    151                     shortcode.mp4 = props.linkUrl;
     150                    shortcode.mp4 = attachment.url;
    152151                    break;
    153152                case 'video/m4v':
    154                     shortcode.m4v = props.linkUrl;
     153                    shortcode.m4v = attachment.url;
    155154                    break;
    156155                case 'video/webm':
    157                     shortcode.webm = props.linkUrl;
     156                    shortcode.webm = attachment.url;
    158157                    break;
    159158                case 'video/ogg':
    160                     shortcode.ogv = props.linkUrl;
     159                    shortcode.ogv = attachment.url;
    161160                    break;
    162161                case 'video/x-ms-wmv':
    163162                case 'video/wmv':
    164163                case 'video/asf':
    165                     shortcode.wmv = props.linkUrl;
     164                    shortcode.wmv = attachment.url;
    166165                    break;
    167166                case 'video/flv':
    168167                case 'video/x-flv':
    169                     shortcode.flv = props.linkUrl;
     168                    shortcode.flv = attachment.url
    170169                    break;
    171170                }
     
    661660                    });
    662661                } else if ( 'video' === attachment.type ) {
    663                     html = wp.media.string.video( props );
     662                    html = wp.media.string.video( props, attachment );
    664663                } else if ( 'audio' === attachment.type ) {
    665                     html = wp.media.string.audio( props );
     664                    html = wp.media.string.audio( props, attachment );
    666665                } else {
    667666                    html = wp.media.string.link( props );
Note: See TracChangeset for help on using the changeset viewer.