@@ -19,7 +19,7 @@ http://www.pip-installer.org/en/latest/
1919Add the ``opentok `` package as a dependency in your project. The most common way is to add it to your
2020``requirements.txt `` file::
2121
22- opentok>=2.4.1
22+ opentok>=2.5.0
2323
2424Next, install the dependencies::
2525
@@ -44,10 +44,20 @@ Import the package at the top of any file where you will use it. At the very lea
4444 Creating Sessions
4545~~~~~~~~~~~~~~~~~
4646
47- The create an OpenTok Session, use the ``opentok.create_session() `` method. There are three optional
48- keyword parameters for this method: ``location `` which can be set to a string containing an IP
49- address, ``media_mode `` which is a String (defined by the MediaModes class) and ``archive_mode `` which
50- specifies whether the session will be automatically archived (``always ``) or not (``manual ``).
47+ To create an OpenTok Session, use the ``opentok.create_session() `` method. There are three optional
48+ keyword parameters for this method:
49+
50+ * ``location `` which can be set to a string containing an IP address.
51+
52+ * ``media_mode `` which is a String (defined by the MediaModes class).
53+ This determines whether the session will use the
54+ `OpenTok Media Router <https://tokbox.com/developer/guides/create-session/#media-mode >`_
55+ or attempt to send streams directly between clients. A routed session is required for some
56+ OpenTok features (such as archiving).
57+
58+ * ``archive_mode `` which specifies whether the session will be automatically archived (``always ``)
59+ or not (``manual ``).
60+
5161This method returns a ``Session `` object. Its ``session_id `` attribute is useful when saving to a persistent
5262store (such as a database).
5363
@@ -58,7 +68,7 @@ store (such as a database).
5868 session = opentok.create_session()
5969
6070 from opentok import MediaModes
61- # A session that uses the OpenTok Media Router:
71+ # A session that uses the OpenTok Media Router, which is required for archiving :
6272 session = opentok.create_session(media_mode = MediaModes.routed)
6373
6474 # An automatically archived session:
@@ -75,8 +85,9 @@ Generating Tokens
7585
7686Once a Session is created, you can start generating Tokens for clients to use when connecting to it.
7787You can generate a token either by calling the ``opentok.generate_token(session_id) `` method or by
78- calling the ``session.generate_token() `` method on a ``Session `` instance after creating it. There
79- is a set of optional keyword parameters: ``role ``, ``expire_time ``, and ``data ``.
88+ calling the ``session.generate_token() `` method on a ``Session `` instance after creating it. Both
89+ have a set of optional keyword parameters: ``role ``, ``expire_time ``, ``data ``, and
90+ ``initial_layout_class_list ``.
8091
8192.. code :: python
8293
@@ -89,15 +100,19 @@ is a set of optional keyword parameters: ``role``, ``expire_time``, and ``data``
89100 # Set some options in a token
90101 token = session.generate_token(role = Roles.moderator,
91102 expire_time = int (time.time()) + 10 ,
92- data = u ' name=Johnny' )
103+ data = u ' name=Johnny'
104+ initial_layout_class_list = [u ' focus' ])
93105
94106 Working with Archives
95107~~~~~~~~~~~~~~~~~~~~~
96108
109+ You can only archive sessions that use the OpenTok Media
110+ Router (sessions with the media mode set to routed).
111+
97112You can start the recording of an OpenTok Session using the ``opentok.start_archive(session_id) ``
98113method. This method takes an optional keyword argument ``name `` to assign a name to the archive.
99114This method will return an ``Archive `` instance. Note that you can only start an Archive on
100- a Session that has clients connection .
115+ a Session that has clients connected .
101116
102117.. code :: python
103118
@@ -194,15 +209,14 @@ repository and follow the Walkthroughs:
194209Documentation
195210-------------
196211
197- Reference documentation is available at <http://www.tokbox.com/opentok/libraries/server/python/reference/index.html> and in the
198- docs directory of the SDK.
212+ Reference documentation is available at <http://www.tokbox.com/opentok/libraries/server/python/reference/index.html>.
199213
200214Requirements
201215------------
202216
203217You need an OpenTok API key and API secret, which you can obtain at https://dashboard.tokbox.com/
204218
205- The OpenTok Python SDK requires Python 2.6, 2.7, 3.2 , 3.3, or 3.4
219+ The OpenTok Python SDK requires Python 2.6, 2.7, 3.3 , 3.4, 3.5 or 3.6
206220
207221Release Notes
208222-------------
0 commit comments