RTCMediaPlayer class abstract
Audio effect player.
Call RTCMediaPlayer.setEventHandler to set the callback handler to receive related callbacks.
Valid since v3.56.1
Constructors
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
getAudioTrackCount(
) → Future< int?> - Gets the track count of the current media file.
-
getPlaybackDuration(
) → Future< int?> - Gets the actual playback duration of the mixed media file, in milliseconds.
-
getPosition(
) → Future< int?> - Gets the playback progress of the media file.
-
getTotalDuration(
) → Future< int?> - Gets the duration of the media file.
-
getVolume(
[AudioMixingType type = AudioMixingType.playoutAndPublish]) → Future< int?> - Gets the current volume.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
open(
{required String filePath, MediaPlayerConfig config = const MediaPlayerConfig()}) → Future< int?> -
Open the audio file.
You can only open one audio file with one player instance at the same time. For multiple audio files at the same time, create multiple player instances. -
pause(
) → Future< int?> - After calling RTCMediaPlayer.open or RTCMediaPlayer.start to start audio mixing, call this API to pause audio mixing.
-
resume(
) → Future< int?> - After calling RTCMediaPlayer.pause to pause audio mixing, call this API to resume audio mixing.
-
selectAudioTrack(
int index) → Future< int?> - Specifies the playback track of the current media file.
-
setAudioDualMonoMode(
AudioMixingDualMonoMode mode) → Future< int?> - Sets the channel mode of the mixing of the media file.
-
setAudioPitch(
int pitch) → Future< int?> - Sets the pitch of the local audio file mixing. Usually used in karaoke scenes.
-
setEventHandler(
RTCMediaPlayerEventHandler? handler) → void - Sets the event handler.
-
setLoudness(
double loudness) → Future< int?> - To call RTCVideo.enableVocalInstrumentBalance to adjust the volume of the mixed media file or the PCM audio data, you must pass in its original loudness through this API.
-
setPlaybackSpeed(
int speed) → Future< int?> - Sets the playback speed of the audio file.
-
setPosition(
int position) → Future< int?> - Sets the starting playback position of the media file.
-
setProgressInterval(
int interval) → Future< int?> - Sets the interval of the periodic callback RTCMediaPlayerEventHandler.onMediaPlayerPlayingProgress during audio mixing.
-
setVolume(
{required int volume, AudioMixingType type = AudioMixingType.playoutAndPublish}) → Future< int?> - Adjusts the volume of the specified audio mixing.
-
start(
) → Future< int?> -
Start playing the audio. Call this API when you call RTCMediaPlayer.open and set
AutoPlay=False
. -
stop(
) → Future< int?> - After calling RTCMediaPlayer.open or RTCMediaPlayer.start to start audio mixing, call this method to stop audio mixing.
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited