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