Order Now AdSolution Sign Up | Login » Bits on the Run Sign Up | Login »

Forums

/

HQ video thorugh YouTube API & JW player?

92 replies [Last post]

I read a post that stated "I vaguely recall that Jeroen mentioned in a post that only the LQ video is available through the YouTube API."

Is this the case? I would like to use the High Quality videos from YouTube in my player.

I've read most of the "php" posts for the work around, but I am new to this code stuff and I can't seem to make heads or tails of it. I've tried a few things but don't really know where to start.

Thanks,

David

You need:

1) a host that allows you to execute PHP scripts,

2) place the YouTube script on your site,

3) call the YouTube script from the player or a playlist

YouTube_Multi-Format.html

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">

<html lang="en">

  <head>

    <title>YouTube Multi-Format</title>

    <script type="text/javascript" src="swfobject-2.2.js"></script>

    <script type="text/javascript">
      var flashvars =
      {
      // fmt=6 HQ FLV 480x360  fmt=18 HQ MP4 480x270  fmt=22 HQ MP4 1280x720 fmt=35 HQ MP4 640x360
      //...Good Test Case
        'file':                                   encodeURIComponent('YouTube_Multi-Format.php?v=K2_U1kbIcJQ&fmt=18'),
        'type':                                  'video',
        'stretching':                            'none',
        'frontcolor':                            '86C29D',
        'backcolor':                             '849BC1',
        'lightcolor':                            'C286BA',
        'screencolor':                           '000000',
        'autostart':                             'true'
      };

      var params =
      {
        'allowfullscreen':                       'true',
        'allowscriptaccess':                     'always',
        'bgcolor':                               '#000000'
      };

      var attributes =
      {
        'name':                                  'playerId1',
        'id':                                    'playerId1'
      };

      swfobject.embedSWF('player-4.3.132.swf', 'player1', '480', '290', '9.0.124', false, flashvars, params, attributes);
    </script>

  </head>

  <body>

    <div id="playercontainer1" class="playercontainer1">
      <a id="player1" class="player1" href="http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash">Get the Adobe Flash Player to see this video.</a>
    </div>

  </body>

</html>

YouTube_Multi-Format.php

<?php

// call with: http://www.mydomain.com/path/YouTube_Multi-Format.php?v=K2_U1kbIcJQ&fmt=18
//        'file':                                   encodeURIComponent('YouTube_Multi-Format.php?v=K2_U1kbIcJQ&fmt=18'),
//        'type':                                  'video',
// fmt=6  HQ FLV   480x360
// fmt=18 HQ MP4   480x270
// fmt=22 HQ MP4  1280x720
// fmt=35 HQ MP4   640x360

$videoid = (isset($_GET['v']))   ? strval($_GET['v'])   : 'K2_U1kbIcJQ';
$fmt     = (isset($_GET['fmt'])) ? intval($_GET['fmt']) : '';
$uri     = "http://www.youtube.com/api2_rest?method=youtube.videos.get_video_token&video_id=$videoid";
$t       = trim(strip_tags(@file_get_contents($uri)));
$uri     = "http://www.youtube.com/get_video.php?video_id=$videoid&t=$t&fmt=$fmt";

//...debug
/*
$headers = get_headers($uri);
print "<pre>\n";
print "URI: $uri\n" ;
print_r($headers);
print "\n</pre>\n";
exit;
*/
//...debug

header("Location: $uri");

?>

Thanks for the detailed instructions. I'm not familiar with php scripts at all. I believe my hosting service allows it. I will check.

So to recap:
1.) I put the "YouTube_Multi-Format.html" page just as you have provided, up on my site.

2.) then I call the YouTube script from the player.

How do I do that?

Do I place the "YouTube_Multi-Format.php" inside the player code that I usually use to call up a video?

I am not at the computer that has Dreamweaver on it today. I will try it tomorrow first chance I get.

Thanks for the explanation. It's all Greek to me, but it sounds like it's doable.

Have a great rest of the weekend!

David

You call the PHP script as shown in the player code that I posted above:'file':                                   encodeURIComponent('YouTube_Multi-Format.php?v=K2_U1kbIcJQ&fmt=18'),
Or in a playlist:<location>http://www.mydomain.com/path/YouTube_Multi-Format.php?v=K2_U1kbIcJQ&fmt=18</location>

Seems it would only work for a single file, what about using a Google or YouTube feed?

Couple of questions:

1. The "YouTube_Multi-Format.html" script. Is that generic? Or do I need to put the name of the video somewhere in that file?

2. The PHP script. Do I place that code in a new document in DREAMWEAVER than save it as "YouTube_Multi-Format.php"?

Do I put the name of the video file I want to play somewhere in that code?

3. Where on my page do I access the PHP?

Here is what my usual JW player code looks like:
<script type="text/javascript" src="http://www.mediaimageproductions.com/swfobject.js"></script></div>
<div id="player"><div align="center">If movie isn’t playing, download new ADOBE FLASH PLAYER at http://www.adobe.com/products/flashplayer/</div></div><script type="text/javascript">
var so = new SWFObject('player.swf','mpl','396','265','9');
so.addParam('allowscriptaccess','always');
so.addParam('allowfullscreen','true');
so.addParam('flashvars','&file=http://www.mediaimageproductions.com/VideoName.flv&controlbar=none&autostart=true&displayclick=none&...');
so.write('player');
</script>

Do I access the PHP somewhere in there?

Sorry I do not understand your directions. It is my ignorance, not your instructions. I was hoping to figure it out but my knowledge is so limited, I am at a loss here.

Thanks for you patience.

David

Hallo to all "profis"!

like in the first posting, i want to use in my JW-player (4.3), youtube-videos in HQ.

this playlist for me is working:

