ChannelMediaOptions
- Flutter
更新时间
频道媒体设置选项。
@JsonSerializable(explicitToJson: true, includeIfNull: false)
class ChannelMediaOptions {
const ChannelMediaOptions(
{this.publishCameraTrack,
this.publishSecondaryCameraTrack,
this.publishThirdCameraTrack,
this.publishFourthCameraTrack,
this.publishMicrophoneTrack,
this.publishScreenCaptureVideo,
this.publishScreenCaptureAudio,
this.publishScreenTrack,
this.publishSecondaryScreenTrack,
this.publishThirdScreenTrack,
this.publishFourthScreenTrack,
this.publishCustomAudioTrack,
this.publishCustomAudioTrackId,
this.publishCustomVideoTrack,
this.publishEncodedVideoTrack,
this.publishMediaPlayerAudioTrack,
this.publishMediaPlayerVideoTrack,
this.publishTranscodedVideoTrack,
this.publishMixedAudioTrack,
this.publishLipSyncTrack,
this.autoSubscribeAudio,
this.autoSubscribeVideo,
this.enableAudioRecordingOrPlayout,
this.publishMediaPlayerId,
this.clientRoleType,
this.audienceLatencyLevel,
this.defaultVideoStreamType,
this.channelProfile,
this.audioDelayMs,
this.mediaPlayerAudioDelayMs,
this.token,
this.enableBuiltInMediaEncryption,
this.publishRhythmPlayerTrack,
this.isInteractiveAudience,
this.customVideoTrackId,
this.isAudioFilterable,
this.parameters});
@JsonKey(name: 'publishCameraTrack')
final bool? publishCameraTrack;
@JsonKey(name: 'publishSecondaryCameraTrack')
final bool? publishSecondaryCameraTrack;
@JsonKey(name: 'publishThirdCameraTrack')
final bool? publishThirdCameraTrack;
@JsonKey(name: 'publishFourthCameraTrack')
final bool? publishFourthCameraTrack;
@JsonKey(name: 'publishMicrophoneTrack')
final bool? publishMicrophoneTrack;
@JsonKey(name: 'publishScreenCaptureVideo')
final bool? publishScreenCaptureVideo;
@JsonKey(name: 'publishScreenCaptureAudio')
final bool? publishScreenCaptureAudio;
@JsonKey(name: 'publishScreenTrack')
final bool? publishScreenTrack;
@JsonKey(name: 'publishSecondaryScreenTrack')
final bool? publishSecondaryScreenTrack;
@JsonKey(name: 'publishThirdScreenTrack')
final bool? publishThirdScreenTrack;
@JsonKey(name: 'publishFourthScreenTrack')
final bool? publishFourthScreenTrack;
@JsonKey(name: 'publishCustomAudioTrack')
final bool? publishCustomAudioTrack;
@JsonKey(name: 'publishCustomAudioTrackId')
final int? publishCustomAudioTrackId;
@JsonKey(name: 'publishCustomVideoTrack')
final bool? publishCustomVideoTrack;
@JsonKey(name: 'publishEncodedVideoTrack')
final bool? publishEncodedVideoTrack;
@JsonKey(name: 'publishMediaPlayerAudioTrack')
final bool? publishMediaPlayerAudioTrack;
@JsonKey(name: 'publishMediaPlayerVideoTrack')
final bool? publishMediaPlayerVideoTrack;
@JsonKey(name: 'publishTranscodedVideoTrack')
final bool? publishTranscodedVideoTrack;
@JsonKey(name: 'publishMixedAudioTrack')
final bool? publishMixedAudioTrack;
@JsonKey(name: 'autoSubscribeAudio')
final bool? autoSubscribeAudio;
@JsonKey(name: 'autoSubscribeVideo')
final bool? autoSubscribeVideo;
@JsonKey(name: 'enableAudioRecordingOrPlayout')
final bool? enableAudioRecordingOrPlayout;
@JsonKey(name: 'publishMediaPlayerId')
final int? publishMediaPlayerId;
@JsonKey(name: 'clientRoleType')
final ClientRoleType? clientRoleType;
@JsonKey(name: 'audienceLatencyLevel')
final AudienceLatencyLevelType? audienceLatencyLevel;
@JsonKey(name: 'defaultVideoStreamType')
final VideoStreamType? defaultVideoStreamType;
@JsonKey(name: 'channelProfile')
final ChannelProfileType? channelProfile;
@JsonKey(name: 'audioDelayMs')
final int? audioDelayMs;
@JsonKey(name: 'mediaPlayerAudioDelayMs')
final int? mediaPlayerAudioDelayMs;
@JsonKey(name: 'token')
final String? token;
@JsonKey(name: 'enableBuiltInMediaEncryption')
final bool? enableBuiltInMediaEncryption;
@JsonKey(name: 'publishRhythmPlayerTrack')
final bool? publishRhythmPlayerTrack;
@JsonKey(name: 'isInteractiveAudience')
final bool? isInteractiveAudience;
@JsonKey(name: 'customVideoTrackId')
final int? customVideoTrackId;
@JsonKey(name: 'isAudioFilterable')
final bool? isAudioFilterable;
@JsonKey(name: 'enableMultipath')
final bool? enableMultipath;
@JsonKey(name: 'uplinkMultipathMode')
final MultipathMode? uplinkMultipathMode;
@JsonKey(name: 'downlinkMultipathMode')
final MultipathMode? downlinkMultipathMode;
@JsonKey(name: 'preferMultipathType')
final MultipathType? preferMultipathType;
@JsonKey(name: 'parameters')
final String? parameters;
factory ChannelMediaOptions.fromJson(Map<String, dynamic> json) =>
_$ChannelMediaOptionsFromJson(json);
Map<String, dynamic> toJson() => _$ChannelMediaOptionsToJson(this);
}RtcConnection
publishMicrophoneTrack
publishCustomAudioTrack
publishMediaPlayerAudioTrack
true
publishCameraTrack
publishScreenCaptureVideo、
publishScreenTrack、
publishCustomVideoTrack
publishEncodedVideoTrack
true
注: 建议你根据业务场景自行设置成员参数值,否则 SDK 会自动对成员参数进行赋值。
属性
| 参数名 | 描述 |
|---|---|
publishCameraTrack | 设置是否发布摄像头采集的视频:
|
publishSecondaryCameraTrack | 设置是否发布第二个摄像头采集的视频:
|
publishMicrophoneTrack | 设置是否发布麦克风采集到的音频:
|
publishThirdCameraTrack | 注: 该参数仅适用于 Android、Windows 和 macOS 平台。 设置是否发布第三个摄像头采集的视频:
|
publishFourthCameraTrack | 注: 该参数仅适用于 Android、Windows 和 macOS 平台。 设置是否发布第四个摄像头采集的视频:
|
publishScreenTrack | 注: 该参数仅适用于 Windows 和 macOS 平台。 设置是否发布屏幕采集的视频:
|
publishScreenCaptureVideo | 注: 该参数仅适用于 Android 和 iOS 平台。 设置是否发布屏幕采集的视频:
|
publishScreenCaptureAudio | 注: 该参数仅适用于 Android 和 iOS 平台。 设置是否发布屏幕采集的音频:
|
publishSecondaryScreenTrack | 设置是否发布第二个屏幕采集的视频:
|
publishThirdScreenTrack | 注: 该参数仅适用于 Windows 和 macOS 平台。 设置是否发布第三个屏幕采集的视频:
|
publishFourthScreenTrack | 注: 该参数仅适用于 Windows 和 macOS 平台。 设置是否发布第四个屏幕采集的视频:
|
publishTranscodedVideoTrack | 设置是否发布本地的转码视频:
|
publishMixedAudioTrack | 设置是否发布本地混音音频:
|
publishLipSyncTrack | 设置是否发布语音驱动插件处理后的视频:
|
publishCustomAudioTrack | 设置是否发布自定义采集的音频:
|
publishCustomAudioTrackId | 待发布的自定义音频轨道的 ID,默认值为 0。你可以通过 createCustomAudioTrack 方法来获取自定义音频轨道 ID。 |
publishCustomVideoTrack | 设置是否发布自定义采集的视频:
|
publishEncodedVideoTrack | 设置是否发布编码后的视频:
|
publishMediaPlayerAudioTrack | 设置是否发布媒体播放器的音频:
|
publishMediaPlayerVideoTrack | 设置是否发布媒体播放器的视频:
|
autoSubscribeAudio | 设置是否自动订阅所有音频流:
|
autoSubscribeVideo | 设置是否自动订阅所有视频流:
|
enableAudioRecordingOrPlayout | 注: 如果那你需要发布麦克风采集的音频流,请确保该参数设为 true。 设置是否开启音频录制或播放:
|
publishMediaPlayerId | 待发布的媒体播放器的 ID。默认值为 0。 |
clientRoleType | 用户角色。详见 ClientRoleType。 |
audienceLatencyLevel | 观众端延时级别。详见 AudienceLatencyLevelType。 |
defaultVideoStreamType | 默认订阅的视频流类型: VideoStreamType。 |
channelProfile | 频道使用场景。详见 ChannelProfileType。 |
audioDelayMs | 发送音频帧的延时(毫秒)。你可以通过该参数来设置需要发送的音频帧的延时,以确保音画同步。 如果要关闭延时,将此参数值设置为 0。 |
token | (可选)在服务端生成的用于鉴权的动态密钥。详见使用 Token 鉴权。 注:
|
publishRhythmPlayerTrack | 设置是否发布虚拟节拍器声音至远端:
|
isInteractiveAudience | 注:
是否开启互动观众模式:
|
customVideoTrackId | 调用 createCustomVideoTrack 方法返回的视频轨道 ID。默认值为 0。 |
isAudioFilterable | |
enableMultipath | 注: 权限和系统要求:
是否启用多路径传输:
|
preferMultipathType | 首选的传输路径类型。详见 MultipathType。 注: 使用该参数时,请确保已将 |