Created
August 2, 2011 06:51
-
-
Save bueltge/1119715 to your computer and use it in GitHub Desktop.
Shortcode for HTML5 Video Tag in WordPress
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function html5_video( $atts, $content = NULL ) { | |
extract( shortcode_atts( array( | |
"src" => '', | |
"width" => '', | |
"height" => '' | |
), $atts ) ); | |
return '<video src="' . $src . '" width="' . $width . '" height="' . $height . '" controls autobuffer>'; | |
} | |
add_shortcode( 'video5', 'html5_video' ); | |
Now you can use the following shortcode in your post: | |
[video5 src="http://example.com/videos/your-video.mp4" width="720" height="480"] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment