openWithCustomSource method

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

@detail api @brief Enable audio mixing with audio raw data.
To open the audio file, see open{@link #IMediaPlayer#open}. open and this API are mutually exclusive. @param source See MediaPlayerCustomSource{@link #MediaPlayerCustomSource}. @param config See MediaPlayerConfig{@link #MediaPlayerConfig}. @return - 0: Success. - < 0 : Fail. See ReturnStatus{@link #ReturnStatus} for more details. @note - After calling this API, you must call pushExternalAudioFrame{@link #IMediaPlayer#pushExternalAudioFrame} to push audio data and start the audio mixing. - To stop the raw data audio mixing, call stop{@link #IMediaPlayer#stop}.

Implementation

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