@@ -477,6 +477,7 @@ def start_archive(
477477 name = None ,
478478 output_mode = OutputModes .composed ,
479479 resolution = None ,
480+ layout = None ,
480481 ):
481482 """
482483 Starts archiving an OpenTok session.
@@ -508,6 +509,19 @@ def start_archive(
508509 or "1280x720". This parameter only applies to composed archives. If you set this
509510 parameter and set the output_mode parameter to OutputModes.individual, the call to the
510511 start_archive() method results in an error.
512+ :param Dictionary 'layout' optional: Specify this to assign the initial layout type for the
513+ archive.
514+
515+ String 'type': Type of layout. Valid values for the layout property are "bestFit" (best fit),
516+ "custom" (custom), "horizontalPresentation" (horizontal presentation), "pip" (picture-in-picture),
517+ and "verticalPresentation" (vertical presentation)). If you specify a "custom" layout type, set
518+ the stylesheet property of the layout object to the stylesheet.
519+
520+ String 'stylesheet' optional: Custom stylesheet to use for layout. Must set 'type' to custom,
521+ and cannot use 'screenshareType'
522+
523+ String 'screenshareType' optional: Layout to use for screenshares. If this is set, you must
524+ set 'type' to 'bestFit'
511525
512526 :rtype: The Archive object, which includes properties defining the archive,
513527 including the archive ID.
@@ -535,6 +549,9 @@ def start_archive(
535549 "resolution" : resolution ,
536550 }
537551
552+ if layout is not None :
553+ payload ['layout' ] = layout
554+
538555 logger .debug (
539556 "POST to %r with params %r, headers %r, proxies %r" ,
540557 self .endpoints .archive_url (),
@@ -898,7 +915,7 @@ def force_disconnect(self, session_id, connection_id):
898915 else :
899916 raise RequestError ("An unexpected error occurred" , response .status_code )
900917
901- def set_archive_layout (self , archive_id , layout_type , stylesheet = None ):
918+ def set_archive_layout (self , archive_id , layout_type , stylesheet = None , screenshare_type = None ):
902919 """
903920 Use this method to change the layout of videos in an OpenTok archive
904921
@@ -909,11 +926,17 @@ def set_archive_layout(self, archive_id, layout_type, stylesheet=None):
909926
910927 :param String stylesheet optional: CSS used to style the custom layout.
911928 Specify this only if you set the type property to 'custom'
929+
930+ :param String screenshare_type optional: Layout to use for screenshares. Must
931+ set 'layout_type' to 'bestFit'
912932 """
913933 payload = {
914934 "type" : layout_type ,
915935 }
916936
937+ if screenshare_type is not None :
938+ payload ["screenshareType" ] = screenshare_type
939+
917940 if layout_type == "custom" :
918941 if stylesheet is not None :
919942 payload ["stylesheet" ] = stylesheet
@@ -1096,11 +1119,18 @@ def start_broadcast(self, session_id, options):
10961119 :param Dictionary options, with the following properties:
10971120
10981121 Dictionary 'layout' optional: Specify this to assign the initial layout type for the
1099- broadcast. Valid values for the layout property are "bestFit", "custom",
1100- "horizontalPresentation", "pip" and "verticalPresentation". If you specify a "custom"
1101- layout type, set the stylesheet property of the layout object to the stylesheet.
1102- If you do not specify an initial layout type, the broadcast stream uses the Best Fit
1103- layout type
1122+ broadcast.
1123+
1124+ String 'type': Type of layout. Valid values for the layout property are "bestFit" (best fit),
1125+ "custom" (custom), "horizontalPresentation" (horizontal presentation), "pip" (picture-in-picture),
1126+ and "verticalPresentation" (vertical presentation)). If you specify a "custom" layout type, set
1127+ the stylesheet property of the layout object to the stylesheet.
1128+
1129+ String 'stylesheet' optional: Custom stylesheet to use for layout. Must set 'type' to custom,
1130+ and cannot use 'screenshareType'
1131+
1132+ String 'screenshareType' optional: Layout to use for screenshares. If this is set, you must
1133+ set 'type' to 'bestFit'
11041134
11051135 Integer 'maxDuration' optional: The maximum duration for the broadcast, in seconds.
11061136 The broadcast will automatically stop when the maximum duration is reached. You can
@@ -1241,7 +1271,7 @@ def get_broadcast(self, broadcast_id):
12411271 else :
12421272 raise RequestError ("OpenTok server error." , response .status_code )
12431273
1244- def set_broadcast_layout (self , broadcast_id , layout_type , stylesheet = None ):
1274+ def set_broadcast_layout (self , broadcast_id , layout_type , stylesheet = None , screenshare_type = None ):
12451275 """
12461276 Use this method to change the layout type of a live streaming broadcast
12471277
@@ -1252,11 +1282,17 @@ def set_broadcast_layout(self, broadcast_id, layout_type, stylesheet=None):
12521282
12531283 :param String stylesheet optional: CSS used to style the custom layout.
12541284 Specify this only if you set the type property to 'custom'
1285+
1286+ :param String screenshare_type optional: Layout to use for screenshares. Must
1287+ set 'layout_type' to 'bestFit'
12551288 """
12561289 payload = {
12571290 "type" : layout_type ,
12581291 }
12591292
1293+ if screenshare_type is not None :
1294+ payload ["screenshareType" ] = screenshare_type
1295+
12601296 if layout_type == "custom" :
12611297 if stylesheet is not None :
12621298 payload ["stylesheet" ] = stylesheet
0 commit comments