Jump to content

Audio starts playing then stops


The Little Guy

Recommended Posts

I am trying to build an Html 5 / JavaScript audio player, and I can not figure out why when I press play it starts playing, then press stop and it stops, but when I press play again it plays for a few seconds then stops. Why?

 

Here is my click event:

$(".playPause").click(function(){
if(audio.paused){
	audio.play();
	$(this).css({
		backgroundPosition: "-30px -30px"
	});
}else{
	audio.pause();
	$(this).css({
		backgroundPosition: "-30px 0"
	});
}
return false;
});

 

Here is the example:

http://hostbox.us/apiTest.php

Link to comment
https://forums.phpfreaks.com/topic/258798-audio-starts-playing-then-stops/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.