openWithCustomSource method

FutureOr<int> openWithCustomSource(
  1. ByteRTCMediaPlayerCustomSource source,
  2. ByteRTCMediaPlayerConfig config
)

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

Implementation

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