Jump to content

Wirelessly Stream Audio From Harddrive Problem


poxyexams
 Share

Recommended Posts

Hey guys I was wondering if anyone here can help me :) Here's the pro-lemo

I have a hard drive connected to my router. I can access the files on the drive on any Computer/laptop anywhere on the network (specifically audio .mp3/.wav files) I can choose the song I want and play it straight away.

Using the internet (in a friends house) I can dial in my IP address and log into these files. I can see all my audio files. I can download them and play them, however I can not STREAM these files :(

I want to be able to have a script/application that allows the user to see all these files and choose the files and stream the audio. For the moment, before I make the applications all cool I need it to simply stream the audio. I was wondering is there anyway I can write some code and embed it on a website that allows the user to stream (not download these files) I began writing some code for this. I can download the files but can't stream them.

If I click the URL: http://xx.xxx.xxx.xx/shares/usb/Pete/x/ ... ne_Day.mp3

I get the option to download/play the file. I want to embed this into my website so It can be streamed, Some simple testing using:

<embed src="http://xx.xxx.xxx.xx/shares/usb/Pete/x/%26ME_One_Day.mp3"

width="140" height="40" autostart="false" loop="FALSE">

</embed>

It won't play it. But if I just put a link to the file it's self it will download and play properly.

------------------------

Anyone know what I am doing wrong?

Thanks guys!

Link to comment
Share on other sites

Try this code! Remember to replace this line MP3_FILE_URL with the link to your MP3 file.

&lt;embed type="application/x-shockwave-flash" flashvars="audioUrl=MP3_FILE_URL" src="http://www.google.com/reader/ui/3523697345-audio-player.swf" width="400" height="27" quality="best"&gt;&lt;/embed&gt;

Edited by Infiltrator
Link to comment
Share on other sites

Easiest way to embed is using a flash app as the player and point to the mp3. Reasons it doesn't work with embed is you need a default plugin that is associated with embeded mp3's, which is usually something like Quicktime or windows media player, which require slightly different embedding. Media Player will want an object tag around the embed code with the proper data type, then emebed will default to all other players associated with such playing, like Quicktime, but is much better to just use flash, since its cross platform compatible between windows, mac, and linux so long as they have flash installed and the OS itself can play MP3's.

Have a look at something like : http://www.longtailvideo.com/players/jw-flv-player/ or for really stylish stuff, http://activeden.net/searches?term=mp3+player&type=files&categories%5Bflash%5D=1&categories%5Bflex%5D=1&categories%5Bunity-3d%5D=1

Many of the things on ActiveDen show you demos, which if your savvy enough to know where to look, can pull down half the demo files and re-purpose them on your own site since the play lists are usually XML, and the players have no restrictions so long as everything it is fed is coded correctly.

Link to comment
Share on other sites

@Infiltrator, thanks that works now and streams the music :) I'm gonna look into adding a play list to that player.

embed type="application/x-shockwave-flash" flashvars="audioUrl=MP3_FILE_URL" src="http://www.google.com/reader/ui/3523697345-audio-player.swf" width="400" height="27" quality="best"></embed>

Just doing some testing at the moment, have some php code to take input from the user and stores this input as variable 'url'

think the code I used is something along the lines of this:

$url = $_POST['songurl']

I want to add the php (form input) $url to the html code above

flashvars="audioUrl=ADD PHP VARIABLE HERE"

I have hit a brick wall here, can't get the input from the form box into the above html player

What am I missing,

Thanks for the suggestions guys, really appreciate it :)

Link to comment
Share on other sites

try

flashvars="audioUrl=&lt;?php ehco $url; ?&gt;"

Link to comment
Share on other sites

try

flashvars="audioUrl=&lt;?php ehco $url; ?&gt;"

I tried that but didn't work, tried it again and works :) must of been a small typo by me...

I have to player working so they enter the url of the mp3 they want to play, it then plays it in the player. Going to try add it to the player play list instead of playing it straight away.

Thanks guys

Link to comment
Share on other sites

Two small problems, nearly 100% working :rolleyes:

.USER logs on to secure page.

