easyYouTube helps you to load and customize YouTube video player inside your web projects. Using this tool is very simple.
With easyYouTube you can load any video you want, choosing if you want show player controls, related videos, informations and more.
easyYouTube load video as responsive element that resize itself mantaining original ratio. To do this you need only to specify the ratio by function custom parameters.
Look at the following example to learn easyYouTube usage.
On previous example we load a player with some customization as autoplay, no controls and info showed.
The following lines show how to install easyYouTube
In order to use this tool you need to load jQuery.
To use easyYouTube you need to place a DOM element and assign it an univocal ID that will be used on tool configuration.
At last some javascript lines are nedeed to initialize easyYouTube
Note that "element" and "videoId" parameters are mandatory!
| Option | Type | Allowed Values | Description |
|---|---|---|---|
| element | STRING | Any string |
The DOM element where video iframe will be placed. This parameter is mandatory! Without customize this parameter, function will not work! |
| videoId | STRING | Any string |
The YouTube video id. This parameter is mandatory! Without customize this parameter, function will not work! |
| responsive | BOOL | true/false |
Default: true If switched on true this parameter launchs a video player javascript resizing. The player iframe will be resized at the same width of container element. Player height will be calculated according the ratio value placed on ratio parameter. |
| ratio | STRING | any valid ratio as "16/9" |
Default: "16/9" This parameter controls the video ratio for responsive player. This parameter works only if "responsive" option is setted on "true". |
| width | STRING / NUMBER | any valid string or number |
Default: "560" This parameter controls the video player width. Using this parameters means that the width will be alwais the same. This parameter works only if "responsive" option is setted on "false". |
| height | STRING / NUMBER | any valid string or number |
Default: "315" This parameter controls the video player height. Using this parameters means that the height will be alwais the same. This parameter works only if "responsive" option is setted on "false". |
| noCookie | BOOL | true/false |
Default: true This parameter controls source domain. It changes the domain youtube.com to youtube-nocookie.com. |
| fullscreen | BOOL | true/false |
Default: true This parameter allows or not the full screen view. |
| autoplay | BOOL | true/false |
Default: false This parameter if value is "true" allows the video autoplay. |
| controls | BOOL | true/false |
Default: true This parameter, if value is "true", shows the video player controls. |
| related | BOOL | true/false |
Default: true This parameter, if value is "true", shows related video. |
| showinfo | BOOL | true/false |
Default: true This parameter, if value is "true", shows info about current video. |