Shortcode Attribute Definitions
- id
- width
- aspect_ratio
- align
- autohide
- autoplay
- cc_load_policy
- color
- controls
- disablekb
- end
- fs
- iv_load_policy
- list
- listType
- loop
- modestbranding
- playlist
- rel
- showinfo
- start
- theme
- Default video width
- Default video aspect ratio
- Video Alignment
- Autohide
- Autoplay
- Closed caption load policy
- Annotations load policy
- Disable Keyboard
- Theme
- Color
- Controls
- Full Screen
- Modest branding
- Show info
- Start
- End
- Loop
- List
- List Type
- Play list
- Show related videos
Installation
- Log in and navigate to WP-Admin>>Plugins
- Click the "Add New" button next to the Plugins title.
- Click the "Upload" link on the Install Plugin page.
- Click the "Choose File" button.
- Locate and select the Nice YouTube .zip file on your local computer
- Click the Ok button on the pop-up window.
- Click the install button on the Install Plugin page.
- Activate the plugin through the 'Plugins' menu in WordPress.
- Go to Settings>>Nice Youtube
- Configure the Nice Youtube options.
- Click the "Update Settings" button
- Insert Nice Youtube shortcodes in any post or page.
- That's it! You're all ready to start showing off your videos!!
Alternative installation
Basic Usage
Usage is simple. Create a new post, page or text widget add your content to it. Wherever you want a YouTube video to appear include a Nice YouTube shortcode, like the following example. When you view your published post, page or widget the shortcode will be automatically replaced with a corresponding YouTube video.
Shortcode Example
[niceyoutube id="UXtjrb0WBhc"]
Note, id is the YouTube video id of your video. You can find the video idea in the YouTube URL just after the "v=" and before the next & symbol.
Example: http://www.youtube.com/watch?v=UXtjrb0WBhc&feature=c4-overview&list=UUBZ78mpRCvVKkAtsGPP8Z5w
In the example above UXtjrb0WBhc is the video id.
Shortcode Syntax
[niceyoutube attribute_name="attribute_value"]
Shortcode Attributes
The Nice Youtube plugin provides options through the inclusion of 3 shortcode attributes. These attributes are as follows.
- id
- width
- aspect_ratio
- align
- autohide
- autoplay
- cc_load_policy
- color
- controls
- disablekb
- end
- fs
- iv_load_policy
- list
- listType
- loop
- modestbranding
- playlist
- rel
- showinfo
- start
- theme
Each attribute can be set in the shortcode by including the attribute name followed by an equals sign and the attribute value in quotes. You can set a default value for all of the attribute, excluding the video "id", on the admin settings page.
Attribute Example
[niceyoutube id="UXtjrb0WBhc" width="320"]
Shortcode Attribute Definitions
id
[niceyoutube id="YouTube_Video_Id"]
Sets the video id for the YouTube video you wish to display. The YouTube video id is displayed in your browsers address bar when you are watching a video on YouTube. To obtain the video id, go to your video manager on YouTube and simply play your video. Look at your browser's address bar. You will see a web address that looks like the following.
http://www.youtube.com/watch?v=UXtjrb0WBhc
The portion of the address after the "v=" is the video id.
Example
[niceyoutube id="UXtjrb0WBhc"]
Notice that the id value is the same as the value that comes after the "v=" portion of the YouTube video URI.
width
[niceyoutube width="640"]
Use width to set the YouTube video player width.
Example
[niceyoutube id="UXtjrb0WBhc" width="320"]
aspect_ratio
[niceyoutube aspect_ratio="16:9"]
Set the YouTube video player's aspect ratio with the aspect_ratio attribute. The default YouTube video aspect ratio is 16:9. Older videos probably have an aspect ratio of 4:3. The aspect ratio and width settings are used to automatically calculate the appropriate height for the YouTube video player.
Example
[niceyoutube id="UXtjrb0WBhc" aspect_ratio="320"]
align
[niceyoutube align="right"]
Set default alignment for player's videos embed. Appropriate values are left, center and right.
autohide
[niceyoutube autohide="2"]
This parameter indicates whether the video controls will automatically hide after a video begins playing.
- Set to 0, the video progress bar and the video player controls will be visible throughout the video and in fullscreen.
- Set to 1, then the video progress bar and the player controls will slide out of view a couple of seconds after the video starts playing.
- Set to 2 (default behavior), then the video progress bar to fade out while the player controls remain visible.
autoplay
[niceyoutube autohide="2"]
Sets whether or not the initial video will autoplay when the player loads. Default value is 0. Set to 1 to enable autoplay. Note, if more than one video is present on the page and set to autoplay, the first video will autoplay and the others will not.
cc_load_policy
[niceyoutube cc_load_policy="1"]
The Default is based on user preference. Setting to 1 will cause closed captions to be shown by default, even if the user has turned captions off.
color
[niceyoutube color="red"]
This parameter specifies the color that will be used in the player's video progress bar. Valid values are red and white. Note: Setting the color parameter to white will disable the Modest branding option.
controls
[niceyoutube controls="1"]
This parameter indicates whether the video player controls will display. By default the controls are set to 1. Valid values are 0 for off or 1 for on.
disablekb
[niceyoutube disablekb="1"]
Setting disablekb to 1 will disable the player keyboard controls. Keyboard controls are as follows: Spacebar: Play / Pause, Arrow Left: Jump back 10% in the current video, Arrow Right: Jump ahead 10% in the current video, Arrow Up: Volume up, Arrow Down: Volume Down.
end
[niceyoutube end="180"]
A positive integer. This parameter specifies the time, measured in seconds from the start of the video, when the player should stop playing the video. Note that the time is measured from the beginning of the video and not from either the value of the start player parameter or the startSeconds parameter.
fs
[niceyoutube fs="1"]
The default value is 1, which causes the fullscreen button to display on the player. Setting this parameter to 0 prevents the fullscreen button from displaying.
iv_load_policy
[niceyoutube iv_load_policy="1"]
Setting Annotations to 1 will cause video annotations to be shown by default, whereas setting Annotations to 0 will cause video annotation to not be shown by default.
list
[niceyoutube list="PLC77007E23FF423C6"]
The list parameter, in conjunction with the listType parameter, identifies the content that will load in the player. Leave List empty for standard video content loading.
- If the listType parameter value is search, then the list parameter value specifies the search query.
- If the listType parameter value is user_uploads, then the list parameter value identifies the YouTube user whose uploaded videos will be loaded.
- If the listType parameter value is playlist, then the list parameter value specifies a YouTube playlist ID. In the parameter value, you need to prepend the playlist ID with the letters PL.
listType
[niceyoutube listType="1"]
The listType parameter, in conjunction with the list parameter, identifies the content that will load in the player. Set to Single for standard video content loading.
loop
[niceyoutube loop="1"]
The default setting for Loop is 0. To enable video looping set this value to 1. In the case of a single video player, a setting of 1 will cause the player to play the initial video again and again. In the case of a playlist player (or custom player), the player will play the entire playlist and then start again at the first video.
modestbranding
[niceyoutube modestbranding="1"]
This parameter lets you use a YouTube player that does not show a YouTube logo. Set the parameter to 1 to prevent the YouTube logo from displaying in the control bar. Note that a small YouTube text label will still display in the upper-right corner of a paused video when the user's mouse pointer hovers over the player.
playlist
[niceyoutube playlist="UXtjrb0WBhc,miQczggj0SI,loILhSszPMM"]
Value is a comma-separated list of video IDs to play. If you specify a value, the first video that plays will be the id specified in the shortcode, and the videos specified in the playlist parameter will play thereafter.
rel
[niceyoutube rel="0"]
Default is 1. This parameter indicates whether the player should show related videos when playback of the initial video ends.
showinfo
[niceyoutube showinfo="0"]
The parameter's default value is 1. If you set the parameter to 0, then the player will not display information like the video title and uploader before the video starts playing.
start
[niceyoutube start="30"]
Input a positive integer. This parameter causes the player to begin playing the video at the given number of seconds from the start of the video. Note, the player will look for the closest keyframe to the time you specify. This means sometimes the play head may seek to just before the requested time, usually no more than ~2 seconds.
theme
[niceyoutube theme="dark"]
This parameter indicates whether the embedded player will display player controls within a dark or light control bar. By default, the player will display player controls using the dark theme. Valid parameter values are dark and light.
Plugin Options
The Nice Youtube plugin allows you to configure the plugin's global default settings. Configuration of the plugin is made quick and easy through the use of it's admin settings page. You can find the settings page at WP-Admin>>Settings>>Nice Youtube. The global default settings that are made available to you are as follows.
Default Video Width
Enter the default YouTube video embed width in pixels. This will be used for all videos that do not have a width set in their respective shortcodes.
Default Video Aspect Ratio
Enter the YouTube player aspect ratio. This will be used to determine the height of the video player. YouTubes standard aspect ratio is 16:9. Older videos may have an aspect ratio of 4:3.
Video Alignment
Select default alignment for all videos embeds.
Autohide
This parameter indicates whether the video controls will automatically hide after a video begins playing. The default behavior is for the video progress bar to Fade out while the player controls remain visible. If this is set to Slide, then the video progress bar and the player controls will slide out of view a couple of seconds after the video starts playing. If this is set to Off, the video progress bar and the video player controls will be visible throughout the video and in fullscreen.
Autoplay
Sets whether or not the first video in a post will autoplay when the player loads. The default setting is Off
Closed caption load policy
The closed caption default is based on user preference. Setting to 1 will cause closed captions to be shown by default, even if the user has turned captions off.
Annotations load policy
Setting Annotations to On will cause video annotations to be shown by default, whereas setting Annotations to Off will cause video annotation to not be shown by default.
Disable Keyboard
Setting Disable Keyboard to On will disable the player keyboard controls. Keyboard controls are as follows: Spacebar: Play / Pause, Arrow Left: Jump back 10% in the current video, Arrow Right: Jump ahead 10% in the current video, Arrow Up: Volume up, Arrow Down: Volume Down
Theme
This parameter indicates whether the embedded player will display player controls within a dark or light control bar. By default, the player will display player controls using the dark theme.
Color
This parameter specifies the color that will be used in the player's video progress bar. Note: Setting the color parameter to White will disable the Modest branding option.
Controls
This parameter indicates whether the video player controls will display. By default the controls are set to On.
Full Screen
The default value is On, which causes the fullscreen button to display. Setting this parameter to Off prevents the fullscreen button from displaying.
Modest branding
This parameter lets you use a YouTube player that does not show a YouTube logo. Set the parameter to On to prevent the YouTube logo from displaying in the control bar. Note that a small YouTube text label will still display in the upper-right corner of a paused video when the user's mouse pointer hovers over the player.
Show info
The parameter's default value is On. If you set the parameter to Off, then the player will not display information like the video title and uploader before the video starts playing.
Start
Input a positive integer. This parameter causes the player to begin playing the video at the given number of seconds from the start of the video. Note, the player will look for the closest keyframe to the time you specify. This means sometimes the play head may seek to just before the requested time, usually no more than ~2 seconds.
End
A positive integer. This parameter specifies the time, measured in seconds from the start of the video, when the player should stop playing the video. Note that the time is measured from the beginning of the video and not from either the value of the start player parameter or the startSeconds parameter.
Loop
The default setting for Loop is Off. In the case of a single video player, a setting of 1 will cause the player to play the initial video again and again. In the case of a playlist player (or custom player), the player will play the entire playlist and then start again at the first video.
List
The list parameter, in conjunction with the listType parameter, identifies the content that will load in the player. Leave List empty for standard video content loading.
- If the listType parameter value is search, then the list parameter value specifies the search query.
- If the listType parameter value is user_uploads, then the list parameter value identifies the YouTube user whose uploaded videos will be loaded.
- If the listType parameter value is playlist, then the list parameter value specifies a YouTube playlist ID. In the parameter value, you need to prepend the playlist ID with the letters PL.
List Type
The listType parameter, in conjunction with the list parameter, identifies the content that will load in the player. Set to Single for standard video content loading.
Play list
Value is a comma-separated list of video IDs to play. If you specify a value, the first video that plays will be the id specified in the shortcode, and the videos specified in the playlist parameter will play thereafter.
Show related videos
Default is On. This parameter indicates whether the player should show related videos when playback of the initial video ends.