Inherits agora::RefCountInterface.
Inherited by agora::rtc::IMediaPlayerSourceEx.
The IMediaPlayerSource class provides access to a media player source. To playout multiple media sources simultaneously, create multiple media player source objects.
◆ ~IMediaPlayerSource()
virtual agora::rtc::IMediaPlayerSource::~IMediaPlayerSource |
( |
| ) |
|
|
inlineprotectedvirtual |
◆ getSourceId()
virtual int agora::rtc::IMediaPlayerSource::getSourceId |
( |
| ) |
const |
|
pure virtual |
Gets the unique source ID of the media player source.
- Returns
- ≧ 0: The source ID of this media player source.
- < 0: Failure.
◆ open()
virtual int agora::rtc::IMediaPlayerSource::open |
( |
const char * |
url, |
|
|
int64_t |
startPos |
|
) |
| |
|
pure virtual |
Opens a media file with a specified URL.
- Parameters
-
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. |
- Returns
- 0: Success.
- < 0: Failure.
◆ play()
virtual int agora::rtc::IMediaPlayerSource::play |
( |
| ) |
|
|
pure virtual |
Plays the media file.
- Returns
- 0: Success.
- < 0: Failure.
◆ pause()
virtual int agora::rtc::IMediaPlayerSource::pause |
( |
| ) |
|
|
pure virtual |
Pauses the playback.
- Returns
- 0: Success.
- < 0: Failure.
◆ stop()
virtual int agora::rtc::IMediaPlayerSource::stop |
( |
| ) |
|
|
pure virtual |
Stops the playback.
- Returns
- 0: Success.
- < 0: Failure.
◆ resume()
virtual int agora::rtc::IMediaPlayerSource::resume |
( |
| ) |
|
|
pure virtual |
Resumes the playback.
- Returns
- 0: Success.
- < 0: Failure.
◆ seek()
virtual int agora::rtc::IMediaPlayerSource::seek |
( |
int64_t |
newPos | ) |
|
|
pure virtual |
Sets the playback position of the media file.
- Parameters
-
newPos | The new playback position (ms). |
- Returns
- 0: Success.
- < 0: Failure.
◆ getDuration()
virtual int agora::rtc::IMediaPlayerSource::getDuration |
( |
int64_t & |
duration | ) |
|
|
pure virtual |
Gets the duration of the media file.
- Parameters
-
[out] | duration | A reference to the duration of the media file. |
- Returns
- 0: Success.
- < 0: Failure.
◆ getPlayPosition()
virtual int agora::rtc::IMediaPlayerSource::getPlayPosition |
( |
int64_t & |
pos | ) |
|
|
pure virtual |
Gets the current playback position of the media file.
- Parameters
-
[out] | pos | A reference to the current playback position (ms). |
- Returns
-
◆ getStreamCount()
virtual int agora::rtc::IMediaPlayerSource::getStreamCount |
( |
int64_t & |
count | ) |
|
|
pure virtual |
Gets the number of the media streams in the media source.
- Parameters
-
[out] | count | The number of the media streams in the media source. |
- Returns
-
◆ getStreamInfo()
Gets the detailed information of a media stream.
- Parameters
-
| index | The index of the media stream. |
[out] | info | The detailed information of the media stream. See PlayerStreamInfo for details. |
- Returns
-
◆ setLoopCount()
virtual int agora::rtc::IMediaPlayerSource::setLoopCount |
( |
int64_t |
loopCount | ) |
|
|
pure virtual |
Sets whether to loop the media file for playback.
- Parameters
-
loopCount | The number of times of looping the media file.
- 0: Play the media file once.
- 1: Play the media file twice.
- -1: Play the media file in a loop indefinitely, until stop is called.
|
- Returns
-
◆ muteAudio()
virtual int agora::rtc::IMediaPlayerSource::muteAudio |
( |
bool |
audio_mute | ) |
|
|
pure virtual |
Mute the audio playing
- Parameters
-
audio_mute | : mute or unmute audio |
- Returns
- 0: Success.
- < 0: Failure.
◆ isAudioMuted()
virtual bool agora::rtc::IMediaPlayerSource::isAudioMuted |
( |
| ) |
|
|
pure virtual |
Gets whehter audio is muted
- Parameters
-
- Returns
- true or false
◆ muteVideo()
virtual int agora::rtc::IMediaPlayerSource::muteVideo |
( |
bool |
audio_mute | ) |
|
|
pure virtual |
Mute the audio playing
- Parameters
-
audio_mute | : mute or unmute audio |
- Returns
- 0: Success.
- < 0: Failure.
◆ isVideoMuted()
virtual bool agora::rtc::IMediaPlayerSource::isVideoMuted |
( |
| ) |
|
|
pure virtual |
Gets whehter audio is muted
- Parameters
-
- Returns
- true or false
◆ changePlaybackSpeed()
Changes the playback speed.
- Parameters
-
- Returns
-
◆ selectAudioTrack()
virtual int agora::rtc::IMediaPlayerSource::selectAudioTrack |
( |
int64_t |
index | ) |
|
|
pure virtual |
Selects an audio track of the media file for playback.
- Parameters
-
index | The index of the audio track in media file. |
- Returns
-
◆ setPlayerOption() [1/2]
virtual int agora::rtc::IMediaPlayerSource::setPlayerOption |
( |
const char * |
key, |
|
|
int64_t |
value |
|
) |
| |
|
pure virtual |
Changes the player option before playing a file.
- Parameters
-
key | The key of the option paramemter. |
value | The value of option parameter. |
- Returns
-
◆ setPlayerOption() [2/2]
virtual int agora::rtc::IMediaPlayerSource::setPlayerOption |
( |
const char * |
key, |
|
|
const char * |
value |
|
) |
| |
|
pure virtual |
Changes the player option before playing a file.
- Parameters
-
key | The key of the option paramemter. |
value | The value of option parameter. |
- Returns
-
◆ takeScreenshot()
virtual int agora::rtc::IMediaPlayerSource::takeScreenshot |
( |
const char * |
filename | ) |
|
|
pure virtual |
Takes a screenshot when playing a video file.
- Parameters
-
filename | The filename of the screenshot file. |
- Returns
-
◆ selectInternalSubtitle()
virtual int agora::rtc::IMediaPlayerSource::selectInternalSubtitle |
( |
int64_t |
index | ) |
|
|
pure virtual |
Selects internal subtitles for a video file.
- Parameters
-
index | The index of the internal subtitles. |
- Returns
-
◆ setExternalSubtitle()
virtual int agora::rtc::IMediaPlayerSource::setExternalSubtitle |
( |
const char * |
url | ) |
|
|
pure virtual |
Sets an external subtitle file for a video file.
- Parameters
-
url | The URL of the subtitle file. |
- Returns
-
◆ getState()
Gets the playback state.
- Returns
- The current playback state. See MEDIA_PLAYER_STATE for details.
◆ registerPlayerSourceObserver()
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.
- Parameters
-
- Returns
-
◆ unregisterPlayerSourceObserver()
Releases the media player source observer.
- Parameters
-
- Returns
-
◆ registerAudioFrameObserver()
Registers the audio frame observer.
- Parameters
-
- Returns
-
◆ unregisterAudioFrameObserver()
Releases the audio frame observer.
- Parameters
-
- Returns
-