CVS 2011/webrtc/editor

Update of /sources/public/2011/webrtc/editor
In directory roscoe:/tmp/cvs-serv2380

Modified Files:
	getusermedia.js getusermedia.html 
Log Message:
Added 20130704 archived version.

--- /sources/public/2011/webrtc/editor/getusermedia.js	2013/05/29 21:06:26	1.13
+++ /sources/public/2011/webrtc/editor/getusermedia.js	2013/07/04 13:38:43	1.14
@@ -19,7 +19,7 @@
    // copyrightStart: "2005",
 
    // if there is a previously published draft, uncomment this and set its YYYY-MM-DD
-   prevED: "http://dev.w3.org/2011/webrtc/editor/archives/20130514/getusermedia.html",
+   prevED: "http://dev.w3.org/2011/webrtc/editor/archives/20130529/getusermedia.html",
 
    // if there a publicly available Editor's Draft, this is the link
    edDraftURI:           "http://dev.w3.org/2011/webrtc/editor/getusermedia.html",
--- /sources/public/2011/webrtc/editor/getusermedia.html	2013/05/29 21:04:54	1.20
+++ /sources/public/2011/webrtc/editor/getusermedia.html	2013/07/04 13:38:43	1.21
@@ -337,9 +337,8 @@
       <h2>MediaStream</h2>
 
       <p>The <dfn id="dom-mediastream"> <code>MediaStream()</code></dfn>
-      constructor composes a new stream out of existing tracks. It takes zero
-      or one argument. If the argument is supplied, it
-      MUST either be of type <code><a>MediaStream</a></code> or an array of
+      constructor composes a new stream out of existing tracks. It takes an
+      optional argument of type <code><a>MediaStream</a></code> or an array of
       <code><a>MediaStreamTrack</a></code> objects. When the constructor is
       invoked, the UA must run the following steps:</p>
 
@@ -641,7 +640,7 @@
             </ol>
         </dd>
 
-        <dt>attribute boolean ended</dt>
+        <dt>readonly attribute boolean ended</dt>
 
         <dd>
           <p>The <dfn id=
@@ -733,7 +732,9 @@
         disable a <code><a>MediaStreamTrack</a></code> to prevent it from
         rendering media from the source. A muted track will however, regardless
         of the enabled state, render silence and blackness. A disabled track is
-        logically equivalent to a muted track, from a consumer point of view.</p>
+        logically equivalent to a muted track, from a consumer point of view.
+        A newly created <code><a>MediaStreamTrack</a></code> object is always
+        enabled unless stated otherwise.</p>
 
         <p>A <code><a>MediaStreamTrack</a></code> object is said to <em>end</em>
         when the source of the track is disconnected or exhausted.</p>
@@ -744,7 +745,7 @@
         end has been reached and the user has not requested that it be looped, or
         because the UA has instructed the track to end for any reason, or because
         the reference count of the track's underlying media source has reached
-        zero, it is said to be <dfn>ended</dfn>. When track instance
+        zero), it is said to be <dfn>ended</dfn>. When track instance
         <var>track</var> ends for any reason other than the <code><a href=
         "#dom-mediastreamtrack-stop">stop()</a></code> method being invoked on the
         <code><a>MediaStreamTrack</a></code> object that represents
@@ -1160,14 +1161,25 @@
         <h2>Track Source Types</h2>
 
         <dl class="idl" title="enum SourceTypeEnum">
+	  
           <dt>none</dt>
-          <dd>This track has no source. This is the case when the track is in the <code>"new"</code> or <code>"ended"</code> <code><a>readyState</a></code>.</dd>
+
+	  <dd>This track has no source. This is the case when the
+	  track is in the <code>"new"</code> or <code>"ended"</code>
+	  <code><a>readyState</a></code>.</dd>
 
           <dt>camera</dt>
