Does anyone know of a scriptable mp3 player similar to niftyplayer? niftyplayer does exactly what I need, but the code is old (2003) and seems broken. It had one flash .swf and a .js file with functions for controlling the player.
I am looking for an mp3 player where I could call functions such as play(), stop(), load(file.mp3), loadandp开发者_运维问答lay(file.mp3).
niftyplayer did this.
<a href="javascript:niftyplayer('niftyPlayer1').playToggle()">play toggle</a>
(or
<a href="javascript:niftyplayer('niftyPlayer1').play()">play</a>
|
<a href="javascript:niftyplayer('niftyPlayer1').pause()">pause</a>
)
<a href="javascript:niftyplayer('niftyPlayer1').stop()">stop</a>
<br />
<a href="javascript:niftyplayer('niftyPlayer1').load('betty.mp3')">load file 1</a>
|
<a href="javascript:niftyplayer('niftyPlayer1').load('creeeeak.mp3')">load file 2</a>
|
<a href="javascript:niftyplayer('niftyPlayer1').loadAndPlay('creeeeak.mp3')">load file 2 and play it</a>
Have you had a look at JPlayer? It can be used as an MP3 player, and is HTML5 compatible. Also, there are a bunch of methods for controlling it.
精彩评论