[html5] r5968 - [giow] (0) Add the ability to encourage the user to pick a particular camera, wh [...]

whatwg at whatwg.org whatwg at whatwg.org
Mon Mar 28 18:01:37 PDT 2011


Author: ianh
Date: 2011-03-28 18:01:36 -0700 (Mon, 28 Mar 2011)
New Revision: 5968

Modified:
   complete.html
   index
   source
Log:
[giow] (0) Add the ability to encourage the user to pick a particular camera, when a device has multiple cameras (e.g. phones with front and rear cameras)

Modified: complete.html
===================================================================
--- complete.html	2011-03-28 23:58:04 UTC (rev 5967)
+++ complete.html	2011-03-29 01:01:36 UTC (rev 5968)
@@ -239,7 +239,7 @@
 
   <header class=head id=head><p><a class=logo href=http://www.whatwg.org/ rel=home><img alt=WHATWG height=101 src=/images/logo width=101></a></p>
    <hgroup><h1>Web Applications 1.0</h1>
-    <h2 class="no-num no-toc">Living Standard — Last Updated 28 March 2011</h2>
+    <h2 class="no-num no-toc">Living Standard — Last Updated 29 March 2011</h2>
    </hgroup><p>You can take part in this work. <a href=http://www.whatwg.org/mailing-list>Join the working group's discussion list.</a></p>
    <p><strong>Web designers!</strong> We have a <a href=http://blog.whatwg.org/faq/>FAQ</a>, a <a href=http://forums.whatwg.org/>forum</a>, and a <a href=http://www.whatwg.org/mailing-list#help>help mailing list</a> for you!</p>
    <!--<p class="impl"><strong>Implementors!</strong> We have a <a href="http://www.whatwg.org/mailing-list#implementors">mailing list</a> for you too!</p>-->
@@ -71894,7 +71894,9 @@
     video or audio input.</p>
 
     <p>The <var title="">options</var> argument is a string of
-    comma-separated values from the following list:</p>
+    comma-separated values, each of which is itself a space-separated
+    list of tokens, the first token of which is from the following
+    list:</p>
 
     <dl><dt>"<code title="">audio</code>"</dt>
 
@@ -71903,7 +71905,9 @@
 
      <dt>"<code title="">video</code>"</dt>
 
-     <dd>The provided media needs to include video data.</dd>
+     <dd>The provided media needs to include video data. The token can
+     be followed by the tokens "<code title="">user</code>" or "<code title="">environment</code>" to indicate the preferred cameras to
+     use.</dd>
 
 
     </dl><p>If the user accepts, the <var title="">successCallback</var> is
@@ -71947,16 +71951,47 @@
    exception here, or for /options/ below, without changing the
    algorithm) -->
 
+   <li><p>Let <var title="">audio</var> be false.</li>
+
+   <li><p>Let <var title="">video</var> be false.</li>
+
+   <li><p>Let <var title="">camera preference</var> be the empty
+   set.</li>
+
    <li><p><a href=#split-a-string-on-commas title="split a string on commas">Split <var title="">options</var> on commas</a> to obtain <var title="">list of options</var>.</li>
 
-   <li><p>If one of the tokens in <var title="">list of options</var>
-   is a <a href=#case-sensitive>case-sensitive</a> match for the string "<code title="">audio</code>", let <var title="">audio</var> be true.
-   Otherwise, let it be false.</li>
+   <li>
 
-   <li><p>If one of the tokens in <var title="">list of options</var>
-   is a <a href=#case-sensitive>case-sensitive</a> match for the string "<code title="">video</code>", let <var title="">video</var> be true.
-   Otherwise, let it be false.</li>
+    <p>For each string <var title="">option</var> in <var title="">list of options</var>, run the following substeps:</p>
 