<?xml version="1.0" encoding="UTF-8"?>
<asx version="3.0" >
  <title>Hartmut`s ASX playlist</title>
<moreinfo href="http://www.schwab-meiringen.ch"/>
<entry>
<title>Slideshow</title>
<abstract>Intro Music</abstract>
<Author>Hartmut</Author>
<param name="image" value="http://www.schwab-meiringen.ch/mediaplayer/images/preview.jpg" />
<ref href="http://www.schwab-meiringen.ch/files/mp3/monoslideshow.mp3" />
</entry>
<entry>
<title>Hasliberg</title>
<abstract>Skiabfahrt von Glogghüs nach Käserstatt.</abstract>
<Author>Hartmut</Author>
<param name="image" value="http://www.schwab-meiringen.ch/mediaplayer/images/image8.jpg" />
<ref href="http://www.schwab-meiringen.ch/images/stories/videos/SkiabfahrtMeiringenHasliberg.flv" />
</entry>
<entry>
<title>Metallica Live</title>
<abstract>"One, Nothing Else Matters und Fade To Black" am 17.08.2008</abstract>
<Author>Hartmut</Author>
<param name="image" value="http://www.schwab-meiringen.ch/mediaplayer/images/Metallica.jpg" />
<ref href="http://blip.tv/file/get/Hartmut2911-Metallica282.flv" />
</entry>
<entry>
<title>Metallica</title>
<abstract>New music video "The Day That Never Comes".</abstract>
<Author>Hartmut</Author>
<param name="image" value="http://www.schwab-meiringen.ch/mediaplayer/images/Metallica4.jpg" />
<ref href="http://blip.tv/file/get/Hartmut2911-MetallicaTheDayThatNeverComesHighQuality607.flv" />
</entry>
<entry>
<title>Alpbachschlucht</title>
<abstract>Neueröffnung der Alpbachschlucht in Meiringen mit Panoramablick.</abstract>
<Author>Hartmut</Author>
<param name="image" value="http://www.schwab-meiringen.ch/mediaplayer/images/image9.jpg" />
<ref href="http://www.schwab-meiringen.ch/images/stories/videos/Alpbachschlucht.flv" />
</entry>
<entry>
<title>Europapark 2008</title>
<abstract>Überblick auf die Saison 2008 im Europapark Rust.</abstract>
<Author>Hartmut</Author>
<param name="image" value="http://www.schwab-meiringen.ch/mediaplayer/images/image1.jpg" />
<ref href="http://www.schwab-meiringen.ch/images/stories/videos/Europapark.flv" />
</entry>
<entry>
<title>Euromir</title>
<abstract>Hartmut auf einer Fahrt im Europapark Rust.</abstract>
<Author>Hartmut</Author>
<param name="image" value="http://www.schwab-meiringen.ch/mediaplayer/images/image2.jpg" />
<ref href="http://www.schwab-meiringen.ch/images/stories/videos/Euromir.flv" />
</entry>
<entry>
<title>Gotthard live</title>
<abstract>Livekonzert "One life, one soul" im Januar 2008.</abstract>
<Author>Hartmut</Author>
<param name="image" value="http://www.schwab-meiringen.ch/mediaplayer/images/image4.jpg" />
<ref href="http://www.schwab-meiringen.ch/images/stories/videos/gotthardlive.flv" />
</entry>
<entry>
<title>The Corrs live</title>
<abstract>"Summer wine" - Andrea from The Corrs and Bono .</abstract>
<Author>Hartmut</Author>
<param name="image" value="http://www.schwab-meiringen.ch/mediaplayer/images/image3.jpg" />
<ref href="http://www.schwab-meiringen.ch/images/stories/videos/corrslive.flv" />
</entry>
<entry>
<title>Eiger Nordwand</title>
<abstract>Ueli Steck: Neuer Speed Rekord an Eiger Nordwand.</abstract>
<Author>Hartmut</Author>
<param name="image" value="http://www.schwab-meiringen.ch/mediaplayer/images/image5.jpg" />
<ref href="http://www.schwab-meiringen.ch/images/stories/videos/eigerspeed.flv" />
</entry>
<entry>
<title>Eiger Nordwand</title>
<abstract>Speed-Riding Down The Eiger Nordwand - Switzerland.</abstract>
<Author>Hartmut</Author>
<param name="image" value="http://www.schwab-meiringen.ch/mediaplayer/images/image6.jpg" />
<ref href="http://www.schwab-meiringen.ch/images/stories/videos/eigerspeed2.flv" />
</entry>
<entry>
<title>Swiss Air Force</title>
<abstract>Militärflugplatz Unterbach, die laute Seite in Meiringen.</abstract>
<Author>Hartmut</Author>
<param name="image" value="http://www.schwab-meiringen.ch/mediaplayer/images/image7.jpg" />
<ref href="http://www.schwab-meiringen.ch/images/stories/videos/swissairforce.flv" />
</entry>
<entry>
<title>Snowboarding</title>
<abstract>Meiringen-Hasliberg 2008 im Freestyle Fun-Park</abstract>
<Author>ZWO Team and friends...</Author>
<param name="image" value="http://www.schwab-meiringen.ch/mediaplayer/images/image12.jpg" />
<ref href="http://www.youtube.com/watch?v=g5U_xAIXJYA&feature=related&fmt=22" />
</entry>
<entry>
<title>Polarkereis 18</title>
<abstract>Allein Allein..."Polarkreis 18 Number One Hit.</abstract>
<Author>Polarkreis 18</Author>
<param name="image" value="http://www.schwab-meiringen.ch/mediaplayer/images/image11.jpg" />
<ref href="http://www.youtube.com/watch?v=J48zXoKoxJs" />
</entry>
<entry>
<title>Matt Harding (2008)</title>
<abstract>14 Monate in 42 Ländern.</abstract>
<Author>Matt Harding</Author>
<param name="image" value="http://www.schwab-meiringen.ch/mediaplayer/images/image11.jpg" />
<ref href="http://www.youtube.com/watch?v=zlfKdbWwruY&fmt=18" />
</entry>
</asx>

as you can see on my site:

www.schwab-meiringen.ch

i use this script in my joolma-modul:

<script type="text/javascript" src="/mediaplayer/swfobject.js"></script>

<div id="player"><p>
<a href="http://www.adobe.com/go/getflashplayer"><img src="http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif" style="margin-top: 1em" alt="Get Adobe Flash player" /></a><br />
You need the latest flash player. Please download <a href="http://www.adobe.com/go/getflashplayer">here</a>.
</p></div>

<script type="text/javascript">
window.addEvent('load', function()  {
var so = new SWFObject('http://www.schwab-meiringen.ch/mediaplayer/player.swf','mpl','635','285','9.0.124');
so.addParam('allowscriptaccess','always');
so.addParam('allowfullscreen','true');
so.addParam("wmode","opaque");
so.addParam('flashvars','file=http://www.schwab-meiringen.ch/mediaplayer/chapters.xml&playlistsize=315&frontcolor=cccccc&lightcolor=ff0000&skin=http://www.schwab-meiringen.ch/mediaplayer/skins/stylish.swf&controlbar=over&stretching=uniform&playlist=right&autostart=true');
so.write('player');
});
</script>

i use swfobject 1.5

i added &fmt=18&ap=%2526fmt%3D18 p.e. to the Matt Harding video, but its not in HQ.

http://helmschrott.de/blog/youtube-videos-groesser-und-in-besserer-qualitaet-einbinden-howto

can someone help me? i tried a lot also other playlists and the special php-scripts (youtube_multiformat.php or the youtubefix.php), but nothing works.

Hartmut

@Tom Bailey,

You can have thousands of tracks in a playlist, each one calling any kind of media file or script as long as they return a media file type that is supported by the Adobe Flash Player.

Try the page and script that I posted above, it's been thoroughly tested for single files and playlists.

@David Fortin,

Copy and paste the PHP script into a plain-text editor, like Windows Notepad. Save the script as plain text, named YouTube_Multi-Format.php. Upload that script to your server.

Look at YouTube_Multi-Format.html which I posted above to see the correct place for the call to the script. You can copy and paste that entire page, it's a full, tested, and working page.

Further down, I posted the code for use in player code (like YouTube_Multi-Format.html) or in a playlist track.

For your code:

<script type="text/javascript" src="http://www.mediaimageproductions.com/swfobject.js"></script>

<div id="player">
  <div align="center">If movie isn’t playing, download new ADOBE FLASH PLAYER at http://www.adobe.com/products/flashplayer/
  </div>
</div>

<script type="text/javascript">
  var so = new SWFObject('player.swf', 'mpl', '396', '265', '9.0.124');
      so.addParam('allowscriptaccess',     'always');
      so.addParam('allowfullscreen',       'true');
      so.addVariable('controlbar',         'none');
      so.addVariable('autostart',          'true');
      so.addVariable('displayclick',       'none');
      so.addVariable('icons',              'false');
      so.addVariable('stretching',         'fill');
      so.addVariable('file',                encodeURIComponent('YouTube_Multi-Format.php?v=K2_U1kbIcJQ&fmt=18');
      so.addVariable('type',               'video');
      so.write('player');
</script>

If it's not clear, keep asking questions.

@Hartmut,

Use the script in your playlist like this for MP4 files:

<ref href="http://www.schwab-meiringen.ch/files/YouTube_Multi-Format.php?v=K2_U1kbIcJQ&fmt=18" />
<param name="type" value="video/mp4" />

And like this for FLV files:

<ref href="http://www.schwab-meiringen.ch/files/YouTube_Multi-Format.php?v=K2_U1kbIcJQ&fmt=6" />
<param name="type" value="video/x-flv" />

Note that some "fmt" (formats), are MP4 files and some "fmt" are FLV files:

fmt=?  HQ FLV   480x320  1.5:1   3:2  H.263  MP3
fmt=6  HQ FLV   480x360  1.3:1   4:3  H.263  MP3
fmt=18 HQ MP4   480x270  1.7:1  16:9  AVC    AAC
fmt=?  HQ FLV   534x360  1.4:1   6:4  AVC    AAC
fmt=22 HQ MP4  1280x720  1.7:1  16:9  AVC    AAC
fmt=35 HQ MP4   640x360  1.7:1  16:9  AVC    AAC

lefTY,

Thanks for your continued effort. I have my JW player inserted into a layer called "VIDEOBox".
When I replace the code you gave me starting at <script type=> I seem to mess up that layer and all the other images down below it that make up the page.

Here's the page with my JW player

http://www.mediaimageproductions.com/videos-090114-923am-testvideo.html

Also, where do I put the file name of the YouTube video I am trying to play?
Here's the file I want to access:

="http://www.youtube.com/v/mXTLK7PbVEs&hl=en&fs=1&ap=%2526fmt%3D18"

Again, thanks for your patience. If I ever figure this out I'll be forever indebted. As you can see, I don't know diddly about Dreamweaver, but if you ever have any video questions I can help with, hopefully my 30 years of experience will prove to be of some assistance.

Thanks,

David

Since you're developing a new site, I highly recommend that you use swfobject v2.x, which you can load from Google. The swfobject developers consider SWFObject v1.5 to be obsolete.

In the head element of your HTML document, with the other scripts:

    <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/swfobject/2.1/swfobject.js"></script>

In the head:

    <script type="text/javascript">
      var flashvars =
      {
      //file:                 'http://www.mediaimageproductions.com/WEB_TEST_424x286.flv',
        file:                  encodeURIComponent('http://www.mediaimageproductions.com/<strong>somepath</strong>/YouTube_Multi-Format.php?v=mXTLK7PbVEs&fmt=18'),
        type:                 'video',
        controlbar:           'none',
        displayclick:         'none',
        icons:                'false',
        stretching:           'fill',
        autostart:            'true'
      };

      var params =
      {
        allowscriptaccess:    'always',
        allowfullscreen:      'true',
        bgcolor:              '#000000'
      };

      var attributes =
      {
        id:                   'playerId',
        name:                 'playerId'
      };

      swfobject.embedSWF('player.swf', 'player', '396', '265', '9.0.124', false, flashvars, params, attributes);
    </script>

Adjust the path "somepath" to the location of the script on your site.

In the body of your HTML document, where you want the player to appear:

    <div id="VIDEOBox">
      <div id="playercontainer" class="playercontainer">
        <a id="player" class="player" align="center" href"http://www.adobe.com/products/flashplayer/">If the movie isn’t playing, download a new ADOBE FLASH PLAYER.</a>
      </div>
    </div>

Simple demo page using the code posted above:

http://willswonders.myip.org:8081/David Fortin-1.html

lefTY,

If I download and use swfobject v2.x, will that affect other pages on the site that have already been created? I've made some pages for other people and placed them on the mediaimageproductions.com server.

Thanks for the last post. That's exactly what I need, the HQ version to play. Now I just have to figure out how to get it properly into my page. I will work on that this afternoon.

Thanks again,

David

Use swfobject v2.1 hosted by Google, exactly as I posted the code.

If you have other pages that use SWFObject v1.5 player code, leave the script loading code using swfobject v1.5 (that loads from your server), on those pages.

lefTY,

Thanks.

I miss read your note. I thought you said "download" from google. So I thought it was something I had upload to my site.

Thanks for the clarification.

David

lefTY

thank you very much for helping, i have done exactly what you have told to me, my playlist looks now like this:

<entry>
<title>Matt Harding (2008)</title>
<abstract>14 Monate in 42 Ländern.</abstract>
<Author>Matt Harding</Author>
<param name="type" value="video/mp4" />
<ref href="http://www.schwab-meiringen.ch/mediaplayer/YouTube_Multi-Format.php?v=zlfKdbWwruY&fmt=18" />
</entry>

to see on:
www.schwab-meiringen.ch

but if you scroll down to the last video in the JW-player and you start it there comes an error:

"No suitable model found for playback."

What shell i do?
Please help me again, if possible...

Hartmut

P.S. could it be the wrong playlist-format?

ok, a few minutes later i found out, this seems to work:

<entry>
<title>Matt Harding (2008)</title>
<abstract>14 Monate in 42 Ländern.</abstract>
<Author>Matt Harding</Author>
<ref href="http://www.youtube.com/watch?v=zlfKdbWwruY&fmt=18" />
<param name="type" value="video/mp4" />
</entry>

can you control it and if yes, why not with the YouTube_Multi-Format.php ?

@Hartmut,

Your YouTube_Multi-Format.php script doesn't work because of some error in your script.

Pasting this into my browser:http://www.schwab-meiringen.ch/mediaplayer/YouTube_Multi-Format.php?v=zlfKdbWwruY&fmt=18returns this:Warning: Cannot modify header information - headers already sent by (output started at /var/www/virtual/schwab-meiringen.ch/htdocs/mediaplayer/YouTube_Multi-Format.php:7) in /var/www/virtual/schwab-meiringen.ch/htdocs/mediaplayer/YouTube_Multi-Format.php on line 34so there is a mistake on lline 7 of your script. (Line 7 should be a comment.)

Please copy & paste your YouTube_Multi-Format.php script here so I can look at it.

lefTy:

http://www.longtailvideo.com/support/forum/Bug-Reports/15218/flvplayer-with-YouTube-video-stops-work...

my YouTube_Multi-Format.php

<?php

// call with: http://www.mydomain.com/path/YouTube_Multi-Format.php?v=K2_U1kbIcJQ&fmt=18
//        'file':                                   encodeURIComponent('YouTube_Multi-Format.php?v=K2_U1kbIcJQ&fmt=18'),
//        'type':                                  'video',
// fmt=6  HQ FLV   480x360
// fmt=18 HQ MP4   480x270
// fmt=22 HQ MP4  1280x720
// fmt=35 HQ MP4   640x360

$videoid = (isset($_GET['v']))   ? strval($_GET['v'])   : 'K2_U1kbIcJQ';
$fmt     = (isset($_GET['fmt'])) ? intval($_GET['fmt']) : '';
$uri     = "http://www.youtube.com/api2_rest?method=youtube.videos.get_video_token&video_id=$videoid";
$t       = trim(strip_tags(@file_get_contents($uri)));
$uri     = "http://www.youtube.com/get_video.php?video_id=$videoid&t=$t&fmt=$fmt";

//...debug
/*
$headers = get_headers($uri);
print "<pre>\n";
print "URI: $uri\n" ;
print_r($headers);
print "\n</pre>\n";
exit;
*/
//...debug

header("Location: $uri");

?>

@Hartmut,

Your code is fine, works for me on my server, so there is some problem with executing PHP scripts on your server. You will probably have to work with your host to resolve it.

lefTY,

Thanks for all your guidance. After many attempts I was able to replicate that page you made, and the HQ video plays.

Now, I have to somehow get the video in the proper layer, at the proper place on the page. If I run into trouble you know I'll be back looking for more help.

This is a testament to your teaching abilities. I didn't even know what PHP was, and you've got me successfully using it.

I'll post back to let you know how I make out trying to get the flash player into the correct layer in my document.

Thanks again,

David

@lefTY

ok, my host had fixed the problem with my YouTube_Multi-Format.php, there was an empty line in my code. now the script works as you can see.

but in the JW-player it will not work.

this is now my playlist:

<?xml version="1.0" encoding="UTF-8"?>
<asx version="3.0" >
  <title>Hartmut`s ASX playlist</title>
