Make WordPress Core

Ticket #42643: 42643.patch

File 42643.patch, 772 bytes (added by Clorith, 8 years ago)
  • src/wp-includes/js/mediaelement/wp-mediaelement.js

     
    4242                                }
    4343                        };
    4444
     45            /*
     46                         * Add a custom error handler, this ensures media files can be
     47                         * downloaded if the player encounters an error.
     48                         */
     49                        settings.customError = function ( media, node ) {
     50                                return '<a href="' + node.src + '">Download ' + node.src.substring( node.src.lastIndexOf( '/' ) + 1 ) + '</a>';
     51                        };
     52                       
    4553                        // Only initialize new media elements.
    4654                        $( '.wp-audio-shortcode, .wp-video-shortcode' )
    4755                                .not( '.mejs-container' )