.Input text field called 'audiourl' and submit button

.Music Player

.Loads html from another page and shows all audio files on the drive

Page has simple INPUT text box that prompts the user to enter an audio file URL and stores the input in a php variable called $url

When submit is clicked, the variable $url (audio file) is added to the audio player

-------------------------------------

I want to add a second audio player & a second audio url text box. I did it and I can get the audio to play in each player. However every time submit is hit for each player it reloads the page (stopping the current playing audio player)

Is it possible to to have one audio player playing music and when the user enters a second url it just goes into the player number 2 without loading the entire page (and stopping the current playing track)

---------------------------------------

Just a small problem here; I get this error message on the page:

Notice: Undefined index: songurl in /var/www/player.php on line 11

---------------------------------------

Thanks guys, and here is the CODE to the actual page:

&lt;html&gt;
&lt;head&gt;&lt;title&gt;myStreamZ&lt;/title&gt;&lt;/head&gt;
&lt;body&gt;

&lt;form method='POST'&gt;
Player 1: &lt;input type='text'value='Song URL' name='songurl'&gt;&lt;br/&gt; 
&lt;input type='submit' value='Add Track To Player 1'&gt;&lt;br/&gt; 
&lt;br/&gt;

&lt;?php
$url=$_POST['songurl'];
?&gt;

&lt;br/&gt;
&lt;center&gt;Player 1&lt;br/&gt;&lt;embed type="application/x-shockwave-flash" flashvars="audioUrl=&lt;?php echo $url; ?&gt;" src="http://www.google.com/reader/ui/3523697345-audio-player.swf" width="400" height="27" quality="best"&gt;&lt;/embed&gt;
&lt;br/&gt;
&lt;br/&gt;
&lt;br/&gt;
&lt;object data=http://xx.xxx.xxx.xxx/???/???/???/?/ width="1000" height="300"&gt; &lt;embed src=http://xx.xxx.xxx.xxx/???/???/???/?/ width="600" height="400"&gt; &lt;/embed&gt; Error: Embedded data could not be displayed. &lt;/object&gt;
&lt;/body&gt;
&lt;/html&gt;

---------------------

Thanks guys, once I get this I will be very happy :D

Link to comment
Share on other sites

The other option is to have either a drop down of all songs, or maybe list them all with check boxes, then combine selected songs into a play-list to queue them up. There is actual software for this for streaming music such as MP3's via web pages, but I can't remember the name of it nor if it was free. Its a php driven backed that works kind of like a media center in your browser, indexes all your music for you when put in the media folder, and you can use it on web sites and intranets and have user accounts created for saved playlists, etc. I don't know the name but if I can find the link again, I'll post it.

edit:

Found something similar but not the one I was looking for. Check out http://musicbrowser.sourceforge.net/

Not the prettiest thing out there, but I guess you could customize all of it to your needs and use it as a base.

Edited by digip
Link to comment
Share on other sites

I personally use http://www.vibestreamer.com/, to stream mp3 off my computer to the web. It has its own web-interface where you can view all artists as as well as select which songs you want to play.

screenshot3.jpg

screenshot2.jpg

Link to comment
Share on other sites

Going to check these out later guys, only thing is my website is on a server online.

My music is on the external hard drive connected to the router. Will these applications/programs only scan the music in your web server folder? /var/wwww/etc....

I need it to scan xx.xxx.xxx/shares/usb/x/

Wonder can I have the application running on the server online and scan music on that external usb.

Link to comment
Share on other sites

Going to check these out later guys, only thing is my website is on a server online.

My music is on the external hard drive connected to the router. Will these applications/programs only scan the music in your web server folder? /var/wwww/etc....

I need it to scan xx.xxx.xxx/shares/usb/x/

Wonder can I have the application running on the server online and scan music on that external usb.

It shouldn't be a problem, what you need to do is on the server map a network drive pointing to the external hard drive. For example, say your router ip address is 10.0.0.1 and your share name is "share".

So to map the network drive, all you need to do is connect to \\10.0.0.1\<share name>, once connected it should look just like a normal drive on your server, C:\ or D:\.

Edited by Infiltrator
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...