IT
Web Multimedia
Using a 'Watch in HD' link with the JW FLV Player
|
|
Using a 'Watch in HD' link with the JW FLV Player to change YouTube video formats on the fly is possible, and I'll explain how in this article.
If you aren't familar with the NEW YouTube HD/HQ video formats, read my article Introducing the NEW HD/HQ YouTube Video Formats.
This article assumes you have already read Playing HD/HQ YouTube Videos using the JW FLV Player.
Below is a player with sample links to show you how the JW FLV Player can be controlled. Clicking 'Watch in Normal Quality' will play the Gran Torino movie trailer in Format 18 and in a 4:3 aspect ratio. Clicking 'Different Trailer' will play the Che movie trailer in Format 18 and in a 4:3 aspect ratio. Clicking 'Watch in HD' will play the current video (whether that be GranTorino or Che) in Format 22 (HD) and in a 16:9 aspect ratio.
Watch in Normal Quality
Watch in HD
Different Trailer
Below is the code that contols the JW FLV Player on this page. It will be a good starting place for you as you create and customize your own webpages.
|
<script src="/http://ajax.googleapis.com/ajax/libs/swfobject/2.1/swfobject.js" type="text/javascript"></script> function deletePlayer(theWrapper, thePlaceholder, thePlayerId) { function createPlayer(thePlaceholder, thePlayerId, theWidth, theHeight, theFile, theAutostart) { var params = var attributes = swfobject.embedSWF('/embed/player.swf', thePlaceholder, theWidth, theHeight, '9.0.124', false, flashvars, params, attributes); function initPlayer(theFile, theWidth, theHeight, theAutostart) { <body onload="javascript:initPlayer(encodeURIComponent('youtube_format18.php?v=t2BiE0bwC1M'), '396', '297', false);"> <div id="wrapper1"> <a href="javascript:initPlayer(encodeURIComponent('youtube_format18.php?v=t2BiE0bwC1M'), '396', '297', true);"><span style="color: #0000ff;">Watch in Normal Quality</span></a><br /> <a href="javascript:initPlayer((player.getConfig().file).replace ('18', '22'), '528', '297', true);"><span style="color: #0000ff;">Watch in HD</span></a><br /> <a href="javascript:initPlayer(encodeURIComponent('youtube_format18.php?v=nQes9Iz8jBU'), '396', '297', true);"><span style="color: #0000ff;">Different Trailer</span></a><br /> |
Please leave me a comment if you found this article useful or if you have any questions.
| < Prev | Next > |
|---|