Last Comment Bug 683263 - Deprecate nsISound::Play() or use media code for implementation
: Deprecate nsISound::Play() or use media code for implementation
Status: NEW
tpi:+
:
Product: Core
Classification: Components
Component: Widget (show other bugs)
: Trunk
: All All
: P4 normal (vote)
: ---
Assigned To: Nobody; OK to take it and work on it
:
Mentors:
: 479822 (view as bug list)
Depends on: cubeb
Blocks:
  Show dependency treegraph
 
Reported: 2011-08-30 12:46 PDT by Brian R. Bondy [:bbondy]
Modified: 2016-07-20 12:58 PDT (History)
6 users (show)
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Attachments

Description Brian R. Bondy [:bbondy] 2011-08-30 12:46:09 PDT
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.
Comment 1 Robert O'Callahan (:roc) (Exited; email my personal email if necessary) 2011-08-30 13:04:49 PDT
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.
Comment 2 Brian R. Bondy [:bbondy] 2011-08-30 13:07:24 PDT
> 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.
Comment 3 Robert O'Callahan (:roc) (Exited; email my personal email if necessary) 2011-08-30 16:14:35 PDT
(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.
Comment 4 Brian R. Bondy [:bbondy] 2011-08-30 16:35:57 PDT
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
Comment 5 Robert O'Callahan (:roc) (Exited; email my personal email if necessary) 2011-08-30 16:46:01 PDT
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.
Comment 6 Brian R. Bondy [:bbondy] 2011-08-30 16:53:02 PDT
> 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> ?
Comment 7 Robert O'Callahan (:roc) (Exited; email my personal email if necessary) 2011-08-30 17:18:30 PDT
I'm just vacillating on whether it's worth doing at all :-).
Comment 8 Brian R. Bondy [:bbondy] 2011-08-30 18:29:26 PDT
I set as low priority for now.
Comment 9 Brian R. Bondy [:bbondy] 2011-08-30 18:30:20 PDT
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 :)
Comment 10 Brian R. Bondy [:bbondy] 2011-08-30 18:30:55 PDT
err p1 not normal
Comment 11 Jim Mathies [:jimm] 2016-07-20 12:58:27 PDT
*** Bug 479822 has been marked as a duplicate of this bug. ***

Note You need to log in before you can comment on or make changes to this bug.