Closed
Bug 1391751
Opened 7 years ago
Closed 7 years ago
html5 audio tag not working with javascript
Categories
(Core :: Audio/Video: Playback, defect)
Core
Audio/Video: Playback
Tracking
()
RESOLVED
INVALID
People
(Reporter: ac_ytube, Unassigned)
References
Details
Attachments
(1 file)
651 bytes,
text/plain
|
Details |
User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:54.0) Gecko/20100101 Firefox/54.0
Build ID: 20170628075643
Steps to reproduce:
The code below (basically, click on a gif and play a sound) works in Safari, Opera and Seamonkey. It also worked in Firefox up to and including v50.
In versions 53-55, Firefox produces a white page displaying [object Promise].
I've run Firefox in Safe mode and with a new profile, but no joy.
Art Coughlin
----------------------
<!DOCTYPE html>
<html>
<body>
<audio id="myAudio">
<source src="Sitar.ogg" type="audio/ogg">
<source src="Sitar.mp3" type="audio/mpeg">
Your browser does not support the audio element.
</audio>
<A HREF="javascript:myAudio.play();"><IMG SRC="lamp.gif" ALT="Lamp"></A>
</body>
</html>
----------------------
Actual results:
white page displaying [object Promise]
Expected results:
Sound should play
Comment 1•7 years ago
|
||
The HTMLMediaElement.play() was changed according to spec.
See https://developer.mozilla.org/en-US/Firefox/Releases/53
and https://bugzilla.mozilla.org/show_bug.cgi?id=1244768
if you modify the code as follows, then it will be working again.
<A HREF="javascript:myAudio.play();void(0)"><IMG SRC="lamp.gif" ALT="Lamp"></A>
Status: UNCONFIRMED → RESOLVED
Closed: 7 years ago
Resolution: --- → INVALID
Reporter | ||
Comment 2•7 years ago
|
||
Thanks for the explanation and the solution, I really appreciate it.
Art
You need to log in
before you can comment on or make changes to this bug.
Description
•