Skip to content

Commit fddb2dd

Browse files
committed
enabled multiArchive and multiBroadcast options for start_archive and start_broadcast methods
1 parent 290fdef commit fddb2dd

File tree

2 files changed

+45
-2
lines changed

2 files changed

+45
-2
lines changed

README.rst

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,13 @@ Warning: This value cannot be set for Individual output mode, an error will be t
160160
# Store this archive_id in the database
161161
archive_id = archive.id
162162
163+
You can enable multiple simultaneous archives by specifying a unique value for the ``multi_archive_tag``
164+
parameter in the ``start_archive`` method.
165+
166+
.. code:: python
167+
168+
archive = opentok.start_archive(session_id, name=u'Important Presentation', multi_archive_tag='MyArchiveTag')
169+
163170
You can stop the recording of a started Archive using the ``opentok.stop_archive(archive_id)``
164171
method. You can also do this using the ``archive.stop()`` method of an ``Archive`` instance.
165172

@@ -403,6 +410,36 @@ The live streaming broadcast can target one HLS endpoint and up to five RTMP ser
403410
404411
broadcast = opentok.start_broadcast(session_id, options)
405412
413+
To enable multiple simultaneous broadcasts on the same session, specify a unique value for the
414+
``multiBroadcastTag`` parameter in ``options`` when calling the ``opentok.start_broadcast`` method.
415+
416+
.. code:: python
417+
418+
session_id = 'SESSIONID'
419+
options = {
420+
'multiBroadcastTag': 'unique_broadcast_tag'
421+
'layout': {
422+
'type': 'custom',
423+
'stylesheet': 'the layout stylesheet (only used with type == custom)'
424+
},
425+
'maxDuration': 5400,
426+
'outputs': {
427+
'hls': {},
428+
'rtmp': [{
429+
'id': 'foo',
430+
'serverUrl': 'rtmp://myfooserver/myfooapp',
431+
'streamName': 'myfoostream'
432+
}, {
433+
'id': 'bar',
434+
'serverUrl': 'rtmp://mybarserver/mybarapp',
435+
'streamName': 'mybarstream'
436+
}]
437+
},
438+
'resolution': '640x480'
439+
}
440+
441+
broadcast = opentok.start_broadcast(session_id, options)
442+
406443
You can stop a started Broadcast using the ``opentok.stop_broadcast(broadcast_id)`` method.
407444

408445
.. code:: python

opentok/opentok.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -484,7 +484,8 @@ def start_archive(
484484
output_mode=OutputModes.composed,
485485
stream_mode=StreamModes.auto,
486486
resolution=None,
487-
layout=None
487+
layout=None,
488+
multi_archive_tag=None
488489
):
489490
"""
490491
Starts archiving an OpenTok session.
@@ -535,6 +536,8 @@ def start_archive(
535536
StreamModes.manual to explicitly select streams to include in the the archive, using the
536537
OpenTok.add_archive_stream() and OpenTok.remove_archive_stream() methods.
537538
539+
:param String multi_archive_tag (Optional): If specified, triggers a new simultaneous archive on the session.
540+
538541
:rtype: The Archive object, which includes properties defining the archive,
539542
including the archive ID.
540543
"""
@@ -559,7 +562,8 @@ def start_archive(
559562
"hasVideo": has_video,
560563
"outputMode": output_mode.value,
561564
"resolution": resolution,
562-
"streamMode": stream_mode.value
565+
"streamMode": stream_mode.value,
566+
"multiArchiveTag": multi_archive_tag
563567
}
564568

565569
if layout is not None:
@@ -1314,6 +1318,8 @@ def start_broadcast(self, session_id, options, stream_mode=BroadcastStreamModes.
13141318
String 'resolution' optional: The resolution of the broadcast, either "640x480"
13151319
(SD, the default) or "1280x720" (HD)
13161320
1321+
String 'multiBroadcastTag' optional: If specified, triggers a new simultaneous broadcast on the session.
1322+
13171323
:param BroadcastStreamModes stream_mode (Optional): Determines the broadcast stream handling mode.
13181324
Set this to BroadcastStreamModes.auto (the default) to have streams added automatically. Set this to
13191325
BroadcastStreamModes.manual to explicitly select streams to include in the the broadcast, using the

0 commit comments

Comments
 (0)