mazazino Posted August 13, 2007 Share Posted August 13, 2007 I have this code that plays songs online (streaming)..but it doesn't play .mp3 files..so can anyone help me get a music player for streaming mp3 files? <script type="text/javascript"> function PlayerOpen(soundfiledesc,soundfilepath) { PlayWin = window.open('','','width=550,height=150,top=25,left=250,resizable=0,scrollbars=0,titlebar=0,toolbar=0,menubar=0,status=0,directories=0,personalbar=0'); PlayWin.focus(); var winContent = "<HTML><HEAD><TITLE>" + soundfiledesc + "</TITLE><LINK rel='stylesheet' type='text/css' name='style1' href='/styles/media_player.css'></HEAD><BODY bgcolor='#ffffff'><center>"; winContent += "<div style='font-size:11px; font-weight:bold; font-family:Verdana,sans-serif;line-height:1.5'>" + soundfiledesc + "</div>"; winContent += "<OBJECT width='300' height='42'>"; winContent += "<param name='SRC' value='" + soundfilepath + "'>"; winContent += "<param name='AUTOPLAY' VALUE='true'>"; winContent += "<param name='CONTROLLER' VALUE='true'>"; winContent += "<param name='BGCOLOR' VALUE='#FF9900'>"; winContent += "<EMBED TYPE='application/x-mplayer2' pluginspage='http://www.microsoft.com/isapi/redir.dll?prd=windows&sbp=mediaplayer&ar=Media&sba=Plugin&' SRC='" + soundfilepath + "' AUTOSTART='TRUE' LOOP='FALSE' WIDTH='375' HEIGHT='42' CONTROLLER='TRUE' BGCOLOR='#e0e0e0'></EMBED>"; winContent += "</OBJECT>"; winContent += "<p style='font-size:12px;font-family:Verdana,sans-serif;text-align:center'><a href='" + soundfilepath +"'>Right-Click to Download</a></p>"; winContent += "<FORM><DIV align='center'><INPUT type='button' value='Close this window' onclick='javascript:window.close();'></DIV></FORM>"; winContent += "</center></BODY></HTML>"; PlayWin.document.write(winContent); } </script> Quote Link to comment Share on other sites More sharing options...
NArc0t1c Posted August 13, 2007 Share Posted August 13, 2007 This isn't PHP. Try the Javascript section. Quote Link to comment Share on other sites More sharing options...
php_tom Posted August 13, 2007 Share Posted August 13, 2007 Hey have you tried XSPF player http://musicplayer.sourceforge.net/? It's done in flash, but you can make your own playlists (using the XSPF paylist format http://www.xspf.org/) and embed it in a webpage. Maybe this will help you. I thought about using it for my band's website but it only deals with mp3s which is fine for you but we had some legal reasons for not wanting that... Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.