How to Set the Layout Automatically
The standard layouts in MCU mode are one
, two
, four
, six
, and nine
, each corresponding to the number of video spots available.
The video stream layout updates automatically based on the number of active participants.
To enable the feature, set the layout
paramete to auto
in your request without specifying any additional layout parameters.
This operation requires an access_key
for the video call, which is obtained when initiating a video meeting via the API, when adding participants to an active session, or from the last 25 characters of the address of an ongoing meeting.
- curl
- node sdk
- go sdk
- php sdk
export ACCESS_KEY=...
$ curl -X POST \
-d "layout=auto" \
"https://api.eyeson.team/rooms/$ACCESS_KEY>/layout"
const accessKey = '...';
const eyeson = new Eyeson();
const user = await eyeson.getUser(accessKey);
await user.setLayout({ layout: 'auto' });
accessKey := "..."
userService, _ := eyeson.NewUserServiceFromAccessKey(accessKey)
userService.SetLayout(eyeson.Auto, &eyeson.SetLayoutOptions{
ShowNames: true,
})
$accessKey = '...';
$eyeson = new Eyeson();
$layout = $eyeson->layout($accessKey);
$layout->apply(['layout' => 'auto']);
If you have made multiple changes to the layout and wish to revert to the default settings, use this method.
However, this does not reset all layout configurations — settings like show_names
or voice_activation
will remain unchanged.