The default bug view has changed. See this FAQ.

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

NEW
Unassigned

Status

()

Core
Widget
P4
normal
6 years ago
8 months ago

People

(Reporter: bbondy, Unassigned)

Tracking

Trunk
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

(Whiteboard: tpi:+)

(Reporter)

Description

6 years ago
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.
(Reporter)

Comment 2

6 years ago
> 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.
(Reporter)

Comment 4

6 years ago
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.
(Reporter)

Comment 6

6 years ago
> 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 :-).
(Reporter)

Comment 8

6 years ago
I set as low priority for now.
Severity: normal → trivial
(Reporter)

Comment 9

6 years ago
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 :)
(Reporter)

Comment 10

6 years ago
err p1 not normal
Severity: trivial → normal
Priority: -- → P1
(Reporter)

Updated

6 years ago
Priority: P1 → P3
(Reporter)

Updated

4 years ago
Assignee: netzen → nobody

Updated

8 months ago
Priority: P3 → P4

Updated

8 months ago
Whiteboard: tpi:+

Updated

8 months ago
Duplicate of this bug: 479822
You need to log in before you can comment on or make changes to this bug.