AgoraRtcChannelMediaOptions
- macOS
更新时间
频道媒体选项。
@interface AgoraRtcChannelMediaOptions : NSObject
@property(assign, nonatomic) BOOL publishCameraTrack;
@property(assign, nonatomic) BOOL publishSecondaryCameraTrack;
@property(assign, nonatomic) BOOL publishMicrophoneTrack;
@property(assign, nonatomic) BOOL publishScreenCaptureVideo;
@property(assign, nonatomic) BOOL publishScreenCaptureAudio;
@property(assign, nonatomic) BOOL publishThirdCameraTrack;
@property(assign, nonatomic) BOOL publishFourthCameraTrack;
@property(assign, nonatomic) BOOL publishScreenTrack;
@property(assign, nonatomic) BOOL publishSecondaryScreenTrack;
@property(assign, nonatomic) BOOL publishThirdScreenTrack;
@property(assign, nonatomic) BOOL publishFourthScreenTrack;
@property(assign, nonatomic) BOOL publishCustomAudioTrack;
@property(assign, nonatomic) NSInteger publishCustomAudioTrackId;
@property(assign, nonatomic) BOOL publishCustomVideoTrack;
@property(assign, nonatomic) BOOL publishEncodedVideoTrack;
@property(assign, nonatomic) BOOL publishMediaPlayerAudioTrack;
@property(assign, nonatomic) BOOL publishMediaPlayerVideoTrack;
@property(assign, nonatomic) BOOL publishTranscodedVideoTrack;
@property(assign, nonatomic) BOOL publishMixedAudioTrack;
@property(assign, nonatomic) BOOL publishLipSyncTrack;
@property(assign, nonatomic) BOOL autoSubscribeAudio;
@property(assign, nonatomic) BOOL autoSubscribeVideo;
@property(assign, nonatomic) BOOL enableAudioRecordingOrPlayout;
@property(assign, nonatomic) NSInteger publishMediaPlayerId;
@property(assign, nonatomic) AgoraClientRole clientRoleType;
@property(assign, nonatomic) AgoraAudienceLatencyLevelType audienceLatencyLevel;
@property(assign, nonatomic) AgoraVideoStreamType defaultVideoStreamType;
@property(assign, nonatomic) AgoraChannelProfile channelProfile;
@property(assign, nonatomic) NSInteger audioDelayMs;
@property(assign, nonatomic) NSInteger mediaPlayerAudioDelayMs;
@property(copy, nonatomic) NSString * _Nullable token;
@property(assign, nonatomic) BOOL enableBuiltInMediaEncryption;
@property(assign, nonatomic) BOOL publishRhythmPlayerTrack;
@property(assign, nonatomic) BOOL isInteractiveAudience;
@property(assign, nonatomic) NSInteger customVideoTrackId;
@property(assign, nonatomic) BOOL isAudioFilterable;
@property(copy, nonatomic) NSString * _Nullable parameters;
@property(assign, nonatomic) BOOL enableMultipath;
@property(assign, nonatomic) AgoraMultipathMode uplinkMultipathMode;
@property(assign, nonatomic) AgoraMultipathMode downlinkMultipathMode;
@property(assign, nonatomic) AgoraMultipathType preferMultipathType;
@end支持在同一个 AgoraRtcConnection 中同时发布多个音频流和一个视频流。例如,你可以同时将 publishMicrophoneTrack、publishCustomAudioTrack 和 publishMediaPlayerAudioTrack 设置为 YES,但 publishCameraTrack、publishScreenCaptureVideo(iOS)/publishScreenTrack(macOS)、publishCustomVideoTrack 和 publishEncodedVideoTrack 中只能有一个设置为 YES。
注: 建议你根据业务场景自行设置各成员参数值,否则 SDK 会自动为其赋值。
属性
| 参数名 | 描述 |
|---|---|
publishCameraTrack | 是否发布由摄像头采集的视频:
|
publishSecondaryCameraTrack | 是否发布由第二路摄像头采集的视频:
|
publishMicrophoneTrack | 是否发布由麦克风采集的音频:
|
publishScreenCaptureVideo | 注: 自 v4.0.0 起,参数名由 publishScreenTrack 更名为 publishScreenCaptureVideo。 是否发布来自屏幕的视频采集:
|
publishScreenCaptureAudio | 是否发布来自屏幕的音频采集:
|
publishThirdCameraTrack | 是否发布由第三路摄像头采集的视频:
|
publishFourthCameraTrack | 是否发布由第四路摄像头采集的视频:
|
publishScreenTrack | (仅适用于 macOS)是否发布从主屏幕采集的视频:
|
publishSecondaryScreenTrack | (仅适用于 macOS)是否发布从第二块屏幕采集的视频:
|
publishThirdScreenTrack | (仅适用于 macOS)是否发布从第三块屏幕采集的视频:
|
publishFourthScreenTrack | (仅适用于 macOS)是否发布从第四块屏幕采集的视频:
|
publishCustomAudioTrack | 是否发布从自定义音频源采集的音频:
|
publishCustomAudioTrackId | 要发布的自定义音频轨道的 ID。默认值为 0。你可以通过 createCustomAudioTrack 方法获取自定义音频轨道 ID。 |
publishCustomVideoTrack | 是否发布自定义视频源采集的视频:
|
publishEncodedVideoTrack | 是否发布编码后的视频:
|
publishMediaPlayerAudioTrack | 是否发布媒体播放器的音频:
|
publishMediaPlayerVideoTrack | 是否发布媒体播放器的视频:
|
publishTranscodedVideoTrack | 是否发布本地合图视频轨道:
|
publishLipSyncTrack | 是否发布由语音驱动扩展处理后的视频轨道:
|
autoSubscribeAudio | 用户加入频道时,是否自动订阅所有远端音频流:
|
autoSubscribeVideo | 用户加入频道时,是否自动订阅所有远端视频流:
|
enableAudioRecordingOrPlayout | 注: 如果你需要发布麦克风采集的音频流,请确保该参数设置为 YES。 是否启用音频采集或播放功能:
|
publishMediaPlayerId | 要发布的媒体播放器 ID。默认值为 0。 |
clientRoleType | 用户角色,详见 AgoraClientRole。 注: 如果你将用户角色设置为观众,则无法在频道中发布音视频流。如果你希望在直播中发布媒体流,请确保将用户角色设置为主播。 |
audienceLatencyLevel | 互动直播中观众的延迟等级,详见 AgoraAudienceLatencyLevelType。 |
defaultVideoStreamType | 默认的视频流类型,详见 AgoraVideoStreamType。 |
channelProfile | 频道场景,详见 AgoraChannelProfile。 |
publishMixedAudioTrack | 是否发布混音音频轨道:
|
audioDelayMs | 发送音频帧的延迟(单位为毫秒)。你可以使用该参数设置需要发送的音频帧的延迟,以确保音视频同步。若要关闭延迟,将该值设为 0。 |
mediaPlayerAudioDelayMs | 发送媒体播放器音频帧的延迟(单位为毫秒)。用于显式控制音视频同步。若要关闭延迟,将该值设为 0。 |
token | 你在服务器上生成的用于鉴权的 Token。 注:
|
enableBuiltInMediaEncryption | 注: 调用 updateChannelMediaOptions 方法时该参数将被忽略。 是否启用媒体包加密:
|
publishRhythmPlayerTrack | 是否向远端用户发布节拍器的声音:
|
isInteractiveAudience | 注:
是否启用互动模式:
|
customVideoTrackId | 调用 createCustomVideoTrack 方法返回的视频轨道 ID。默认值为 0。 |
isAudioFilterable | |
enableMultipath | 注: 权限和系统要求:
是否启用多路径传输:
|
preferMultipathType | 首选的传输路径类型。详见 AgoraMultipathType。 注: 使用该参数时,请确保 |