ChannelMediaOptions
Channel media configuration options.
public class ChannelMediaOptions : OptionalJsonParse
{
public Optional<bool> publishCameraTrack = new Optional<bool>();
public Optional<bool> publishSecondaryCameraTrack = new Optional<bool>();
public Optional<bool> publishThirdCameraTrack = new Optional<bool>();
public Optional<bool> publishFourthCameraTrack = new Optional<bool>();
public Optional<bool> publishMicrophoneTrack = new Optional<bool>();
public Optional<bool> publishScreenCaptureVideo = new Optional<bool>();
public Optional<bool> publishScreenCaptureAudio = new Optional<bool>();
public Optional<bool> publishScreenTrack = new Optional<bool>();
public Optional<bool> publishSecondaryScreenTrack = new Optional<bool>();
public Optional<bool> publishThirdScreenTrack = new Optional<bool>();
public Optional<bool> publishFourthScreenTrack = new Optional<bool>();
public Optional<bool> publishCustomAudioTrack = new Optional<bool>();
public Optional<int> publishCustomAudioTrackId = new Optional<int>();
public Optional<bool> publishCustomVideoTrack = new Optional<bool>();
public Optional<bool> publishEncodedVideoTrack = new Optional<bool>();
public Optional<bool> publishMediaPlayerAudioTrack = new Optional<bool>();
public Optional<bool> publishMediaPlayerVideoTrack = new Optional<bool>();
public Optional<bool> publishTranscodedVideoTrack = new Optional<bool>();
public Optional<bool> publishLipSyncTrack = new Optional<bool>();
public Optional<bool> autoSubscribeAudio = new Optional<bool>();
public Optional<bool> autoSubscribeVideo = new Optional<bool>();
public Optional<bool> enableAudioRecordingOrPlayout = new Optional<bool>();
public Optional<int> publishMediaPlayerId = new Optional<int>();
public Optional<CLIENT_ROLE_TYPE> clientRoleType = new Optional<CLIENT_ROLE_TYPE>();
public Optional<AUDIENCE_LATENCY_LEVEL_TYPE> audienceLatencyLevel = new Optional<AUDIENCE_LATENCY_LEVEL_TYPE>();
public Optional<VIDEO_STREAM_TYPE> defaultVideoStreamType = new Optional<VIDEO_STREAM_TYPE>();
public Optional<CHANNEL_PROFILE_TYPE> channelProfile = new Optional<CHANNEL_PROFILE_TYPE>();
public Optional<string> token = new Optional<string>();
public Optional<bool> publishRhythmPlayerTrack = new Optional<bool>();
public Optional<bool> isInteractiveAudience = new Optional<bool>();
public Optional<video_track_id_t> customVideoTrackId = new Optional<video_track_id_t>();
public Optional<bool> isAudioFilterable;
public Optional<bool> enableMultipath;
public Optional<MultipathMode> uplinkMultipathMode;
public Optional<MultipathMode> downlinkMultipathMode;
public Optional<MultipathType> preferMultipathType = new Optional<bool>();
}
RtcConnection
publishMicrophoneTrack
publishCustomAudioTrack
publishMediaPlayerAudioTrack
true
publishCameraTrack
publishScreenCaptureVideo,
publishScreenTrack,
publishCustomVideoTrack
publishEncodedVideoTrack
true
Note: It is recommended that you set the member parameter values according to your business scenario. Otherwise, the SDK will assign values to the member parameters automatically.
Properties
- publishCameraTrack
- Sets whether to publish the video captured by the camera:
- true: Publishes the video captured by the camera.
- false: Does not publish the video captured by the camera.
- publishSecondaryCameraTrack
- Sets whether to publish the video captured by the second camera:
- true: Publishes the video captured by the second camera.
- false: Does not publish the video captured by the second camera.
- publishMicrophoneTrack
- Sets whether to publish the audio captured by the microphone:
- true: Publishes the audio captured by the microphone.
- false: Does not publish the audio captured by the microphone.
- publishThirdCameraTrack
-
Note: This parameter is only applicable to Android, Windows, and macOS platforms.Sets whether to publish the video captured by the third camera:
- true: Publishes the video captured by the third camera.
- false: Does not publish the video captured by the third camera.
- publishFourthCameraTrack
-
Note: This parameter is only applicable to Android, Windows, and macOS platforms.Sets whether to publish the video captured by the fourth camera:
- true: Publishes the video captured by the fourth camera.
- false: Does not publish the video captured by the fourth camera.
- publishScreenTrack
-
Note: This parameter is only applicable to Windows and macOS platforms.Sets whether to publish the video captured from the screen:
- true: Publishes the video captured from the screen.
- false: Does not publish the video captured from the screen.
- publishScreenCaptureVideo
-
Note: This parameter is only applicable to Android and iOS platforms.Sets whether to publish the video captured from the screen:
- true: Publishes the video captured from the screen.
- false: Does not publish the video captured from the screen.
- publishScreenCaptureAudio
-
Note: This parameter is only applicable to Android and iOS platforms.Sets whether to publish the audio captured from the screen:
- true: Publishes the audio captured from the screen.
- false: Does not publish the audio captured from the screen.
- publishSecondaryScreenTrack
- Sets whether to publish the video captured from the second screen:
- true: Publishes the video captured from the second screen.
- false: Does not publish the video captured from the second screen.
- publishThirdScreenTrack
-
Note: This parameter is only applicable to Windows and macOS platforms.Sets whether to publish the video captured from the third screen:
- true: Publishes the video captured from the third screen.
- false: Does not publish the video captured from the third screen.
- publishFourthScreenTrack
-
Note: This parameter is only applicable to Windows and macOS platforms.Sets whether to publish the video captured from the fourth screen:
- true: Publishes the video captured from the fourth screen.
- false: Does not publish the video captured from the fourth screen.
- publishTranscodedVideoTrack
- Sets whether to publish the local transcoded video:
- true: Publishes the local transcoded video.
- false: Does not publish the local transcoded video.
- publishMixedAudioTrack
- Sets whether to publish the local audio mixing:
- true: Publishes the local audio mixing.
- false: Does not publish the local audio mixing.
- publishLipSyncTrack
- Sets whether to publish the video processed by the voice-driven plugin:
- true: Publishes the video processed by the voice-driven plugin.
- false: (default) Does not publish the video processed by the voice-driven plugin.
- publishCustomAudioTrack
- Sets whether to publish the custom captured audio:
- true: Publishes the custom captured audio.
- false: Does not publish the custom captured audio.
- publishCustomAudioTrackId
- ID of the custom audio track to be published. The default value is 0. You can get the custom audio track ID through the CreateCustomAudioTrack method.
- publishCustomVideoTrack
- Sets whether to publish the custom captured video:
- true: Publishes the custom captured video.
- false: Does not publish the custom captured video.
- publishEncodedVideoTrack
- Sets whether to publish the encoded video:
- true: Publishes the encoded video.
- false: Does not publish the encoded video.
- publishMediaPlayerAudioTrack
- Sets whether to publish the audio from the media player:
- true: Publishes the audio from the media player.
- false: Does not publish the audio from the media player.
- publishMediaPlayerVideoTrack
- Sets whether to publish the video from the media player:
- true: Publishes the video from the media player.
- false: Does not publish the video from the media player.
- autoSubscribeAudio
- Sets whether to automatically subscribe to all audio streams:
- true: Automatically subscribes to all audio streams.
- false: Does not automatically subscribe to any audio stream.
- autoSubscribeVideo
- Sets whether to automatically subscribe to all video streams:
- true: Automatically subscribes to all video streams.
- false: Does not automatically subscribe to any video stream.
- enableAudioRecordingOrPlayout
-
Note: If you need to publish the audio stream captured by the microphone, make sure this parameter is set to true.Sets whether to enable audio recording or playback:
- true: Enables audio recording or playback.
- false: Disables audio recording or playback.
- publishMediaPlayerId
- ID of the media player to be published. The default value is 0.
- clientRoleType
- User role. See CLIENT_ROLE_TYPE.
Note: Users with the audience role cannot publish audio or video streams in the channel. When publishing streams in a live broadcast scenario, make sure the user role is set to broadcaster.
- audienceLatencyLevel
- Audience latency level. See AUDIENCE_LATENCY_LEVEL_TYPE.
- defaultVideoStreamType
- Default video stream type to subscribe to: VIDEO_STREAM_TYPE.
- channelProfile
- Channel usage scenario. See CHANNEL_PROFILE_TYPE.
- audioDelayMs
- Delay (in milliseconds) for sending audio frames. You can use this parameter to set the delay for sending audio frames to ensure audio-video synchronization. To disable the delay, set this parameter to 0.
- token
- (Optional) A dynamic key generated on the server for authentication. See Use Token for Authentication.
Note:
- This parameter takes effect only when calling UpdateChannelMediaOptions or UpdateChannelMediaOptionsEx.
- Make sure the App ID, channel name, and user name used to generate the token are the same as those used in the Initialize method to initialize the engine, and the channel name and user name used in JoinChannel [2/2] or JoinChannelEx to join the channel.
- publishRhythmPlayerTrack
- Sets whether to publish the virtual metronome sound to remote users:
- true: Publishes. Both local and remote users can hear the metronome.
- false: Does not publish. Only the local user can hear the metronome.
- isInteractiveAudience
-
Note:Whether to enable interactive audience mode:
- This parameter is used to implement cross-room co-hosting scenarios. The co-host needs to call the JoinChannelEx method to join the other live room as an audience and set
isInteractiveAudienceto true. - This parameter takes effect only when the user role is
CLIENT_ROLE_AUDIENCE.
- true: Enables interactive audience mode. After successfully enabling, the local user, as an interactive audience, receives low-latency and smooth video from remote users.
- false: Disables interactive audience mode. The local user, as a regular audience, receives remote user video with default settings.
- This parameter is used to implement cross-room co-hosting scenarios. The co-host needs to call the JoinChannelEx method to join the other live room as an audience and set
- customVideoTrackId
- Video track ID returned by the CreateCustomVideoTrack method. The default value is 0.
- isAudioFilterable
-
Note: To enable this feature, please [contact sales](mailto:support@agora.io).Sets whether the current audio stream participates in stream selection based on volume level algorithm.
- true: Participates in volume-based stream selection. If volume-based stream selection is not enabled, this parameter has no effect.
- false: Does not participate in volume-based stream selection.
- enableMultipath
-
Note: Permissions and system requirements:Whether to enable multipath transmission:
- Android: Android 7.0 or later (API level 24 or above), requires ACCESS_NETWORK_STATE and CHANGE_NETWORK_STATE permissions.
- iOS: iOS 12.0 or later.
- macOS: 10.14 or later.
- Windows: Windows Vista or later.
- true: Enables multipath transmission.
- false: Disables multipath transmission.
- uplinkMultipathMode
- Uplink transmission mode. See MultipathMode.
Note: When using this parameter, make sure
enableMultipathis set to true. - downlinkMultipathMode
- Downlink transmission mode. See MultipathMode.
Note: When using this parameter, make sure
enableMultipathis set to true. - preferMultipathType
- Preferred transmission path type. See MultipathType.
Note: When using this parameter, make sure
enableMultipathis set to true.