TalkPHP

TalkPHP (http://www.talkphp.com/forums.php)
-   General (http://www.talkphp.com/general/)
-   -   Music Player (http://www.talkphp.com/general/3900-music-player.html)

KingOfTheSouth 01-21-2009 01:33 AM

Music Player
 
Hey everyone I am back:-) I have been working on a artist website I did it all from scratch also:-P But now I have run into a problem... I want to add a music player with the artists music I have never done anything like this before so I have no idea where to begin so I came to some people with knowledge... I would like it to be where when you click on a different link that goes into the site to where the song does not change... Does anyone have any ideas for me?

xenon 01-21-2009 08:53 AM

Well, the playlist of the music player (or a single song at a time) is loaded by passing the URL to the song to the player, using PHP or a similar server-side technology. If that's the case, then you can easily store the currently playing song URL into a session or a cookie variable and load that if it's set.

Wildhoney 01-21-2009 12:59 PM

It is actually easy to do since JavaScript can interact with Flash. You simply add an onclick to each link with the path to the music files, and then pass that to the Flash player when the user clicks it. The Flash should be constantly aware that the track can change at any moment.

buildakicker 01-21-2009 04:22 PM

A great player with tons of functionality is the JW Player. You can find it here: http://www.longtailvideo.com/. I've used it now and again.

KingOfTheSouth 01-21-2009 06:08 PM

Thanks, But I got the files and everything. But the problem now here is I do not know how to add the music. Also I do not know how to get it to show up

KingOfTheSouth 01-23-2009 01:37 AM

Ok I got it all up. Can someone help me make it automatically play please? Here is the code.

Code:

<div name="mediaspace" id="mediaspace"><!--player and image for lucky 7's demo  ... song rims spin --></div>
<script type='text/javascript' src="silverlight.js"></script>
<script type='text/javascript' src="wmvplayer.js"></script>
<script type="text/javascript">
var cnt = document.getElementById("mediaspace");
var src = 'wmvplayer.xaml';
var cfg = {
file:'swf_files/RimsSpin.mp3',
image:'swf_files/Lucky.jpg',
height:'240',
width:'440'
};
var ply = new jeroenwijering.Player(cnt,src,cfg);
</script>



All times are GMT. The time now is 10:55 AM.

Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0