Agora Java API Reference for Android
|
#include <IAgoraMediaPlayerSource.h>
Public Member Functions | |
virtual int | getSourceId () const =0 |
virtual int | open (const char *url, int64_t startPos)=0 |
virtual int | play ()=0 |
virtual int | pause ()=0 |
virtual int | stop ()=0 |
virtual int | resume ()=0 |
virtual int | seek (int64_t newPos)=0 |
virtual int | getDuration (int64_t &duration)=0 |
virtual int | getPlayPosition (int64_t &pos)=0 |
virtual int | getStreamCount (int64_t &count)=0 |
virtual int | getStreamInfo (int64_t index, media::base::PlayerStreamInfo *info)=0 |
virtual int | setLoopCount (int64_t loopCount)=0 |
virtual int | muteAudio (bool audio_mute)=0 |
virtual bool | isAudioMuted ()=0 |
virtual int | muteVideo (bool audio_mute)=0 |
virtual bool | isVideoMuted ()=0 |
virtual int | changePlaybackSpeed (media::base::MEDIA_PLAYER_PLAYBACK_SPEED speed)=0 |
virtual int | selectAudioTrack (int64_t index)=0 |
virtual int | setPlayerOption (const char *key, int64_t value)=0 |
virtual int | setPlayerOption (const char *key, const char *value)=0 |
virtual int | takeScreenshot (const char *filename)=0 |
virtual int | selectInternalSubtitle (int64_t index)=0 |
virtual int | setExternalSubtitle (const char *url)=0 |
virtual media::base::MEDIA_PLAYER_STATE | getState ()=0 |
virtual int | registerPlayerSourceObserver (IMediaPlayerSourceObserver *observer)=0 |
virtual int | unregisterPlayerSourceObserver (IMediaPlayerSourceObserver *observer)=0 |
virtual int | registerAudioFrameObserver (media::base::IAudioFrameObserver *observer)=0 |
virtual int | unregisterAudioFrameObserver (media::base::IAudioFrameObserver *observer)=0 |
![]() | |
virtual void | AddRef () const =0 |
virtual RefCountReleaseStatus | Release () const =0 |
virtual bool | HasOneRef () const =0 |
The IMediaPlayerSource class provides access to a media player source. To playout multiple media sources simultaneously, create multiple media player source objects.
|
pure virtual |
Gets the unique source ID of the media player source.
|
pure virtual |
Opens a media file with a specified URL.
url | The path of the media file. Both the local path and online path are supported. |
startPos | The starting position (ms) for playback. Default value is 0. |
|
pure virtual |
Plays the media file.
|
pure virtual |
Pauses the playback.
|
pure virtual |
Stops the playback.
|
pure virtual |
Resumes the playback.
|
pure virtual |
Sets the playback position of the media file.
newPos | The new playback position (ms). |
|
pure virtual |
Gets the duration of the media file.
[out] | duration | A reference to the duration of the media file. |
|
pure virtual |
Gets the current playback position of the media file.
[out] | pos | A reference to the current playback position (ms). |
|
pure virtual |
Gets the number of the media streams in the media source.
[out] | count | The number of the media streams in the media source. |
|
pure virtual |
Gets the detailed information of a media stream.
index | The index of the media stream. | |
[out] | info | The detailed information of the media stream. See PlayerStreamInfo for details. |
|
pure virtual |
Sets whether to loop the media file for playback.
loopCount | The number of times of looping the media file.
|
|
pure virtual |
Mute the audio playing
audio_mute | : mute or unmute audio |
|
pure virtual |
Gets whehter audio is muted
None |
|
pure virtual |
Mute the audio playing
audio_mute | : mute or unmute audio |
|
pure virtual |
Gets whehter audio is muted
None |
|
pure virtual |
Changes the playback speed.
speed | The playback speed. See MEDIA_PLAYER_PLAYBACK_SPEED for details. |
|
pure virtual |
Selects an audio track of the media file for playback.
index | The index of the audio track in media file. |
|
pure virtual |
Changes the player option before playing a file.
key | The key of the option paramemter. |
value | The value of option parameter. |
|
pure virtual |
Changes the player option before playing a file.
key | The key of the option paramemter. |
value | The value of option parameter. |
|
pure virtual |
Takes a screenshot when playing a video file.
filename | The filename of the screenshot file. |
|
pure virtual |
Selects internal subtitles for a video file.
index | The index of the internal subtitles. |
|
pure virtual |
Sets an external subtitle file for a video file.
url | The URL of the subtitle file. |
|
pure virtual |
Gets the playback state.
|
pure virtual |
Registers a media player source observer.
Once the media player source observer is registered, you can use the observer to monitor the state change of the media player.
observer | The pointer to the IMediaPlayerSourceObserver object. |
|
pure virtual |
Releases the media player source observer.
observer | The pointer to the IMediaPlayerSourceObserver object. |
|
pure virtual |
Registers the audio frame observer.
observer | The pointer to the IAudioFrameObserver object. |
|
pure virtual |
Releases the audio frame observer.
observer | The pointer to the IAudioFrameObserver object. |