ChannelMediaOptions
Channel media configuration options.
export class ChannelMediaOptions {
publishCameraTrack?: boolean;
publishSecondaryCameraTrack?: boolean;
publishThirdCameraTrack?: boolean;
publishFourthCameraTrack?: boolean;
publishMicrophoneTrack?: boolean;
publishScreenCaptureVideo?: boolean;
publishScreenCaptureAudio?: 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
publishScreenCaptureVideo,
publishCustomVideoTrack
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 secondary camera:
- true: Publish the video captured by the secondary camera.
- false: Do not publish the video captured by the secondary 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
-
Note: This parameter is only applicable on Android.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
-
Note: This parameter is only applicable on Android.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.
- publishScreenCaptureVideo
- Sets whether to publish the video captured from the screen:
- true: Publish the screen-captured video.
- false: Do not publish the screen-captured video.
- publishScreenCaptureAudio
- Sets whether to publish the audio captured from the screen:
- true: Publish the screen-captured audio.
- false: Do not publish the screen-captured audio.
- publishSecondaryScreenTrack
- Sets whether to publish the video captured from the secondary screen:
- true: Publish the video captured from the secondary screen.
- false: Do not publish the video captured from the secondary 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 sync plugin:
- true: Publish the video processed by the voice sync plugin.
- false: (Default) Do not publish the video processed by the voice sync 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 using 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 media player audio.
- false: Do not publish the media player audio.
- publishMediaPlayerVideoTrack
- Sets whether to publish the video from the media player:
- true: Publish the media player video.
- false: Do not publish the media player video.
- 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 delay for sending audio frames to ensure audio-video sync. To disable the delay, set this parameter to 0.
- token
- (Optional) A dynamic key generated on the server for authentication. See Token Authentication.
Note:
- This parameter only takes effect when calling updateChannelMediaOptions or updateChannelMediaOptionsEx.
- Make sure the App ID, channel name, and user name used to generate the token are consistent with those used in the initialize method to initialize the engine and in the joinChannel or joinChannelEx method to join the channel.
- 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:Whether to enable interactive audience mode:
- This parameter is used for cross-room co-hosting scenarios. The co-host needs to call the joinChannelEx method to join the other room as an audience member and set
isInteractiveAudienceto true. - This parameter takes effect only when the user role is
ClientRoleAudience.
- true: Enable interactive audience mode. Once enabled, the local user, as an interactive audience member, receives low-latency and smooth remote video.
- false: Do not enable interactive audience mode. The local user, as a regular audience member, receives remote video with default settings.
- This parameter is used for cross-room co-hosting scenarios. The co-host needs to call the joinChannelEx method to join the other room as an audience member and set
- customVideoTrackId
- The 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 algorithm.
- true: Participate in volume-based stream selection. If the volume-based stream selection feature is not enabled, this parameter has no effect.
- false: Do not participate in volume-based stream selection.
- enableMultipath
-
Note: Permissions and system requirements:Whether to enable multipath transmission:
- Android: Android 7.0 or higher (API level 24 or above), requires ACCESS_NETWORK_STATE and CHANGE_NETWORK_STATE permissions.
- iOS: iOS 12.0 or higher.
- macOS: 10.14 or higher.
- Windows: Windows Vista or higher.
- true: Enable multipath transmission.
- false: Disable 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.