Forum Moderators: coopster

Message Too Old, No Replies

streaming audio problem

streaming audio mp3

         

trilogistick

6:06 pm on Nov 13, 2006 (gmt 0)

10+ Year Member



I need help about my mp3 music files, I have a mp3 files saved from my old server. I have a new server working which is the one I'm using right now. I want to link my mp3 files from my old server to my new server using PHP script without tracking my old server by the user or client.

ex.
<embed in media player>
mp3.oldserver.com/demo - demo.mp3
and change it into
www.newserver.com/stream.php?id=demo - demo

something like that and unable tobe download by the users. I've tried surfing the net and i could find one. tnx 4 helping me.

[edited by: jatar_k at 6:54 pm (utc) on Nov. 21, 2006]
[edit reason] Removed e-mail link as per TOS. [/edit]

coopster

2:11 am on Nov 21, 2006 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



Welcome to WebmasterWorld, trilogistick.

I fear the lack of responses has come because of the clarity of your message. Can you tell us a little more clearly what you have and what you desire to have?

trilogistick

1:11 pm on Nov 23, 2006 (gmt 0)

10+ Year Member



thanks for your reply.
I have a mp3 files saved from my old server, i want to link all my audio files in my new server without tracking the original link by the users who viewed our site.

<EMBED type='application/x-mplayer2' pluginspage='http://microsoft.com/windows/mediaplayer/en/download/'
id='mediaPlayer'
name='mediaPlayer'
showcontrols="true"
width="320" height="285"
src="http://www.oldserver.com/mp3/songtest.mp3"
autostart="true"</EMBED>

This is the player code with a mp3 file located at my old server "http://www.oldserver.com/mp3/songtest.mp3" and i want to change it "http://www.newserver.com/songplayer?id=songtest" making it a dynamic link using php and would became like this.

<EMBED type='application/x-mplayer2' pluginspage='http://microsoft.com/windows/mediaplayer/en/download/'
id='mediaPlayer'
name='mediaPlayer'
showcontrols="true"
width="320" height="285"
src="http://www.newserver.com/songplayer?id=songtest"
autostart="true"</EMBED>

Any idea? thanks for your reply.

Psychopsia

2:56 pm on Nov 23, 2006 (gmt 0)

10+ Year Member



I made something similar, but the redirect was on the same server.

You could try to use Rewrite Mod, information in Apache forum [webmasterworld.com].

trilogistick

8:48 pm on Nov 29, 2006 (gmt 0)

10+ Year Member



thanks for the reply but I've already tried apache but still it won't work. maybe I'll try Flash as my player

Mohamed

11:10 pm on Nov 29, 2006 (gmt 0)

10+ Year Member



I think this code will do the job. the code works my pc so I hope it will work on your server too.

php code

//specify folder of the mp3 files
// this is not necessary you can query the complete path from database
$mp3dir = "http://localhost/playground/";

//here I called my db class
include 'db/mysql_db.php';

$id=$_GET['id']; // id of specific entry

//creating db object and querying from database;
$db = new sql();
$row = $db->sql_query("select path from lyrics where id=\"$id\"");
$res = $db->sql_fetchrow($row);

$mp3file = $res[0]['path'];

$filename = $mp3dir.$mp3file;
//echo $filename;
header("Content-Type: audio/mp3");
readfile($filename);

HTML part

<EMBED type='application/x-mplayer2' pluginspage='http://microsoft.com/windows/mediaplayer/en/download/'
id='mediaPlayer'
name='mediaPlayer'
showcontrols="true"
width="320" height="285"
src="http://localhost/playground/test1.php?id=60"
autostart="true"</EMBED>