diff --git a/multimedia/player_framework/avplayer.h b/multimedia/player_framework/avplayer.h index ab0d17cd3db94677f00be9027f49a98bb6169c09..b5d354b9f9b7669d88c5f1005321cf0b145bdf5d 100644 --- a/multimedia/player_framework/avplayer.h +++ b/multimedia/player_framework/avplayer.h @@ -563,6 +563,46 @@ OH_AVErrCode OH_AVPlayer_GetMediaKeySystemInfo(OH_AVPlayer *player, DRM_MediaKey OH_AVErrCode OH_AVPlayer_SetDecryptionConfig(OH_AVPlayer *player, MediaKeySession *mediaKeySession, bool secureVideoPath); +/** + * @brief mute or unmute specified media. + * @syscap SystemCapability.Multimedia.Media.AVPlayer + * @param player Pointer to an OH_AVPlayer instance + * @param mediaType Indicates the target media type. see @OH_AVCodec.OH_MediaType + * @param isMuted The switch to set mute or unmute + * @return Function result code. + * {@link AV_ERR_OK} if the execution is successful. + * {@link AV_ERR_INVALID_VAL} if input player is nullptr or media don't contain specified mediaType. + * {@link AV_ERR_UNSUPPORT} if the specified mediaType not supported. + * @since 13 +*/ +OH_AVErrCode OH_AVPlayer_SetMediaMuted(OH_AVPlayer *player, OH_MediaType mediaType, bool isMuted); + +/** + * @brief Add the subtitle source for the player. The corresponding source can be http url. + * @syscap SystemCapability.Multimedia.Media.AVPlayer + * @param player Pointer to an OH_AVPlayer instance + * @param url Indicates the playback source. + * @return Function result code. + * {@link AV_ERR_OK} if the execution is successful. + * {@link AV_ERR_INVALID_VAL} if input player is nullptr, url is null or player setUrlSource failed. + * @since 13 + */ +OH_AVErrCode OH_AVPlayer_AddSubtitleFromUrl(H_AVPlayer *player, const char *url); + +/** + * @brief Add the subtitle file descriptor source for the player. + * @syscap SystemCapability.Multimedia.Media.AVPlayer + * @param player Pointer to an OH_AVPlayer instance + * @param fd Indicates the file descriptor of subtitle source. + * @param offset Indicates the offset of subtitle source in file descriptor. + * @param size Indicates the size of subtitle source. + * @return Function result code. + * {@link AV_ERR_OK} if the execution is successful. + * {@link AV_ERR_INVALID_VAL} if input player is nullptr or player setFdSource failed. + * @since 13 + */ +OH_AVErrCode OH_AVPlayer_AddSubtitleFromFd(H_AVPlayer *player, int32_t fd, int64_t offset, int64_t size); + #ifdef __cplusplus } #endif diff --git a/multimedia/player_framework/avplayer_base.h b/multimedia/player_framework/avplayer_base.h index 903a52f72ae0a6c957451398b9cb494a871781d2..5dcc9126b4ba1152ee9294079144cd89b14d26b9 100644 --- a/multimedia/player_framework/avplayer_base.h +++ b/multimedia/player_framework/avplayer_base.h @@ -172,6 +172,41 @@ typedef enum AVPlayerOnInfoType { AV_INFO_TYPE_AUDIO_OUTPUT_DEVICE_CHANGE = 17, } AVPlayerOnInfoType; +/** + * @brief Key to get subtitle text, value type is char array. + * @syscap SystemCapability.Multimedia.Media.AVPlayer + * @since 13 + */ +extern const char* OH_PLAYER_SUBTITLE_TEXT; + +/** + * @brief Key to get subtitle pts, value type is int32_t. + * @syscap SystemCapability.Multimedia.Media.AVPlayer + * @since 13 + */ +extern const char* OH_PLAYER_SUBTITLE_PTS; + +/** + * @brief Key to get subtitle duration, value type is int32_t. + * @syscap SystemCapability.Multimedia.Media.AVPlayer + * @since 13 + */ +extern const char* OH_PLAYER_SUBTITLE_DURATION; + +/** + * @brief Key to get track count, value type is uint32_t. + * @syscap SystemCapability.Multimedia.Media.AVPlayer + * @since 13 + */ +extern const char* OH_PLAYER_TRACK_COUNT; + +/** + * @brief Key to get track info array, value type is OH_AVFormat pointer array. + * @syscap SystemCapability.Multimedia.Media.AVPlayer + * @since 13 + */ +extern const char* OH_PLAYER_TRACK_INFO_ARRAY; + /** * @brief Called when a player message or alarm is received. * @syscap SystemCapability.Multimedia.Media.AVPlayer