<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://www.w3.org/Bugs/Public/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4"
          urlbase="https://www.w3.org/Bugs/Public/"
          
          maintainer="sysbot+bugzilla@w3.org"
>

    <bug>
          <bug_id>23128</bug_id>
          
          <creation_ts>2013-09-02 15:24:14 +0000</creation_ts>
          <short_desc>Add an explicit &quot;get access to media&quot; call</short_desc>
          <delta_ts>2013-09-17 13:27:21 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebRTC Working Group</product>
          <component>Media Capture and Streams</component>
          <version>unspecified</version>
          <rep_platform>PC</rep_platform>
          <op_sys>Linux</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>WONTFIX</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Harald Alvestrand">harald</reporter>
          <assigned_to name="public-media-capture@w3.org">public-media-capture</assigned_to>
          <cc>annevk</cc>
    
    <cc>public-media-capture</cc>
    
    <cc>stefan.lk.hakansson</cc>
          
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>92827</commentid>
    <comment_count>0</comment_count>
    <who name="Harald Alvestrand">harald</who>
    <bug_when>2013-09-02 15:24:14 +0000</bug_when>
    <thetext>One of the problems with the current method of getting access to media
is that it occurs as a side effect of a call done for other purposes
(GetUserMedia).

The parameters for this aren&apos;t ideal to determine the full range of
permissions that a page would want - for instance, a page might first
open a video device, and later open an audio device separately; in our
current models, that would give 2 permissions prompts.

Instead of doing it this way, we could make an explicit call:

void GetMediaPermissions(Permissions permissions,
                            successCallback, errorCallback)

Permissions = enum(
  &quot;videoInputDevices&quot;,
  &quot;audioInputDevices&quot;,
  // and maybe extend this to
  &quot;deviceEnumeration&quot;,
  &quot;screenCapture&quot;,
  &quot;windowCapture&quot;,
  ....
)

The UA could then use the list of permissions requested to construct an
appropriate UI element for asking permission from the user (or use a
stored permissions model to grant access immediately, if that&apos;s the
Right Thing).
In any case, all programs that know what class of permissions they want
can get those permissions with one call, one prompt, no matter what they
do later.

For backwards compatibility, getUserMedia would be documented to have an
implicit call to GetMediaPermissions &quot;behind the curtains&quot;.

An earlier attempt was http://dev.w3.org/2009/dap/perms/FeaturePermissions.html - an important difference between that and this proposal is that this proposal explicitly states that one can ask for a set of features, not just one at a time, and that user prompts (and therefore reasonably long delays) are to be expected.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>93086</commentid>
    <comment_count>1</comment_count>
    <who name="Harald Alvestrand">harald</who>
    <bug_when>2013-09-06 09:03:32 +0000</bug_when>
    <thetext>Proposed IDL, based on the DAP IDL:

Navigator implements NavigatorDevicePermissions;

[NoInterfaceObject]
interface NavigatorDevicePermissions {
    DevicePermissionLevel devicePermissionLevel (in DOMString feature);
    void requestDevicePermission (in sequence&lt;DOMString&gt; features,
                            in Function success, in Function failure);
    attribute DOMString[] devicePermissionsImplemented;
};

enum DevicePermissionLevel {
  &quot;UserAllowed&quot;,
  &quot;DefaultAllowed&quot;,
  &quot;UserDenied&quot;,
  &quot;DefaultDenied&quot;
};

// Permissions must be valid members of DevicePermissionNames
// or a subtype that extends it.
enum DevicePermissionNames {
  &quot;videoInputDevices&quot;,
  &quot;audioInputDevices&quot;,
  &quot;inputDeviceLabels&quot;,
  &quot;outputDeviceLabels&quot;,
  &quot;screenCapture&quot;,
  &quot;windowCapture&quot;
}</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>93090</commentid>
    <comment_count>2</comment_count>
    <who name="Anne">annevk</who>
    <bug_when>2013-09-06 10:56:28 +0000</bug_when>
    <thetext>Please see http://notifications.spec.whatwg.org/#dom-notification-requestpermission and in particular http://robert.ocallahan.org/2011/06/permissions-for-web-applications_30.html

There&apos;s good reasons why we abandoned this path. Flash tried to do this, Java tried, both are not very successful at conveying to the user what&apos;s going on.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>93483</commentid>
    <comment_count>3</comment_count>
    <who name="Stefan Hakansson LK">stefan.lk.hakansson</who>
    <bug_when>2013-09-17 13:27:21 +0000</bug_when>
    <thetext>I could not see any consensus for this change, so I&apos;m resolving this bug as WONTFIX.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>