<moreinfo href="http://www.schwab-meiringen.ch"/>
<entry>
<title>Matt Harding (2008)</title>
<abstract>14 Monate in 42 Ländern.</abstract>
<Author>Matt Harding</Author>
<ref href="http://www.schwab-meiringen.ch/mediaplayer/YouTube_Multi-Format.php?v=zlfKdbWwruY&fmt=18" />
<param name="type" value="video/mp4" />
</entry>
</asx>

any idea?

do you have a working playlist?

thanks again!!
Hartmut

a few hours later...it was the playlist too!

which this one no problem:

<?xml version='1.0' encoding='UTF-8'?>
<playlist version='1' xmlns='http://xspf.org/ns/0/'>
  <trackList>
    <track>
      <title>Matt Harding</title>
      <creator>Hartmut</creator>
      <location>http://www.schwab-meiringen.ch/mediaplayer/YouTube_Multi-Format.php?v=zlfKdbWwruY&fmt=18</location>
      <image>http://www.schwab-meiringen.ch/mediaplayer/images/image11.jpg</image>
      <meta rel='type'>video</meta>
      <info>http://www.schwab-meiringen.ch</info>
    </track>
  </trackList>
</playlist>

i hope, i can play all other files too (,flv, mp3, )

if yes: SOLVED

