loadResourceFromMediaData abstract method
- Uint8List mediaData,
- int startPosition
Load binary audio resource.
Available: since 2.10.0
Description: Load binary audio data.
Use case: Developers do not want to cache the audio data locally, and directly transfer the audio binary data to the media player, directly load and play the audio.
When to call: It can be called after the engine by createEngine
has been initialized and the media player has been created by createMediaPlayer
.
Related APIs: Resources can be loaded through the loadResource or loadResourceWithPosition function.
Caution: 1.When startPosition
exceeds the total playing time, it will start playing from the beginning.
2.If the mediaplayer has already loaded resources or is in the process of playing, please first call the stop interface to halt the playback, and then proceed to call the interface to load the media resources; failure to do so will result in an unsuccessful load.
mediaData
Binary audio data.startPosition
Position of starting playback, in milliseconds.- Returns Callback result of loading media resource.
Implementation
Future<ZegoMediaPlayerLoadResourceResult> loadResourceFromMediaData(
Uint8List mediaData, int startPosition);