@@ -477,6 +477,7 @@ def start_archive(
477
477
name = None ,
478
478
output_mode = OutputModes .composed ,
479
479
resolution = None ,
480
+ layout = None ,
480
481
):
481
482
"""
482
483
Starts archiving an OpenTok session.
@@ -508,6 +509,19 @@ def start_archive(
508
509
or "1280x720". This parameter only applies to composed archives. If you set this
509
510
parameter and set the output_mode parameter to OutputModes.individual, the call to the
510
511
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'
511
525
512
526
:rtype: The Archive object, which includes properties defining the archive,
513
527
including the archive ID.
@@ -535,6 +549,9 @@ def start_archive(
535
549
"resolution" : resolution ,
536
550
}
537
551
552
+ if layout is not None :
553
+ payload ['layout' ] = layout
554
+
538
555
logger .debug (
539
556
"POST to %r with params %r, headers %r, proxies %r" ,
540
557
self .endpoints .archive_url (),
@@ -898,7 +915,7 @@ def force_disconnect(self, session_id, connection_id):
898
915
else :
899
916
raise RequestError ("An unexpected error occurred" , response .status_code )
900
917
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 ):
902
919
"""
903
920
Use this method to change the layout of videos in an OpenTok archive
904
921
@@ -909,11 +926,17 @@ def set_archive_layout(self, archive_id, layout_type, stylesheet=None):
909
926
910
927
:param String stylesheet optional: CSS used to style the custom layout.
911
928
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'
912
932
"""
913
933
payload = {
914
934
"type" : layout_type ,
915
935
}
916
936
937
+ if screenshare_type is not None :
938
+ payload ["screenshareType" ] = screenshare_type
939
+
917
940
if layout_type == "custom" :
918
941
if stylesheet is not None :
919
942
payload ["stylesheet" ] = stylesheet
@@ -1096,11 +1119,18 @@ def start_broadcast(self, session_id, options):
1096
1119
:param Dictionary options, with the following properties:
1097
1120
1098
1121
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'
1104
1134
1105
1135
Integer 'maxDuration' optional: The maximum duration for the broadcast, in seconds.
1106
1136
The broadcast will automatically stop when the maximum duration is reached. You can
@@ -1241,7 +1271,7 @@ def get_broadcast(self, broadcast_id):
1241
1271
else :
1242
1272
raise RequestError ("OpenTok server error." , response .status_code )
1243
1273
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 ):
1245
1275
"""
1246
1276
Use this method to change the layout type of a live streaming broadcast
1247
1277
@@ -1252,11 +1282,17 @@ def set_broadcast_layout(self, broadcast_id, layout_type, stylesheet=None):
1252
1282
1253
1283
:param String stylesheet optional: CSS used to style the custom layout.
1254
1284
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'
1255
1288
"""
1256
1289
payload = {
1257
1290
"type" : layout_type ,
1258
1291
}
1259
1292
1293
+ if screenshare_type is not None :
1294
+ payload ["screenshareType" ] = screenshare_type
1295
+
1260
1296
if layout_type == "custom" :
1261
1297
if stylesheet is not None :
1262
1298
payload ["stylesheet" ] = stylesheet
0 commit comments