Search Results for

    Show / Hide Table of Contents

    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:

    1. Configure and enable recording from the Console of your Deployment Configuration and Channel.
    2. 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.

    • CSharp
    • Android
    • iOS
    • JavaScript
    // 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);
    
    // ChannelClaims must have the "CanUpdate" flag set to true
    final ChannelClaim channelClaim = new ChannelClaim(channelId);
    channelClaim.setCanUpdate(true);
    final ChannelClaim[] channelClaims = new ChannelClaim[]{channelClaim};
    
    // The Channel object mentioned here is the one returned when you call Client.Register()
    final ChannelConfig channelConfig = new ChannelConfig();
    channelConfig.setRecording(NullableBoolean.trueValue());
    channelConfig.setRecordingMode("AudioVideo");
    channel.update(channelConfig);
    
    // ChannelClaims must have the "CanUpdate" flag set to true
    let channelClaim: FMLiveSwitchChannelClaim = FMLiveSwitchChannelClaim.init(id: channelId)
    channelClaim.setCanUpdate(true)
    let channelClaims: NSMutableArray = [channelClaim]
    
    // The Channel object mentioned here is the one returned when you call Client.Register()
    let channelConfig: FMLiveSwitchChannelConfig = FMLiveSwitchChannelConfig.init()
    channelConfig.setRecording(FMLiveSwitchNullableBool.fromValue(true))
    channelConfig.setRecordingMode("AudioVideo");
    channel?.update(withNewConfig: channelConfig)
    
    // ChannelClaims must have the "CanUpdate" flag set to true
    let channelClaim = new fm.liveswitch.ChannelClaim(channelId);
    channelClaim.setCanUpdate(true);
    let channelClaims = [channelClaim];
    
    // The Channel object mentioned here is the one returned when you call Client.Register()
    let channelConfig = new fm.liveswitch.ChannelConfig();
    channelConfig.setRecording(true);
    channelConfig.setRecordingMode("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}

    • PUT /api/v1/applications/{applicationId}/channels/{channelId}/users/{userId}/devices/{deviceId}/clients/{clientId}

    • PUT /api​/v1​/applications​/{applicationId}​/channels​/{channelId}​/users​/{userId}​/devices​/{deviceId}​/clients​/{clientId}​/connections​/{connectionId}

    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.

    In This Article
    Back to top Copyright © LiveSwitch Inc. All Rights Reserved.Documentation for LiveSwitch Version 1.24.6