The YouTube API limits you to a maximum of 50 items per request (use: max-results=50).
To obtain more than 50 items, you have to make multiple requests (use: start-index=51&max-results=50) and keep increasing the start-index by 50 on each request. Then combine the results from multiple requests into one giant playlist.
I used to have some PHP code to do this; if I can find it, I'll post it here...
Ok, it's clear for me. I'm not a developer, not a programmer. Without detailled example and a minimum of PHP knowledge, I can't continue more longer. Then, for playlists Youtube, I'will continue to use the Youtube player which can load a full list, above the Jwplayer limit of 50 videos.
Jwplayer will be used for my own videos made-playlists not published on Youtube !
When I launch your above Url test page, I get an error message : Task queue failed at step5 : playlist could not be loaded due to crossdomain policy restrictions.
I looked at the source code of the test page, and I give "jwplayer.min.js" as name of the file phpscript . I've created a similar html page with your source code, but when I launch my webpage that load and stay at : "Player loading ....."
My functional playlist is :bc.. http://gdata.youtube.com/feeds/api/playlists/76F4FD50F2E7F1AC
should I change the ID in the script at :// myplaylist ? and how to change the syntax for the content of playlistfile into the webpage ?
We must go slowly, you have in front of you new to the Web, and knowing nothing in php. php file is first in my computer, the directory used by the software Dreamweaver with which I create my site, with which I upload to my website then. I do this in the Dreamweaver interface: I edit the php and possibly the html file and I want a preview locally with Firefox. If this is correct, I upload. So I think the php runs when he was asked in my PC. Can we see this as the "server" you mean?
The script file that you use in your testPage is "jwplayer.min.js" and is different from the one that comes with the package "JW-mediaplayer-5.5" called "jwplayer.js" I downloaded Jwplayer site to this page: h t t p : / /w w w.longtailvideo.com/players/jw-flv-player/ If I use yours, I remain with the web page loading and the text: "loading player ...." If I use the file "jwplayer.js" package, the web page load, but gives me only 24 videos. I created a folder called "cache"on my website, and I filled out the php file like this: $ cachedirectory = 'h t t p : / / gerard.marin.free.fr/Templates/cache/'; This brings me nothing better.
If you are ending up with a playlist file in your cache directory, then everything is working OK.
Just because you have 200 tracks in your personal playlist doesn't mean that you will end up with 200 tracks in the generated playlist. Many of the videos in your playlist may be invalid for various reasons, therefore you will end up with 49 tracks.
I have over 200 tracks in my YouTube playlist, yet only 87 of them end up being valid tracks...
I can not for the life of me get this cache folder to work. I'm hosted through GoDaddy, and am assuming the cache folder is whats preventing me from successfully getting my playlist to work.
I can get it to work using the willswonders.myip.org cache folder (im sure he doesnt appreciate this though) but can not use my own cache folder. The PHP is hosted in a folder called etchasketchy4. And also in the etchasketchy4 folder I have a folder called cache. I have tried using
Nothing ever shows up in the cache folder. I always get the error "Task Queue failed at step 5: Playlist could not be loaded: Error #1088"
I've also tried editing the CHMOD of the folder EVERY which way, I'm assuming though the php script should be allowed to add to the cache folder without any CHMOD editing because the PHP is locally hosted on the server though right?
This has been driving me crazy for months. Any help will be so appreciated. Here's my code so far for the stream.php
// YouTube_Playlist_XSPF-3.3.php 20110402 - compatible with v5.6.x player // playlists need to be updated at least every 2 hours // call with: http://willswonders.myip.org:8085/php/YouTube_Playlist_XSPF-3.2.php?playlistid=B8D6FA74D3F2629C // file: encodeURIComponent('http://willswonders.myip.org:8085/php/YouTube_Playlist_XSPF-3.2.php?playlistid=B8D6FA74D3F2629C), // call with: http://my.domain.com/YouTube_Playlist_XSPF-3.2.php?playlistid=9A337BB0628CF018 // file: encodeURIComponent('http://my.domain.com/YouTube_Playlist_XSPF-3.2.php?playlistid=B8D6FA74D3F2629C), // Direct: // From: http://www.youtube.com/view_play_list?p=F4DF7B5DEE6ACA06 // To: http://gdata.youtube.com/feeds/api/playlists/F4DF7B5DEE6ACA06 // To: http://gdata.youtube.com/feeds/api/playlists/B8D6FA74D3F2629C
// max-results is limited to 50 per request, total of 100 for playlists // http://gdata.youtube.com/feeds/api/playlists/B8D6FA74D3F2629C ?start-index=1&max-results=50 $playlisturl1 = "http://gdata.youtube.com/feeds/api/playlists/" . $playlistid . "?start-index=1&max-results=50"; $playlisturl2 = "http://gdata.youtube.com/feeds/api/playlists/" . $playlistid . "?start-index=51&max-results=50";
The path to the cache directory must be a local (local meaning on the server) filesystem path to the cache directory because that is what PHP will use. NOT a web server path.
Since I don't know what your directory structure is, I can't give you an example. It may be something like /use/home... GoDaddy should be able to help you determine what your local filesystem path to the cache directory would be.
Jimmy, I would just like to say THANK YOU. I just googled how to find cache directory on GoDaddy, and they had simple instructions on how to login and get the actual filesystem path. Never knew PHP used this specifically. You don't know how many times i've been through each line of the code trying to figure out what I did wrong haha.
I'm glad I was right about it having to do with the cache not working.
You fixed all my problems, and I can't thank you enough!