openWithCustomSource method
FutureOr<int>
openWithCustomSource(
- ByteRTCMediaPlayerCustomSource source,
- ByteRTCMediaPlayerConfig config
@detail api
@brief 启动音频裸数据混音。
要播放音乐文件,参看 open:config:{@link #ByteRTCMediaPlayer#open:config}。open 与此 API 互斥。
@param source 数据源,详见 ByteRTCMediaPlayerCustomSource{@link #ByteRTCMediaPlayerCustomSource}
@param config 详见 ByteRTCMediaPlayerConfig{@link #ByteRTCMediaPlayerConfig}
@return
- 0: 调用成功。
- < 0 : 调用失败。查看 ByteRTCReturnStatus{@link #ByteRTCReturnStatus} 获得更多错误说明
@note
- 调用本方法启动后,再调用 pushExternalAudioFrame:{@link #ByteRTCEngine#pushExternalAudioFrame} 推送音频数据,才会开始混音。
- 如要结束 PCM 音频数据混音,调用 stop{@link #ByteRTCMediaPlayer#stop}。
Implementation
FutureOr<int> openWithCustomSource(ByteRTCMediaPlayerCustomSource source,
ByteRTCMediaPlayerConfig config) async {
return await nativeCall('openWithCustomSource:config:', [source, config]);
}