@lefTY,

Well, I don't know how I did it (YOU did it), but it's working. In trying to get the video into the correct position in the layer on my page, the entire composition would get messed up. I kept trying different things, with out any luck. As I was trying things I would go back to the page and hit UNDO. At one point, I re-save and re-uploaded and it worked.

When I look at the code, I think it still has code from the old page not using the PHP in the layer I call "VIDEObox". But I guess the new PHP code is there, so it works.

Again, not sure how it's working but it is.

Thanks for all your help. Hopefully this is it for now on this PHP set-up.

Can't begin to say how much I appreciate your expertise and patience.

Have a great 2009!

David

How do I call it by embed code ? I tried but I received error #2032

@Ryudo206,

What are you trying to do?

Details, details, details...

Please post your current embed code. Use the code tags "<>" below the text entry box.

@lefTY

Does the PHP script work in IE?

The movie shows up in Firefox and Safari, but not IE.
I've never used IE. I have IE 7 on my laptop. But the movie won't play.

Thanks,

David

The script is good for all browsers.

Check your IE7 Flash version here and upgrade if necessary.

     http://kb.adobe.com/selfservice/viewContent.do?externalId=tn_15507

I have implemented your script to my player. I have one question. Can I embed youtube movies to other sites. I have tried using file=link to file but no luck.

