Jump to content

Audio streaming for Mac users


MikeFloutier

Recommended Posts

Hi,After a lot of work and some wonderful help from you guys I've got my wife's site up and running. One of the main features is the possibility of users listening to her written material spoken via a streaming audio file.So far I've got this to work for IE and Firefox browsers but cannot find out how to accommodate Mac Safari and Opera users.Does anyone have any idea how I should go about this?ThanksMikePs My present "media_player" file looks like this:

<object classid="CLSID:6BF52A52-394A-11D3-B153-00C04F79FAA6" type="application/x-oleobject"	   codebase="http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=6,4,5,715"		standby="Loading Microsoft Windows Media Player components..."		width="60" height="32">		 <param name="Autostart" value="false">		 <param name="volume" value="100">		 <param name="url" value= "Waves/<?php echo $exhortation_wma; ?>"		 <p>		  ActiveX is not installed or is not working properly.		  If you are using Firefox, please refer to the following Guide:		  <a href="http://forums.mozillazine.org/viewtopic.php?t=206213">		   Embedded Windows Media in Firefox		  </a>		 </p>	   </object>

Link to comment
Share on other sites

The ActiveX codebase threw me off, I think that is actually the code for generic Windows Media Player. Someone else who has embedded WMP might be able to post the link I was trying to search for on how to do that.If you want to use Flash, there are quite a few music players out there that use it. The Flash player is installed on most machines and is cross-platform. There are some players you can download the source for and customize them using the Flash software, but the Flash software costs around $400. Here is one example of a player that you can just embed and use:http://musicplayer.sourceforge.net/That page has a lot of documentation about how to create the playlist files that you need to send to the player, what code to put on your page, etc. There are also help links on the site.

Link to comment
Share on other sites

Thanks Justsomeguy,I certainly don't want to spend $400 as this is a small personal project at present.I'm still very new to all this but from what I've read so far I can't help thinking that it must be possible to:1. Sense what browser the viewer is using and2. Down-load a media player - appropriate to his browser/OS.Does this make sense?Mike

Link to comment
Share on other sites

Flash helps out because there's generally no need to detect the platform. The Flash Player is now distributed by Adobe (formerly Macromedia), and allows browsers on a pretty wide range of platforms to play Flash content. Websites like Google Video and Youtube use the Flash player to stream movies to help ensure that they reach the largest audience. Forgive me if I sound like a marketing droid at this point, but I work for a company that does a lot of Flash development. We have pieces that will run on any PC, laptop, Mac, PDA, etc. Before Macromedia was bought by Adobe, Macromedia was claiming up to 98% of computers had the Flash player installed, which beats out anything like Windows Media Player or Real Player.I think your best bet is the Sourceforge link I posted. With that Flash movie (all Flash applications are essentially "movies"), you can include it on your page and just tell it the URL of your playlist to load. It will appear on your page and it will look for the playlist you send it and load those songs or clips to play.From the Sourceforge site, this is what the code looks like to embed the player (notice the URL of the player is on the Sourceforge server):<object type="application/x-shockwave-flash" width="400" height="170"data="http://musicplayer.sourceforge.net/xspf_player.swf?playlist_url=http://yourdomain.com/yourplaylistlist.xspf"><param name="movie" value="http://musicplayer.sourceforge.net/xspf_player.swf?playlist_url=http://yourdomain.com/yourplaylistlist.xspf" /></object>The parts in bold you can change to change the size that the controls appear on your page, and the URL of the playlist you want to load. You can also use it to play a single file instead of a playlist, and you can change the title on the player, set it to autoload, autoplay, etc. The full list of parameters is on the Sourceforge site.To set it up, you need to download the swf file (the music player itself) from here:http://musicplayer.sourceforge.net/#downloadThe swf you need to put on your server, maybe in the same location as your other pages or songs. Then in the code posted above, replace the URL of the player:http://musicplayer.sourceforge.net/xspf_player.swfWith the URL to the swf file on your server.The playlist itself is an XML file, and looks like this:

<?xml version="1.0" encoding="UTF-8"?><playlist version="0" xmlns = "http://xspf.org/ns/0/">  <trackList>   <track>	<location>http://www.name.com/folder/song.mp3</location>	<image>http://www.name.com/folder/picture.jpg</image>	<annotation>Text to be displayed</annotation>   </track>   <track>	<location>http://www.name.com/folder/song2.mp3</location>	<image>http://www.name.com/folder/picture2.jpg</image>	<annotation>Text to be displayed</annotation>   </track>  </trackList></playlist>

Each of those <track></track> tags is one track, where you specify the path to the MP3 file, the path to a jpg image (to display while the track is playing), and some text to display for the track. You save that playlist as a .xspf file, and that xspf file is what you give to the player to load.There are more details and instructions about how to create the playlist and embed it in your page here:http://www.ic.sunysb.edu/stu/ahanley/music/help.htmIt's a little bit of work to get set up, but it will probably give you the widest audience of users.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...