@@ -283,6 +283,18 @@ public function createSession($options = array())
283283 * <code>hasVideo</code> to false, the call to the <code>startArchive()</code> method results
284284 * in an error.</li>
285285 *
286+ * <li><code>'streamMode'</code> (String) — Whether streams included in the archive are
287+ * selected automatically (<code>StreamMode.AUTO</code>, the default) or manually
288+ * (<code>StreamMode.MANUAL</code>). When streams are selected automatically
289+ * (<code>StreamMode.AUTO</code>), all streams in the session can be included in the archive.
290+ * When streams are selected manually (<code>StreamMode.MANUAL</code>), you specify streams
291+ * to be included based on calls to the <code>Archive.addStreamToArchive()</code> and
292+ * <code>Archive.removeStreamFromArchive()</code>. methods. With manual mode, you can specify
293+ * whether a stream's audio, video, or both are included in the archive. In both automatic and
294+ * manual modes, the archive composer includes streams based on
295+ * <a href="https://tokbox.com/developer/guides/archive-broadcast-layout/#stream-prioritization-rules">stream
296+ * prioritization rules</a>.</li>
297+ *
286298 * <li><code>'hasAudio'</code> (Boolean) — Whether the archive will record audio
287299 * (true, the default) or not (false). If you set both <code>hasAudio</code> and
288300 * <code>hasVideo</code> to false, the call to the <code>startArchive()</code> method results
@@ -315,15 +327,17 @@ public function startArchive(string $sessionId, $options = []): Archive
315327 'hasAudio ' => true ,
316328 'outputMode ' => OutputMode::COMPOSED ,
317329 'resolution ' => null ,
330+ 'streamMode ' => StreamMode::AUTO
318331 );
319332 $ options = array_merge ($ defaults , array_intersect_key ($ options , $ defaults ));
320- list ($ name , $ hasVideo , $ hasAudio , $ outputMode , $ resolution ) = array_values ($ options );
333+ list ($ name , $ hasVideo , $ hasAudio , $ outputMode , $ resolution, $ streamMode ) = array_values ($ options );
321334 // validate arguments
322335 Validators::validateSessionId ($ sessionId );
323336 Validators::validateArchiveName ($ name );
324337 Validators::validateArchiveHasVideo ($ hasVideo );
325338 Validators::validateArchiveHasAudio ($ hasAudio );
326339 Validators::validateArchiveOutputMode ($ outputMode );
340+ Validators::validateHasStreamMode ($ streamMode );
327341
328342 if ((is_null ($ resolution ) || empty ($ resolution )) && $ outputMode === OutputMode::COMPOSED ) {
329343 $ options ['resolution ' ] = "640x480 " ;
@@ -598,6 +612,19 @@ public function disableForceMute(string $sessionId, array $options): bool
598612 * <a href="https://tokbox.com/developer/guides/broadcast/live-streaming/#configuring-live-streaming-video-layout">Configuring
599613 * Video Layout for the OpenTok live streaming feature</a>.
600614 * </li>
615+ *
616+ * <li><code>'streamMode'</code> (String) — Whether streams included in the broadcast
617+ * are selected automatically (<code>StreamMode.AUTO</code>, the default) or manually
618+ * (<code>StreamMode.MANUAL</code>). When streams are selected automatically
619+ * (<code>StreamMode.AUTO</code>), all streams in the session can be included in the broadcast.
620+ * When streams are selected manually (<code>StreamMode.MANUAL</code>), you specify streams
621+ * to be included based on calls to the <code>Broadcast.addStreamToBroadcast()</code> and
622+ * <code>Broadcast.removeStreamFromBroadcast()</code> methods. With manual mode, you can specify
623+ * whether a stream's audio, video, or both are included in the broadcast. In both automatic and
624+ * manual modes, the broadcast composer includes streams based on
625+ * <a href="https://tokbox.com/developer/guides/archive-broadcast-layout/#stream-prioritization-rules">stream
626+ * prioritization rules</a>.</li>
627+ *
601628 * </ul>
602629 *
603630 * @return Broadcast An object with properties defining the broadcast.
@@ -609,14 +636,16 @@ public function startBroadcast(string $sessionId, array $options = []): Broadcas
609636 // not preferred to depend on that in the SDK because its then harder to garauntee backwards
610637 // compatibility
611638 $ defaults = array (
612- 'layout ' => Layout::getBestFit ()
639+ 'layout ' => Layout::getBestFit (),
640+ 'streamMode ' => 'auto '
613641 );
614642 $ options = array_merge ($ defaults , $ options );
615- list ($ layout ) = array_values ($ options );
643+ list ($ layout, $ streamMode ) = array_values ($ options );
616644
617645 // validate arguments
618646 Validators::validateSessionId ($ sessionId );
619647 Validators::validateLayout ($ layout );
648+ Validators::validateHasStreamMode ($ streamMode );
620649
621650 // make API call
622651 $ broadcastData = $ this ->client ->startBroadcast ($ sessionId , $ options );
0 commit comments