lefTY,

I checked the FLASH version and it was okay.

Thanks. I tried that original example page you made for me and that worked. I went back and tried my pages again today and they seemed to work. Not sure what was happening yesterday.

Just checked the pages on my 2.5GHz Power MAC G55. The controller doesn't appear on the video in either Firefox or Safari.

Have you ever heard of that happening?

Thanks again for all your help.

David

@David,

The control bar not appearing would indicate a problem with that particular combination of the Adobe Flash Player, the JW FLV Media Player, and the Operating System.

Try updating the Adobe Flash Player.

Try using a different version of the JW FLV Media Player.

Be sure that you clear your browser's cache before trying different versions of the JW FLV Media Player.

All releases of the JW FLV Media Player are available here:

      http://developer.longtailvideo.com/trac/log/trunk/as3/player.swf

Click on the "@140" in the Rev column to download a particular release.

I used the tips on this thread to successfully embed the different Youtube HD/HQ formats with the JW FLV Player.

However, if you use <B>JOOMLA</B>, the tips on this page need some tweaking. Read <B>http://garethhooper.com/articles/it/web-multimedia/122-playing-hdhq-youtube-videos-using-the-jw-flv-...</B> for a full explanation.

I used the tips on this thread to successfully embed the different Youtube HD/HQ formats with the JW FLV Player.

However, if you use JOOMLA, the tips on this page need some tweaking. Read

http://garethhooper.com/articles/it/web-multimedia/122-playing-hdhq-youtube-videos-using-the-jw-flv-...

for a full explanation.

Nice explanation. Thanks.

hi

can you add on how to add play list on the page

@johny,

If you post a live link to your test page, perhaps someone will be able to help you.

http://www.coinlauncher.com/index.html
i put all javascript externally, makes sense.. but the <object> code from swfobject won't work alone :/

How to make the <object> tag to call other videos? And without JS in the tag??

I don't understand what you mean by the <object> code.

Do you mean the object element that swfobject writes to the HTML containing element?

is it okay if i add the javascript for getting the file inside the the body section... as i want to use this in dynamic php page and i need to grab the variables for the video are store in the database..

like the example below works but is it okay just putting the javascript that calls the file in the body?

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">

<html lang="en">

  <head>

    <title>YouTube Multi-Format</title>

    <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/swfobject/2.1/swfobject.js"></script>

  </head>

  <body>

    <script type="text/javascript">
      var flashvars =
      {
      // fmt=6 HQ FLV 480x360  fmt=18 HQ MP4 480x270  fmt=22 HQ MP4 1280x720 fmt=35 HQ MP4 640x360
      //...Good Test Case
        'file':                                   encodeURIComponent('http://www.subfighter.tv/components/com_jomtube/assets/swf/YouTube_Multi-Format.php?v=K2_U1kbIcJQ&fmt=18'),
        'type':                                  'video',
        'stretching':                            'none',
        'frontcolor':                            '86C29D',
        'backcolor':                             '849BC1',
        'lightcolor':                            'C286BA',
        'screencolor':                           '000000',
        'autostart':                             'true'
      };

      var params =
      {
        'allowfullscreen':                       'true',
        'allowscriptaccess':                     'always',
        'bgcolor':                               '#000000'
      };

      var attributes =
      {
        'name':                                  'playerId1',
        'id':                                    'playerId1'
      };

      swfobject.embedSWF('player.swf', 'player1', '480', '290', '9.0.124', false, flashvars, params, attributes);
    </script>

    <div id="playercontainer1" class="playercontainer1">
      <a id="player1" class="player1" href="http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash">Get the Adobe Flash Player to see this video.</a>
    </div>

  </body>

</html>

thanks for any help

Q: Does it work?

A: Yes - Then it's OK.

A: NO - Then it's NOT OK.

The preferred place for the JavaScript is in the head element, but if you really need it in the body element it will usually be OK (especially if it works :D).

Hey thanks guys..

i'm now trying to use this lightweight xHTML 1.0 <object> tag, so the code also works on myspace ( and without swfobject) , but the variables aren't xHTML valid..

<object type="application/x-shockwave-flash" style="width:480px; height:295px;" data="http://www.coinlauncher.com/youtube.php?v=SuugciKjhPY&fmt=18">
<param name="movie" value="http://www.coinlauncher.com/youtube.php?v=SuugciKjhPY&fmt=18" />
</object>

Anyone know how to call the /player.swf and put the variables into the /youtube.php? Any ideas??

/youtube.php

<?php
// call with: http://www.mydomain.com/path/YouTube_Multi-Format.php?v=K2_U1kbIcJQ&fmt=18
// 'file': encodeURIComponent('YouTube_Multi-Format.php?v=K2_U1kbIcJQ&fmt=18'),
// 'type': 'video',
// fmt=6 HQ FLV 480x360
// fmt=18 HQ MP4 480x270
// fmt=22 HQ MP4 1280x720
// fmt=35 HQ MP4 640x360

$videoid = (isset($_GET['v'])) ? strval($_GET['v']) : 'K2_U1kbIcJQ';
$fmt = (isset($_GET['fmt'])) ? intval($_GET['fmt']) : '';
$uri = "http://www.youtube.com/api2_rest?method=youtube.videos.get_video_token&video_id=$videoid";
$t = trim(strip_tags(@file_get_contents($uri)));
$uri = "http://www.youtube.com/get_video.php?video_id=$videoid&t=$t&fmt=$fmt";

//...debug
/*
$headers = get_headers($uri);
print "<pre>\n";
print "URI: $uri\n" ;
print_r($headers);
print "\n</pre>\n";
exit;
*/
//...debug

header("Location: $uri");

?>

Many, many, many, many thanks for the detailed instructions and laying everything out step-by-step!!! This is AWESOME!

It took a little tweaking but I was able to get the playlist version to work with WordPress 2.7, WordTube Plugin, and JW Player 4.4.x. Most of the mods were done to the WordTube .php and db tables.

On a side note.. is anyone using this for longer playlists? I noticed that it can take up to 10 - 15 seconds for a playlist with 10+ items to load?

Thanks again and AWESOME work on figure this out guys!!

-> update

