harmony 鸿蒙avplayer.h
avplayer.h
Overview
The avplayer.h file declares the AVPlayer APIs. You can use the native AVPlayer APIs to play a media asset.
Library: libavplayer.so
File to include:
Since: 11
Related module: AVPlayer
Summary
Types
Name | Description |
---|---|
typedef struct MediaKeySession MediaKeySession | Defines a struct for the media key session. |
typedef struct DRM_MediaKeySystemInfo DRM_MediaKeySystemInfo | Defines a struct for the media key system information. |
typedef void(* Player_MediaKeySystemInfoCallback) (OH_AVPlayer *player, DRM_MediaKeySystemInfo *mediaKeySystemInfo) | Defines a callback invoked when media key system information of the AVPlayer is updated. |
Functions
Name | Description |
---|---|
OH_AVPlayer *OH_AVPlayer_Create (void) | Creates an OH_AVPlayer instance. |
OH_AVErrCode OH_AVPlayer_SetURLSource (OH_AVPlayer *player, const char *url) | Sets the HTTP URL of a media source to be played by an AVPlayer. |
OH_AVErrCode OH_AVPlayer_SetFDSource (OH_AVPlayer *player, int32_t fd, int64_t offset, int64_t size) | Sets the file descriptor of a media source to be played by an AVPlayer. |
OH_AVErrCode OH_AVPlayer_Prepare (OH_AVPlayer *player) | Prepares the playback environment and buffers media data. |
OH_AVErrCode OH_AVPlayer_Play (OH_AVPlayer *player) | Starts playback. |
OH_AVErrCode OH_AVPlayer_Pause (OH_AVPlayer *player) | Pauses playback. |
OH_AVErrCode OH_AVPlayer_Stop (OH_AVPlayer *player) | Stops playback. |
OH_AVErrCode OH_AVPlayer_Reset (OH_AVPlayer *player) | Restores the AVPlayer to the initial state. |
OH_AVErrCode OH_AVPlayer_Release (OH_AVPlayer *player) | Asynchronously releases an OH_AVPlayer instance. |
OH_AVErrCode OH_AVPlayer_ReleaseSync (OH_AVPlayer *player) | Synchronously releases an OH_AVPlayer instance. |
OH_AVErrCode OH_AVPlayer_SetVolume (OH_AVPlayer *player, float leftVolume, float rightVolume) | Sets the volume for an AVPlayer. |
OH_AVErrCode OH_AVPlayer_Seek (OH_AVPlayer *player, int32_t mSeconds, AVPlayerSeekMode mode) | Seeks to a playback position. |
OH_AVErrCode OH_AVPlayer_GetCurrentTime (OH_AVPlayer *player, int32_t *currentTime) | Obtains the playback position, in milliseconds. |
OH_AVErrCode OH_AVPlayer_GetVideoWidth (OH_AVPlayer *player, int32_t *videoWidth) | Obtains the video width. |
OH_AVErrCode OH_AVPlayer_GetVideoHeight (OH_AVPlayer *player, int32_t *videoHeight) | Obtains the video height. |
OH_AVErrCode OH_AVPlayer_SetPlaybackSpeed (OH_AVPlayer *player, AVPlaybackSpeed speed) | Sets the playback speed for an AVPlayer. |
OH_AVErrCode OH_AVPlayer_GetPlaybackSpeed (OH_AVPlayer *player, AVPlaybackSpeed *speed) | Obtains the playback speed of an AVPlayer. |
OH_AVErrCode OH_AVPlayer_SetAudioRendererInfo (OH_AVPlayer *player, OH_AudioStream_Usage streamUsage) | Sets the audio stream type for an AVPlayer. |
OH_AVErrCode OH_AVPlayer_SetVolumeMode (OH_AVPlayer *player, OH_AudioStream_VolumeMode volumeMode) | Sets the audio volume mode for an AVPlayer. |
OH_AVErrCode OH_AVPlayer_SetAudioInterruptMode (OH_AVPlayer *player, OH_AudioInterrupt_Mode interruptMode) | Sets the audio interruption mode for an AVPlayer. |
OH_AVErrCode OH_AVPlayer_SetAudioEffectMode (OH_AVPlayer *player, OH_AudioStream_AudioEffectMode effectMode) | Sets the audio effect mode for an AVPlayer. |
OH_AVErrCode OH_AVPlayer_SelectBitRate (OH_AVPlayer *player, uint32_t bitRate) | Sets the bit rate used by an HLS player. |
OH_AVErrCode OH_AVPlayer_SetVideoSurface (OH_AVPlayer *player, OHNativeWindow *window) | Sets a playback window. |
OH_AVErrCode OH_AVPlayer_GetDuration (OH_AVPlayer *player, int32_t *duration) | Obtains the total duration of a media file, in milliseconds. |
OH_AVErrCode OH_AVPlayer_GetState (OH_AVPlayer *player, AVPlayerState *state) | Obtains the AVPlayer state. |
bool OH_AVPlayer_IsPlaying (OH_AVPlayer *player) | Checks whether an AVPlayer is playing. |
bool OH_AVPlayer_IsLooping (OH_AVPlayer *player) | Checks whether an AVPlayer is looping. |
OH_AVErrCode OH_AVPlayer_SetLooping (OH_AVPlayer *player, bool loop) | Enables loop playback. |
OH_AVErrCode OH_AVPlayer_SetPlayerCallback (OH_AVPlayer *player, AVPlayerCallback callback) | Sets a callback for an AVPlayer. |
OH_AVErrCode OH_AVPlayer_SelectTrack (OH_AVPlayer *player, int32_t index) | Selects an audio or subtitle track. |
OH_AVErrCode OH_AVPlayer_DeselectTrack (OH_AVPlayer *player, int32_t index) | Deselects an audio or subtitle track. |
OH_AVErrCode OH_AVPlayer_GetCurrentTrack (OH_AVPlayer *player, int32_t trackType, int32_t *index) | Obtains the currently valid track. |
OH_AVErrCode OH_AVPlayer_SetMediaKeySystemInfoCallback (OH_AVPlayer *player, Player_MediaKeySystemInfoCallback callback) | Sets a callback to return the media key system information for an AVPlayer. |
OH_AVErrCode OH_AVPlayer_GetMediaKeySystemInfo (OH_AVPlayer *player, DRM_MediaKeySystemInfo *mediaKeySystemInfo) | Obtains the media key system information to create a media key session. |
OH_AVErrCode OH_AVPlayer_SetDecryptionConfig (OH_AVPlayer *player, MediaKeySession *mediaKeySession, bool secureVideoPath) | Sets the decryption information. |
OH_AVErrCode OH_AVPlayer_SetOnInfoCallback (OH_AVPlayer *player, OH_AVPlayerOnInfoCallback callback, void *userData) | Sets a callback for the event indicating that the AVPlayer receives a message. |
OH_AVErrCode OH_AVPlayer_SetOnErrorCallback (OH_AVPlayer *player, OH_AVPlayerOnErrorCallback callback, void *userData) | Sets a callback for the event indicating that an error occurs in the AVPlayer. |
你可能感兴趣的鸿蒙文章
harmony 鸿蒙OH_AVRecorder_Config
0
赞
- 所属分类: 后端技术
- 本文标签:
热门推荐
-
2、 - 优质文章
-
3、 gate.io
-
8、 golang
-
9、 openharmony
-
10、 Vue中input框自动聚焦