=== Plugin Name === Contributors: Tubal Donate link: Tags: youtube, shortcode, embed, video, player Requires at least: 2.5 Tested up to: 3.1 Stable tag: 1.2 Embed Youtube videos using shortcodes == Description == A really simple and lightweight plugin (180 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 detects if user's browser supports Abobe's Flash (thanks to the swfobject library bundled with wp). If it does not support Adobe's Flash (iPhone, iPad and other devices) the plugin will embed Youtube's new code (iframe) that will take care of the environment capabilities. This way you know your video will work on every "special" device, not only on Apple's. * Supports **web browsers with no Javascript support** (Adobe's Flash required to play video). * Youtube's videos are inserted once the DOM has finished loading so that **your web page renders faster** (Youtube's videos start loading once every other resource in your web page has already started loading). = Documentation = **Basic example:** `` This shortcode will embed a Youtube video of 300px wide with an automatically calculated height. It will disable related videos and enable the fullscreen button. **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: * `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` with the class `youtube_sc`. Check it out with Firebug or Webkit's web inspector. == Changelog == = 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.