- From: CVS User dburnett <cvsmail@w3.org>
- Date: Tue, 05 Nov 2013 18:10:45 +0000
- To: public-dap-commits@w3.org
Update of /sources/public/2011/webrtc/editor/sources In directory roscoe:/tmp/cvs-serv480/sources Added Files: getusermedia.css getusermedia.html getusermedia.js webrtc.css webrtc.html webrtc.js Log Message: Added 20131105 archived version. --- /sources/public/2011/webrtc/editor/sources/getusermedia.css 2013/11/05 18:10:45 NONE +++ /sources/public/2011/webrtc/editor/sources/getusermedia.css 2013/11/05 18:10:45 1.1 @media screen { html { background: #eeeeee; } body { margin-bottom: 30%; border-bottom: thin solid #3c790a; } } pre { margin-left: 2em; white-space: pre-wrap; } dt, dfn { font-weight: bold; font-style: normal; } i, em, dt dfn { font-style: italic; } pre, code { font-size: inherit; font-family: monospace, Droid Sans Fallback, sans-serif; font-variant: normal; } pre strong { color: black; font: inherit; font-weight: bold; background: yellow; } pre em { font-weight: bolder; font-style: normal; } @media screen { code { color: orangered; } } var sub { vertical-align: bottom; font-size: smaller; position: relative; top: 0.1em; } table { border-collapse: collapse; border-style: hidden hidden none hidden; } table thead, table tbody { border-bottom: solid; } table tbody th { text-align: left; } table tbody th:first-child { border-left: solid; } table td, table th { border-left: solid; border-right: solid; border-bottom: solid thin; vertical-align: top; padding: 0.2em; } ins { background: green; color: white; /* color: green; border: solid thin lime; padding: 0.3em; line-height: 1.6em; */ text-decoration: none; } del { background: maroon; color: white; /* color: maroon; border: solid thin red; padding: 0.3em; line-height: 1.6em; */ text-decoration: line-through; } body ins, body del { display: block; } body * ins, body * del { display: inline; } p > span:not([title=""]):not([class="XXX"]):not([class="impl"]):not([class="note"]), li > span:not([title=""]):not([class="XXX"]):not([class="impl"]):not([class="note"]) { border-bottom: solid #99CC99; } .note { color: green; background: transparent; font-family: sans-serif, Droid Sans Fallback; } .warning { color: red; background: transparent; } .note, .warning { font-weight: bolder; font-style: italic; } .note em, .warning em, .note i, .warning i { font-style: normal; } p.note, div.note { padding: 0.5em 2em; } span.note { padding: 0 2em; } .note p:first-child, .warning p:first-child { margin-top: 0; } .note p:last-child, .warning p:last-child { margin-bottom: 0; } .warning:before { font-style: normal; } p.note:before { content: 'Note: '; } p.warning:before { content: '\26A0 Warning! '; } .bookkeeping:before { display: block; content: 'Bookkeeping details'; font-weight: bolder; font-style: italic; } .bookkeeping { font-size: 0.8em; margin: 2em 0; } .bookkeeping p { margin: 0.5em 2em; display: list-item; list-style: square; } .bookkeeping dt { margin: 0.5em 2em 0; } .bookkeeping dd { margin: 0 3em 0.5em; } .critical { margin: 1em; border: double thick red; padding: 1em; background: #FFFFCC; } .critical > :first-child { margin-top: 0; } .example { display: block; color: #222222; background: #FCFCFC; border-left: double; margin-left: 2em; padding-left: 1em; } td > .example:only-child { margin: 0 0 0 0.1em; } a.externalDFN { color: inherit; border-bottom: 1px dotted #ccc; text-decoration: none; } --- /sources/public/2011/webrtc/editor/sources/getusermedia.html 2013/11/05 18:10:45 NONE +++ /sources/public/2011/webrtc/editor/sources/getusermedia.html 2013/11/05 18:10:45 1.1 <!DOCTYPE html> <html lang="en-us"> <head> <meta name="generator" content= "HTML Tidy for HTML5 (experimental) for Linux https://github.com/w3c/tidy-html5/tree/68a9e74"> <link href="getusermedia.css" rel="stylesheet" type="text/css"> <title>Media Capture and Streams</title> <meta content="text/html; charset=utf-8" http-equiv="Content-Type"> <!-- To publish this document, see instructions in README --> <script class="remove" src="http://www.w3.org/Tools/respec/respec-w3c-common" type="text/javascript"> <!-- keep this comment --> </script> <script class="remove" src="getusermedia.js" type="text/javascript"> <!-- keep this comment --> </script> </head> <body> <section id="abstract"> <p>This document defines a set of JavaScript APIs that allow local media, including audio and video, to be requested from a platform.</p> </section> <section id="sotd"> <p>This document is not complete. It is subject to major changes and, while early experimentations are encouraged, it is therefore not intended for implementation. The API is based on preliminary work done in the WHATWG.</p> </section> <section class="informative" id="intro"> <h2>Introduction</h2> <p>Access to multimedia streams (video, audio, or both) from local devices (video cameras, microphones, Web cams) can have a number of uses, such as real-time communication, recording, and surveillance.</p> <p>This document defines the APIs used to get access to local devices that can generate multimedia stream data. This document also defines the MediaStream API by which JavaScript is able to manipulate the stream data or otherwise process it.</p> </section> <section id="conformance"> <p> This specification defines conformance criteria that apply to a single product: the <dfn>user agent</dfn> that implements the interfaces that it contains. </p> <p> Implementations that use ECMAScript to implement the APIs defined in this specification must implement them in a manner consistent with the ECMAScript Bindings defined in the Web IDL specification [[!WEBIDL]], as this specification uses that specification and terminology. </p> </section> <section> <h2>Terminology</h2> <dl> <dt><i>HTML Terms:</i></dt> <dd> <p> The <code><a href="http://dev.w3.org/html5/spec/webappapis.html#eventhandler"> EventHandler</a></code> interface represents a callback used for event handlers as defined in [[!HTML5]]. </p> <p> The concepts <dfn><a href="http://dev.w3.org/html5/spec/webappapis.html#queue-a-task"> queue a task</a></dfn> and <dfn><a href="http://dev.w3.org/html5/spec/webappapis.html#fire-a-simple-event"> fires a simple event</a></dfn> are defined in [[!HTML5]]. </p> <p> The terms <dfn><a href="http://dev.w3.org/html5/spec/webappapis.html#event-handlers"> event handlers</a></dfn> and <dfn><a href="http://dev.w3.org/html5/spec/webappapis.html#event-handler-event-type"> event handler event types</a></dfn> are defined in [[!HTML5]]. </p> </dd> <dt><dfn>source</dfn></dt> <dd> <p>A source is the "thing" providing the source of a media stream track. The source is the broadcaster of the media itself. A source can be a physical webcam, microphone, local video or audio file from the user's hard drive, network resource, or static image.</p> <p>Some sources have an identifier which <em title="must" class="rfc2119">must</em> be unique to the application (un-guessable by another application) and persistent between application sessions (e.g., the identifier for a given source device/application must stay the same, but not be guessable by another application). Sources that must have an identifier are camera and microphone sources; local file sources are not required to have an identifier. Source identifiers let the application save, identify the availability of, and directly request specific sources.</p> <p>Other than the identifier, other bits of source identity are <strong>never</strong> directly available to the application until the user agent connects a source to a track. Once a source has been "released" to the application (either via a permissions UI, pre-configured allow-list, or some other release mechanism) the application will be able discover additional source-specific capabilities.</p> <p>Sources <strong>do not</strong> have constraints -- tracks have constraints. When a source is connected to a track, it must conform to the constraints present on that track (or set of tracks).</p> <p>Sources will be released (un-attached) from a track when the track is ended for any reason.</p> <p>On the <code><a>MediaStreamTrack</a></code> object, sources are represented by a <code><a>sourceType</a></code> attribute. The behavior of APIs associated with the source's capabilities and settings change depending on the source type.</p> <p>Sources have <code><a>capabilities</a></code> and <code><a>settings</a></code>. The capabilities and settings are "owned" by the source and are common to any (multiple) tracks that happen to be using the same source (e.g., if two different track objects bound to the same source ask for the same capability or setting information, they will get back the same answer).</p> </dd> <dt><dfn title="state">Setting (Source Setting)</dfn></dt> <dd> <p>A setting refers to the immediate, current value of the source's (optionally constrained) capabilities. Settings are always read-only.</p> <p>A source's settings can change dynamically over time due to environmental conditions, sink configurations, or constraint changes. A source's settings must always conform to the current set of mandatory constraints that all of the tracks it is bound to have defined, and should do its best to conform to the set of optional constraints specified.</p> <p>A source's settings are directly exposed to audio and video track objects through individual read-only attributes. These attributes share the same name as their corresponding <a>capabilities</a> and <a>constraints</a>.</p> <p>Events are available that signal to the application that a source's settings have changed.</p> <p>A conforming user-agent <em title="must" class="rfc2119">must</em> support all the setting names defined in this spec.</p> </dd> <dt><dfn title="capabilities" id="dfn-capabilities">Capabilities</dfn></dt> <dd> <p>Source capabilities are the intrinsic "features" of a source object. For each source setting, there is a corresponding capability that describes whether it is supported by the source and if so, what the range of supported values are. Capabilities are expressed as either a series of settings (for enumerated-type capabilities) or as a min/max range.</p> <p>The values of the supported capabilities must be normalized to the ranges and enumerated types defined in this specification.</p> <p>Capabilities return the same underlying per-source capabilities, regardless of any user-supplied constraints present on the source (capabilities are independent of constraints).</p> <p>Source capabilities are effectively constant. Applications should be able to depend on a specific source having the same capabilities for any session.</p> </dd> <dt><dfn title="constraints" id="dfn-constraints">Constraints</dfn></dt> <dd> <p>Constraints are an optional feature for restricting the range of allowed variability on a source. Without provided constraints, implementations are free to select a source's settings from the full ranges of its supported capabilities, and to adjust those settings at any time for any reason.</p> <p>Constraints may be optional or mandatory. Optional constraints are represented by an ordered list, mandatory constraints are an unordered set. The order of the optional constraints is from most important (at the head of the list) to least important (at the tail of the list).</p> <p>Constraints are stored on the track object, not the source. Each track can be optionally initialized with constraints, or constraints can be added afterward through the constraint APIs defined in this spec.</p> <p>Applying track level constraints to a source is conditional based on the type of source. For example, read-only sources will ignore any specified constraints on the track.</p> <p>It is possible for two tracks that share a unique source to apply contradictory constraints. Under such contradictions, the implementation will mute both tracks and notify them that they are over-constrained.</p> <p>Events are available that allow the application to know when constraints cannot be met by the user agent. These typically occur when the application applies constraints beyond the capability of a source, contradictory constraints, or in some cases when a source cannot sustain itself in over-constrained scenarios (overheating, etc.).</p> <p>A correspondingly-named constraint exists for each corresponding source setting name and capability name. In general, user agents will have more flexibility to optimize the media streaming experience the fewer constraints are applied.</p> </dd> </dl> </section> <section id="stream-api"> <h2>MediaStream API</h2> <section> <h2>Introduction</h2> <p>The <code><a>MediaStream</a></code> interface is used to represent streams of media data, typically (but not necessarily) of audio and/or video content, e.g. from a local camera. The data from a <code><a>MediaStream</a></code> object does not necessarily have a canonical binary form; for example, it could just be "the video currently coming from the user's video camera". This allows user agents to manipulate media streams in whatever fashion is most suitable on the user's platform.</p> <p>Each <code><a>MediaStream</a></code> object can contain zero or more tracks, in particular audio and video tracks. All tracks in a MediaStream are intended to be synchronized when rendered. Different MediaStreams do not need to be synchronized.</p> <p>Each track in a MediaStream object has a corresponding <code><a>MediaStreamTrack</a></code> object.</p> <p>A <code><a>MediaStreamTrack</a></code> represents content comprising one or more channels, where the channels have a defined well known relationship to each other (such as a stereo or 5.1 audio signal).</p> <p>A channel is the smallest unit considered in this API specification.</p> <p>A <code><a>MediaStream</a></code> object has an input and an output. The input depends on how the object was created: a <code><a>MediaStream</a></code> object generated by a <code><a href= "#dom-navigator-getusermedia">getUserMedia()</a></code> call (which is described later in this document), for instance, might take its input from the user's local camera. The output of the object controls how the object is used, e.g., what is saved if the object is written to a file or what is displayed if the object is used in a <code>video</code> element.</p> <p>Each track in a <code><a>MediaStream</a></code> object can be disabled, meaning that it is muted in the object's output. All tracks are initially enabled.</p> <p>A <code><a>MediaStream</a></code> can be <a>finished</a>, indicating that its inputs have forever stopped providing data.</p> <p>The output of a <code><a>MediaStream</a></code> object MUST correspond to the tracks in its input. Muted audio tracks MUST be replaced with silence. Muted video tracks MUST be replaced with blackness.</p> <p>A new <code><a>MediaStream</a></code> object can be created from accessible media sources (that does not require any additional permissions) using the <code><a href="#dom-mediastream">MediaStream()</a> </code> constructor. The constructor argument can either be an existing <code><a>MediaStream</a></code> object, in which case all the tracks of the given stream are added to the new <code><a>MediaStream</a></code> object, or an array of <code><a>MediaStreamTrack</a></code> objects. The latter form makes it possible to compose a stream from different source streams.</p> <p><img alt="A MediaStream" src="images/media-stream.png" width= "418"></p> <p>Both <code><a>MediaStream</a></code> and <code> <a>MediaStreamTrack</a></code> objects can be cloned. This allows for greater control since the separate instances can be manipulated and <a title="consumer">consumed</a> individually. A cloned <code> <a>MediaStream</a></code> contains clones of all member tracks from the original stream.</p> <p>When a <code><a>MediaStream</a></code> object is being generated from a local file (as opposed to a live audio/video source), the user agent SHOULD stream the data from the file in real time, not all at once. The <code>MediaStream</code> object is also used in contexts outside <code>getUserMedia</code>, such as [[!WEBRTC10]]. In both cases, ensuring a realtime stream reduces the ease with which pages can distinguish live video from pre-recorded video, which can help protect the user's privacy.</p> </section> <section> <h2>MediaStream</h2> <p>The <dfn id="dom-mediastream"> <code>MediaStream()</code></dfn> 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. <dfn id='mediastream-constructor'>When the constructor is invoked</dfn>, the UA must run the following steps:</p> <ol> <li> <p>Let <var>stream</var> be a newly constructed <code> <a>MediaStream</a></code> object.</p> </li> <li> <p>Initialize <var>stream's</var> <code><a href= "#dom-mediastream-id">id</a></code> attribute to a newly generated value.</p> </li> <li> <p>If the constructor's argument is present, run the sub steps that corresponds to the argument type.</p> <ul> <li> <p><code>Array</code> of <code><a>MediaStreamTrack</a></code> objects:</p> [3383 lines skipped] --- /sources/public/2011/webrtc/editor/sources/getusermedia.js 2013/11/05 18:10:45 NONE +++ /sources/public/2011/webrtc/editor/sources/getusermedia.js 2013/11/05 18:10:45 1.1 [3475 lines skipped] --- /sources/public/2011/webrtc/editor/sources/webrtc.css 2013/11/05 18:10:45 NONE +++ /sources/public/2011/webrtc/editor/sources/webrtc.css 2013/11/05 18:10:45 1.1 [3527 lines skipped] --- /sources/public/2011/webrtc/editor/sources/webrtc.html 2013/11/05 18:10:45 NONE +++ /sources/public/2011/webrtc/editor/sources/webrtc.html 2013/11/05 18:10:45 1.1 [8304 lines skipped] --- /sources/public/2011/webrtc/editor/sources/webrtc.js 2013/11/05 18:10:45 NONE +++ /sources/public/2011/webrtc/editor/sources/webrtc.js 2013/11/05 18:10:45 1.1 [8377 lines skipped]
Received on Tuesday, 5 November 2013 18:10:48 UTC