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 | openWithCustomSource (int64_t startPos, media::base::IMediaPlayerCustomDataProvider *provider)=0 |
Open media file or stream with custom soucrce. More... | |
virtual int | openWithMediaSource (const media::base::MediaSource &source)=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 | setPlaybackSpeed (int 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 int | openWithAgoraCDNSrc (const char *src, int64_t startPos)=0 |
virtual int | getAgoraCDNLineCount ()=0 |
virtual int | switchAgoraCDNLineByIndex (int index)=0 |
virtual int | getCurrentAgoraCDNIndex ()=0 |
virtual int | enableAutoSwitchAgoraCDN (bool enable)=0 |
virtual int | renewAgoraCDNSrcToken (const char *token, int64_t ts)=0 |
virtual int | switchAgoraCDNSrc (const char *src, bool syncPts=false)=0 |
virtual int | switchSrc (const char *src, bool syncPts)=0 |
virtual int | preloadSrc (const char *src, int64_t startPos)=0 |
virtual int | unloadSrc (const char *src)=0 |
virtual int | playPreloadedSrc (const char *src)=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 |
Open media file or stream with custom soucrce.
startPos | Set the starting position for playback, in seconds |
observer | dataProvider object |
|
pure virtual |
Opens a media file with a media file source.
source | Media file source that you want to play, see MediaSource |
|
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 ref [50-400]. |
|
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. |
|
pure virtual |
Open the Agora CDN media source.
src | The src of the media file that you want to play. |
startPos | The playback position (ms). |
|
pure virtual |
Gets the number of Agora CDN lines.
|
pure virtual |
Switch Agora CDN lines.
index | Specific CDN line index. |
|
pure virtual |
Gets the line of the current CDN.
|
pure virtual |
Enable automatic CDN line switching.
enable | Whether enable. |
|
pure virtual |
Update the CDN source token and timestamp.
token | token. |
ts | ts. |
|
pure virtual |
Switch the CDN source when open a media through "openWithAgoraCDNSrc" API
src | Specific src. |
syncPts | Live streaming must be set to false. |
|
pure virtual |
Switch the media source when open a media through "open" API
src | Specific src. |
syncPts | Live streaming must be set to false. |
|
pure virtual |
Preload a media source
src | Specific src. |
startPos | The starting position (ms) for playback. Default value is 0. |
|
pure virtual |
Unload a preloaded media source
src | Specific src. |
|
pure virtual |
Play a pre-loaded media source
src | Specific src. |