Changeset 42583
- Timestamp:
- 01/24/2018 01:52:17 AM (7 years ago)
- Location:
- branches/4.9
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/4.9
-
branches/4.9/src/wp-includes/js/mediaelement/wp-mediaelement.js
r41877 r42583 1 /* global _wpmejsSettings */1 /* global _wpmejsSettings, mejsL10n */ 2 2 (function( window, $ ) { 3 3 … … 43 43 }; 44 44 45 /** 46 * Custom error handler. 47 * 48 * Sets up a custom error handler in case a video render fails, and provides a download 49 * link as the fallback. 50 * 51 * @since 4.9.3 52 * 53 * @param {object} media The wrapper that mimics all the native events/properties/methods for all renderers. 54 * @param {object} node The original HTML video, audio, or iframe tag where the media was loaded. 55 * @returns {string} 56 */ 57 settings.customError = function ( media, node ) { 58 // Make sure we only fall back to a download link for flash files. 59 if ( -1 !== media.rendererName.indexOf( 'flash' ) || -1 !== media.rendererName.indexOf( 'flv' ) ) { 60 return '<a href="' + node.src + '">' + mejsL10n.strings['mejs.download-video'] + '</a>'; 61 } 62 }; 63 45 64 // Only initialize new media elements. 46 65 $( '.wp-audio-shortcode, .wp-video-shortcode' )
Note: See TracChangeset
for help on using the changeset viewer.