+    <ol><li><p><a href=#split-a-string-on-spaces title="split a string on spaces">Split <var title="">option</var> on spaces</a> to obtain <var title="">list of suboptions</var>.</li>
+
+     <li><p>If the first token in <var title="">list of
+     suboptions</var> is a <a href=#case-sensitive>case-sensitive</a> match for the
+     string "<code title="">audio</code>", let <var title="">audio</var> be true.</li>
+
+     <li><p>If the first token in <var title="">list of
+     suboptions</var> is a <a href=#case-sensitive>case-sensitive</a> match for the
+     string "<code title="">video</code>", run these subsubsteps:</p>
+
+      <ol><li><p>Let <var title="">video</var> be true.</li>
+
+       <li><p>If <var title="">list of suboptions</var> contains a
+       token that is a <a href=#case-sensitive>case-sensitive</a> match for the
+       string "<code title="">user</code>", add any cameras that face
+       towards the user to the <var title="">camera preference</var>
+       set.</li>
+
+       <li><p>If <var title="">list of suboptions</var> contains a
+       token that is a <a href=#case-sensitive>case-sensitive</a> match for the
+       string "<code title="">environment</code>", add any cameras
+       that face away from the user to the <var title="">camera
+       preference</var> set.</li>
+
+      </ol></li>
+
+    </ol></li>
+
    <!-- any error handling for /options/ should be done here (that's
    why the method doesn't return until the next step: so we can add
    exception throwing here) -->
@@ -71990,6 +72025,9 @@
     users to use any media source, including pre-recorded media
     files.</p>
 
