|
Media Player Kit v1.3.0 API Reference for Windows
|
Inherits RefCountInterface.
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::MediaStreamInfo *info)=0 |
| virtual int | setLoopCount (int loopCount)=0 |
| virtual int | changePlaybackSpeed (media::base::MEDIA_PLAYER_PLAYBACK_SPEED speed)=0 |
| virtual int | selectAudioTrack (int index)=0 |
| virtual int | setPlayerOption (const char *key, int value)=0 |
| virtual int | setPlayerOption (const char *key, const char *value)=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 |
Protected Member Functions | |
| virtual | ~IMediaPlayerSource ()=default |
The IMediaPlayerSource class provides access to a media player source. To playout multiple media sources simultaneously, create multiple media player source objects.
|
protectedvirtualdefault |
|
pure virtual |
Get unique source id of the media player source.
|
pure virtual |
Opens the media resource.
| src | The path of the media resource. Both local path and online path are supported. |
| startPos | The starting position (ms) for playback. Default value is 0. |
|
pure virtual |
Plays the media resource.
After open() or pause() or seek(), you can call this method to play the media resource.
|
pure virtual |
Pauses the playback.
To resume the playback, call the play() method.
|
pure virtual |
Stops the playback.
|
pure virtual |
Resumes the playback.
|
pure virtual |
Seeks to a new playback position.
After successfully calling the method, you will receive the onPlayerEvent callback, reporting the result of the seek operation to the new playback position.
| pos | The new playback position (ms). |
|
pure virtual |
Gets the duration of the media resource.
| [out] | duration | The total duration (ms) of the media resource. |
|
pure virtual |
Gets current playback progress.
| [out] | pos | The playback progress (ms). |
|
pure virtual |
Gets the number of the media streams in the media resource.
| [out] | count | The number of the media streams in the media resource. |
|
pure virtual |
Gets the detailed information of the media stream.
| index | The index of the media stream. | |
| [out] | info | The detailed information of the media stream. See MediaStreamInfo for details. |
|
pure virtual |
Sets the loop playback.
If you want to loop, call this method and set the number of the loops.
When the loop playback ends, MediaPlayer Kit returns PLAYER_STATE_PLAYBACK_ALL_LOOPS_COMPLETED.
| loopCount | The number of the loops. |
|
pure virtual |
Adjusts the playback speed.
Call this method after the play() method.
| speed | The playback speed. See MEDIA_PLAYER_PLAYBACK_SPEED for details |
|
pure virtual |
Selects the audio track.
When the media resource contains more than one audio track, you can call this method to select which audio track to use.
| index | The index of the audio track. |
|
pure virtual |
Sets the private options for the MediaPlayer Kit.
The MediaPlayer Kit supports setting private options by providing key and value. Under normal circumstances, you do not need to know the private option settings, and just use the default option settings.
| key | key. |
| value | value. |
|
pure virtual |
Sets the private options for the MediaPlayer Kit.
The MediaPlayer Kit supports setting private options by providing key and value. Under normal circumstances, you do not need to know the private option settings, and just use the default option settings.
| key | key. |
| value | value. |
|
pure virtual |
Sets the external subtitle.
After opening the media file, you can call this method set the mediaplayer kit to display the external subtitle.
| url | The URL address of the external subtitle. Both SRT subtitle and ASS subtitle, local address and online address are supported. |
|
pure virtual |
Gets current 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 an audio observer.
| observer | The audio observer, reporting the reception of each audio frame. See IAudioFrameObserver for details. |
|
pure virtual |
Unregisters an audio observer.
| observer | The audio observer, reporting the reception of each audio frame. See IAudioFrameObserver for details. |