IT
Web Multimedia
Playing HD/HQ YouTube Videos using the JW FLV Player in Joomla
|
|
You can now play High Definition/High Quality YouTube videos with the JW FLV Player in Joomla, however it is nowhere near as easy as it sounds!
I am in the process of updating this article. Please read these extremely relevant articles in the meantime, they are completely up-to-date and will help you. 1) Forget downloading from YouTube, use Amazon S3 instead and 2) Here we go again! Did the PHP files for viewing HD/HQ YouTube videos in the JW FLV Player stop working? Updated 4/17/2010.
There are 2 elements that make it harder than it should be. First YouTube doesn't officially support embedding HD/HQ on other FLV players (they support their own player only) so documentation and examples are only available (if at all) from the user community. And second, unique to Joomla, you cannot put an apersand (&) in a link without it being changed from & to & ; so a link such as http://www.youtube.com/v=xyz12345&fmt=18 will become http://www.youtube.com/v=xyz12345& ;fmt=18 and will no longer work. There is a workaround to prevent Joomla from replacing a & with & ; but it involves changing a core Joomla component, and you would have to change this component again everytime you do a Joomla upgrade.
There is a better way however, one that gives you the HD/HQ video formats from YouTube in the JW FLV Player without having to modify a core Joomla component. This better way involves creating a PHP page for each of the different YouTube HD formats. This solution is largely based on the forum tread http://www.longtailvideo.com/support/forum/Setup-Problems/15114/HQ-video-thorugh-YouTube-API-JW-player- but doesn't tackle the unique Joomla issue of a & being replaced with a & ;.
As a reminder, the YouTube HD/HQ formats are below:
|
Format # |
Type |
Resolution |
Aspect Ratio |
| 6 | HQ FLV | 480x360 | 4:3 |
| 18 | HQ MP4 | 480x270 | 16:9 |
| 22 | HD MP4 | 1280x720 | 16:9 |
| 35 | HQ MP4 | 640x360 | 16:9 |
Below is an example HD video from YouTube, it's format 22. You particularly notice the fact that it's HD when you make the video full screen.
Perform the following steps to add HD/HQ YouTube videos to your JW FLV Player.
|
<script src="/http://ajax.googleapis.com/ajax/libs/swfobject/2.1/swfobject.js" type="text/javascript"></script> var params = var attributes = swfobject.embedSWF('/embed/player.swf', 'player1', '528','297', '9.0.124', false, flashvars, params, attributes); |
If you don't want to use a JW FLV Player config file, alternatively you can use the below code instead.
|
<script type="text/javascript" src="/http://ajax.googleapis.com/ajax/libs/swfobject/2.1/swfobject.js"></script> var params = var attributes = swfobject.embedSWF('/embed/player.swf', 'player1', '528','297', '9.0.124', false, flashvars, params, attributes); |
If you're interested in comparing the different YouTube HD/HQ formats side by side, see Introducing the NEW HD/HQ YouTube Video Formats.
You might also be interested in the articles Using a 'Watch in HD' link with the JW FLV Player, and How to add HD/HQ YouTube videos to a Playlist for use with the JW FLV Player.
Please leave me a comment if you found this article useful or if you have any questions.
$youTube = 'Necessites tenir el Reproductor Flash instal·lat per tal de veure el vídeo.
var s1 = new SWFObject("'.$modUrl.'player.swf","ply","'.$params->get("width").'","'.$params->get("height").'","9","#'.$params->get("bgColour").'");
s1.addParam("allowfullscreen","true");
s1.addParam("allowscriptaccess","always");
s1.addParam("wmode","transparent", "true");
s1.addVariable("autostart","'.$starton.'");
s1.addVariable("repeat", "'.$repton.'");
s1.addVariable("stretching","'.$params->get("stretching").'");
s1.addVariable("controlbar","'.$params->get("barPosition").'");
s1.addVariable("file", "http://www.youtube.com/watch?v='.$params-s1.addVariable("screencolor", "'.$params->get("bgColour").'");
s1.addVariable("backcolor","'.$params->get("bgColour").'");
s1.addVariable("frontcolor","'.$params->get("btnColour").'");
s1.addVariable("skin","'.$modUrl.'skins/'.$params->get("skin").'.swf");
s1.write("player");
';
| < Prev | Next > |
|---|