Skip to content

Commit 9db631b

Browse files
committed
Update Python Server SDK docs to have a relay mode by default
1 parent 5df402f commit 9db631b

File tree

6 files changed

+93
-78
lines changed

6 files changed

+93
-78
lines changed

docs/README.html

Lines changed: 42 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,9 @@ <h3>Navigation</h3>
3232
<li class="right" style="margin-right: 10px">
3333
<a href="genindex.html" title="General Index"
3434
accesskey="I">index</a></li>
35+
<li class="right" >
36+
<a href="py-modindex.html" title="Python Module Index"
37+
>modules</a> |</li>
3538
<li><a href="index.html">OpenTok Python SDK 2.2 2.2.0 documentation</a> &raquo;</li>
3639
</ul>
3740
</div>
@@ -43,32 +46,27 @@ <h3>Navigation</h3>
4346

4447
<div class="section" id="opentok-python-sdk">
4548
<h1>OpenTok Python SDK<a class="headerlink" href="#opentok-python-sdk" title="Permalink to this headline"></a></h1>
46-
<a class="reference external image-reference" href="https://travis-ci.org/aoberoi/Opentok-Python-SDK"><img alt="https://travis-ci.org/aoberoi/Opentok-Python-SDK.svg?branch=modernization" src="https://travis-ci.org/aoberoi/Opentok-Python-SDK.svg?branch=modernization" /></a>
49+
<a class="reference external image-reference" href="https://travis-ci.org/opentok/Opentok-Python-SDK"><img src="https://travis-ci.org/opentok/Opentok-Python-SDK.svg" /></a>
4750
<p>The OpenTok Python SDK lets you generate
4851
<a class="reference external" href="http://tokbox.com/opentok/tutorials/create-session/">sessions</a> and
4952
<a class="reference external" href="http://tokbox.com/opentok/tutorials/create-token/">tokens</a> for <a class="reference external" href="http://www.tokbox.com/">OpenTok</a>
50-
applications. This version of the SDK also includes support for working with OpenTok 2.0 archives.</p>
51-
<div class="section" id="installation">
52-
<h2>Installation<a class="headerlink" href="#installation" title="Permalink to this headline"></a></h2>
53-
<div class="section" id="pip-recommended">
54-
<h3>Pip (recommended):<a class="headerlink" href="#pip-recommended" title="Permalink to this headline"></a></h3>
53+
applications, and <a class="reference external" href="http://www.tokbox.com/platform/archiving">archive</a> Opentok 2.0 sessions.</p>
54+
<p>If you are updating from a previous version of this SDK, see
55+
<a class="reference external" href="#important-changes-in-v22">Important changes in v2.2</a>.</p>
56+
<div class="section" id="installation-using-pip-recommended">
57+
<h2>Installation using Pip (recommended):<a class="headerlink" href="#installation-using-pip-recommended" title="Permalink to this headline"></a></h2>
5558
<p>Pip helps manage dependencies for Python projects using the PyPI index. Find more info here:
5659
<a class="reference external" href="http://www.pip-installer.org/en/latest/">http://www.pip-installer.org/en/latest/</a></p>
5760
<p>Add the <tt class="docutils literal"><span class="pre">opentok</span></tt> package as a dependency in your project. The most common way is to add it to your
5861
<tt class="docutils literal"><span class="pre">requirements.txt</span></tt> file:</p>
59-
<div class="highlight-python"><div class="highlight"><pre><span class="n">opentok</span><span class="o">&gt;=</span><span class="mf">2.2</span>
62+
<div class="highlight-python"><div class="highlight"><pre>opentok&gt;=2.2.0
6063
</pre></div>
6164
</div>
6265
<p>Next, install the dependencies:</p>
6366
<div class="highlight-python"><div class="highlight"><pre>$ pip install -r requirements.txt
6467
</pre></div>
6568
</div>
6669
</div>
67-
<div class="section" id="manually">
68-
<h3>Manually:<a class="headerlink" href="#manually" title="Permalink to this headline"></a></h3>
69-
<p>Download the latest package zip from the <a class="reference external" href="https://github.com/opentok/Opentok-Python-SDK/releases">Releases page</a></p>
70-
</div>
71-
</div>
7270
<div class="section" id="usage">
7371
<h2>Usage<a class="headerlink" href="#usage" title="Permalink to this headline"></a></h2>
7472
<div class="section" id="initializing">
@@ -85,12 +83,14 @@ <h3>Initializing<a class="headerlink" href="#initializing" title="Permalink to t
8583
<h3>Creating Sessions<a class="headerlink" href="#creating-sessions" title="Permalink to this headline"></a></h3>
8684
<p>The create an OpenTok Session, use the <tt class="docutils literal"><span class="pre">opentok.create_session()</span></tt> method. There are two optional
8785
keyword parameters for this method: <tt class="docutils literal"><span class="pre">location</span></tt> which can be set to a string containing an IP
88-
address, and <tt class="docutils literal"><span class="pre">p2p</span></tt> which is a boolean. This method returns a <tt class="docutils literal"><span class="pre">Session</span></tt> object. Its
89-
<tt class="docutils literal"><span class="pre">session_id</span></tt> attribute is useful when saving to a persistent store (e.g. database).</p>
90-
<div class="code python highlight-python"><div class="highlight"><pre><span class="c"># Just a plain Session</span>
86+
address, and <tt class="docutils literal"><span class="pre">media_mode</span></tt> which is a String (defined by the MediaModes class). This method returns
87+
a <tt class="docutils literal"><span class="pre">Session</span></tt> object. Its <tt class="docutils literal"><span class="pre">session_id</span></tt> attribute is useful when saving to a persistent store (such
88+
as a database).</p>
89+
<div class="code python highlight-python"><div class="highlight"><pre><span class="c"># Just a plain Session:</span>
9190
<span class="n">session</span> <span class="o">=</span> <span class="n">opentok</span><span class="o">.</span><span class="n">create_session</span><span class="p">()</span>
92-
<span class="c"># A p2p Session</span>
93-
<span class="n">session</span> <span class="o">=</span> <span class="n">opentok</span><span class="o">.</span><span class="n">create_session</span><span class="p">(</span><span class="n">p2p</span><span class="o">=</span><span class="bp">True</span><span class="p">)</span>
91+
<span class="c"># A Session that attempts to send streams directly between clients (falling back</span>
92+
<span class="c"># to use the OpenTok TURN server to relay streams if the clients cannot connect):</span>
93+
<span class="n">session</span> <span class="o">=</span> <span class="n">opentok</span><span class="o">.</span><span class="n">create_session</span><span class="p">(</span><span class="n">media_mode</span><span class="o">=</span><span class="n">MediaModes</span><span class="o">.</span><span class="n">relayed</span><span class="p">)</span>
9494
<span class="c"># A Session with a location hint</span>
9595
<span class="n">session</span> <span class="o">=</span> <span class="n">opentok</span><span class="o">.</span><span class="n">create_session</span><span class="p">(</span><span class="n">location</span><span class="o">=</span><span class="s">u&#39;12.34.56.78&#39;</span><span class="p">)</span>
9696

@@ -171,9 +171,18 @@ <h3>Working with Archives<a class="headerlink" href="#working-with-archives" tit
171171
</div>
172172
</div>
173173
</div>
174+
<div class="section" id="samples">
175+
<h2>Samples<a class="headerlink" href="#samples" title="Permalink to this headline"></a></h2>
176+
<p>There are two sample applications included in this repository. To get going as fast as possible, clone the whole
177+
repository and follow the Walkthroughs:</p>
178+
<ul class="simple">
179+
<li><a class="reference external" href="sample/HelloWorld/README.md">HelloWorld</a></li>
180+
<li><a class="reference external" href="sample/Archiving/README.md">Archiving</a></li>
181+
</ul>
182+
</div>
174183
<div class="section" id="documentation">
175184
<h2>Documentation<a class="headerlink" href="#documentation" title="Permalink to this headline"></a></h2>
176-
<p>Reference documentation is available at &lt;<a class="reference external" href="http://www.tokbox.com//opentok/libraries/server/python/reference/index.html">http://www.tokbox.com//opentok/libraries/server/python/reference/index.html</a>&gt; and in the
185+
<p>Reference documentation is available at &lt;<a class="reference external" href="http://www.tokbox.com/opentok/libraries/server/python/reference/index.html">http://www.tokbox.com/opentok/libraries/server/python/reference/index.html</a>&gt; and in the
177186
docs directory of the SDK.</p>
178187
</div>
179188
<div class="section" id="requirements">
@@ -185,18 +194,19 @@ <h2>Requirements<a class="headerlink" href="#requirements" title="Permalink to t
185194
<h2>Release Notes<a class="headerlink" href="#release-notes" title="Permalink to this headline"></a></h2>
186195
<p>See the <a class="reference external" href="https://github.com/opentok/Opentok-Python-SDK/releases">Releases</a> page for details about
187196
each release.</p>
188-
<div class="section" id="important-changes-in-v2-0">
189-
<h3>Important changes in v2.0<a class="headerlink" href="#important-changes-in-v2-0" title="Permalink to this headline"></a></h3>
197+
</div>
198+
<div class="section" id="id1">
199+
<h2>Important changes in v2.2<a class="headerlink" href="#id1" title="Permalink to this headline"></a></h2>
190200
<p>This version of the SDK includes support for working with OpenTok 2.0 archives. (This API does not
191201
work with OpenTok 1.0 archives.)</p>
192-
</div>
202+
<p>The OpenTok.create_session() method now includes a media_mode parameter, instead of a p2p parameter.</p>
203+
<p>For details, see the reference documentation at
204+
&lt;<a class="reference external" href="http://www.tokbox.com/opentok/libraries/server/python/reference/index.html">http://www.tokbox.com/opentok/libraries/server/python/reference/index.html</a>&gt;.</p>
193205
</div>
194206
<div class="section" id="development-and-contributing">
195207
<h2>Development and Contributing<a class="headerlink" href="#development-and-contributing" title="Permalink to this headline"></a></h2>
196-
<p>Interested in contributing? We &lt;3 pull requests! File a new
197-
<a class="reference external" href="https://github.com/opentok/opentok-python-sdk/issues">Issue</a> or take a look at the existing ones.
198-
If you are going to send us a pull request, please try to run the test suite first and also include
199-
tests for your changes.</p>
208+
<p>Interested in contributing? We :heart: pull requests! See the <a class="reference external" href="DEVELOPING.md">Development</a> and
209+
<a class="reference external" href="CONTRIBUTING.md">Contribution</a> guidelines.</p>
200210
</div>
201211
<div class="section" id="support">
202212
<h2>Support<a class="headerlink" href="#support" title="Permalink to this headline"></a></h2>
@@ -215,24 +225,19 @@ <h2>Support<a class="headerlink" href="#support" title="Permalink to this headli
215225
<h3><a href="index.html">Table Of Contents</a></h3>
216226
<ul>
217227
<li><a class="reference internal" href="#">OpenTok Python SDK</a><ul>
218-
<li><a class="reference internal" href="#installation">Installation</a><ul>
219-
<li><a class="reference internal" href="#pip-recommended">Pip (recommended):</a></li>
220-
<li><a class="reference internal" href="#manually">Manually:</a></li>
221-
</ul>
222-
</li>
228+
<li><a class="reference internal" href="#installation-using-pip-recommended">Installation using Pip (recommended):</a></li>
223229
<li><a class="reference internal" href="#usage">Usage</a><ul>
224230
<li><a class="reference internal" href="#initializing">Initializing</a></li>
225231
<li><a class="reference internal" href="#creating-sessions">Creating Sessions</a></li>
226232
<li><a class="reference internal" href="#generating-tokens">Generating Tokens</a></li>
227233
<li><a class="reference internal" href="#working-with-archives">Working with Archives</a></li>
228234
</ul>
229235
</li>
236+
<li><a class="reference internal" href="#samples">Samples</a></li>
230237
<li><a class="reference internal" href="#documentation">Documentation</a></li>
231238
<li><a class="reference internal" href="#requirements">Requirements</a></li>
232-
<li><a class="reference internal" href="#release-notes">Release Notes</a><ul>
233-
<li><a class="reference internal" href="#important-changes-in-v2-0">Important changes in v2.0</a></li>
234-
</ul>
235-
</li>
239+
<li><a class="reference internal" href="#release-notes">Release Notes</a></li>
240+
<li><a class="reference internal" href="#id1">Important changes in v2.2</a></li>
236241
<li><a class="reference internal" href="#development-and-contributing">Development and Contributing</a></li>
237242
<li><a class="reference internal" href="#support">Support</a></li>
238243
</ul>
@@ -267,6 +272,9 @@ <h3>Navigation</h3>
267272
<li class="right" style="margin-right: 10px">
268273
<a href="genindex.html" title="General Index"
269274
>index</a></li>
275+
<li class="right" >
276+
<a href="py-modindex.html" title="Python Module Index"
277+
>modules</a> |</li>
270278
<li><a href="index.html">OpenTok Python SDK 2.2 2.2.0 documentation</a> &raquo;</li>
271279
</ul>
272280
</div>

docs/_sources/README.txt

Lines changed: 34 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -2,39 +2,32 @@
22
OpenTok Python SDK
33
==================
44

5-
.. image:: https://travis-ci.org/aoberoi/Opentok-Python-SDK.svg?branch=modernization
6-
:target: https://travis-ci.org/aoberoi/Opentok-Python-SDK
5+
.. image:: https://travis-ci.org/opentok/Opentok-Python-SDK.svg
6+
:target: https://travis-ci.org/opentok/Opentok-Python-SDK
77

88
The OpenTok Python SDK lets you generate
99
`sessions <http://tokbox.com/opentok/tutorials/create-session/>`_ and
1010
`tokens <http://tokbox.com/opentok/tutorials/create-token/>`_ for `OpenTok <http://www.tokbox.com/>`_
11-
applications. This version of the SDK also includes support for working with OpenTok 2.0 archives.
11+
applications, and `archive <http://www.tokbox.com/platform/archiving>`_ Opentok 2.0 sessions.
1212

13+
If you are updating from a previous version of this SDK, see
14+
`Important changes in v2.2 <#important-changes-in-v22>`_.
1315

14-
Installation
15-
------------
16-
17-
Pip (recommended):
18-
~~~~~~~~~~~~~~~~~~
16+
Installation using Pip (recommended):
17+
-------------------------------------
1918

2019
Pip helps manage dependencies for Python projects using the PyPI index. Find more info here:
2120
http://www.pip-installer.org/en/latest/
2221

2322
Add the ``opentok`` package as a dependency in your project. The most common way is to add it to your
2423
``requirements.txt`` file::
2524

26-
opentok>=2.2
25+
opentok>=2.2.0
2726

2827
Next, install the dependencies::
2928

3029
$ pip install -r requirements.txt
3130

32-
Manually:
33-
~~~~~~~~~
34-
35-
Download the latest package zip from the `Releases page
36-
<https://github.com/opentok/Opentok-Python-SDK/releases>`_
37-
3831

3932
Usage
4033
-----
@@ -56,15 +49,17 @@ Creating Sessions
5649

5750
The create an OpenTok Session, use the ``opentok.create_session()`` method. There are two optional
5851
keyword parameters for this method: ``location`` which can be set to a string containing an IP
59-
address, and ``p2p`` which is a boolean. This method returns a ``Session`` object. Its
60-
``session_id`` attribute is useful when saving to a persistent store (e.g. database).
52+
address, and ``media_mode`` which is a String (defined by the MediaModes class). This method returns
53+
a ``Session`` object. Its ``session_id`` attribute is useful when saving to a persistent store (such
54+
as a database).
6155

6256
.. code:: python
6357

64-
# Just a plain Session
58+
# Just a plain Session:
6559
session = opentok.create_session()
66-
# A p2p Session
67-
session = opentok.create_session(p2p=True)
60+
# A Session that attempts to send streams directly between clients (falling back
61+
# to use the OpenTok TURN server to relay streams if the clients cannot connect):
62+
session = opentok.create_session(media_mode=MediaModes.relayed)
6863
# A Session with a location hint
6964
session = opentok.create_session(location=u'12.34.56.78')
7065

@@ -154,10 +149,19 @@ instance of the ``ArchiveList`` class.
154149
# Get the total number of Archives for this API Key
155150
total = archive_list.total
156151

152+
Samples
153+
-------
154+
155+
There are two sample applications included in this repository. To get going as fast as possible, clone the whole
156+
repository and follow the Walkthroughs:
157+
158+
- `HelloWorld <sample/HelloWorld/README.md>`_
159+
- `Archiving <sample/Archiving/README.md>`_
160+
157161
Documentation
158162
-------------
159163

160-
Reference documentation is available at <http://www.tokbox.com//opentok/libraries/server/python/reference/index.html> and in the
164+
Reference documentation is available at <http://www.tokbox.com/opentok/libraries/server/python/reference/index.html> and in the
161165
docs directory of the SDK.
162166

163167
Requirements
@@ -173,19 +177,22 @@ Release Notes
173177
See the `Releases <https://github.com/opentok/Opentok-Python-SDK/releases>`_ page for details about
174178
each release.
175179

176-
Important changes in v2.0
177-
~~~~~~~~~~~~~~~~~~~~~~~~~
180+
Important changes in v2.2
181+
-------------------------
178182

179183
This version of the SDK includes support for working with OpenTok 2.0 archives. (This API does not
180184
work with OpenTok 1.0 archives.)
181185

186+
The OpenTok.create_session() method now includes a media_mode parameter, instead of a p2p parameter.
187+
188+
For details, see the reference documentation at
189+
<http://www.tokbox.com/opentok/libraries/server/python/reference/index.html>.
190+
182191
Development and Contributing
183192
----------------------------
184193

185-
Interested in contributing? We <3 pull requests! File a new
186-
`Issue <https://github.com/opentok/opentok-python-sdk/issues>`_ or take a look at the existing ones.
187-
If you are going to send us a pull request, please try to run the test suite first and also include
188-
tests for your changes.
194+
Interested in contributing? We :heart: pull requests! See the `Development <DEVELOPING.md>`_ and
195+
`Contribution <CONTRIBUTING.md>`_ guidelines.
189196

190197
Support
191198
-------

docs/docs/opentok.html

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ <h2>Submodules<a class="headerlink" href="#submodules" title="Permalink to this
124124

125125
<dl class="class">
126126
<dt id="opentok.archives.ArchiveList">
127-
<em class="property">class </em><tt class="descclassname">opentok.archives.</tt><tt class="descname">ArchiveList</tt><big>(</big><em>values</em><big>)</big><a class="headerlink" href="#opentok.archives.ArchiveList" title="Permalink to this definition"></a></dt>
127+
<em class="property">class </em><tt class="descclassname">opentok.archives.</tt><tt class="descname">ArchiveList</tt><big>(</big><em>sdk</em>, <em>values</em><big>)</big><a class="headerlink" href="#opentok.archives.ArchiveList" title="Permalink to this definition"></a></dt>
128128
<dd><p>Bases: <tt class="xref py py-class docutils literal"><span class="pre">object</span></tt></p>
129129
<dl class="method">
130130
<dt id="opentok.archives.ArchiveList.attrs">
@@ -254,15 +254,19 @@ <h2>Submodules<a class="headerlink" href="#submodules" title="Permalink to this
254254
<tbody valign="top">
255255
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
256256
<li><strong>mediaMode</strong> (<em>String</em>) &#8211; <p>Determines whether the session will transmit streams using the
257-
OpenTok Media Router (MediaMode.ROUTED) or not (MediaMode.RELAYED). By default,
258-
sessions use the OpenTok Media Router.</p>
257+
OpenTok Media Router (MediaMode.routed) or not (MediaMode.relayed). By default,
258+
the setting is MediaMode.relayed.</p>
259+
<p>With the mediaMode property set to MediaMode.relayed, the session
260+
will attempt to transmit streams directly between clients. If clients cannot connect
261+
due to firewall restrictions, the session uses the OpenTok TURN server to relay
262+
audio-video streams.</p>
259263
<p>The OpenTok Media Router (see <a class="reference external" href="http://www.tokbox.com/#multiparty">http://www.tokbox.com/#multiparty</a>)
260264
provides the following benefits:</p>
261265
<blockquote>
262266
<div><ul>
263267
<li><dl class="first docutils">
264268
<dt>The OpenTok Media Router can decrease bandwidth usage in multiparty sessions.</dt>
265-
<dd>(When the mediaMode property is set to MediaMode.RELAYED, each client must send
269+
<dd>(When the mediaMode property is set to MediaMode.relayed, each client must send
266270
a separate audio-video stream to each client subscribing to it.)</dd>
267271
</dl>
268272
</li>
@@ -276,10 +280,6 @@ <h2>Submodules<a class="headerlink" href="#submodules" title="Permalink to this
276280
you record, save, and retrieve OpenTok sessions (see <a class="reference external" href="http://tokbox.com/platform/archiving">http://tokbox.com/platform/archiving</a>).</li>
277281
</ul>
278282
</div></blockquote>
279-
<p>With the mediaMode property set to MediaMode.RELAYED, the session
280-
will attempt to transmit streams directly between clients. If clients cannot connect
281-
due to firewall restrictions, the session uses the OpenTok TURN server to relay
282-
audio-video streams.</p>
283283
<p>You will be billed for streamed minutes if you use the OpenTok Media Router or if the
284284
session uses the OpenTok TURN server to relay streams. For information on pricing, see
285285
the OpenTok pricing page (<a class="reference external" href="http://www.tokbox.com/pricing">http://www.tokbox.com/pricing</a>).</p>

docs/objects.inv

0 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)