加入收藏
举报
02-14 20:02
#0
文件名称:
OHOS-Media-Player.md
所在目录:
Openharmony v1.0 / docs / api / api-SmartVision-Devices
文件大小:
12.32 KB
下载地址:
fenwii/OpenHarmony
   
免责声明:本网站仅提供指向 GitHub 上的文件的链接,所有文件的版权归原作者所有,本网站不对文件内容的合法性、准确性或安全性承担任何责任。
文本预览:
# OHOS::Media::Player
## **Overview**
**Related Modules:**
[MultiMedia\_Player](MultiMedia_Player.md)
**Description:**
Provides functions for playing online movies, offline movies, and streams, for example, playing local movies and advanced audio coding \(AAC\) streams.
**Since:**
1.0
**Version:**
1.0
## **Summary**
## Public Member Functions




























































Public Member Function Name


Description


SetSource (const Source &source)


int32_t 


Sets the playback source for the player. The corresponding source can be the file descriptor (FD) of the local file, local file URI, network URI, or media stream.


Prepare ()


int32_t 


Prepares the playback environment and buffers media data.


Play ()


int32_t 


Starts or resumes playback.


IsPlaying ()


bool 


Checks whether the player is playing.


Pause ()


int32_t 


Pauses playback.


Stop ()


int32_t 


Stops playback.


Rewind (int64_t mSeconds, int32_t mode)


int32_t 


Changes the playback position.


SetVolume (float leftVolume, float rightVolume)


int32_t 


Sets the volume of the player.


SetVideoSurface (Surface *surface)


int32_t 


Sets a surface for video playback.


EnableSingleLooping (bool loop)


int32_t 


Sets loop playback.


IsSingleLooping ()


bool 


Checks whether the player is looping.


GetCurrentTime (int64_t &time) const


int32_t 


Obtains the playback position, accurate to millisecond.


GetDuration (int64_t &duration) const


int32_t 


Obtains the total duration of media files, in milliseconds.


GetVideoWidth (int32_t &videoWidth)


int32_t 


Obtains the width of the video.


GetVideoHeight (int32_t &videoHeight)


int32_t 


Obtains the height of the video.


Reset ()


int32_t 


Restores the player to the initial state.


Release ()


int32_t 


Releases player resources.


SetPlayerCallback (const std::shared_ptr< PlayerCallback > &cb)


void 


Registers a listener to receive events and exception notifications from the player.


点赞 回复
回帖
支持markdown部分语法 ?