Skip to content

Commit 0f9db37

Browse files
committed
Docs additions for archive hasAudio/hasVideo
1 parent 7de936b commit 0f9db37

File tree

3 files changed

+24
-10
lines changed

3 files changed

+24
-10
lines changed

README.rst

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,16 @@ a Session that has clients connection.
101101
# Store this archive_id in the database
102102
archive_id = archive.id
103103
104+
You can also disable audio or video recording by setting the `hasAudio` or `hasVideo` property of
105+
the `options` parameter to `false`:
106+
107+
.. code:: python
108+
109+
archive = opentok.start_archive(session_id, name=u'Important Presentation', hasVideo=False)
110+
111+
# Store this archive_id in the database
112+
archive_id = archive.id
113+
104114
You can stop the recording of a started Archive using the ``opentok.stop_archive(archive_id)``
105115
method. You can also do this using the ``archive.stop()`` method of an ``Archive`` instance.
106116

opentok/archives.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,14 @@ class Archive(object):
1919
:ivar duration:
2020
The duration of the archive, in milliseconds.
2121
22+
:ivar hasAudio:
23+
Boolean value set to true when the archive contains an audio track,
24+
and set to false otherwise.
25+
26+
:ivar hasVideo:
27+
Boolean value set to true when the archive contains a video track,
28+
and set to false otherwise.
29+
2230
:ivar id:
2331
The archive ID.
2432
@@ -52,14 +60,6 @@ class Archive(object):
5260
Amazon S3 bucket or Windows Azure container that you set at the
5361
`OpenTok dashboard <https://dashboard.tokbox.com>`_.
5462
55-
:ivar hasAudio:
56-
Boolean value set to true when the archive contains an audio track,
57-
and set to false otherwise.
58-
59-
:ivar hasVideo:
60-
Boolean value set to true when the archive contains a video track,
61-
and set to false otherwise.
62-
6363
:ivar url:
6464
The download URL of the available MP4 file. This is only set for an archive with the status set to
6565
"available"; for other archives, (including archives with the status "uploaded") this property is

opentok/opentok.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -278,8 +278,12 @@ def start_archive(self, session_id, hasAudio=True, hasVideo=True, name=None):
278278
:param String name: This is the name of the archive. You can use this name
279279
to identify the archive. It is a property of the Archive object, and it is a property
280280
of archive-related events in the OpenTok.js library.
281-
:param Boolean hasAudio: if set to true, an audio track will be inserted to the archive. hasAudio is an optional parameter that is set to true by default.
282-
:param Boolean hasVideo: if set to true, a video track will be inserted to the archive. hasVideo is an optional parameter that is set to true by default.
281+
:param Boolean hasAudio: if set to True, an audio track will be inserted to the archive.
282+
hasAudio is an optional parameter that is set to True by default. If you set both
283+
hasAudio and hasVideo to False, the call to the start_archive() method results in
284+
an error.
285+
:param Boolean hasVideo: if set to True, a video track will be inserted to the archive.
286+
hasVideo is an optional parameter that is set to True by default.
283287
284288
:rtype: The Archive object, which includes properties defining the archive,
285289
including the archive ID.

0 commit comments

Comments
 (0)