+    <p>If <var title="">video</var> is true, then the user agent
+    should encourage the user to provide a camera from the <var title="">camera preference</var> set.</p>
+
     <p>If the user grants permission to use local recording devices,
     user agents are encouraged to include a prominent indicator that
     the devices are "hot" (i.e. an "on-air" or "recording"
@@ -72053,7 +72091,7 @@
 
    <pre><script>
  function beginCall() {
-   navigator.getUserMedia('audio,video', gotStream);
+   navigator.getUserMedia('audio,video user', gotStream);
  }
  function gotStream(stream) {
    // ... use 'stream' ...
@@ -72490,7 +72528,7 @@
   <p><input type=button value="&#x1F4F7;" onclick="snapshot()">
  </section>
  <script>
-  navigator.getUserMedia('video', gotStream, noStream);
+  navigator.getUserMedia('video user', gotStream, noStream);
   var video = document.getElementById('monitor');
   var canvas = document.getElementById('photo');
   function gotStream(stream) {

Modified: index
===================================================================
--- index	2011-03-28 23:58:04 UTC (rev 5967)
+++ index	2011-03-29 01:01:36 UTC (rev 5968)
@@ -243,7 +243,7 @@
 
   <header class=head id=head><p><a class=logo href=http://www.whatwg.org/ rel=home><img alt=WHATWG height=101 src=/images/logo width=101></a></p>
    <hgroup><h1 class=allcaps>HTML</h1>
-    <h2 class="no-num no-toc">Living Standard — Last Updated 28 March 2011</h2>
+    <h2 class="no-num no-toc">Living Standard — Last Updated 29 March 2011</h2>
    </hgroup><p>You can take part in this work. <a href=http://www.whatwg.org/mailing-list>Join the working group's discussion list.</a></p>
    <p><strong>Web designers!</strong> We have a <a href=http://blog.whatwg.org/faq/>FAQ</a>, a <a href=http://forums.whatwg.org/>forum</a>, and a <a href=http://www.whatwg.org/mailing-list#help>help mailing list</a> for you!</p>
    <!--<p class="impl"><strong>Implementors!</strong> We have a <a href="http://www.whatwg.org/mailing-list#implementors">mailing list</a> for you too!</p>-->
@@ -71900,7 +71900,9 @@
     video or audio input.</p>
 
     <p>The <var title="">options</var> argument is a string of
-    comma-separated values from the following list:</p>
+    comma-separated values, each of which is itself a space-separated
+    list of tokens, the first token of which is from the following
+    list:</p>
 
     <dl><dt>"<code title="">audio</code>"</dt>
 
@@ -71909,7 +71911,9 @@
 
      <dt>"<code title="">video</code>"</dt>
 
-     <dd>The provided media needs to include video data.</dd>
+     <dd>The provided media needs to include video data. The token can
+     be followed by the tokens "<code title="">user</code>" or "<code title="">environment</code>" to indicate the preferred cameras to
+     use.</dd>
 
 
     </dl><p>If the user accepts, the <var title="">successCallback</var> is
@@ -71953,16 +71957,47 @@
    exception here, or for /options/ below, without changing the
    algorithm) -->
 
+   <li><p>Let <var title="">audio</var> be false.</li>
+
+   <li><p>Let <var title="">video</var> be false.</li>
+
+   <li><p>Let <var title="">camera preference</var> be the empty
+   set.</li>
+
    <li><p><a href=#split-a-string-on-commas title="split a string on commas">Split <var title="">options</var> on commas</a> to obtain <var title="">list of options</var>.</li>
 
-   <li><p>If one of the tokens in <var title="">list of options</var>
-   is a <a href=#case-sensitive>case-sensitive</a> match for the string "<code title="">audio</code>", let <var title="">audio</var> be true.
-   Otherwise, let it be false.</li>
+   <li>
 
-   <li><p>If one of the tokens in <var title="">list of options</var>
-   is a <a href=#case-sensitive>case-sensitive</a> match for the string "<code title="">video</code>", let <var title="">video</var> be true.
-   Otherwise, let it be false.</li>
+    <p>For each string <var title="">option</var> in <var title="">list of options</var>, run the following substeps:</p>
 
+    <ol><li><p><a href=#split-a-string-on-spaces title="split a string on spaces">Split <var title="">option</var> on spaces</a> to obtain <var title="">list of suboptions</var>.</li>
+
+     <li><p>If the first token in <var title="">list of
+     suboptions</var> is a <a href=#case-sensitive>case-sensitive</a> match for the
+     string "<code title="">audio</code>", let <var title="">audio</var> be true.</li>
+
+     <li><p>If the first token in <var title="">list of
+     suboptions</var> is a <a href=#case-sensitive>case-sensitive</a> match for the
+     string "<code title="">video</code>", run these subsubsteps:</p>
+
+      <ol><li><p>Let <var title="">video</var> be true.</li>
+
+       <li><p>If <var title="">list of suboptions</var> contains a
+       token that is a <a href=#case-sensitive>case-sensitive</a> match for the
+       string "<code title="">user</code>", add any cameras that face
+       towards the user to the <var title="">camera preference</var>
+       set.</li>
+
+       <li><p>If <var title="">list of suboptions</var> contains a
+       token that is a <a href=#case-sensitive>case-sensitive</a> match for the
+       string "<code title="">environment</code>", add any cameras
+       that face away from the user to the <var title="">camera
+       preference</var> set.</li>
+
+      </ol></li>
+
+    </ol></li>
+
    <!-- any error handling for /options/ should be done here (that's
    why the method doesn't return until the next step: so we can add
    exception throwing here) -->
@@ -71996,6 +72031,9 @@
     users to use any media source, including pre-recorded media
     files.</p>
 
+    <p>If <var title="">video</var> is true, then the user agent
+    should encourage the user to provide a camera from the <var title="">camera preference</var> set.</p>
+
     <p>If the user grants permission to use local recording devices,
     user agents are encouraged to include a prominent indicator that
     the devices are "hot" (i.e. an "on-air" or "recording"
@@ -72059,7 +72097,7 @@
 
    <pre><script>
  function beginCall() {
-   navigator.getUserMedia('audio,video', gotStream);
+   navigator.getUserMedia('audio,video user', gotStream);
  }
  function gotStream(stream) {
    // ... use 'stream' ...
@@ -72496,7 +72534,7 @@
   <p><input type=button value="&#x1F4F7;" onclick="snapshot()">
  </section>
  <script>
-  navigator.getUserMedia('video', gotStream, noStream);
+  navigator.getUserMedia('video user', gotStream, noStream);
   var video = document.getElementById('monitor');
   var canvas = document.getElementById('photo');
   function gotStream(stream) {

Modified: source
===================================================================
--- source	2011-03-28 23:58:04 UTC (rev 5967)
+++ source	2011-03-29 01:01:36 UTC (rev 5968)
@@ -81951,7 +81951,9 @@
     video or audio input.</p>
 
     <p>The <var title="">options</var> argument is a string of
-    comma-separated values from the following list:</p>
+    comma-separated values, each of which is itself a space-separated
+    list of tokens, the first token of which is from the following
+    list:</p>
 
     <dl>
 
@@ -81963,7 +81965,10 @@
 
      <dt>"<code title="">video</code>"</dt>
 
-     <dd>The provided media needs to include video data.</dd>
+     <dd>The provided media needs to include video data. The token can
+     be followed by the tokens "<code title="">user</code>" or "<code
+     title="">environment</code>" to indicate the preferred cameras to
+     use.</dd>
 
 
     </dl>
@@ -82015,20 +82020,61 @@
    exception here, or for /options/ below, without changing the
    algorithm) -->
 
+   <li><p>Let <var title="">audio</var> be false.</p></li>
+
+   <li><p>Let <var title="">video</var> be false.</p></li>
+
+   <li><p>Let <var title="">camera preference</var> be the empty
+   set.</p></li>
+
    <li><p><span title="split a string on commas">Split <var
    title="">options</var> on commas</span> to obtain <var
    title="">list of options</var>.</p></li>
 
-   <li><p>If one of the tokens in <var title="">list of options</var>
-   is a <span>case-sensitive</span> match for the string "<code
-   title="">audio</code>", let <var title="">audio</var> be true.
-   Otherwise, let it be false.</p></li>
+   <li>
 
-   <li><p>If one of the tokens in <var title="">list of options</var>
-   is a <span>case-sensitive</span> match for the string "<code
-   title="">video</code>", let <var title="">video</var> be true.
-   Otherwise, let it be false.</p></li>
+    <p>For each string <var title="">option</var> in <var
+    title="">list of options</var>, run the following substeps:</p>
 
+    <ol>
+
+     <li><p><span title="split a string on spaces">Split <var
+     title="">option</var> on spaces</span> to obtain <var
+     title="">list of suboptions</var>.</p></li>
+
+     <li><p>If the first token in <var title="">list of
+     suboptions</var> is a <span>case-sensitive</span> match for the
+     string "<code title="">audio</code>", let <var
+     title="">audio</var> be true.</p></li>
+
+     <li><p>If the first token in <var title="">list of
+     suboptions</var> is a <span>case-sensitive</span> match for the
+     string "<code title="">video</code>", run these subsubsteps:</p>
+
+      <ol>
+
+       <li><p>Let <var title="">video</var> be true.</li>
+
+       <li><p>If <var title="">list of suboptions</var> contains a
+       token that is a <span>case-sensitive</span> match for the
+       string "<code title="">user</code>", add any cameras that face
+       towards the user to the <var title="">camera preference</var>
+       set.</p></li>
+
+       <li><p>If <var title="">list of suboptions</var> contains a
+       token that is a <span>case-sensitive</span> match for the
+       string "<code title="">environment</code>", add any cameras
+       that face away from the user to the <var title="">camera
+       preference</var> set.</p></li>
+
+      </ol>
+
+     </li>
+
+    </ol>
+
+   </li>
+
    <!-- any error handling for /options/ should be done here (that's
    why the method doesn't return until the next step: so we can add
    exception throwing here) -->
@@ -82062,6 +82108,10 @@
     users to use any media source, including pre-recorded media
     files.</p>
 
+    <p>If <var title="">video</var> is true, then the user agent
+    should encourage the user to provide a camera from the <var
+    title="">camera preference</var> set.</p>
+
     <p>If the user grants permission to use local recording devices,
     user agents are encouraged to include a prominent indicator that
     the devices are "hot" (i.e. an "on-air" or "recording"
@@ -82138,7 +82188,7 @@
 
    <pre><script>
  function beginCall() {
-   navigator.getUserMedia('audio,video', gotStream);
+   navigator.getUserMedia('audio,video user', gotStream);
  }
  function gotStream(stream) {
    // ... use 'stream' ...
@@ -82644,7 +82694,7 @@
   <p><input type=button value="&#x1F4F7;" onclick="snapshot()">
  </section>
  <script>
-  navigator.getUserMedia('video', gotStream, noStream);
+  navigator.getUserMedia('video user', gotStream, noStream);
   var video = document.getElementById('monitor');
   var canvas = document.getElementById('photo');
   function gotStream(stream) {




More information about the Commit-Watchers mailing list