=== Plugin Name === Contributors: Tubal Donate link: Tags: youtube, shortcode, embed, video, player Requires at least: 2.5 Tested up to: 3.2 Stable tag: trunk Embed Youtube videos using shortcodes == Description == A really simple and lightweight plugin (173 lines of code - comments included) to embed Youtube videos anywhere in your blog or website using wp shortcodes. = Features: = * Supports **all official player customization parameters** and respects Youtube's default values: [Official documentation](http://code.google.com/intl/en/apis/youtube/player_parameters.html "Official documentation"). You can override any default value. * Supports **automatic calculation of video height**. Just set the video `width` and omit the `height` parameter in the shortcode. There's no need to set the height manually to get the perfect height. * Supports **normal** Youtube URLs, **short** Youtube URLs and Youtube's **video ID** as value for `url` parameter. * Supports **localized videos**. This plugin detects user's preferred language and sets the locale of the video according to Youtube's documentation. * Supports **Flash & HTML5 videos**. This plugin uses Youtube's new embed code (iframe). This new embed code will take care of the environment capabilities. This way you know your video will work on most devices, including mobile devices (that have Adobe's Flash 10.1 installed or support CSS, iframes and basic Javascript) and RSS readers. * Supports **web browsers with no Javascript support or with Javascript disabled**. If a web browser does not support Javascript or Javascript is disabled, Youtube's new embed code will not work. In that case this plugin will try to show the video using Adobe's Flash. * Tested on IE 6+, Firefox 2+, Opera 8+, Safari 3+, Chrome 5+, Webkit mobile (iPhone, iPad, iPod, Android phones, Nokia tablets). = Documentation = **Basic examples:** Example 1: `` This code will embed a Youtube video of 300px wide with an automatically calculated height wherever you need in your site. It will disable related videos and enable the fullscreen button. Example 2: `[youtube_sc url=http://www.youtube.com/watch?v=ZUD3qUtT3go width=300 rel=0 fs=1]` You can also embed a customized Youtube video in your posts or pages easily by writing the shortcode in the built-in WYSIWYG editor. **Shortcode Name:** This is the shortcode name you must use to make the plugin work: `youtube_sc`. **Custom Parameters:** * `url`: Youtube's video URL (default value = ''). Any of these is valid: * Normal: http://www.youtube.com/watch?v=ZUD3qUtT3go * Short: http://youtu.be/ZUD3qUtT3go * Video ID: ZUD3qUtT3go * `width`: Set the width of the video player in pixels (default value = 560). Minimum width allowed is 200px according to Youtube. * `height`: Set the height of the video player in pixels (default value = 340) * `version`: Set the video player version. Possible values are 2 or 3 (default value = 2) * `nocookie`: Set privacy mode on or off. Possible values are 0 or 1 (default value = 0). To enable privacy mode set this to 1 and no cookies will be stored in the user's browser. **Official Parameters:** You can find in [Youtube's official documentation for player parameters](http://code.google.com/intl/en/apis/youtube/player_parameters.html "Official documentation") all parameters explained and their possible and default values. I'll list them here for a quick reference: * `autohide`: (default value = 2) * `controls`: (default value = 1) * `modestbranding`: (default value = 0) * `origin`: (default value = '') * `playlist`: (default value = '') * `rel`: (default value = 1) * `autoplay`: (default value = 0) * `loop`: (default value = 0) * `enablejsapi`: (default value = 0) * `playerapiid`: (default value = '') * `disablekb`: (default value = 0) * `egm`: (default value = 0) * `border`: (default value = 0) * `color1`: (default value = 'b1b1b1') * `color2`: (default value = 'cfcfcf') * `start`: (default value = '') * `fs`: (default value = 0) * `hd`: (default value = 0) * `showsearch`: (default value = 1) * `showinfo`: (default value = 1) * `iv_load_policy`: (default value = 1) * `cc_load_policy`: (default value = user's Youtube account setting. To force subtitles set to 1) == Installation == 1. Upload `youtube-shortcode` folder to the `/wp-content/plugins/` directory 2. Activate the plugin through the 'Plugins' menu in WordPress 3. Place `` in your templates and you're done == Frequently Asked Questions == = Hey, I need to style the video player with css ¿How can I target it with a css selector? = Easy, every Youtube video player is wrapped by a `div` or `p` tag with the class `youtube_sc`. Check it out with Firebug or Webkit's web inspector. `p` tags are only used when the shortcode is inserted in a post/page wysiwyg text editor. == Changelog == = 1.6 = * The video's html wrapper tag, `div` by default, changes automatically to `p` if the shortcode is used in a post/page wysiwyg text editor to avoid weird cases with WP formatting functions and other filters or plugins. = 1.5 = * Added new official parameters: autohide, controls, modestbranding, origin, playlist = 1.4 = * Force "wmode=transparent" on Youtube's new embed code (iframe) to solve some design issues when Flash is used (layers appearing below Flash video). = 1.3 = * Youtube's new embed code (iframe) is from now on the preferred way of embedding videos and supports all customization parameters. * swfobject javascript library removed. Client side detection of Adobe's Flash is no longer needed. = 1.2 = * Added "wmode=transparent" to solve some design issues (layers appearing below Flash video) = 1.1 = * Improved automatic height calculation. * Added support for web browsers with no Javascript support.