I just realized that with javascript the code doesn't work on myspace, so it has to work without swfobject -_-

How to make this work??

<object type="application/x-shockwave-flash"
data="http://www.coinlauncher.com/player.swf" width="425" height="355" id="VideoPlayback">
<param name="movie" value="http://www.coinlauncher.com/player.swf" />
<param name="allowScriptAcess" value="always" />
<param name="quality" value="best" />
<param name="bgcolor" value="#000000" />
<param name="scale" value="noScale" />
<param name="flashvars"
value="&file=http://www.coinlauncher.com/youtube.php?v=SuugciKjhPY" />
</object>

youtube.php

<?php

// call with: http://www.mydomain.com/youtube.php?v=K2_U1kbIcJQ&fmt=18
// 'file': encodeURIComponent('youtube.php?v=K2_U1kbIcJQ&fmt=18'),
// 'type': 'video',
// fmt=6 HQ FLV 480x360
// fmt=18 HQ MP4 480x270
// fmt=22 HQ MP4 1280x720
// fmt=35 HQ MP4 640x360

$videoid = (isset($_GET['v'])) ? strval($_GET['v']) : 'K2_U1kbIcJQ';
$fmt = (isset($_GET['fmt'])) ? intval($_GET['fmt']) : '';
$uri = "http://www.youtube.com/api2_rest?method=youtube.videos.get_video_token&video_id=$videoid";
$t = trim(strip_tags(@file_get_contents($uri)));
$uri = "http://www.youtube.com/get_video.php?video_id=$videoid&t=$t&fmt=$fmt";

//...debug
/*
$headers = get_headers($uri);
print "<pre>\n";
print "URI: $uri\n" ;
print_r($headers);
print "\n</pre>\n";
exit;
*/
//...debug
header("Location: $uri");

?>

@lefTY

If I want to create a Template that uses the PHP script, how do I designate the PHP script as an editable region, so I can input the correct video for each new page I make from the Template?

I've tried a few things but can't seem to make it work. Is there some code to put before the <script type="text/javascript">

and after the </script>

from the PHP code you gave me to make that region editable?

Thanks,

David

@lefTY

Found it in another thread and got it to work;

<!-- TemplateBeginEditable name="page_title" --><title>Enter a title for this page</title>
<!-- TemplateEndEditable -->

Thanks for all your help.

David

@DPC

Hey DPC or anybody else, I would really appreciate if you could explain to me how you made the HQ work for wordtube.

@lefTy

Hi,
I've looked to your code, but I'd like a few tips on integrating this to a plugin I use.

I use wordTube for wordpress, basically, the plugin takes care of everything in terms of displaying the video with JW Player. It has the swfobject and everything.

What I would like to know is which lines of your code are telling JW Player to correctly display HQ videos.

I believe it's in you .php file, but I can't figure out how to use this for my plugin.

You'll find the plugin here, if you wanna know how it's built :
http://wordpress.org/extend/plugins/wordtube/

Thank very much for your help.

@Tomakun - Are you using a playlist? Basically my hack is not 100% as some features like the preview of individual videos (on the edit page) will not work (at least just yet as I plan on providing a more complete solution).

If you're using a playlist then you will need to either a or b:
a) Hard code the media type in the page that generates the .xml file
b) Add new column to the wortube table to store that value.

Regardless of choice you will need to add the following to your .xml:

<meta rel='type'>video</meta>

Let me know how comfortable you are with either of those steps and I'll see if I can walk you through it.

Using the basic PHP scripting lefTY provided above, when I access the page in IE 7.0.6 on my laptop the video plays. BUT when I REFRESH the page, I hear the audio, but the video screen is black. Anyone have any idea why this is happening. Is there a setting in IE that needs to be changed?

Thanks for your help.

David

@David,

Try a newer release from here:

      http://developer.longtailvideo.com/trac/log/trunk/as3/player.swf

Click on the release that you want in the Rev column.

@lefTY,

Thanks. I tried one of the revisions and it seems to be working.

Question. Sometimes the video takes a while to load. Is it because it has to read the PHP script and then go and get the video from it's location. When I first started trying to create these pages the videos seem to load faster. Now some of them take a while.

Just wondering.

Now that I've got this working, I'm finally going to be able to get my site up and running.

Thanks for all your help.

David

The HQ MP4 videos from YouTube have not been post-processed to move the MOOV atoms to the front of the file (using MP4Box or qt-faststart.) I surmise that the YouTube player deals with the MOOV atoms being at the end of the file or whatever.

Therefore, the HQ YouTube videos will not begin to play until the MOOV atoms at the end of the file have been downloaded, hence the delay.

Where are you calling the video or playlist you wish to play in the above example files?

I can't seem to find it.

I now see how to play a single video from the example pages you've provided, but how do you call a playlist?

Thanks for any help!

<location>http://www.coinlauncher.com/youtube.php?v=SuugciKjhPY</location>

lefTy

Thanks for the help! I saw earlier that you said to call playlists in this manner, but I am confused as to where in the html the <location> tag would be placed and also, if this is the link to my youtube playlist:

http://www.youtube.com/view_play_list?p=F8CEAC0509B5784C

how do I add that id in place of the single video id included in the example. I tried just exchanging the playlist id (F8CEAC0509B5784C), with the video id from the example, but was told it was not a valid video id.

Here is the html I'm using from the example you provided:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">

<html lang="en">

  <head>

    <title>YouTube Multi-Format</title>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/swfobject/2.1/swfobject.js"></script>
  

    <script type="text/javascript">
      var flashvars =
      {
      // fmt=6 HQ FLV 480x360  fmt=18 HQ MP4 480x270  fmt=22 HQ MP4 1280x720 fmt=35 HQ MP4 640x360
      //...Good Test Case
        'file':                                   encodeURIComponent('YouTube_Multi-Format.php?v=3rOvjnJXiOw&fmt=22'),
        'type':                                  'video',
        'frontcolor':                            '86C29D',
        'backcolor':                             '849BC1',
        'lightcolor':                            'C286BA',
        'screencolor':                           '000000',
        'autostart':                             'true'
      };

      var params =
      {
        'allowfullscreen':                       'true',
        'allowscriptaccess':                     'always',
        'bgcolor':                               '#000000'
      };

      var attributes =
      {
        'name':                                  'playerId1',
        'id':                                    'playerId1'
      };

      swfobject.embedSWF('player.swf', 'player1', '570', '380', '9.0.124', false, flashvars, params, attributes);
    </script>

  </head>

  <body>

    <div id="playercontainer1" class="playercontainer1">
      <a id="player1" class="player1" href="http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash">Get the Adobe Flash Player to see this video.</a>
    </div>

  </body>

