When rendering an audio or video shortcode in IE 6-8, call document.createElement() as a poor man's HTML5 shiv. see #24902.
git-svn-id: https://develop.svn.wordpress.org/trunk@24931 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
301258c30b
commit
a5bdd9439c
@ -923,7 +923,10 @@ function wp_audio_shortcode( $attr ) {
|
||||
$attr_strings[] = $k . '="' . esc_attr( $v ) . '"';
|
||||
}
|
||||
|
||||
$html = sprintf( '<audio %s controls="controls">', join( ' ', $attr_strings ) );
|
||||
$html = '';
|
||||
if ( 'mediaelement' === $library && 1 === $instances )
|
||||
$html .= "<!--[if lt IE 9]><script>document.createElement('audio');</script><![endif]-->\n";
|
||||
$html .= sprintf( '<audio %s controls="controls">', join( ' ', $attr_strings ) );
|
||||
|
||||
$fileurl = '';
|
||||
$source = '<source type="%s" src="%s" />';
|
||||
@ -940,7 +943,7 @@ function wp_audio_shortcode( $attr ) {
|
||||
$html .= wp_mediaelement_fallback( $fileurl );
|
||||
$html .= '</audio>';
|
||||
|
||||
return apply_filters( 'wp_audio_shortcode', $html, $atts, $audio, $post_id );
|
||||
return apply_filters( 'wp_audio_shortcode', $html, $atts, $audio, $post_id, $library );
|
||||
}
|
||||
add_shortcode( 'audio', apply_filters( 'wp_audio_shortcode_handler', 'wp_audio_shortcode' ) );
|
||||
|
||||
@ -1061,7 +1064,10 @@ function wp_video_shortcode( $attr ) {
|
||||
$attr_strings[] = $k . '="' . esc_attr( $v ) . '"';
|
||||
}
|
||||
|
||||
$html = sprintf( '<video %s controls="controls">', join( ' ', $attr_strings ) );
|
||||
$html = '';
|
||||
if ( 'mediaelement' === $library && 1 === $instances )
|
||||
$html .= "<!--[if lt IE 9]><script>document.createElement('video');</script><![endif]-->\n";
|
||||
$html .= sprintf( '<video %s controls="controls">', join( ' ', $attr_strings ) );
|
||||
|
||||
$fileurl = '';
|
||||
$source = '<source type="%s" src="%s" />';
|
||||
@ -1081,7 +1087,7 @@ function wp_video_shortcode( $attr ) {
|
||||
$html .= '</video>';
|
||||
|
||||
$html = sprintf( '<div style="width: %dpx; max-width: 100%%;">%s</div>', $width, $html );
|
||||
return apply_filters( 'wp_video_shortcode', $html, $atts, $video, $post_id );
|
||||
return apply_filters( 'wp_video_shortcode', $html, $atts, $video, $post_id, $library );
|
||||
}
|
||||
add_shortcode( 'video', apply_filters( 'wp_video_shortcode_handler', 'wp_video_shortcode' ) );
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user