[Webkit-unassigned] [Bug 40266] New: Audio src cannot be changed in javascript

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Mon Jun 7 14:25:42 PDT 2010


https://bugs.webkit.org/show_bug.cgi?id=40266

           Summary: Audio src cannot be changed in javascript
           Product: WebKit
           Version: 420+
          Platform: PC
        OS/Version: Windows XP
            Status: UNCONFIRMED
          Severity: Normal
          Priority: P2
         Component: JavaScriptGlue
        AssignedTo: webkit-unassigned at lists.webkit.org
        ReportedBy: migrigaut at gmail.com


Component : no idea
Chrome version : 5.0.375.55

Hi,
Thank you for you great work.

I am making games and I need to play several short sounds.
I first try with :
<audio id="audiochrome">
</audio>

And in the javascript :

var mson=document.getElementById("audiochrome");
mson.src="somesound.ogg"
mson.play();

This works fine the first time, but if I call it again :

var mson=document.getElementById("audiochrome");
mson.src="anothersound.ogg"
mson.play();

The first sound is played instead of "anothersound.ogg"


=========================================================
To workaround the problem, I then created an audio at each new sound :
 // Works on Mac also
 var mson=document.getElementById("audiochrome");
 if (mson) {
    document.body.removeChild(mson);
    // to be clean... 
 }
 mson=document.createElement("audio");
 mson.id="audiochrome";
 mson.src="sound1.ogg";
 document.body.appendChild(mson);

This works fine for exactly 50 times. After that it becomes silent. 
When I try to debug, sounds come back !

So Im stuck !

I would like to be able to say for my games :
"Sounds are supported with IE AND Chome !"
instead of
"Sounds are only supported with IE" ;-)

Is ther any other way ? (I use wav with IE)
Michel

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list