</html>

Thank you for your help lefTy!

Another area where I may be getting confused:

Do I have to create an xml playlist or can this work with the existing youtube feed?

Hey!

I figured everything out! Thanks anyway! :)

I have this code in my YouTube_Multi-Format.php file:

<?php

$videoid = (isset($_GET['v'])) ? strval($_GET['v']) : '';
$fmt = (isset($_GET['fmt'])) ? intval($_GET['fmt']) : '';
$uri = "http://www.youtube.com/api2_rest?method=youtube.videos.get_video_token&video_id=$videoid";
$t = trim(strip_tags(@file_get_contents($uri)));
$uri = "http://www.youtube.com/get_video.php?video_id=$videoid&t=$t&fmt=$fmt";

header("Location: $uri");

?>

And this doesn't output the video, it just returns me a link.

You can try it here for instance: http://514gt.com/YouTube_Multi-Format.php?v=On2ZP4b7ZEk&fmt=18

Is this a code error or my server not handling PHP properly?

The script is working properly.

It is supposed to return a redirect, to the actual location of the video file, to the player, which will then download the video file from that redirect URI.

Yes now it works :-) I had to edit the .htacess to make it work! Thx!

How do I add the playlist?

instead of the php file url I put a xml playlist url in the 'file' section?

How do I add I playlist here?

\'file\': encodeURIComponent(\'YouTube_Multi-Format.php?v=K2_U1kbIcJQ&fmt=18\'),

'file': 'http://www.domain.com/path/playlist.xml',

Each playlist track:

<location>http://www.domain.com/path/YouTube_Multi-Format.php?v=<strong>K2_U1kbIcJQ</strong>&fmt=18</location>
<meta rel='type'>video</meta>

Change the YouTube video identifier (in bold) for each track. Some player versions need the type, some don't.

hmm...it doesn't work, is this compatible with swfobject 2.1?

when I use the

'file': 'http://www.domain.com/path/playlist.xml',

the player tells me that the playlist.xml is not found...it is because of the syntax of the playlist?

<rss version="2.0" xmlns:media="http://search.yahoo.com/mrss/">
<channel>
<title>GTTV Marketing Video Channel</title>
<link>http://www.514gt.com</link>

<item>
<title>G.T.T.V. Coming Soon</title>
<link>http://www.514gt.com/</link>
<description>GTTV Promotional Ads for GT Studios</description>
<media:credit role="author">GTTV</media:credit>
<media:content url="http://514gt.com/img/Custom/gttv540_01.jpg"  type="image/jpg" duration="10" />
<media:thumbnail url="http://514gt.com/img/Custom/gttv_blank540360.gif" />
</item>

</channel>
</rss>

OR?

<?xml version='1.0' encoding='UTF-8'?>
<playlist version='1' xmlns='http://xspf.org/ns/0/'>
<trackList>
<track>
<title>Matt Harding</title>
<creator>Hartmut</creator>
<location>http://www.514gt.com/YouTube_Multi-Format.php?v=ZBivxbf0ZzU</location>
<image>http://www.schwab-meiringen.ch/mediaplayer/images/image11.jpg</image>
<meta rel='type'>video</meta>
<info>http://www.schwab-meiringen.ch</info>
</track>
</trackList>
</playlist>

The playlist files are OK.

Have you tried loading them in your browser to test their accessibility and validate the XML.

Something like:http://www.514gt.com/playlist.xml
Adjust the domain, path, and playlist name to match yours.

ok try to getting this work with a component i make making.. my question is possible to get the fmt= and try to make a check to see and grab the High Quality video and if it does not exist.

then it would go do the the list and get the worst quality video..

as not all videos have HQ??

I have a question regarding the video token. I'm not using PHP, my website uses .NET.

So to play a video using the JW FLV Player, I will lookup the video token.

http://www.youtube.com/api2_rest?method=youtube.videos.get_video_token&video_id=pMA12qeoz4M

I get vjVQa1PpcFM5k76c9kegL6Bnce8T8sxtRfMLIaZzgxI=

I then use the token as below

http://www.youtube.com/get_video.php?video_id=pMA12qeoz4M&t=vjVQa1PpcFM5k76c9kegL6Bnce8T8sxtRfMLIaZz...

Will the video token ever change? can I use the above url permanently to play that video?

Thanks in advance for your help.

Gareth

This youtube php script does not seem to work all the time.
I have gotten one video out of 10 to work. most return a sandbox security error.
Did something change on youtube end to effect this?

Something changed, yes.

I will also investigate.

Something changed with the t string.

I think their is some sort of expiration of cached file on google.

Yes, something has changed in the last 24 hrs to stop the PHP file from working.

I'm looking into it.

yeah it stopped working on my site also..

Here the updated YouTube_Multi-Format.php

<?php

// call with: http://www.mydomain.com/path/YouTube_Multi-Format.php?v=K2_U1kbIcJQ&fmt=18
// 'file': encodeURIComponent('YouTube_Multi-Format.php?v=K2_U1kbIcJQ&fmt=18'),
// 'type': 'video',
// fmt=6 HQ FLV 480x360
// fmt=18 HQ MP4 480x270
// fmt=22 HQ MP4 1280x720
// fmt=35 HQ MP4 640x360

$videoid=$_GET["v"];
$format = 18;
$content= file_get_contents("http://youtube.com/get_video_info?video_id=$videoid");
parse_str($content);
$url = "http://www.youtube.com/get_video.php?video_id=" . $videoid . "&t=" . $token. "&fmt=".$format;

//...debug
/*
$headers = get_headers($uri);
print "<pre>\n";
print "URI: $uri\n" ;
print_r($headers);
print "\n</pre>\n";
exit;
*/
//...debug

header("Location: $url");

?>

use this code and it should work fine again

nice!

thanks but does anyone know if there is a script anywhere or know the how to code the php so it can grab the HQ video and if it does not find it it will check for the next best quality Video..

Basically if there is way where it would find the High Quality Video Available and use it to Play..

Since some videos are just LQ and other have HQ versions available.. would be great if this was added so it was automated in the script to check and play..

thanks

Thanks paniekzaaier! That fixed the problem!

So YouTube basically changed the way you look up the video token.

