I’m building a website with a music player, using an <audio> tag.
I’m using jQuery to make some basic operation like “pause” and “play”:
$("#music_player")[0].pause();
$("#music_player")[0].play();
In Chrome everything seems to be fine, but in Firefox it isn’t working.
Does somebody know what is the problem? Or what other commands in JavaScript can control the audio tag?
First of all I would suggest to follow this link: http://www.position-absolute.com/articles/introduction-to-the-html5-audio-tag-javascript-manipulation/
It give an example on how to use audio tag in html and manipulate it in javascript. If you see
Your browser does not support the audio tag.instead of an audio widget, thats because your firefox version doesn’t support HTML5 audio tag.