-          <dd>A valid source type only for <code><a>VideoStreamTrack</a></code>s. The source is a local video-producing camera source.</dd>
+
+	  <dd>A valid source type only for
+	  <code><a>VideoStreamTrack</a></code>s. The source is a local
+	  video-producing camera source.</dd>
 
           <dt>microphone</dt>
-          <dd>A valid source type only for <code><a>AudioStreamTrack</a></code>s. The source is a local audio-producing microphone source.</dd>
+
+	  <dd>A valid source type only for
+	  <code><a>AudioStreamTrack</a></code>s. The source is a local
+	  audio-producing microphone source.</dd>
+	  
         </dl>
       </section>
 
@@ -1175,8 +1187,11 @@
         <h2>Source Info</h2>
  
         <dl class="idl" title="dictionary SourceInfo">
+	  
           <dt>DOMString sourceId</dt>
-          <dd>The unique id for this source as described in the <code><a>MediaSourceStates</a></code> dictionary.</dd>
+	  
+          <dd>The unique id for this source as described in the
+          <code><a>MediaSourceStates</a></code> dictionary.</dd>
 
           <dt>DOMString kind</dt>
           <dd>MUST be either "audio" or "video".</dd>
@@ -1206,9 +1221,59 @@
           <dd>The source is facing to the left of the user.</dd>
 
           <dt>right</dt>
-          <dd>The source is fating to the right of the user.</dd>
+          <dd>The source is facing to the right of the user.</dd>
         </dl>
       </section>
+
+      <section>
+        <h2>Isolated Media Streams</h2>
+        
+        <p>When either the "noaccess" or "peerIdentity" constraints is
+          applied to a MediaStreamTrack, the track shall be isolated so that its
+          content is not accessible to the content JS. An isolated media stream
+          may be used for two purposes:
+        </p>
+        <ul>
+          <li>
+            <p>
+              Displayed in an appropriate tag (e.g., a video or audio element).
+              The video element MUST have a unique origin so that it is
+              inaccessible to the content JS. This is the same security mechanism
+              as is used with an ordinary audio or video element which has
+              a src= property from a separate origin.
+            </p>
+          </li>
+          <li>
+            <p>
+              Used as the argument to addStream() for a PeerConnection, subject
+              to the restrictions detailed in the WebRTC document.
+            </p>
+          </li>
+        </ul>
+        <p>
+          When the noaccess=true constraint applies to a track, that track
+          may be added to any PeerConnection.
+        </p>
+
+        <p class="note"> Open Issue: The editors worry that the above paragraph
+        is just wrong. If the track can be added to a PeerConnection that
+        is connect to another PeerConenction in the same application, the
+        application could get access to the data. We sugest this should be changed
+        from "may be added" to "may not be added". This will allow noaccess=true
+        to be used for things like hair check dialogs. 
+        </p>
+        
+        <p>
+          When the peerIdentity=foo constraint applies to a track, then
+          that track may be added only to PeerConnections with compatible
+          peer identities as described in the WebRTC document.
+        </p>
+
+        <p>
+          Both the noaccess and peerIdentity constraints must be mandatory.
+          Any use of them in the optional block must trigger an error.
+        </p>
+      </section>
     </section>
 
     <section>
@@ -1438,7 +1503,8 @@
       home client's video source is changed to a higher resolution
       (1920 by 1200 pixels).</p>
 
