im.zego.zegoexpress.ZegoMediaPlayer

Zego MediaPlayer.

Declared in ZegoMediaPlayer.java

Public-Func Lists

Package-Func Lists

Public-Func Docs

setEventHandler

public void setEventHandler (IZegoMediaPlayerEventHandler handler)

Set event callback handler for media player.

Parameters
handler Media player event callback object

setVideoHandler

public void setVideoHandler (IZegoMediaPlayerVideoHandler handler, ZegoVideoFrameFormat format)

Set video callback handler.

Parameters
handler Video event callback object for media player
format Video frame format for video data

setAudioHandler

public void setAudioHandler (IZegoMediaPlayerAudioHandler handler)

Set audio callback handler.

Parameters
handler Audio event callback object for media player

loadResource

public void loadResource (String path, IZegoMediaPlayerLoadResourceCallback callback)

Load media resource.

Parameters
path the absolute path of the local resource or the URL of the network resource
callback Notification of resource loading results

start

public void start ()

Start playing.

stop

public void stop ()

Stop playing.

pause

public void pause ()

Pause playing.

resume

public void resume ()

resume playing

seekTo

public void seekTo (long millisecond, IZegoMediaPlayerSeekToCallback callback)

Set the specified playback progress.

Parameters
millisecond Point in time of specified playback progress
callback the result notification of set the specified playback progress

enableRepeat

public void enableRepeat (boolean enable)

Whether to repeat playback.

Parameters
enable repeat playback flag. The default is false.

enableAux

public void enableAux (boolean enable)

Whether to mix the player's sound into the stream being published.

Parameters
enable Aux audio flag. The default is false.

muteLocal

public void muteLocal (boolean mute)

Whether to play locally silently.

Parameters
mute Mute local audio flag, The default is false.

setPlayerCanvas

public void setPlayerCanvas (ZegoCanvas canvas)

Set the view of the player playing video.

Parameters
canvas Video rendered canvas object

setVolume

public void setVolume (int volume)

Set player volume.

Parameters
volume The range is 0 ~ 100. The default is 50.

setProgressInterval

public void setProgressInterval (long millisecond)

Set playback progress callback interval.

Parameters
millisecond Interval of playback progress callback in milliseconds

getVolume

public int getVolume ()

Get the current volume.

getTotalDuration

public long getTotalDuration ()

Get the total progress of your media resources.

getCurrentProgress

public long getCurrentProgress ()

Get current playing progress.

getCurrentState

public ZegoMediaPlayerState getCurrentState ()

Get the current playback status.

getIndex

public int getIndex ()

Get media player index.

Package-Func Docs

ZegoMediaPlayer

package ZegoMediaPlayer ()