{"id":10840105,"date":"2018-11-02T04:26:12","date_gmt":"2018-11-02T04:26:12","guid":{"rendered":"https:\/\/wordpress.org\/support\/?post_type=helphub_article&p=10840105"},"modified":"2024-06-09T09:29:02","modified_gmt":"2024-06-09T09:29:02","slug":"video-shortcode","status":"publish","type":"helphub_article","link":"https:\/\/wordpress.org\/documentation\/article\/video-shortcode\/","title":{"rendered":"Video shortcode"},"content":{"rendered":"\n
The Video<\/strong> feature allows you to embed video files and play them back using a simple shortcode. This was added as of WordPress Version 3.6<\/a> and is used like this:<\/p>\n\n\n\n You can also use built in embeds and simply put the media file on its own line:<\/p>\n\n\n\n I have an old post that has an audio file in the Media Library attached to it, and I want to use the new shortcode:<\/p>\n\n\n\n Note: Do Not put Space between “[” and “video”.<\/p>\n\n\n\n I have the URL for an MP3, from the Media Library or external, that I want to play:<\/p>\n\n\n\n I have a source URL and fallbacks for other HTML5-supported filetypes:<\/p>\n\n\n\n The following basic options are supported:<\/p>\n\n\n\n Default: First video file attached to the post<\/p>\n\n\n\n Default: “off”<\/p>\n\n\n\n Default: “off”<\/p>\n\n\n\n Default: “metadata”<\/p>\n\n\n\n WordPress Shortcodes: audio<\/a>, caption<\/a>, embed<\/a>, gallery<\/a>, playlist<\/a><\/p>\n\n\n\n <\/p>\n","protected":false},"excerpt":{"rendered":" The Video feature allows you to embed video files and play them back using a simple shortcode. This was added as of WordPress Version 3.6 and is used like this: [video] You can also use built in embeds and simply put the media file on its own line: My cool contenthttp:\/\/my.movies.com\/cool\/movie\/coolest.mp4More cool content Usage I have […]<\/p>\n","protected":false},"featured_media":0,"menu_order":0,"comment_status":"open","ping_status":"closed","template":"","meta":{"advanced_seo_description":"","jetpack_seo_html_title":"","jetpack_seo_noindex":false},"category":[79,78],"class_list":["post-10840105","helphub_article","type-helphub_article","status-publish","hentry","category-dashboard","category-support-guides"],"revision_note":"","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/wordpress.org\/documentation\/wp-json\/wp\/v2\/articles\/10840105","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wordpress.org\/documentation\/wp-json\/wp\/v2\/articles"}],"about":[{"href":"https:\/\/wordpress.org\/documentation\/wp-json\/wp\/v2\/types\/helphub_article"}],"replies":[{"embeddable":true,"href":"https:\/\/wordpress.org\/documentation\/wp-json\/wp\/v2\/comments?post=10840105"}],"version-history":[{"count":7,"href":"https:\/\/wordpress.org\/documentation\/wp-json\/wp\/v2\/articles\/10840105\/revisions"}],"predecessor-version":[{"id":16360447,"href":"https:\/\/wordpress.org\/documentation\/wp-json\/wp\/v2\/articles\/10840105\/revisions\/16360447"}],"wp:attachment":[{"href":"https:\/\/wordpress.org\/documentation\/wp-json\/wp\/v2\/media?parent=10840105"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/wordpress.org\/documentation\/wp-json\/wp\/v2\/category?post=10840105"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}[video]<\/pre>\n\n\n\n
My cool content
http:\/\/my.movies.com\/cool\/movie\/coolest.mp4
More cool content<\/pre>\n\n\n\nUsage<\/h2>\n\n\n\n
[video]<\/pre>\n\n\n\n
[video src=\"video-source.mp4\"]<\/pre>\n\n\n\n
[video mp4=\"source.mp4\" ogv=\"source.ogv\" webm=\"source.webm\"]<\/pre>\n\n\n\n
Options<\/h2>\n\n\n\n
src<\/code>
\n(string) (optional) The source of your video file. If not included it will auto-populate with the first video file attached to the post. You can use the following options to define specific filetypes, allowing for graceful fallbacks:<\/p>\n\n\n\n\n
poster<\/code>
\nDefines image to show as placeholder before the media plays.
\nDefault: none<\/p>\n\n\n\nloop<\/code>
\n(string) Allows for the looping of media. Defaults to “off.”<\/p>\n\n\n\n\n
autoplay<\/code>
\n(string) Causes the media to automatically play as soon as the media file is ready. Defaults to “off.”<\/p>\n\n\n\n\n
preload<\/code>
\n(string) (optional) Specifies if and how the video should be loaded when the page loads. Defaults to “metadata.”<\/p>\n\n\n\n\n
height<\/code>
\n(integer) (required) Defines height of the media. Value is automatically detected on file upload.
\nDefault: [Media file height]<\/p>\n\n\n\nwidth<\/code>
\n(integer) (required) Defines width of the media. Value is automatically detected on file upload.
\nDefault: [Media file width]<\/p>\n\n\n\nRelated<\/h2>\n\n\n\n
Changelog <\/strong><\/h4>\n\n\n\n
\n
\n