RE: Request for feedback: Media Capture and Streams Last Call

I like the idea of only persisting deviceIds after a site was granted permissions to use the track but I'm a little confused about the implication of the "ask" permission.

Consider the following flow:
enumerateDevices() => { device: id = 12345 type = videoinput }
getUserMedia({video: { deviceId: { exact: 12345 } }, user allows but doesn't want choice remembered => success, app stores deviceId to localStorage

Browser gets closed, in a new session, user visits site again, deviceId is saved in localStorage:
getUserMedia({video: { deviceId: { exact: 12345 } } => ?
enumerateDevices() => { device: id = ????? type = videoinput }

What is the behavior here?

To make sure the app can function properly, we need to persist deviceId if the site was ever granted permissions in the past, even if the user chose not to remember their choice. This seems detached from the current permissions possibilities of "ask / always / never", and wouldn't be surfaced in the UI. The user might not have a way to reset this either.

Or did I miss something?

Mathieu

> -----Original Message-----
> From: Jan-Ivar Bruaroey [mailto:jib@mozilla.com]
> Sent: Monday, July 06, 2015 1:51 PM
> To: Harald Alvestrand; public-media-capture@w3.org
> Subject: Re: Request for feedback: Media Capture and Streams Last Call
> 
> On 7/6/15 4:00 PM, Harald Alvestrand wrote:
> > I am somewhat confused by one thing, though....
> >
> > If I do:
> >
> >
> > enumerateDevices() => { device: id = 12345 type = videoinput }
> >
> > getUserMedia({video: { deviceId: { exact: 12345 } }
> >
> > enumerateDevices()
> >
> > am I guaranteed that the device with id 12345 in the second
> > enumerateDevices is the same device as the one I grabbed?
> 
> OK so we need to be clearer about what persisting means. I meant persist (to
> disk) across browser sessions, leaving deviceIds stable "for the current
> session", by which I meant browser session, i.e. until you quit the browser.
> 
> > I think it should be - that the getUserMedia() call has the effect of
> > freezing the previous ID assignment.
> 
> so this would work regardless of the outcome of the gUM call (I'm assuming
> you meant to wait for gUM to succeed?)
> 
> > But on the other hand:
> >
> > enumerateDevices() => { device: id = 12345 type = videoinput }
> > enumerateDevices() => { device: id = 2346 type = videoinput }
> > getUserMedia({video: { deviceId: { exact: 12345 } }
> >
> > would result in a failure of getUserMedia. Right?
> 
> No, as that's not what I had in mind with "current session".
> 
> .: Jan-Ivar :.
> 

Received on Tuesday, 7 July 2015 19:18:10 UTC