ChannelMediaOptions

Channel media configuration options.

export class ChannelMediaOptions {

  publishCameraTrack?: boolean;

  publishSecondaryCameraTrack?: boolean;

  publishThirdCameraTrack?: boolean;

  publishFourthCameraTrack?: boolean;

  publishMicrophoneTrack?: boolean;

  publishScreenTrack?: boolean;

  publishSecondaryScreenTrack?: boolean;

  publishThirdScreenTrack?: boolean;

  publishFourthScreenTrack?: boolean;

  publishCustomAudioTrack?: boolean;

  publishCustomAudioTrackId?: number;

  publishCustomVideoTrack?: boolean;

  publishEncodedVideoTrack?: boolean;

  publishMediaPlayerAudioTrack?: boolean;

  publishMediaPlayerVideoTrack?: boolean;

  publishTranscodedVideoTrack?: boolean;

  publishLipSyncTrack?: boolean;

  autoSubscribeAudio?: boolean;

  autoSubscribeVideo?: boolean;

  enableAudioRecordingOrPlayout?: boolean;

  publishMediaPlayerId?: number;

  clientRoleType?: ClientRoleType;

  audienceLatencyLevel?: AudienceLatencyLevelType;

  defaultVideoStreamType?: VideoStreamType;

  channelProfile?: ChannelProfileType;

  token?: string;

  enableBuiltInMediaEncryption?: boolean;

  publishRhythmPlayerTrack?: boolean;

  isInteractiveAudience?: boolean;

  customVideoTrackId?: number;

  isAudioFilterable?: boolean;

  enableMultipath?: boolean;

  uplinkMultipathMode?: MultipathMode;

  downlinkMultipathMode?: MultipathMode;

  preferMultipathType?: MultipathType;
}

RtcConnection publishMicrophoneTrack publishCustomAudioTrack publishMediaPlayerAudioTrack true publishCameraTrack publishScreenTrackpublishCustomVideoTrack publishEncodedVideoTrack true

Note: It is recommended that you configure the member parameters based on your business scenario. Otherwise, the SDK will automatically assign values to the member parameters.

Properties

publishCameraTrack
Sets whether to publish the video captured by the camera:
  • true: Publish the video captured by the camera.
  • false: Do not publish the video captured by the camera.
publishSecondaryCameraTrack
Sets whether to publish the video captured by the second camera:
  • true: Publish the video captured by the second camera.
  • false: Do not publish the video captured by the second camera.
publishMicrophoneTrack
Sets whether to publish the audio captured by the microphone:
  • true: Publish the audio captured by the microphone.
  • false: Do not publish the audio captured by the microphone.
publishThirdCameraTrack
Sets whether to publish the video captured by the third camera:
  • true: Publish the video captured by the third camera.
  • false: Do not publish the video captured by the third camera.
publishFourthCameraTrack
Sets whether to publish the video captured by the fourth camera:
  • true: Publish the video captured by the fourth camera.
  • false: Do not publish the video captured by the fourth camera.
publishScreenTrack
Sets whether to publish the video captured from the screen:
  • true: Publish the video captured from the screen.
  • false: Do not publish the video captured from the screen.
publishSecondaryScreenTrack
Sets whether to publish the video captured from the second screen:
  • true: Publish the video captured from the second screen.
  • false: Do not publish the video captured from the second screen.
publishThirdScreenTrack
Sets whether to publish the video captured from the third screen:
  • true: Publish the video captured from the third screen.
  • false: Do not publish the video captured from the third screen.
publishFourthScreenTrack
Sets whether to publish the video captured from the fourth screen:
  • true: Publish the video captured from the fourth screen.
  • false: Do not publish the video captured from the fourth screen.
publishTranscodedVideoTrack
Sets whether to publish the local transcoded video:
  • true: Publish the local transcoded video.
  • false: Do not publish the local transcoded video.