My work website will have a ton of video on it, and it will be high traffic. I was planning to use this PHP script.

I can't have people not be able to view video if YouTube decide to change something to prevent this PHP script.

Does anyone know if YouTube change their API's/URL's very often?

I use the JW FLV Player because 1) I want the Google Analytics integration, 2) I like HQ Videos played by default, and 3) Not a show stopper, but I prefer not having the YouTube logo shown.

Gareth

broke again :/

yup youtube api has changed what do we need to change in the YouTube_HQ.php script?

i think they are expiring urls based on ip adress after x hours.

I just tried a brand new IP and still the same problem.

<?php

// call with: http://www.mydomain.com/path/YouTube_Multi-Format.php?v=K2_U1kbIcJQ&fmt=18
// JWMP code:
// 'file': encodeURIComponent('YouTube_Multi-Format.php?v=K2_U1kbIcJQ&fmt=18'),
// 'type': 'video',
// fmt=6 HQ FLV 480x360
// fmt=18 HQ MP4 480x270
// fmt=22 HQ MP4 1280x720
// fmt=35 HQ MP4 640x360

$videoid=$_GET["v"];
//$videoid = (isset($_GET['videoid'])) ? strval($_GET['videoid']) : '8bV0XSwnPkI';
//$fmt = (isset($_GET['fmt'])) ? intval($_GET['fmt']) : '';
$fmt = 18;
parse_str(file_get_contents("http://youtube.com/get_video_info?video_id=$videoid"));
//$uri = "http://www.youtube.com/get_video.php?video_id=$videoid&t=$token";
$uri = "http://www.youtube.com/get_video.php?video_id=$videoid&t=$token&fmt=$fmt";
//...debug

//$headers = get_headers($uri);
//print "<pre>\n";
//print " uri: $uri\n" ;
//print "videoid: $videoid\n";
//print " token: $token\n";
//print " fmt: $fmt\nheaders: ";
//print_r($headers);
//print "\n</pre>\n";
//exit;

//...debug

function http_test_existance(
$url,
$timeout = 10
) {
$timeout = (int)round($timeout/2+0.00000000001);
$return = array();

### 1 ###
$inf = parse_url($url);

if (!isset($inf['scheme']) or $inf['scheme'] !== 'http') return array('status' => -1);
if (!isset($inf['host'])) return array('status' => -2);
$host = $inf['host'];

if (!isset($inf['path'])) return array('status' => -3);
$path = $inf['path'];
if (isset($inf['query'])) $path .= '?'.$inf['query'];

if (isset($inf['port'])) $port = $inf['port'];
else $port = 80;

### 2 ###
$pointer = fsockopen($host, $port, $errno, $errstr, $timeout);
if (!$pointer) return array('status' => -4, 'errstr' => $errstr, 'errno' => $errno);
socket_set_timeout($pointer, $timeout);

### 3 ###
$head =
'HEAD '.$path.' HTTP/1.1'."\r\n".
'Host: '.$host."\r\n";

if (isset($inf['user']))
$head .= 'Authorization: Basic '.
base64_encode($inf['user'].':'.(isset($inf['pass']) ? $inf['pass'] : ''))."\r\n";
if (func_num_args() > 2) {
for ($i = 2; $i < func_num_args(); $i++) {
$arg = func_get_arg($i);
if (
strpos($arg, ':') !== false and
strpos($arg, "\r") === false and
strpos($arg, "\n") === false
) {
$head .= $arg."\r\n";
}
}
}
else $head .=
'User-Agent: Selflinkchecker 1.0 (http://aktuell.selfhtml.org/artikel/php/existenz/)'."\r\n";

$head .=
'Connection: close'."\r\n"."\r\n";

### 4 ###
fputs($pointer, $head);

$response = '';

$status = socket_get_status($pointer);
while (!$status['timed_out'] && !$status['eof']) {
$response .= fgets($pointer);
$status = socket_get_status($pointer);
}
fclose($pointer);
if ($status['timed_out']) {
return array('status' => -5, '_request' => $head);
}

### 5 ###
$res = str_replace("\r\n", "\n", $response);
$res = str_replace("\r", "\n", $res);
$res = str_replace("\t", ' ', $res);

$ares = explode("\n", $res);
$first_line = explode(' ', array_shift($ares), 3);

$return['status'] = trim($first_line[1]);
$return['reason'] = trim($first_line[2]);

foreach ($ares as $line) {
$temp = explode(':', $line, 2);
if (isset($temp[0]) and isset($temp[1])) {
$return[strtolower(trim($temp[0]))] = trim($temp[1]);
}
}

//$return['_response'] = $response;
//$return['_request'] = $head;

return $return;

}

$response=http_test_existance($uri);
$uri=$response["location"];

header("location: $uri");
exit;

?>

This will work

wow, excellent! ...but legit too?

I think the solution posted by "paniekzaaier" works only on localhost.
If you investigate the googlevideo.com link, then it is clear, that the IP address (where the php code runs) is encoded into the video file url. Therefore I assume that you could not download it from other IP's. (So the Flash at the client side could not access the file.)

anyone get youtube fixed?

paniekzaaier,

Thank you, thank you, thank you!

David

Hi guys,
I would like to embed my player with a youtube clip. I can take the embed code provided by the setup wizard and everything works but i really need high quality.
Here is an example http://revivl.com/news_detail.php?nid=16101

I just need this to play the HQ version in my player which is here http://www.youtube.com/watch?v=reWEWpp-uiI

This is my site by the way so I can do whatever although php is not something I know very well. Using javascript to place on the site does not work through the site dialog box. Only using the embed version will it show up.
Thanks Jon

hey there, this is awesome script. i can get it to work for a single file, but not for a playlist. i have followed the instructions specifically, and my server allows php. any help at this point is appreciated.

i even tried to locate the YouTube_Multi-Format.php file directly on my server here, and it goes to YouTube, but displays nothing:

http://[filelocation]/YouTube_Multi-Format.php?v=mswI3Mt4lYs&fmt=18

1. is there a problem with my php file?

2. is there a problem with my playlist file?

I'm having issues pulling up the HQ videos using this script, is anyone able to confirm it works or know of another way to display HQ YouTube videos using the JW Player and yt.swf?

i know that this is an old post....

can anybody help me to get this work?

Unfortunately, we do not have YouTube HD support yet, as we are using the AS2 version of the YouTube API. This will be addressed when we move over to the AS3 version.