@@ -58,6 +58,7 @@ address, and ``p2p`` which is a boolean. This method returns a ``Session`` objec
58
58
``session_id `` attribute is useful when saving to a persistent store (e.g. database).
59
59
60
60
.. code :: python
61
+
61
62
# Just a plain Session
62
63
session = opentok.create_session()
63
64
# A p2p Session
@@ -77,6 +78,7 @@ calling the ``session.generate_token()`` method on a ``Session`` instance after
77
78
is a set of optional keyword parameters: ``role ``, ``expire_time ``, and ``data ``.
78
79
79
80
.. code :: python
81
+
80
82
# Generate a Token from just a session_id (fetched from a database)
81
83
token = opentok.generate_token(session_id)
82
84
# Generate a Token by calling the method on the Session (returned from create_session)
@@ -97,6 +99,7 @@ This method will return an ``Archive`` instance. Note that you can only start an
97
99
a Session that has clients connection.
98
100
99
101
.. code :: python
102
+
100
103
archive = opentok.start_archive(session_id, name = u ' Important Presentation' )
101
104
102
105
# Store this archive_id in the database
@@ -106,6 +109,7 @@ You can stop the recording of a started Archive using the ``opentok.stop_archive
106
109
method. You can also do this using the ``archive.stop() `` method of an ``Archive `` instance.
107
110
108
111
.. code :: python
112
+
109
113
# Stop an Archive from an archive_id (fetched from database)
110
114
opentok.stop_archive(archive_id)
111
115
# Stop an Archive from an instance (returned from opentok.start_archive)
@@ -115,12 +119,14 @@ To get an ``Archive`` instance (and all the information about it) from an archiv
115
119
``opentok.get_archive(archive_id) `` method.
116
120
117
121
.. code :: python
122
+
118
123
archive = opentok.get_archive(archive_id)
119
124
120
125
To delete an Archive, you can call the ``opentok.delete_archive(archive_id) `` method or the
121
126
``archive.delete() `` method of an ``Archive `` instance.
122
127
123
128
.. code :: python
129
+
124
130
# Delete an Archive from an archive ID (fetched from database)
125
131
opentok.delete_archive(archive_id)
126
132
# Delete an Archive from an Archive instance (returned from opentok.start_archive or
@@ -133,6 +139,7 @@ done using the ``opentok.list_archives()`` method. There are two optional keywor
133
139
instance of the ``ArchiveList `` class.
134
140
135
141
.. code :: python
142
+
136
143
archive_list = opentok.list_archive()
137
144
138
145
# Get a specific Archive from the list
0 commit comments