Agora Java API Reference for Android
Public Member Functions | Public Attributes | List of all members
io.agora.rtc2.ChannelMediaOptions Class Reference

Public Member Functions

 ChannelMediaOptions (Integer clientRoleType)
 
Boolean isPublishCameraTrack ()
 
Boolean isPublishScreenTrack ()
 
Boolean isPublishCustomAudioTrack ()
 
Boolean isPublishCustomAudioTrackEnableAec ()
 
Boolean isPublishCustomVideoTrack ()
 
Boolean isPublishEncodedVideoTrack ()
 
Boolean isPublishMediaPlayerAudioTrack ()
 
Boolean isPublishMediaPlayerVideoTrack ()
 
Integer getPublishMediaPlayerId ()
 
Boolean isPublishAudioTrack ()
 
Boolean isAutoSubscribeAudio ()
 
Boolean isAutoSubscribeVideo ()
 
Boolean isEnableAudioRecordingOrPlayout ()
 
Integer getClientRoleType ()
 
Integer getDefaultVideoStreamType ()
 
Integer getChannelProfile ()
 
Integer getAudioDelayMs ()
 
String toString ()
 

Public Attributes

Boolean publishCameraTrack
 
Boolean publishScreenTrack
 
Boolean publishCustomAudioTrack
 
Boolean publishCustomAudioTrackEnableAec
 
Boolean publishCustomVideoTrack
 
Boolean publishEncodedVideoTrack
 
Boolean publishMediaPlayerAudioTrack
 
Boolean publishMediaPlayerVideoTrack
 
Integer publishMediaPlayerId
 
Boolean publishAudioTrack
 
Boolean autoSubscribeAudio
 
Boolean autoSubscribeVideo
 
Boolean enableAudioRecordingOrPlayout
 
Integer clientRoleType
 
Integer defaultVideoStreamType
 
Integer channelProfile
 
Integer audioDelayMs
 

Detailed Description

The channel media options.

Member Data Documentation

◆ publishCameraTrack

Boolean io.agora.rtc2.ChannelMediaOptions.publishCameraTrack

Determines whether to publish the video of the camera track.

  • true: (Default) Publish the video track of the camera capturer.
  • false: Do not publish the video track of the camera capturer.

◆ publishScreenTrack

Boolean io.agora.rtc2.ChannelMediaOptions.publishScreenTrack

Determines whether to publish the video of the screen track.

  • true: Publish the video track of the screen capturer.
  • false: (Default) Do not publish the video track of the screen capturer.

◆ publishCustomAudioTrack

Boolean io.agora.rtc2.ChannelMediaOptions.publishCustomAudioTrack

Determines whether to publish the audio of the custom audio track.

  • true: Publish the audio of the custom audio track.
  • false: (Default) Do not publish the audio of the custom audio track.

◆ publishCustomAudioTrackEnableAec

Boolean io.agora.rtc2.ChannelMediaOptions.publishCustomAudioTrackEnableAec

Determines whether to enable AEC when publish custom audio track.

  • true: Enable AEC.
  • false: (Default) Do not enable AEC.

◆ publishCustomVideoTrack

Boolean io.agora.rtc2.ChannelMediaOptions.publishCustomVideoTrack

Determines whether to publish the video of the custom video track.

  • true: Publish the video of the custom video track.
  • false: (Default) Do not publish the video of the custom video track.

◆ publishEncodedVideoTrack

Boolean io.agora.rtc2.ChannelMediaOptions.publishEncodedVideoTrack

Determines whether to publish the video of the encoded video track.

  • true: Publish the video of the encoded video track.
  • false: (default) Do not publish the video of the encoded video track.

◆ publishMediaPlayerAudioTrack

Boolean io.agora.rtc2.ChannelMediaOptions.publishMediaPlayerAudioTrack

Determines whether to publish the audio track of media player source.

  • true: Publish the audio track of media player source.
  • false: (default) Do not publish the audio track of media player source.

◆ publishMediaPlayerVideoTrack

Boolean io.agora.rtc2.ChannelMediaOptions.publishMediaPlayerVideoTrack

Determines whether to publish the video track of media player source.

  • true: Publish the video track of media player source.
  • false: (default) Do not publish the video track of media player source.

◆ publishMediaPlayerId

Integer io.agora.rtc2.ChannelMediaOptions.publishMediaPlayerId

Determines which media player source should be published.

  • DEFAULT_PLAYER_ID(0) is default.

◆ publishAudioTrack

Boolean io.agora.rtc2.ChannelMediaOptions.publishAudioTrack

Determines whether to publish the recorded audio. This method replaces calling muteLocalAudioStream before joining a channel.

  • true: (Default) Publish the recorded audio.
  • false: Do not publish the recorded audio.

◆ autoSubscribeAudio

Boolean io.agora.rtc2.ChannelMediaOptions.autoSubscribeAudio

Determines whether to subscribe to all audio streams automatically.

This member replaces calling setDefaultMuteAllRemoteAudioStreams before joining a channel.

  • true: (Default) Subscribe to all audio streams automatically.
  • false: Do not subscribe to any audio stream automatically.

◆ autoSubscribeVideo

Boolean io.agora.rtc2.ChannelMediaOptions.autoSubscribeVideo

Determines whether to subscribe to all video streams automatically.

This member replaces calling setDefaultMuteAllRemoteVideoStreams before joining a channel.

  • True: Subscribe to all video streams automatically.
  • False: (default) Do not subscribe to any video stream automatically.

◆ enableAudioRecordingOrPlayout

Boolean io.agora.rtc2.ChannelMediaOptions.enableAudioRecordingOrPlayout

Determines whether to enable audio recording or playout.

  • true: It's used to publish audio and mix microphone, or subscribe audio and playout
  • false: It's used to publish extenal audio frame only without mixing microphone, or no need audio device to playout audio either

◆ clientRoleType

Integer io.agora.rtc2.ChannelMediaOptions.clientRoleType

The client role type:

  • CLIENT_ROLE_BROADCASTER(1): The broadcaster, who can both send and receive streams.
  • CLIENT_ROLE_AUDIENCE(2): (Default) The audience, who can only receive streams.

◆ defaultVideoStreamType

Integer io.agora.rtc2.ChannelMediaOptions.defaultVideoStreamType

The default video stream type to subscribe to:

  • VIDEO_STREAM_HIGH(0): (Default) The high-stream video, that is, the video stream featuring in high resolution and high bitrate.
  • VIDEO_STREAM_LOW(1): The low-stream video, that is, the video stream featuring in low resolution and low bitrate.

◆ channelProfile

Integer io.agora.rtc2.ChannelMediaOptions.channelProfile

The channel profile:

  • CHANNEL_PROFILE_COMMUNICATION(0): Communication. Use this profile in one-on-one calls or group calls, where all users can talk freely.
  • CHANNEL_PROFILE_LIVE_BROADCASTING(1): (Default) Live Broadcast. Users in a live-broadcast channel has a role as either broadcaster or audience. A broadcaster can both send and receive streams; an audience can only receive streams.
  • CHANNEL_PROFILE_GAME(2): Gaming. This profile uses a codec with a low bitrate and consumes less power. Applies to the gaming scenario, where all game players can talk freely.

◆ audioDelayMs

Integer io.agora.rtc2.ChannelMediaOptions.audioDelayMs

The delay in ms for sending audio frames. This is used for explicit control of A/V sync. To switch off the delay, set the value to zero.