1 Star 0 Fork 4.9K

Lin_bruin / docs

forked from OpenHarmony / docs 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
OHOS-Media-Player.md 12.32 KB
一键复制 编辑 原始数据 按行查看 历史
wenjun 提交于 2020-09-08 10:08 . add OpenHarmony 1.0 baseline

OHOS::Media::Player

Overview

Related Modules:

MultiMedia_Player

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.

1
https://gitee.com/dreaminghell/docs.git
git@gitee.com:dreaminghell/docs.git
dreaminghell
docs
docs
master

搜索帮助