Make WordPress Core

Ticket #42643: 42643.2.patch

File 42643.2.patch, 1.1 KB (added by Clorith, 8 years ago)
  • src/wp-includes/js/mediaelement/wp-mediaelement.js

     
    4444                                }
    4545                        };
    4646
    47                         // Only initialize new media elements.
     47            /*
     48             * Add a custom error handler, this ensures media files can be
     49             * downloaded if the player encounters an error.
     50             */
     51            settings.customError = function ( media, node ) {
     52                // Make sure we only fall back to a download link for flash files.
     53                if ( -1 !== media.rendererName.indexOf( 'flash' ) || -1 !== media.rendererName.indexOf( 'flv' ) ) {
     54                    return '<a href="' + node.src + '">Download ' + node.src.substring(node.src.lastIndexOf('/') + 1) + '</a>';
     55                }
     56                        };
     57
     58            // Only initialize new media elements.
    4859                        $( '.wp-audio-shortcode, .wp-video-shortcode' )
    4960                                .not( '.mejs-container' )
    5061                                .filter(function () {