-      <img title="Changing media stream source effects: after the requested change" src="images/change_states_after.png">
+      <img title="Changing media stream source effects: after the
+      requested change" src="images/change_states_after.png">
 
       <p>Note that the source change immediately affects all of the
       sinks on the home client, but does not impact any of the sinks (or
@@ -1614,6 +1680,11 @@
         then this attribute MUST be the user agent's vsync display
         rate.  Returned for video sources.</dd>
 
+        <dt>float? aspectRatio</dt>
+        <dd>The current aspect ratio for the source.  Aspect ratio is
+        width in pixels divided by height in pixels, rounded to the
+        tenth decimal place.  Returned for video sources.</dd>
+
         <dt>VideoFacingModeEnum? facingMode</dt>
         <dd>From the user's perspective, this value describes whether
         this camera is pointed toward the user ("user") or away from
@@ -1668,11 +1739,15 @@
 
       <section>
         <h2>CapabilityList array</h2>
-        <dl class="idl" title="typedef sequence<DOMString> CapabilityList"></dl>
+      
+        <dl class="idl" title="typedef sequence &lt;DOMString&gt;
+        CapabilityList"></dl>
+	
         <p>Capability Lists are just an array of
         supported <code>DOMString</code> values from the possible
         superset of values described by each
         <a>state</a>'s enumerated type.</p>
+	
       </section>
  
 
@@ -1710,12 +1785,20 @@
         values with min being the smallest width, and max the largest
         width. The type of the min/max values are unsigned long.</dd>
 
-        <dt>CapabilityRange? frameRate</dt>
-        <dd>The supported range of frame rates on the source. The type
-        of the min/max values are float.</dd>
+        <dt>CapabilityRange? frameRate</dt> <dd>The supported range of frame
+        rates on the source. The type of the min/max values are float.</dd>
+
+        <dt>CapabilityRange? aspectRatio</dt> <dd>The supported range
+        of aspect ratio defined as a floating point number rounded to
+        10 decimal places on the source and representing the width in
+        pixels divided by the height in pixels. The type of the
+        min/max values are float.</dd>
 
         <dt>CapabilityList? facingMode</dt>
-        <dd>The available video facing options (<code><a>VideoFacingModeEnum</a></code>) on the source.</dd>
+	
+        <dd>The available video facing options
+        (<code><a>VideoFacingModeEnum</a></code>) on the source.</dd>
+	
       </dl>
 
 
@@ -1758,39 +1841,149 @@
     <section>
       <h2>MediaStreams as Media Elements</h2>
 
-      <p>A <code>MediaStream</code> may be assigned to media elements as defined in <a href=
-      "http://www.w3.org/TR/html5/embedded-content-0.html#media-elements">HTML5</a> [[!HTML5]]
-      by calling <code><a>createObjectURL</a></code> to obtain a URL for the <code>MediaStream</code> and then
-      setting the media elements <code>src</code> attribute to that URL. A <code>MediaStream</code> is
-      not preloadable or seekable and represents a simple, potentially infinite,
-      linear media timeline. The timeline starts at 0 and increments linearly
-      in real time as long as the <code>MediaStream</code> is playing. The timeline does not
-      increment when the <code>MediaStream</code> is paused.</p>
-
-      <p class="issue">Do we also need to support direct assignment and access
-      of the underlying stream?</p>
+      <p>A <code>MediaStream</code> may be assigned to media elements
+      as defined in <a href=
+      "http://www.w3.org/TR/html5/embedded-content-0.html#media-elements">HTML5</a>
+      [[!HTML5]] A <code>MediaStream</code> is not preloadable or
+      seekable and represents a simple, potentially infinite, linear
+      media timeline. The timeline starts at 0 and increments linearly
+      in real time as long as the <code>MediaStream</code> is
+      playing. The timeline does not increment when the
+      <code>MediaStream</code> is paused.</p>
+     
+     <section>
+      <h3>Direct Assignment to Media Elements</h3>
+      
+      <p>There are two methods by which a MediaStream may be assigned
+      to a media element.  First, <code><a>createObjectURL</a></code>
+      can be used to obtain a URL for the <code>MediaStream</code>.
+      That URL can then be used to set the <code>src</code> attribute
+      of the media element itself, or of one of its &lt;source&gt;
+      children.  Secondly, UAs that support this specification MUST
+      support the following partial interface, which allows a
+      MediaStream to be assigned directly to a media element.  </p>
+      	
+      <dl class="idl" title="partial interface directAssignment">
 
-      <p>The nature of the <code>MediaStream</code> places certain restrictions on the
-      behavior and attribute values of the associated media element and on the
-      operations that can be performed on it, as shown below:</p>
+	<dt>attribute MediaStream? sourceObj </dt>
+	
+	<dd><p>Holds the MediaStream that provides media for this
+	  element. This attribute overrides both the <code>src</code>
+	  attribute and any &lt;source&gt; elements. Specifically, if
+	  <code>sourceObj</code> is specified, the UA MUST use it as
+	  the source of media, even if the <code>src</code> attribute
+	  is also set or &lt;source&gt; children are present.  If the
+	  value of <code>sourceObj</code> is replaced or set to null
+	  the UA MUST re-run the <a href=
+	  "http://www.w3.org/TR/html5/embedded-content-0.html#media-element-load-algorithm">
+	  media element load algorithm</a>
+        	
+        	</p></dd>
+		
+      </dl> 	
+
+ <p class="issue"> We may want to allow direct assignment of other types as well </p>
+ </section> 
+ <section>
+ 	<h3>Loading and Playing a MediaStream in a Media Element</h3>
+      
+      <p>The UA runs the <a href=
+        "http://www.w3.org/TR/html5/embedded-content-0.html#media-element-load-algorithm">
+        media element load algorithm</a> to obtain media for the media
+        element to display.  As defined in the [[HTML5]]
+        specification, this algorithm has two basic phases: <a
+         href="http://www.w3.org/TR/html5/embedded-content-0.html#concept-media-load-algorithm">
+        resource selection algorithm</a> chooses the resource to play
+        and resolves its URI. Then the <a
+         href="http://www.w3.org/TR/html5/embedded-content-0.html#concept-media-load-resource">
+        resource fetch phase</a> loads the resource. Both these phases
+        are potentially simplified when using a MediaStream.  First of
+        all, in the case of direct assignment, <code>sourceObj</code>
+        takes priority over other means of specifying the resource.
+        Futhermore, it provides the object itself rather than a URI.
+        In this case, there is no need to run the resource selection
+        algorithm.  Secondly, when the UA reaches the resource fetch
+        algorithm with a MediaStream (whether specified by URI or
+        direct assignment), the MediaStream is a local object so
+        there's nothing to fetch.  Therefore, the following
+        modifications/restrictions to the <a href=
+        "http://www.w3.org/TR/html5/embedded-content-0.html#media-element-load-algorithm">
+        media element load algorithm</a> apply: </p>
 
       <ul>
+	
+      	<li>Whenever the user agent runs the <a href=
+        "http://www.w3.org/TR/html5/embedded-content-0.html#media-element-load-algorithm">
+        media element load algorithm</a>, if <code>sourceObj</code> is
+        specified, the UA must immediately go to the <a href=
+        "http://www.w3.org/TR/html5/embedded-content-0.html#concept-media-load-resource">
+        resource fetch phase</a> of the algorithm. (Note that in this
+        case, the UA will have the MediaStream object, and not an
+        absolute URI, as it would if the MediaStream had been
+        specified by <code>src</code> or &lt;source&gt;.  However the
+        load operation on a MediaStream is trivial in all cases, as
+        indicated in the next item.) </li>
+	
         <li>Whenever the user agent runs the <a href=
         "http://www.w3.org/TR/html5/embedded-content-0.html#media-element-load-algorithm">
-          media element load algorithm</a>, reaches the <a href=
-          "http://www.w3.org/TR/html5/embedded-content-0.html#concept-media-load-resource">
-          resource fetch phase</a> of this algorithm and determines that the
-          media resource in question is a MediaStream, it MUST immediately abort the <a href=
-          "http://www.w3.org/TR/html5/embedded-content-0.html#concept-media-load-algorithm">
-          resource selection algorithm</a>, setting the <a href=
-          "http://www.w3.org/TR/html5/embedded-content-0.html#dom-media-readystate">
-          <code>media.readystate</code></a> to HAVE_ENOUGH_DATA.
+        media element load algorithm</a>, reaches the <a href=
+        "http://www.w3.org/TR/html5/embedded-content-0.html#concept-media-load-resource">
+        resource fetch phase</a> of this algorithm, and determines
+        that the media resource in question is a MediaStream, it MUST
+        immediately abort the <a href=
+        "http://www.w3.org/TR/html5/embedded-content-0.html#concept-media-load-algorithm">
+        resource selection algorithm</a>, setting the <a href=
+        "http://www.w3.org/TR/html5/embedded-content-0.html#dom-media-readystate">
+        <code>media.readyState</code></a> to HAVE_ENOUGH_DATA.  </li>
+	
+        <li>For each Track in the MediaStream, including those that
+	are added after the UA enters the <a href=
+	"http://www.w3.org/TR/html5/embedded-content-0.html#media-element-load-algorithm">
+	media element load algorithm</a>, the UA MUST create the
+	corresponding <a
+	 href="http://www.w3.org/TR/html5/embedded-content-0.html#audiotracklist">
+	audio track</a> or <a
+	 href="http://www.w3.org/TR/html5/embedded-content-0.html#videotracklist">
+	video track</a> as defined in [[!HTML5]]. (Note that since the
+	MediaStream is potentially endless, the UA does not exit the
+	<a href=
+	"http://www.w3.org/TR/html5/embedded-content-0.html#media-element-load-algorithm">
+	media element load algorithm</a> until the MediaStream moves
+	from the active to the inactive state.) </li>
+
+        <li>The UA MUST NOT buffer data from a MediaStream. When
+        playing, the UA MUST always play the current data from the
+        stream.</li>
+
+	<li>When the MediaStream is moves from the active to the
+        inactive state, the UA MUST raise an <a
+         href="http://www.w3.org/TR/html5/embedded-content-0.html#event-media-ended">ended</a>
+        event on the media element and set its <a
+         href="http://www.w3.org/TR/html5/embedded-content-0.html#dom-media-ended">ended</a>
+        attribute to <code>true</code>. Note that once <a
+         href="http://www.w3.org/TR/html5/embedded-content-0.html#dom-media-ended">ended</a>
+        equals <code>true</code> the media element will not play media
+        even if new Tracks are added to the MediaStream (causing it to
+        return to the active state) until the JavaScript restarts the
+        element, e.g., by calling <a
+         href="http://www.w3.org/TR/html5/embedded-content-0.html#dom-media-play">play()</a>.
         </li>
-
-        <li>The UA MUST NOT buffer data
-        from a MediaStream. When playing, the UA MUST always play the current data from the stream.</li>
+	
       </ul>
+      
+      <p class="issue">If a MediaStream is inactive and the media
+      	element is ended, and the element's <code>autoplay</code>
+      	attribute is set to true, should it start playing
+      	automatically if new Tracks are added to the MediaStream?</p>
+      
+</section>
+<section>
+      
+      <h3>Media Element Attributes when Playing a MediaStream</h3>
 
+      <p>The nature of the <code>MediaStream</code> places certain restrictions on the
+      behavior and attribute values of the associated media element and on the
+      operations that can be performed on it, as shown below:</p>
       <table summary=
       "Legal values for the properties of a media element bound to a MediaStream"
       class="simple">
@@ -1800,7 +1993,7 @@
 
             <th scope="col">Attribute Type</th>
 
-            <th scope="col">Valid Values</th>
+            <th scope="col">Valid Values When Using a MediaStream</th>
 
             <th scope="col">Additional considerations</th>
           </tr>
@@ -1818,9 +2011,13 @@
 
             <td>a local URI referencing a MediaStream</td>
 
-            <td>N.B. Revocation of the URI does not count as a change to this
-            field.</td>

[175 lines skipped]

Received on Thursday, 4 July 2013 13:38:45 UTC