Shortcode: [youtube] / [vimeo] – Show Video
[ vimeo], [ youtube]
Weaver X Theme Support supports specialized shortcodes to display video. While there are other ways to embed video, the Weaver X Theme Support versions have two important features. First, they will auto adjust to the width of your content, including the mobile view. Second, they use the latest iframe/HTML5 interface provided by YouTube and Vimeo.
Specifying Video Display Size for both shortcodes
Weaver X Theme Support supports a common set of options for both the YouTube and Vimeo shortcodes to support displaying your videos with a specific width and correct height. By default, your videos will be displayed using the full width of the content area being used (percent=100). The percent= parameter is used to specify the width you want.
The height of the video is automatically determined based on the width and the display ratio of the particular video.
Finally, you may specify if the video should be centered or no within the display area using “center=0” to not center (centering is on by default).
Note – if you want to display more than one video horizontally, use “center=0” and specify an appropriate percentage to fit all the videos.
Parameters in Common
- percent=100 – By default, the video will be sized to fill the full content space. You can use the percent value to make the video use a percentage of the content space (but mobile will always use full width).
- center=1 – Specify ‘center=0’ to disable centering of the video.
- sd=0 – By default, Weaver X Theme Support will generate sizes for HD/widescreen videos. To display old 4:3 standard definition videos, include ‘sd=1’ in the shortcode.
Vimeo
[ vimeo vimeo-url id=videoid sd=0 percent=100 center=1 color=#hex autoplay=0 loop=0 portrait=1 title=1 byline=1]
This will display Vimeo videos. At the minimum, you can provide the standard http://vimeo.com/nnnnn link, or just the video ID number (which is part of the Vimeo Link). The other Vimeo specific options include:
- color – You can optionally specify a Vimeo color theme using 6 hex digits for a color value.
- autoplay – Add ‘autoplay=1’ to have the video autoplay.
- loop – Add ‘loop=1’ to have the video loop.
- portrait, title, byline – You can specify a value ‘=0’ for these to hide the display of the corresponding element on the Vimeo player. Portrait is the avatar/icon, title is the video title, and byline is source attribution.
YouTube
[ youtube youtube-url id=videoid sd=0 percent=100 center=1 rel=1 https=0 privacy=0 {youtube options}]
This will display YouTube videos. At the minimum, you can provide the standard http://youtu.be/xxxxxx share link (including the options YouTube lets you specify), the long format share link, or just the video ID number using the id=videoid parameter (which is part of the YouTube Link). The other YouTube specific options include:
- rel – If you specify ‘rel=0’, YouTube won’t show related videos after the video plays.
- https – If you specify ‘https=1’, YouTube will use the https protocol.
- privacy – If you specify ‘privacy=1’, YouTube won’t used cookies to track your viewing.
In addition to the above [youtube] options, the shortcode also supports most standard YouTube options. These are more fully described on the YouTube Embedded Player Parameters page.
The supported options, with Weaver X Theme Support’s default values include:
‘autohide’ = ‘1’ . . . . . . 0: always show controls; 1: autohide controls; 2: autohide progress bar
‘autoplay’ = ‘0’ . . . . . . 1: auto play; 0: don’t
‘border’ = ‘0’ . . . . . . . . 0: no border; 1: border using color1 and color2 (don’t seem to work)
‘color’ = not set . . . . . . progress bar color – red or white
‘color1’ = not set . . . . . RGB hex value for border color
‘color2’ = not set . . . . . RGB hex value for control bar bg
‘controls’ = ‘1’ . . . . . . . 0: hide player controls
‘disablekb’ = ‘0’ . . . . . . 1: disable keyboard controls
‘egm’ =’0′ . . . . . . . . . . . 1: enable “Enhanced Genie Menu”
‘hd’ = ‘0’ . . . . . . . . . . . . 1: enable HD playback by default
‘iv_load_policy’ = ‘1’ . . . 1: show annotations; 3: don’t show; 2: discontinued support
‘loop’ = ‘0’ . . . . . . . . . . . 1: loop video
‘modestbranding’ = ‘0’ . .1: hide YouTube logo – will still show label in upper right corner
‘origin’ = not set . . . . . . . See YouTube docs
‘playlist’ = not set . . . . . . Comma separated list of videoIDs to play (id/url video played 1st)
‘showinfo’ = ‘1’ . . . . . . . 0: hide video title
‘showsearch’ = ‘1’ . . . . . 0: hide video searchbox
‘start’ = not set . . . . . . . start vide this number of seconds from start
‘theme’ = ‘dark’ . . . . . . . dark or light – display theme for player
‘wmode’ = ‘transparent’ . Keeps video behind menu bars, etc. Other values available – see YouTube