openWithCustomSource method

FutureOr<int> openWithCustomSource(
  1. MediaPlayerCustomSource source,
  2. MediaPlayerConfig config
)

@detail api @brief 启动音频裸数据混音。
要播放音乐文件,参看 open{@link #IMediaPlayer#open}。open 与此 API 互斥。 @param source 数据源,详见 MediaPlayerCustomSource{@link #MediaPlayerCustomSource} @param config 详见 MediaPlayerConfig{@link #MediaPlayerConfig} @return - 0: 调用成功。 - < 0 : 调用失败。查看 ReturnStatus{@link #ReturnStatus} 获得更多错误说明 @note - 调用本方法启动后,再调用 pushExternalAudioFrame{@link #IMediaPlayer#pushExternalAudioFrame} 推送音频数据,才会开始混音。 - 如要结束 PCM 音频数据混音,调用 stop{@link #IMediaPlayer#stop}。

Implementation

FutureOr<int> openWithCustomSource(
    MediaPlayerCustomSource source, MediaPlayerConfig config) async {
  return await nativeCall('openWithCustomSource', [source, config]);
}