-
Notifications
You must be signed in to change notification settings - Fork 9
/
module-rtc-core.html
119 lines (113 loc) · 5.92 KB
/
module-rtc-core.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="X-UA-Compatible" content="chrome=1">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="format-detection" content="telephone=no">
<meta name="viewport" content="user-scalable=no, initial-scale=1, maximum-scale=1, minimum-scale=1, width=device-width">
<title>rtc.io</title>
<link rel="stylesheet" type="text/css" href="css/reset.css">
<link rel="stylesheet" type="text/css" href="css/main.css">
<!-- responsive -->
<link rel="stylesheet" media="screen and (max-width: 960px)" href="css/tablet.css">
<link rel="stylesheet" media="screen and (max-width: 710px)" href="css/phone.css">
<link rel="stylesheet" type="text/css" href="fonts/source-sans/stylesheet.css">
<link rel="stylesheet" type="text/css" href="css/code.css">
</head>
<body>
<a class="scroll-point pt-top" name="top"></a>
<header>
<a href="https://github.com/rtc-io/rtc-core"><img class="fork" src="https://s3.amazonaws.com/github/ribbons/forkme_right_orange_ff7600.png" alt="Fork me on GitHub"></a>
<a class="scroll-point pt-top" name="top"></a>
<div class="site">
<div class="mascot">
<img src="images/artsio.png">
</div>
<div class="logo" data-subtext="OpenSource WebRTC">
<a href="index.html">rtc.io</a>
</div>
<nav>
<ul>
<li><a href="index.html">About</a></li>
<li><a href="tutorials.html">Tutorials</a></li>
<li><a href="demos.html">Demos</a></li>
<li><a href="modules.html">Modules</a></li>
</ul>
</nav>
</div>
<div class="shadow"></div>
</header>
<div class="main" role="content"><h1 id="rtc-core">rtc-core</h1>
<p>The rtc-core package includes a number of core types and constants that
are used across the rtc.io suite.</p>
<p><a href="https://nodei.co/npm/rtc-core/"><img src="https://nodei.co/npm/rtc-core.png" alt="NPM"></a></p>
<p><a href="https://travis-ci.org/rtc-io/rtc-core"><img src="https://img.shields.io/travis/rtc-io/rtc-core.svg?branch=master" alt="Build Status"></a> <a href="https://github.com/dominictarr/stability#unstable"><img src="https://img.shields.io/badge/stability-unstable-yellowgreen.svg" alt="unstable"></a> </p>
<h3 id="-rtc-core-detect-"><code>rtc-core/detect</code></h3>
<p>A browser detection helper for accessing prefix-free versions of the various
WebRTC types.</p>
<h3 id="example-usage">Example Usage</h3>
<p>If you wanted to get the native <code>RTCPeerConnection</code> prototype in any browser
you could do the following:</p>
<div class="highlight"><pre><span class="kd">var</span> <span class="nx">detect</span> <span class="o">=</span> <span class="nx">require</span><span class="p">(</span><span class="s1">'rtc-core/detect'</span><span class="p">);</span> <span class="c1">// also available in rtc/detect</span>
<span class="kd">var</span> <span class="nx">RTCPeerConnection</span> <span class="o">=</span> <span class="nx">detect</span><span class="p">(</span><span class="s1">'RTCPeerConnection'</span><span class="p">);</span>
</pre></div>
<p>This would provide whatever the browser prefixed version of the
RTCPeerConnection is available (<code>webkitRTCPeerConnection</code>,
<code>mozRTCPeerConnection</code>, etc).</p>
<h3 id="-rtc-core-genice-"><code>rtc-core/genice</code></h3>
<p>Respond appropriately to options that are passed to packages like
<code>rtc-quickconnect</code> and trigger a <code>callback</code> (error first) with iceServer
values.</p>
<p>The function looks for either of the following keys in the options, in
the following order or precedence:</p>
<ol>
<li><p><code>ice</code> - this can either be an array of ice server values or a generator
function (in the same format as this function). If this key contains a
value then any servers specified in the <code>iceServers</code> key (2) will be
ignored.</p>
</li>
<li><p><code>iceServers</code> - an array of ice server values.</p>
</li>
</ol>
<h3 id="-rtc-core-reset-"><code>rtc-core/reset</code></h3>
<p>This is a simple, cross-browser method for resetting a media element
back to a initial state after having media attached.</p>
<h3 id="-rtc-core-wait-connected-"><code>rtc-core/wait-connected</code></h3>
<p><code>waitConnected(pc, callback)</code></p>
<p>A simple helper function that will monitor <code>iceconnectionstatechange</code> events
and wait until a connected <code>iceConnectionState</code> has been triggered (either
<code>connected</code> or <code>completed</code>). Once this state has been achieved the event
listener will be removed and a callback fired.</p>
<h2 id="license-s-">License(s)</h2>
<h3 id="apache-2-0">Apache 2.0</h3>
<p>Copyright 2013 - 2014 National ICT Australia Limited (NICTA)</p>
<p> Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at</p>
<pre><code> http://www.apache.org/licenses/LICENSE-2.0</code></pre>
<p> Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.</p>
</div>
<footer>
<p>
<a href="http://nicta.com.au">
<img src="images/nicta-logo.gif" alt="NICTA logo">
</a>© NICTA 2013 - 2014
</p>
<p class="license">Project source code is licensed under the <a href="https://github.com/rtc-io/rtc/blob/master/LICENSE">Apache 2.0</a>.</p>
<a class="closing" href="#top"></a>
</footer>
</body>
<script src="js/app.js"></script>
<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
ga('create', 'UA-26567546-2', 'rtc.io');
ga('send', 'pageview');
</script>
</html>