@@ -46,19 +46,20 @@ Import the package at the top of any file where you will use it. At the very lea
46
46
Creating Sessions
47
47
~~~~~~~~~~~~~~~~~
48
48
49
- The create an OpenTok Session, use the ``opentok.create_session() `` method. There are two optional
49
+ The create an OpenTok Session, use the ``opentok.create_session() `` method. There are three optional
50
50
keyword parameters for this method: ``location `` which can be set to a string containing an IP
51
- address, and ``media_mode `` which is a String (defined by the MediaModes class). This method returns
52
- a ``Session `` object. Its ``session_id `` attribute is useful when saving to a persistent store (such
53
- as a database).
51
+ address, ``media_mode `` which is a String (defined by the MediaModes class) and ``archive_mode `` which
52
+ specifies whether the session will be automatically archived (``always ``) or not (``manual ``).
53
+ This method returns a ``Session `` object. Its ``session_id `` attribute is useful when saving to a persistent
54
+ store (such as a database).
54
55
55
56
.. code :: python
56
57
57
58
# Create a session that attempts to send streams directly between clients (falling back
58
59
# to use the OpenTok TURN server to relay streams if the clients cannot connect):
59
60
session = opentok.create_session()
60
61
# A session that uses the OpenTok Media Router:
61
- session = opentok.create_session(media_mode = MediaModes.routed)
62
+ session = opentok.create_session(media_mode = MediaModes.routed, archive_mode = ArchiveModes.always )
62
63
# A session with a location hint
63
64
session = opentok.create_session(location = u ' 12.34.56.78' )
64
65
@@ -101,12 +102,23 @@ a Session that has clients connection.
101
102
# Store this archive_id in the database
102
103
archive_id = archive.id
103
104
104
- You can also disable audio or video recording by setting the `hasAudio ` or `hasVideo ` property of
105
+ You can also disable audio or video recording by setting the `has_audio ` or `has_video ` property of
105
106
the `options ` parameter to `false `:
106
107
107
108
.. code :: python
108
109
109
- archive = opentok.start_archive(session_id, name = u ' Important Presentation' , hasVideo = False )
110
+ archive = opentok.start_archive(session_id, name = u ' Important Presentation' , has_video = False )
111
+
112
+ # Store this archive_id in the database
113
+ archive_id = archive.id
114
+
115
+ By default, all streams are recorded to a single (composed) file. You can record the different
116
+ streams in the session to individual files (instead of a single composed file) by setting the
117
+ ``output_mode `` parameter of the ``opentok.start_archive() `` method `OutputModesModes.individual `.
118
+
119
+ .. code :: python
120
+
121
+ archive = opentok.start_archive(session_id, name = u ' Important Presentation' , output_mode = OutputModes.individual)
110
122
111
123
# Store this archive_id in the database
112
124
archive_id = archive.id
@@ -158,6 +170,10 @@ instance of the ``ArchiveList`` class.
158
170
# Get the total number of Archives for this API Key
159
171
total = archive_list.total
160
172
173
+ Note that you can also create an automatically archived session, by passing in ``ArchiveModes.always ``
174
+ as the ``archive_mode `` parameter when you call the ``opentok.create_session() `` method (see "Creating
175
+ Sessions," above).
176
+
161
177
Samples
162
178
-------
163
179
0 commit comments