MediaPlayer class abstract
Class that provides media player functionality and supports multiple instances.
- Implementers
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
-
adjustPlayoutVolume(
int volume) → Future< void> - Adjusts the local playback volume.
-
adjustPublishSignalVolume(
int volume) → Future< void> - Adjusts the volume heard by remote users.
-
getDuration(
) → Future< int> - Gets the total duration of the media file.
-
getMediaPlayerId(
) → int - Gets the player ID.
-
getMute(
) → Future< bool> - Gets whether the currently playing media file is muted.
-
getPlayoutVolume(
) → Future< int> - Gets the current local playback volume.
-
getPlayPosition(
) → Future< int> - Gets the current playback position.
-
getPlaySrc(
) → Future< String> - Gets the path of the media resource being played.
-
getPublishSignalVolume(
) → Future< int> - Gets the volume heard by remote users.
-
getState(
) → Future< MediaPlayerState> - Gets the current state of the player.
-
getStreamCount(
) → Future< int> - Gets the number of media streams in the current media file.
-
getStreamInfo(
int index) → Future< PlayerStreamInfo> - Gets media stream information by stream index.
-
mute(
bool muted) → Future< void> - Sets whether to mute.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
open(
{required String url, required int startPos}) → Future< void> - Opens a media resource.
-
openWithMediaSource(
MediaSource source) → Future< void> - Opens a media resource and sets playback options.
-
pause(
) → Future< void> - Pauses playback.
-
play(
) → Future< void> - Plays the media file.
-
playPreloadedSrc(
String src) → Future< void> - Plays a preloaded media resource.
-
preloadSrc(
{required String src, required int startPos}) → Future< void> - Preloads a media resource.
-
registerAudioFrameObserver(
{required AudioPcmFrameSink observer, RawAudioFrameOpModeType mode = RawAudioFrameOpModeType.rawAudioFrameOpModeReadOnly}) → void - Registers an audio frame observer.
-
registerPlayerSourceObserver(
MediaPlayerSourceObserver observer) → void - Registers a playback observer.
-
registerVideoFrameObserver(
MediaPlayerVideoFrameObserver observer) → void - Registers a video frame observer.
-
resume(
) → Future< void> - Resumes playback after pausing.
-
seek(
int newPos) → Future< void> - Seeks to the specified playback position in the media file.
-
selectAudioTrack(
int index) → Future< void> - Specifies the audio track for the current audio file.
-
selectMultiAudioTrack(
{required int playoutTrackIndex, required int publishTrackIndex}) → Future< void> - Selects the audio tracks for local playback and remote publishing.
-
setAudioDualMonoMode(
AudioDualMonoMode mode) → Future< void> - Sets the channel mode of the current audio file.
-
setAudioPitch(
int pitch) → Future< void> - Adjusts the pitch of the currently playing media resource.
-
setLoopCount(
int loopCount) → Future< void> - Sets loop playback.
-
setPlaybackSpeed(
int speed) → Future< void> - Sets the playback speed of the current audio file.
-
setPlayerOptionInInt(
{required String key, required int value}) → Future< void> - Sets media player options.
-
setPlayerOptionInString(
{required String key, required String value}) → Future< void> - Sets media player options.
-
setRenderMode(
RenderModeType renderMode) → Future< void> - Sets the rendering mode of the player view.
-
setSpatialAudioParams(
SpatialAudioParams params) → Future< void> - Enables or disables spatial audio for the media player.
-
setView(
int view) → Future< void> - Sets the player rendering view.
-
stop(
) → Future< void> - Stops playback.
-
switchSrc(
{required String src, bool syncPts = true}) → Future< void> - Switches the media resource.
-
toString(
) → String -
A string representation of this object.
inherited
-
unloadSrc(
String src) → Future< void> - Releases the preloaded media resource.
-
unregisterAudioFrameObserver(
AudioPcmFrameSink observer) → void - Unregisters the audio frame observer.
-
unregisterPlayerSourceObserver(
MediaPlayerSourceObserver observer) → void - Unregisters the playback observer.
-
unregisterVideoFrameObserver(
MediaPlayerVideoFrameObserver observer) → void - Unregisters the video frame observer.
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited