Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Valid mozGetUserMedia parameters

396 views
Skip to first unread message

Henrik Skupin

unread,
Nov 30, 2012, 8:41:32 AM11/30/12
to mozilla-...@lists.mozilla.org
Hi all,

I wonder what are valid combinations for the media streams in the gUM
call. As given by Jasons QA feature page [1] there are a couple ones
which should call onError. But whatever I try here I never see onError
called.

Examples from that page are:

{picture: true, audio: true}
{picture: true, video: true}
{video: true, audio: true, picture: true}

Can someone please help out? As it seems like 'picture' is not a valid
media stream as given by the W3C docs, so is that something we
implemented on our own? Also I have seen 'camera' some time in the past.
Is that valid too? Which types of media streams do we actually support?

Thanks!

[1]
https://wiki.mozilla.org/Platform/Features/Camera_API_-_Phase_2_%28getUserMedia%29/Test_Plan#API_and_DOM_Test_Cases

--
Henrik

Henrik Skupin

unread,
Nov 30, 2012, 8:48:45 AM11/30/12
to mozilla-...@lists.mozilla.org, mozilla-...@lists.mozilla.org
Henrik Skupin wrote on 11/30/12 2:41 PM:

> {picture: true, audio: true}
> {picture: true, video: true}
> {video: true, audio: true, picture: true}

Also why does `mozGetUserMedia(1, function() {}, function() {}' throw
instead of calling the onErrorCallback as given by the spec? I haven't
tested yet how Chrome handles that but if we decide to take another
route as given by the spec we will indeed cause trouble by developers
who want to use this feature.

Also what is the reason why the onErrorCallback is mandatory in our
implementation while the spec says it's optional?

I would love if we can document anything we implement differently. If we
don't do this it will be hard for everyone to get started.

--
Henrik

Henrik Skupin

unread,
Nov 30, 2012, 8:48:45 AM11/30/12
to mozilla-...@lists.mozilla.org
Henrik Skupin wrote on 11/30/12 2:41 PM:

> {picture: true, audio: true}
> {picture: true, video: true}
> {video: true, audio: true, picture: true}

Eric Rescorla

unread,
Nov 30, 2012, 1:38:21 PM11/30/12
to Henrik Skupin, mozilla-...@lists.mozilla.org
On Fri, Nov 30, 2012 at 5:48 AM, Henrik Skupin <hsk...@gmail.com> wrote:

> Henrik Skupin wrote on 11/30/12 2:41 PM:
>
> > {picture: true, audio: true}
> > {picture: true, video: true}
> > {video: true, audio: true, picture: true}
>
> Also why does `mozGetUserMedia(1, function() {}, function() {}' throw
> instead of calling the onErrorCallback as given by the spec? I haven't
> tested yet how Chrome handles that but if we decide to take another
> route as given by the spec we will indeed cause trouble by developers
> who want to use this feature.


Actually, the WG isn't completely clear on this point. There is some
feeling that simple programming errors (like the one you illustrate
above) should just throw exceptions.




> Also what is the reason why the onErrorCallback is mandatory in our
> implementation while the spec says it's optional?
>

We decided to make it mandatory at the most recent TPAC. The
spec is out of date.



> I would love if we can document anything we implement differently. If we
> don't do this it will be hard for everyone to get started.


Why don't you record these issues somewhere and then when things
stabilize, we can figure out which ones are really variants and need
real documentation.

-Ekr


-Ekr

Henrik Skupin

unread,
Nov 30, 2012, 1:53:59 PM11/30/12
to Eric Rescorla, mozilla-...@lists.mozilla.org
Eric Rescorla wrote on 11/30/12 7:38 PM:

>> > {picture: true, audio: true}
>> > {picture: true, video: true}
>> > {video: true, audio: true, picture: true}
>>
>> Also why does `mozGetUserMedia(1, function() {}, function() {}' throw
>> instead of calling the onErrorCallback as given by the spec? I haven't
>> tested yet how Chrome handles that but if we decide to take another
>> route as given by the spec we will indeed cause trouble by developers
>> who want to use this feature.
>
> Actually, the WG isn't completely clear on this point. There is some
> feeling that simple programming errors (like the one you illustrate
> above) should just throw exceptions.

Ok, that makes sense but it doesn't answer the first half of my
question. So if your answer also belongs to the example objects above,
where can I find updated specs or actual discussions? Is there an email
list I should subscribe to read that stuff? When do we expect that the
spec gets updated? What is the turnaround for it?

IMO it makes the code kinda hard to maintain as long as `{picture: true,
video: true}` throws an exception. You will have a mixture of
understandable asynchronous code, but also a mess with try/catch
statements around.

>> Also what is the reason why the onErrorCallback is mandatory in our
>> implementation while the spec says it's optional?
>
> We decided to make it mandatory at the most recent TPAC. The
> spec is out of date.

Just out of interest, have there been taken any notes which are
available for the public? It looks like I miss a lot of information
before I can really qualify the webrtc code by writing mochitests for
gUM and pc.

>> I would love if we can document anything we implement differently. If we
>> don't do this it will be hard for everyone to get started.
>
> Why don't you record these issues somewhere and then when things
> stabilize, we can figure out which ones are really variants and need
> real documentation.

I see problems once we really open it up for developers in Firefox 20
builds. Fundamental things like the above mentioned issue should be
clear. Otherwise a lot of code would have to be updated/changed.

I can start such a list by asking all those questions step by step, but
I think that you and Randell have the most knowledge about differences
in our code to the spec which is currently available. That also includes
the above mentioned changes which haven't made it into the specs yet.

--
Henrik

Henrik Skupin

unread,
Nov 30, 2012, 1:53:59 PM11/30/12
to Eric Rescorla, mozilla-...@lists.mozilla.org
Eric Rescorla wrote on 11/30/12 7:38 PM:

>> > {picture: true, audio: true}
>> > {picture: true, video: true}
>> > {video: true, audio: true, picture: true}
>>
>> Also why does `mozGetUserMedia(1, function() {}, function() {}' throw
>> instead of calling the onErrorCallback as given by the spec? I haven't
>> tested yet how Chrome handles that but if we decide to take another
>> route as given by the spec we will indeed cause trouble by developers
>> who want to use this feature.
>
> Actually, the WG isn't completely clear on this point. There is some
> feeling that simple programming errors (like the one you illustrate
> above) should just throw exceptions.

Ok, that makes sense but it doesn't answer the first half of my
question. So if your answer also belongs to the example objects above,
where can I find updated specs or actual discussions? Is there an email
list I should subscribe to read that stuff? When do we expect that the
spec gets updated? What is the turnaround for it?

IMO it makes the code kinda hard to maintain as long as `{picture: true,
video: true}` throws an exception. You will have a mixture of
understandable asynchronous code, but also a mess with try/catch
statements around.

>> Also what is the reason why the onErrorCallback is mandatory in our
>> implementation while the spec says it's optional?
>
> We decided to make it mandatory at the most recent TPAC. The
> spec is out of date.

Just out of interest, have there been taken any notes which are
available for the public? It looks like I miss a lot of information
before I can really qualify the webrtc code by writing mochitests for
gUM and pc.

>> I would love if we can document anything we implement differently. If we
>> don't do this it will be hard for everyone to get started.
>
> Why don't you record these issues somewhere and then when things
> stabilize, we can figure out which ones are really variants and need
> real documentation.

Cullen Jennings (fluffy)

unread,
Dec 1, 2012, 9:10:17 AM12/1/12
to Henrik Skupin, Eric Rescorla, mozilla-...@lists.mozilla.org



> Ok, that makes sense but it doesn't answer the first half of my
> question. So if your answer also belongs to the example objects above,
> where can I find updated specs or actual discussions?

http://dev.w3.org/2011/webrtc/editor/webrtc.html

> Is there an email
> list I should subscribe to read that stuff?

http://lists.w3.org/Archives/Public/public-webrtc/

and

http://lists.w3.org/Archives/Public/public-media-capture/

> When do we expect that the
> spec gets updated?

The editors are a bit erratic - somewhere between say 1 day and 4 months but typically more like every month.


Henrik Skupin

unread,
Dec 1, 2012, 10:21:04 AM12/1/12
to Cullen Jennings (fluffy), Eric Rescorla, mozilla-...@lists.mozilla.org
Cullen Jennings (fluffy) wrote on 12/1/12 3:10 PM:

>> Ok, that makes sense but it doesn't answer the first half of my
>> question. So if your answer also belongs to the example objects above,
>> where can I find updated specs or actual discussions?
>
> http://dev.w3.org/2011/webrtc/editor/webrtc.html

Thanks but as it looks like nothing in this document describes the
behavior of getUserMedia, which I was asking for. But it has a lot of
helpful information. Thanks!

> http://lists.w3.org/Archives/Public/public-webrtc/
> http://lists.w3.org/Archives/Public/public-media-capture/

I will check both lists. Thanks a lot.

--
Henrik

Henrik Skupin

unread,
Dec 1, 2012, 10:21:04 AM12/1/12
to Cullen Jennings (fluffy), Eric Rescorla, mozilla-...@lists.mozilla.org
Cullen Jennings (fluffy) wrote on 12/1/12 3:10 PM:

>> Ok, that makes sense but it doesn't answer the first half of my
>> question. So if your answer also belongs to the example objects above,
>> where can I find updated specs or actual discussions?
>
> http://dev.w3.org/2011/webrtc/editor/webrtc.html

Robert O'Callahan

unread,
Dec 2, 2012, 4:35:34 PM12/2/12
to Henrik Skupin, mozilla-...@lists.mozilla.org
On Sat, Dec 1, 2012 at 2:48 AM, Henrik Skupin <hsk...@gmail.com> wrote:

> Also why does `mozGetUserMedia(1, function() {}, function() {}' throw
> instead of calling the onErrorCallback as given by the spec?
>

Because "1" is not a valid WebIDL dictionary and WebIDL says to throw in
that case.

I think it's better to keep things as they are than to call the error
callback in that case. We don't want to break consistency with WebIDL. That
would create confusion for authors and also be more difficult to implement.

Rob
--
Jesus called them together and said, “You know that the rulers of the
Gentiles lord it over them, and their high officials exercise authority
over them. Not so with you. Instead, whoever wants to become great among
you must be your servant, and whoever wants to be first must be your
slave — just
as the Son of Man did not come to be served, but to serve, and to give his
life as a ransom for many.” [Matthew 20:25-28]

Cullen Jennings (fluffy)

unread,
Dec 3, 2012, 4:13:46 PM12/3/12
to Henrik Skupin, Eric Rescorla, mozilla-...@lists.mozilla.org

On Dec 1, 2012, at 8:21 AM, Henrik Skupin <hsk...@gmail.com> wrote:

> Cullen Jennings (fluffy) wrote on 12/1/12 3:10 PM:
>
>>> Ok, that makes sense but it doesn't answer the first half of my
>>> question. So if your answer also belongs to the example objects above,
>>> where can I find updated specs or actual discussions?
>>
>> http://dev.w3.org/2011/webrtc/editor/webrtc.html
>

for GetUserMedia, the latest draft of the spec is at

http://dev.w3.org/2011/webrtc/editor/getusermedia.html


> Thanks but as it looks like nothing in this document describes the
> behavior of getUserMedia, which I was asking for. But it has a lot of
> helpful information. Thanks!
>
>> http://lists.w3.org/Archives/Public/public-webrtc/
>> http://lists.w3.org/Archives/Public/public-media-capture/
>
> I will check both lists. Thanks a lot.
>
> --
> Henrik
> _______________________________________________
> dev-media mailing list
> dev-...@lists.mozilla.org
> https://lists.mozilla.org/listinfo/dev-media

0 new messages