publishMixedAudioTrack
Sets whether to publish the local audio mixing:
  • true: Publish the local audio mixing.
  • false: Do not publish the local audio mixing.
publishLipSyncTrack
Sets whether to publish the video processed by the voice-driven plugin:
  • true: Publish the video processed by the voice-driven plugin.
  • false: (Default) Do not publish the video processed by the voice-driven plugin.
publishCustomAudioTrack
Sets whether to publish custom captured audio:
  • true: Publish the custom captured audio.
  • false: Do not publish the custom captured audio.
publishCustomAudioTrackId
The ID of the custom audio track to be published. The default value is 0. You can get the custom audio track ID by calling the createCustomAudioTrack method.
publishCustomVideoTrack
Sets whether to publish custom captured video:
  • true: Publish the custom captured video.
  • false: Do not publish the custom captured video.
publishEncodedVideoTrack
Sets whether to publish the encoded video:
  • true: Publish the encoded video.
  • false: Do not publish the encoded video.
publishMediaPlayerAudioTrack
Sets whether to publish the audio from the media player:
  • true: Publish the audio from the media player.
  • false: Do not publish the audio from the media player.
publishMediaPlayerVideoTrack
Sets whether to publish the video from the media player:
  • true: Publish the video from the media player.
  • false: Do not publish the video from the media player.
autoSubscribeAudio
Sets whether to automatically subscribe to all audio streams:
  • true: Automatically subscribe to all audio streams.
  • false: Do not automatically subscribe to any audio streams.
autoSubscribeVideo
Sets whether to automatically subscribe to all video streams:
  • true: Automatically subscribe to all video streams.
  • false: Do not automatically subscribe to any video streams.
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: Enable audio recording or playback.
  • false: Do not enable audio recording or playback.
publishMediaPlayerId
The ID of the media player to be published. The default value is 0.
clientRoleType
User role. See ClientRoleType.
audienceLatencyLevel
Audience latency level. See AudienceLatencyLevelType.
defaultVideoStreamType
Default video stream type to subscribe to: VideoStreamType.
channelProfile
Channel usage scenario. See ChannelProfileType.
audioDelayMs
Delay (in milliseconds) for sending audio frames. You can use this parameter to set the audio frame delay to ensure audio-video synchronization. To disable delay, set this parameter to 0.
token
(Optional) A dynamic key generated on the server for authentication. See Token Authentication.
Note:
publishRhythmPlayerTrack
Sets whether to publish the virtual metronome sound to remote users:
  • true: Publish. Both local and remote users can hear the metronome.
  • false: Do not publish. Only the local user can hear the metronome.
isInteractiveAudience
Note:
  • This parameter is used for cross-room co-hosting scenarios. The co-host needs to call the joinChannelEx method to join the other host's room as an audience and set isInteractiveAudience to true.
  • This parameter only takes effect when the user role is ClientRoleAudience.
Whether to enable interactive audience mode:
  • true: Enable interactive audience mode. Once enabled, the local user acts as an interactive audience and receives low-latency and smooth remote video.
  • false: Do not enable interactive audience mode. The local user acts as a regular audience and receives remote video with default settings.
customVideoTrackId
The video track ID returned by calling 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 audio volume algorithm.
  • true: Participate in volume-based stream selection. If volume-based stream selection is not enabled, this parameter has no effect.
  • false: Do not participate in volume-based stream selection.
enableMultipath
Note: Permissions and system requirements:
  • 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.
Whether to enable multipath transmission:
  • true: Enable multipath transmission.
  • false: Disable multipath transmission.
uplinkMultipathMode
Uplink transmission mode. See MultipathMode.
Note: When using this parameter, make sure enableMultipath is set to true.
downlinkMultipathMode
Downlink transmission mode. See MultipathMode.
Note: When using this parameter, make sure enableMultipath is set to true.
preferMultipathType
Preferred transmission path type. See MultipathType.
Note: When using this parameter, make sure enableMultipath is set to true.