Open Bug 683263 Opened 14 years ago Updated 2 years ago

Deprecate nsISound::Play() or use media code for implementation

Categories

(Core :: Widget, defect, P4)

defect

Tracking

()

People

(Reporter: bbondy, Unassigned)

References

Details

(Whiteboard: tpi:+)

There's no good reason (that I know of) that we use /Widget code per platform for: var sound = Components.classes["@mozilla.org/sound;1"] .createInstance(Components .interfaces.nsISound); var uri = Components.classes["@mozilla.org/network/io-service;1"] .getService(Components.interfaces.nsIIOService) .newURI("file:///C:/hello.wav", null, null); sound.play(uri); Yet we use /media/libsydneyaudio (or soon to be libcubeb via Bug 623444) for: var snd = new Audio("c:\\hello.wav"); snd.play(); We should either deprecate nsISound::Play() or reimplement nsSound::Play() to use libcubeb. Or perhaps do both so that backwards compatibility is not broken.
If we do the former I think there's not much point in doing the latter. The only reason to use nsISound::Play is if you don't have a document/window available, e.g. if you're a JS module perhaps.
> If we do the former I think there's not much point in doing the latter. Is your preference to deprecate? > The only reason to use nsISound::Play is if you don't have a document/window available, e.g. if you're a JS module perhaps. Ah ok.
(In reply to Brian R. Bondy [:bbondy] from comment #2) > > If we do the former I think there's not much point in doing the latter. > > Is your preference to deprecate? I think so. I'd like to get rid of it eventually although that might be hard if extensions use it. Certainly, getting rid of its usage in our own products would be good.
So for this bug, does this sound right? - Get rid of our uses of in mozilla-central and comm-central if any - Update documentation to say deprecated as of Gecko 9 (even know it will still be available). Mention using a Audio element as well. - Possibly add some kind of deprecated warning at compile time for each implementation of nsISound::Play
That all sounds good to me. I wouldn't object to additional work to make nsISound::Play be cross-platform code using libcubeb. But I wouldn't prioritize it either.
> I wouldn't object to additional work to make nsISound::Play be cross-platform code using libcubeb Just to make sure I understand fully, from Comment 2: <strike>If we do the former I think there's not much point in doing the latter.</strike> ?
I'm just vacillating on whether it's worth doing at all :-).
I set as low priority for now.
Severity: normal → trivial
Unless you didn't mean that for the whole task, and just for the libcubeb part. If that's the case please put back to normal :)
err p1 not normal
Severity: trivial → normal
Priority: -- → P1
Priority: P1 → P3
Assignee: netzen → nobody
Priority: P3 → P4
Whiteboard: tpi:+
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.