Start or Stop a Recording on a Channel
LiveSwitch has the capability to capture and store individual, multiple or mixed streams in real-time for easy archiving and post-processing.
To record your channel, do the following:
- Configure and enable recording from the Console of your Deployment Configuration and Channel.
- To start recordings on your channel, do one of the following:
- If your channel is active, close it and then restart it.
- If your channel is active but you don't want to restart it, start recording with the LiveSwitch SDK or REST API.
- If your channel isn't active, activate it.
Note
Channel configurations only take effect on channel activation.
Start or Stop a Recording on an Active Channel
Use the LiveSwitch SDK to start or stop a recording on an active channel.
Note
In order to be able to modify recording through the SDK, channel settings must be set appropriately. See Control Channel Settings.
// ChannelClaims must have the "CanUpdate" flag set to true
var ChannelClaims = new[] { new ChannelClaim(ChannelId) { CanUpdate = true } };
// The Channel object mentioned here is the one returned when you call Client.Register()
var channelConfig = new ChannelConfig();
channelConfig.Recording = true;
channelConfig.RecordingMode = "AudioVideo";
channel.Update(channelConfig);
Use the REST API to start a recording on an active channel, user, device, client, or connection. REST API is the only way to enable recording for a subset of connections instead of all connections on the channel.
PUT /api/v1/applications/{applicationId}/channels/{channelId}
PUT /api/v1/applications/{applicationId}/channels/{channelId}/users/{userId}
PUT /api/v1/applications/{applicationId}/channels/{channelId}/users/{userId}/devices/{deviceId}
In all cases, the body of the PUT request must have the following:
{
"recording": true,
"recordingMode": "AudioVideo"
}
Note
Other requirements for the calls can be found in their respective REST API documentation linked above.