LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   Javascript Song (https://www.linuxquestions.org/questions/programming-9/javascript-song-423660/)

Cottsay 03-10-2006 06:19 PM

Javascript Song
 
I'm writing a script that controls embeded audio on a webpage...a playlist is provided...is there a way that I could display the name of the currently playing track? Really, all I need is something to happen when each song is over...like an event at the end of the song or something...any ideas?

Thanks,

Scott K Logan
logans@cottsay.net

archtoad6 03-23-2006 12:48 PM

Presumably you are you using some command to play each song, & presumably you are/can execute anew for each title. If you aren't using a loop already, would something like this work:

Code:

# pseudo code
for SONG in $PLAYLIST
do
  echo "Playing $SONG"
  _play_song $SONG
done

The above is bash-ish, but surely there is a loop structure in whatever you are using.

Cottsay 03-23-2006 02:45 PM

Yea I know what you mean - its just that there's now way of senseing when a song is through in javascript...is there?

AnanthaP 03-24-2006 10:01 PM

Hey man.

I didn't know that javascript can play songs (executables). (Just by having file:// url on a local drive?).

It should be possible to set the settings in the song playing executable to close on exit instead of rewinding and restarting.

Also, since it is browser based (javascript!?!?!) you could always open it in the same window and will this help?

End

Cottsay 03-25-2006 12:24 AM

I use the <embed> tag to get the music, but I know javascript can control the playback (play/pause) - I also know that you can embed a playlist file...now if I can just make something display what the current track is...

Thanks,

Scott


All times are GMT -5. The time now is 06:01 AM.