The song path for each song id i pass.
<player showDisplay="yes" showPlaylist="yes" autoStart="yes">
and
</player>
are written once at the start and end of the text file.The title is just the name of song without .mp3 extention.
but not the rest!! could u help me fix this problem i get the following errors:
Code:
Array
Warning: fopen(http://localhost/flash_mp3_player/mp3/01 - Saracha.mp3) [function.fopen]: failed to open stream: HTTP request failed! HTTP/1.1 400 Bad Request in c:\wamp\www\player\ID3v1x.php on line 30
Warning: fopen(http://localhost/flash_mp3_player/mp3/13 - Gar Aya.mp3) [function.fopen]: failed to open stream: HTTP request failed! HTTP/1.1 400 Bad Request in c:\wamp\www\player\ID3v1x.php on line 30
Warning: fopen(http://localhost/flash_mp3_player/mp3/Soroush - Yeh Donya - 02 Shoghe Nafas.mp3) [function.fopen]: failed to open stream: HTTP request failed! HTTP/1.1 400 Bad Request in c:\wamp\www\player\ID3v1x.php on line 30
try changing the url to the relative path of the file. so if the file was in a subfolder called music then it would be
PHP Code:
$url[1] = 'music/01 - Elements.mp3';
and change the "[location of file from web]" to the path that appears if you were to browse to them.
PHP Code:
$string = "<song path=\"http://localhost/[location of file from web]/$u\" title=\"" . trim($ID3->title) ."\" />";
Hope that makes sense
Many Many thanks to u that solve the problem. But the only problem is that it writes all the path of songs inside the music folder. For example if i call the script like this : http://localhost/player/ram4.php?sid=1,2,
it should only write path of song number 1 and 2 but not the whole thing!!!
john tindell many many thanks this solved that problem. But i want to know how to use mp3 that are in remote server? When i use
$url[5] = "http://remotesite.com/NewMusic/1.mp3";
i get this error :
Code:
Warning: fopen(http://remotesite.com/NewMusic/1.mp3) [function.fopen]: failed to open stream: HTTP request failed! HTTP/1.1 400 Bad Request in c:\wamp\www\player\ID3v1x.php on line 30
Is there a way to modify ID3v1x.php so it deals with remote mp3 files as well?Furthermore, how about if i do not use title for remote files? since from my understanding ID3v1x.php is only used to get the mp3 title not the song path..I tested by removeing this line
title=\"" . trim($ID3->title) ."\"
it played the local songs but not the remote one.
Correct me if i am wrong . do u think it will solve the problem? i be happy if u help me to be able to deal with remote files.Thanks
Last edited by tony007; Feb 7th, 2006 at 10:08 PM.
As far as im away fseek which is used by the ID3v1x.php does not support streams. This is the what you get when you open a URL with fopen.
http://uk.php.net/manual/en/function.fseek.php
May not be used on file pointers returned by fopen() if they use the "http://" or "ftp://" formats. fseek() gives also undefined results for append-only streams (opened with "a" flag).
How ever the same code be used but the "title" information will not be added.
A fix for the moment is
PHP Code:
if(@$ID3->read_tag() == true)
This will work, ill look to see if i can find away to help you, but it might involve downloading the file from the remote server to your server just so that it can read the tag information from the MP3 file.
I do not know where i get this <song path="" /> ? This line prevents the player to autostart but as u see the remote song is on the playlist without title!
I have this thing in mind but not sure how to code it and i be happy if u help me with it. i want to be able to put the titles of mp3 which are in local server using 'ID3v1x.php'.For the the remote mp3 for example this file:
i do not use 'ID3v1x.php' and instead i scan the remote URL and remove the .mp3 extention and copy the song name between / and mp3 extention and use that as song title .
I tried using if(@$ID3->read_tag() == true) as u suggested it only played local file with title and ignoring the local file completly and no warning!! i think this change only removed the warning but not the actual problem.
Thanks
Last edited by tony007; Feb 7th, 2006 at 11:04 PM.
I was hoping that the @ would supress the error so that it would continue and not include the file that didnt work, o well. Try checked to see if the url is empty of not before you write it to the file.
I was hoping that the @ would supress the error so that it would continue and not include the file that didnt work, o well. Try checked to see if the url is empty of not before you write it to the file.