W3C home > Mailing lists > Public > public-media-capture@w3.org > May 2014

Re: [Bug 24015] Add callback to indicate when available media devices change

From: Adam Bergkvist <adam.bergkvist@ericsson.com>
Date: Wed, 21 May 2014 19:31:58 +0200
Message-ID: <537CE30E.1020903@ericsson.com>
To: Martin Thomson <martin.thomson@gmail.com>, Harald Alvestrand <harald@alvestrand.no>
CC: "public-media-capture@w3.org" <public-media-capture@w3.org>
On 2014-05-21 17:40, Martin Thomson wrote:
> On 21 May 2014 06:49, Harald Alvestrand <harald@alvestrand.no> wrote:
>> On 05/21/2014 09:29 AM, Adam Bergkvist wrote:
>>> On 2014-05-19 20:08, Martin Thomson wrote:
>>>> On 19 May 2014 09:24, Stefan HÃ¥kansson LK
>>>> <stefan.lk.hakansson@ericsson.com> wrote:
>>>>> On 2014-05-18 20:47, Harald Alvestrand wrote:
>>>>>> I'd like to have a real good story for why it shouldn't be an event
>>>>>> fired at some object before introducing a third pattern in this API.
>>>>>
>>>>> The story would be precedence - watchPosition works this way. I don't
>>>>> know if that is a real good story or not!
>>>>
>>>> watchPosition sets a bad precedent.  I prefer using events.
>>>>
>>>
>>> I would prefer an event as well. The question is what object should be
>>> the corresponding EventTarget.
>>>
>>> I don't see that FF or Chrome have the
>>> navigator.<prefix>getMediaDevices() function yet. It would be nice to
>>> have some object on navigator where we could isolate our new stuff
>>> which also could be our EventTarget.
>>>
>>> navigator.userMedia.getMediaDevices(...);
>>>
>>> navigator.userMedia.ondevice = function (evt) { ... };
>>
>> I like that. <bikeshed>Perhaps call it deviceManager?</bikeshed>
>>
>> Can you flush it into a complete proposal (WebIDL)?
>
>
> partial interface Navigator {
>    void getUserMedia(MediaConstraints c, Callback success, Callback
> fail); // legacy cruft
>    attribute DeviceManager deviceManager;
> };
>
> interface DeviceManager {
>    attribute SupportedConstraints supportedConstraints;
>    void getUserMedia(MediaConstraints c, Callback success, Callback fail);
>    sequence<DeviceInfo> enumerateDevices(); // or whatever it's called
>    attribute EventHandler? ondevicechange;
> };
>

I didn't dare to suggest to put gUM() in the new object as well, but I 
think that is something to pursue if possible (it's still prefxed).

/Adam
Received on Wednesday, 21 May 2014 17:32:24 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 16:26:27 UTC