Whether to mix the player's sound into the main stream channel being published.
Aux audio flag. The default is false.
Whether to repeat playback.
repeat playback flag. The default is false.
Get the number of audio tracks of the playback file.
Get current playing progress.
You should load resource before invoking this function, otherwise the return value is 0
Get the current playback status.
Get media player index.
Gets the current local playback volume of the mediaplayer, the range is 0 ~ 200, with the default value of 60.
Gets the current publish volume of the mediaplayer, the range is 0 ~ 200, with the default value of 60.
Get the total progress of your media resources.
You should load resource before invoking this function, otherwise the return value is 0
Unit is millisecond
Load media resource.
Available: since 1.3.4 Description: Load media resources. Use case: Developers can load the absolute path to the local resource or the URL of the network resource incoming. 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 [loadResourceWithPosition] or [loadResourceFromMediaData] function.
The absolute resource path or the URL of the network resource and cannot be null or "".
Notification of resource loading results
Whether to play locally silently.
If [enableAux] switch is turned on, there is still sound in the publishing stream. The default is false.
Mute local audio flag, The default is false.
Unregister the event handler of mediaplayer
Event type.
Call back.
Register the event handler of mediaplayer
Event type.
Call back.
Pause playing.
resume playing.
Set the specified playback progress.
Unit is millisecond
Point in time of specified playback progress
the result notification of set the specified playback progress
Set the audio track of the playback file.
Audio track index, the number of audio tracks can be obtained through the [getAudioTrackCount] function.
Set the speed of play.
Available since: 2.12.0 Description: Set the playback speed of the player. When to call: You should load resource before invoking this function. Restrictions: None. Related APIs: Resources can be loaded through the [loadResource] function.
The speed of play. The range is 0.5 ~ 2.0. The default is 1.0.
Set mediaplayer local play volume.
The range is 0 ~ 200. The default is 60.
Set playback progress callback interval.
This function can control the callback frequency of [onMediaPlayerPlayingProgress]. When the callback interval is set to 0, the callback is stopped. The default callback interval is 1s This callback are not returned exactly at the set callback interval, but rather at the frequency at which the audio or video frames are processed to determine whether the callback is needed to call
Interval of playback progress callback in milliseconds
Set mediaplayer publish volume.
The range is 0 ~ 200. The default is 60.
Set mediaplayer volume. Both the local play volume and the publish volume are set.
The range is 0 ~ 200. The default is 60.
Start playing.
You need to load resources before playing
Stop playing.
Generated using TypeDoc
Zego MediaPlayer.
Yon can use ZegoMediaPlayer to play media resource files on the local or remote server, and can mix the sound of the media resource files that are played into the publish stream to achieve the effect of background music.