目录

Enums

The initial APIs of this module are supported since API version 9. Newly added APIs will be marked with a superscript to indicate their earliest API version.

ProtocolType11+

Enumerates the protocol types supported by the remote device.

System capability: SystemCapability.Multimedia.AVSession.AVCast

Name Value Description
TYPE_LOCAL 0

Local device, which can be the built-in speaker or audio jack of the device, or an A2DP device.

Atomic service API: This API can be used in atomic services since API version 12.

TYPE_CAST_PLUS_STREAM 2

Cast+ stream mode, indicating that the media asset is being displayed on another device.

Atomic service API: This API can be used in atomic services since API version 12.

TYPE_DLNA12+ 4

DLNA protocol, indicating that the media asset is being displayed on another device.

Atomic service API: This API can be used in atomic services since API version 12.

TYPE_CAST_PLUS_AUDIO20+ 8

PCM mode, indicating that the media asset is being displayed on another device.

Atomic service API: This API can be used in atomic services since API version 20.

CastDisplayState12+

Enumerates the states of the cast display.

Atomic service API: This API can be used in atomic services since API version 12.

System capability: SystemCapability.Multimedia.AVSession.ExtendedDisplayCast

Name Value Description
STATE_OFF 1 The device is disconnected, and the extended screen does not display any content.
STATE_ON 2 The device is connected, and the extended screen is available.

CallerType22+

Enumerates the types of sources for the caller.

System capability: SystemCapability.Multimedia.AVSession.Core

Name Value Description
TYPE_CAST 'cast' The caller comes from casting.
TYPE_BLUETOOTH 'bluetooth' The caller comes from Bluetooth.
TYPE_APP 'app' The caller comes from an application.
TYPE_NEARLINK 'nearlink'

The caller comes from NearLink.

Model restriction: This API can be used only in the stage model.

ConnectionState10+

Enumerates the connection states.

Atomic service API: This API can be used in atomic services since API version 12.

System capability: SystemCapability.Multimedia.AVSession.Core

Name Value Description
STATE_CONNECTING 0 The device is connecting.
STATE_CONNECTED 1 The device is connected.
STATE_DISCONNECTED 6 The device is disconnected.

CallState11+

Enumerates the call states.

Atomic service API: This API can be used in atomic services since API version 12.

System capability: SystemCapability.Multimedia.AVSession.Core

Name Value Description
CALL_STATE_IDLE 0 The phone is idle.
CALL_STATE_INCOMING 1 The phone is ringing.
CALL_STATE_ACTIVE 2 The call is connected.
CALL_STATE_DIALING 3 Dialing.
CALL_STATE_WAITING 4 The call is waiting for connection.
CALL_STATE_HOLDING 5 The call is placed on hold.
CALL_STATE_DISCONNECTING 6 The call is disconnecting.

DisplayTag11+

Enumerates the display tags of the media asset. The display tag is a special type identifier of the media audio source.

System capability: SystemCapability.Multimedia.AVSession.Core

Name Value Description
TAG_AUDIO_VIVID 1 Audio Vivid attribute of the media asset.

DecoderType19+

Enumerates the decoding formats supported by the device.

Atomic service API: This API can be used in atomic services since API version 19.

System capability: SystemCapability.Multimedia.AVSession.AVCast

Name Value Description
OH_AVCODEC_MIMETYPE_VIDEO_AVC 'video/avc' Video AVC.
OH_AVCODEC_MIMETYPE_VIDEO_HEVC 'video/hevc' Video HEVC.
OH_AVCODEC_MIMETYPE_AUDIO_VIVID 'audio/av3a' AUDIO AV3A

ResolutionLevel19+

Enumerates the resolution levels supported by the device.

Atomic service API: This API can be used in atomic services since API version 19.

System capability: SystemCapability.Multimedia.AVSession.AVCast

Name Value Description
RESOLUTION_480P 0 480p (640 x 480 px).
RESOLUTION_720P 1 720p (1280 x 720 px).
RESOLUTION_1080P 2 1080p (1920 x 1080 px).
RESOLUTION_2K 3 2K (2560 x 1440 px).
RESOLUTION_4K 4 4K (3840 x 2160 px).

AVCastCategory10+

Enumerates the cast categories.

Atomic service API: This API can be used in atomic services since API version 12.

System capability: SystemCapability.Multimedia.AVSession.AVCast

Name Value Description
CATEGORY_LOCAL 0 Local playback. The sound is played from the local device or a connected Bluetooth headset by default.
CATEGORY_REMOTE 1 Remote playback. The sound or images are played from a remote device.

DeviceType10+

Enumerates the output device types.

Atomic service API: This API can be used in atomic services since API version 12.

Name Value Description
DEVICE_TYPE_LOCAL 0

Local device.

Atomic service API: This API can be used in atomic services since API version 12.

System capability: SystemCapability.Multimedia.AVSession.Core

DEVICE_TYPE_TV 2

TV.

Atomic service API: This API can be used in atomic services since API version 12.

System capability: SystemCapability.Multimedia.AVSession.AVCast

DEVICE_TYPE_SMART_SPEAKER 3

Speaker.

Atomic service API: This API can be used in atomic services since API version 12.

System capability: SystemCapability.Multimedia.AVSession.AVCast

DEVICE_TYPE_CAR 4

Vehicle-mounted device.

Since: 26.0.0

Model restriction: This API can be used only in the stage model.

Atomic service API: This API can be used in atomic services since API version 26.0.0.

System capability: SystemCapability.Multimedia.AVSession.AVCast

DEVICE_TYPE_PAD 6

Tablet.

Since: 26.0.0

Model restriction: This API can be used only in the stage model.

Atomic service API: This API can be used in atomic services since API version 26.0.0.

System capability: SystemCapability.Multimedia.AVSession.AVCast

DEVICE_TYPE_DEFAULT_CAST_PLUS_STREAM 7

Default device using the Cast+ protocol.

Since: 26.0.0

Model restriction: This API can be used only in the stage model.

Atomic service API: This API can be used in atomic services since API version 26.0.0.

System capability: SystemCapability.Multimedia.AVSession.AVCast

DEVICE_TYPE_2IN1 8

PC/2-in-1 device.

Since: 26.0.0

Model restriction: This API can be used only in the stage model.

Atomic service API: This API can be used in atomic services since API version 26.0.0.

System capability: SystemCapability.Multimedia.AVSession.AVCast

DEVICE_TYPE_BLUETOOTH 10

Bluetooth device.

Atomic service API: This API can be used in atomic services since API version 12.

System capability: SystemCapability.Multimedia.AVSession.Core

DEVICE_TYPE_HIPLAY 15

HiPlay device.

Since: 26.0.0

Model restriction: This API can be used only in the stage model.

Atomic service API: This API can be used in atomic services since API version 26.0.0.

System capability: SystemCapability.Multimedia.AVSession.AVCast

LoopMode10+

Enumerates the loop modes of media playback.

Atomic service API: This API can be used in atomic services since API version 12.

System capability: SystemCapability.Multimedia.AVSession.Core

Name Value Description
LOOP_MODE_SEQUENCE 0 Sequential playback.
LOOP_MODE_SINGLE 1 Single loop.
LOOP_MODE_LIST 2 Loop list
LOOP_MODE_SHUFFLE 3 Shuffle.
LOOP_MODE_CUSTOM11+ 4 Custom playback.

PlaybackState10+

Enumerates the media playback states.

Atomic service API: This API can be used in atomic services since API version 12.

System capability: SystemCapability.Multimedia.AVSession.Core

Name Value Description
PLAYBACK_STATE_INITIAL 0 Initial.
PLAYBACK_STATE_PREPARE 1 Preparing.
PLAYBACK_STATE_PLAY 2 Playing.
PLAYBACK_STATE_PAUSE 3 Paused.
PLAYBACK_STATE_FAST_FORWARD 4 Fast-forwarding.
PLAYBACK_STATE_REWIND 5 Rewinding.
PLAYBACK_STATE_STOP 6 Stopped.
PLAYBACK_STATE_COMPLETED 7 Playback complete.
PLAYBACK_STATE_RELEASED 8 Released.
PLAYBACK_STATE_ERROR 9 Error.
PLAYBACK_STATE_IDLE11+ 10 Idle.
PLAYBACK_STATE_BUFFERING11+ 11 Buffering.

AVSessionErrorCode10+

Enumerates the error codes used in the media session.

Name Value Description
ERR_CODE_SERVICE_EXCEPTION 6600101

The session server is abnormal.

Atomic service API: This API can be used in atomic services since API version 12.

System capability: SystemCapability.Multimedia.AVSession.Core

ERR_CODE_SESSION_NOT_EXIST 6600102

The session does not exist.

Atomic service API: This API can be used in atomic services since API version 12.

System capability: SystemCapability.Multimedia.AVSession.Core

ERR_CODE_CONTROLLER_NOT_EXIST 6600103

The session controller does not exist.

Atomic service API: This API can be used in atomic services since API version 12.

System capability: SystemCapability.Multimedia.AVSession.Core

ERR_CODE_REMOTE_CONNECTION_ERR 6600104

Connection to the remote session fails.

Atomic service API: This API can be used in atomic services since API version 12.

System capability: SystemCapability.Multimedia.AVSession.Core

ERR_CODE_COMMAND_INVALID 6600105

The session command is invalid.

Atomic service API: This API can be used in atomic services since API version 12.

System capability: SystemCapability.Multimedia.AVSession.Core

ERR_CODE_SESSION_INACTIVE 6600106

The session is not activated.

Atomic service API: This API can be used in atomic services since API version 12.

System capability: SystemCapability.Multimedia.AVSession.Core

ERR_CODE_MESSAGE_OVERLOAD 6600107

Too many commands or messages.

Atomic service API: This API can be used in atomic services since API version 12.

System capability: SystemCapability.Multimedia.AVSession.Core

ERR_CODE_DEVICE_CONNECTION_FAILED 6600108

Connection to the device fails.

Atomic service API: This API can be used in atomic services since API version 12.

System capability: SystemCapability.Multimedia.AVSession.Core

ERR_CODE_REMOTE_CONNECTION_NOT_EXIST 6600109

The remote session does not exist.

Atomic service API: This API can be used in atomic services since API version 12.

System capability: SystemCapability.Multimedia.AVSession.Core

ERR_CODE_DESKTOP_LYRIC_NOT_ENABLED23+ 6600110

The desktop lyrics feature of the application is not enabled.

Model restriction: This API can be used only in the stage model.

Atomic service API: This API can be used in atomic services since API version 23.

System capability: SystemCapability.Multimedia.AVSession.Core

ERR_CODE_DESKTOP_LYRIC_NOT_SUPPORTED23+ 6600111

The current device does not support the desktop lyrics feature.

Model restriction: This API can be used only in the stage model.

Atomic service API: This API can be used in atomic services since API version 23.

System capability: SystemCapability.Multimedia.AVSession.Core

ERR_CODE_CAST_CONTROL_UNSPECIFIED13+ 6611000

An undefined error occurs during cast control.

Atomic service API: This API can be used in atomic services since API version 13.

System capability: SystemCapability.Multimedia.AVSession.AVCast

ERR_CODE_CAST_CONTROL_REMOTE_ERROR13+ 6611001

An unknown error occurs in the remote player.

Atomic service API: This API can be used in atomic services since API version 13.

System capability: SystemCapability.Multimedia.AVSession.AVCast

ERR_CODE_CAST_CONTROL_BEHIND_LIVE_WINDOW13+ 6611002

The playback is delayed.

Atomic service API: This API can be used in atomic services since API version 13.

System capability: SystemCapability.Multimedia.AVSession.AVCast

ERR_CODE_CAST_CONTROL_TIMEOUT13+ 6611003

The cast control process times out.

Atomic service API: This API can be used in atomic services since API version 13.

System capability: SystemCapability.Multimedia.AVSession.AVCast

ERR_CODE_CAST_CONTROL_RUNTIME_CHECK_FAILED13+ 6611004

The runtime check fails.

Atomic service API: This API can be used in atomic services since API version 13.

System capability: SystemCapability.Multimedia.AVSession.AVCast

ERR_CODE_CAST_CONTROL_PLAYER_NOT_WORKING13+ 6611100

Cross-device data transfer is locked.

Atomic service API: This API can be used in atomic services since API version 13.

System capability: SystemCapability.Multimedia.AVSession.AVCast

ERR_CODE_CAST_CONTROL_SEEK_MODE_UNSUPPORTED13+ 6611101

The specified seek mode is not supported.

Atomic service API: This API can be used in atomic services since API version 13.

System capability: SystemCapability.Multimedia.AVSession.AVCast

ERR_CODE_CAST_CONTROL_ILLEGAL_SEEK_TARGET13+ 6611102

The seek position is out of the media range, or the current seek mode is not supported.

Atomic service API: This API can be used in atomic services since API version 13.

System capability: SystemCapability.Multimedia.AVSession.AVCast

ERR_CODE_CAST_CONTROL_PLAY_MODE_UNSUPPORTED13+ 6611103

The specified playback mode is not supported.

Atomic service API: This API can be used in atomic services since API version 13.

System capability: SystemCapability.Multimedia.AVSession.AVCast

ERR_CODE_CAST_CONTROL_PLAY_SPEED_UNSUPPORTED13+ 6611104

The specified playback speed is not supported.

Atomic service API: This API can be used in atomic services since API version 13.

System capability: SystemCapability.Multimedia.AVSession.AVCast

ERR_CODE_CAST_CONTROL_DEVICE_MISSING13+ 6611105

Operation failed because the media source device or media receiver device has been destroyed.

Atomic service API: This API can be used in atomic services since API version 13.

System capability: SystemCapability.Multimedia.AVSession.AVCast

ERR_CODE_CAST_CONTROL_INVALID_PARAM13+ 6611106

The parameter is invalid.

Atomic service API: This API can be used in atomic services since API version 13.

System capability: SystemCapability.Multimedia.AVSession.AVCast

ERR_CODE_CAST_CONTROL_NO_MEMORY13+ 6611107

Failed to allocate memory.

Atomic service API: This API can be used in atomic services since API version 13.

System capability: SystemCapability.Multimedia.AVSession.AVCast

ERR_CODE_CAST_CONTROL_OPERATION_NOT_ALLOWED13+ 6611108

The operation is not allowed.

Atomic service API: This API can be used in atomic services since API version 13.

System capability: SystemCapability.Multimedia.AVSession.AVCast

ERR_CODE_CAST_CONTROL_IO_UNSPECIFIED13+ 6612000

An unspecified input/output error occurs.

Atomic service API: This API can be used in atomic services since API version 13.

System capability: SystemCapability.Multimedia.AVSession.AVCast

ERR_CODE_CAST_CONTROL_IO_NETWORK_CONNECTION_FAILED13+ 6612001

Network connection fails.

Atomic service API: This API can be used in atomic services since API version 13.

System capability: SystemCapability.Multimedia.AVSession.AVCast

ERR_CODE_CAST_CONTROL_IO_NETWORK_CONNECTION_TIMEOUT13+ 6612002

Network connection times out.

Atomic service API: This API can be used in atomic services since API version 13.

System capability: SystemCapability.Multimedia.AVSession.AVCast

ERR_CODE_CAST_CONTROL_IO_INVALID_HTTP_CONTENT_TYPE 13+ 6612003

The value of Content-Type is invalid.

Atomic service API: This API can be used in atomic services since API version 13.

System capability: SystemCapability.Multimedia.AVSession.AVCast

ERR_CODE_CAST_CONTROL_IO_BAD_HTTP_STATUS13+ 6612004

The HTTP server returns an unexpected HTTP response status code.

Atomic service API: This API can be used in atomic services since API version 13.

System capability: SystemCapability.Multimedia.AVSession.AVCast

ERR_CODE_CAST_CONTROL_IO_FILE_NOT_FOUND13+ 6612005

The file does not exist.

Atomic service API: This API can be used in atomic services since API version 13.

System capability: SystemCapability.Multimedia.AVSession.AVCast

ERR_CODE_CAST_CONTROL_IO_NO_PERMISSION13+ 6612006

The input/output operation is not allowed.

Atomic service API: This API can be used in atomic services since API version 13.

System capability: SystemCapability.Multimedia.AVSession.AVCast

ERR_CODE_CAST_CONTROL_IO_CLEARTEXT_NOT_PERMITTED13+ 6612007

The network security configuration of the application does not allow access to plaintext HTTP traffic.

Atomic service API: This API can be used in atomic services since API version 13.

System capability: SystemCapability.Multimedia.AVSession.AVCast

ERR_CODE_CAST_CONTROL_IO_READ_POSITION_OUT_OF_RANGE13+ 6612008

The read position is out of range.

Atomic service API: This API can be used in atomic services since API version 13.

System capability: SystemCapability.Multimedia.AVSession.AVCast

ERR_CODE_CAST_CONTROL_IO_NO_CONTENTS13+ 6612100

No content can be played in the media.

Atomic service API: This API can be used in atomic services since API version 13.

System capability: SystemCapability.Multimedia.AVSession.AVCast

ERR_CODE_CAST_CONTROL_IO_READ_ERROR13+ 6612101

The media cannot be read.

Atomic service API: This API can be used in atomic services since API version 13.

System capability: SystemCapability.Multimedia.AVSession.AVCast

ERR_CODE_CAST_CONTROL_IO_CONTENT_BUSY13+ 6612102

The resource is in use.

Atomic service API: This API can be used in atomic services since API version 13.

System capability: SystemCapability.Multimedia.AVSession.AVCast

ERR_CODE_CAST_CONTROL_IO_CONTENT_EXPIRED13+ 6612103

The input/output request content has expired.

Atomic service API: This API can be used in atomic services since API version 13.

System capability: SystemCapability.Multimedia.AVSession.AVCast

ERR_CODE_CAST_CONTROL_IO_USE_FORBIDDEN13+ 6612104

The requested content cannot be played.

Atomic service API: This API can be used in atomic services since API version 13.

System capability: SystemCapability.Multimedia.AVSession.AVCast

ERR_CODE_CAST_CONTROL_IO_NOT_VERIFIED13+ 6612105

The allowed content cannot be verified.

Atomic service API: This API can be used in atomic services since API version 13.

System capability: SystemCapability.Multimedia.AVSession.AVCast

ERR_CODE_CAST_CONTROL_IO_EXHAUSTED_ALLOWED_USES13+ 6612106

The number of times that the content can be used has reached the maximum.

Atomic service API: This API can be used in atomic services since API version 13.

System capability: SystemCapability.Multimedia.AVSession.AVCast

ERR_CODE_CAST_CONTROL_IO_NETWORK_PACKET_SENDING_FAILED13+ 6612107

An error occurs when the source device sends data packets to the destination device.

Atomic service API: This API can be used in atomic services since API version 13.

System capability: SystemCapability.Multimedia.AVSession.AVCast

ERR_CODE_CAST_CONTROL_PARSING_UNSPECIFIED13+ 6613000

An unspecified content parsing error occurs.

Atomic service API: This API can be used in atomic services since API version 13.

System capability: SystemCapability.Multimedia.AVSession.AVCast

ERR_CODE_CAST_CONTROL_PARSING_CONTAINER_MALFORMED13+ 6613001

The format of the media container bit stream is incorrectly parsed.

Atomic service API: This API can be used in atomic services since API version 13.

System capability: SystemCapability.Multimedia.AVSession.AVCast

ERR_CODE_CAST_CONTROL_PARSING_MANIFEST_MALFORMED13+ 6613002

An error occurred when parsing the media list.

Atomic service API: This API can be used in atomic services since API version 13.

System capability: SystemCapability.Multimedia.AVSession.AVCast

ERR_CODE_CAST_CONTROL_PARSING_CONTAINER_UNSUPPORTED13+ 6613003

The media container format or feature of the file is not supported.

Atomic service API: This API can be used in atomic services since API version 13.

System capability: SystemCapability.Multimedia.AVSession.AVCast

ERR_CODE_CAST_CONTROL_PARSING_MANIFEST_UNSUPPORTED13+ 6613004

This feature is not supported in the media manifest.

Atomic service API: This API can be used in atomic services since API version 13.

System capability: SystemCapability.Multimedia.AVSession.AVCast

ERR_CODE_CAST_CONTROL_DECODING_UNSPECIFIED13+ 6614000

An unspecified decoding error occurs.

Atomic service API: This API can be used in atomic services since API version 13.

System capability: SystemCapability.Multimedia.AVSession.AVCast

ERR_CODE_CAST_CONTROL_DECODING_INIT_FAILED13+ 6614001

Initializing the decoder fails.

Atomic service API: This API can be used in atomic services since API version 13.

System capability: SystemCapability.Multimedia.AVSession.AVCast

ERR_CODE_CAST_CONTROL_DECODING_QUERY_FAILED13+ 6614002

Querying the decoder fails.

Atomic service API: This API can be used in atomic services since API version 13.

System capability: SystemCapability.Multimedia.AVSession.AVCast

ERR_CODE_CAST_CONTROL_DECODING_FAILED13+ 6614003

Decoding the media sample fails.

Atomic service API: This API can be used in atomic services since API version 13.

System capability: SystemCapability.Multimedia.AVSession.AVCast

ERR_CODE_CAST_CONTROL_DECODING_FORMAT_EXCEEDS_CAPABILITIES13+ 6614004

The decoding capability of the device does not meet the requirements.

Atomic service API: This API can be used in atomic services since API version 13.

System capability: SystemCapability.Multimedia.AVSession.AVCast

ERR_CODE_CAST_CONTROL_DECODING_FORMAT_UNSUPPORTED13+ 6614005

The decoding format is not supported.

Atomic service API: This API can be used in atomic services since API version 13.

System capability: SystemCapability.Multimedia.AVSession.AVCast

ERR_CODE_CAST_CONTROL_AUDIO_RENDERER_UNSPECIFIED13+ 6615000

An unspecified audio renderer error occurs.

Atomic service API: This API can be used in atomic services since API version 13.

System capability: SystemCapability.Multimedia.AVSession.AVCast

ERR_CODE_CAST_CONTROL_AUDIO_RENDERER_INIT_FAILED 13+ 6615001

Initializing the audio renderer fails.

Atomic service API: This API can be used in atomic services since API version 13.

System capability: SystemCapability.Multimedia.AVSession.AVCast

ERR_CODE_CAST_CONTROL_AUDIO_RENDERER_WRITE_FAILED13+ 6615002

Writing data to the audio renderer fails.

Atomic service API: This API can be used in atomic services since API version 13.

System capability: SystemCapability.Multimedia.AVSession.AVCast

ERR_CODE_CAST_CONTROL_DRM_UNSPECIFIED13+ 6616000

An unspecified DRM-related error occurs.

Atomic service API: This API can be used in atomic services since API version 13.

System capability: SystemCapability.Multimedia.AVSession.AVCast

ERR_CODE_CAST_CONTROL_DRM_SCHEME_UNSUPPORTED13+ 6616001

The device does not support the selected DRM scheme.

Atomic service API: This API can be used in atomic services since API version 13.

System capability: SystemCapability.Multimedia.AVSession.AVCast

ERR_CODE_CAST_CONTROL_DRM_PROVISIONING_FAILED13+ 6616002

Device configurations fail.

Atomic service API: This API can be used in atomic services since API version 13.

System capability: SystemCapability.Multimedia.AVSession.AVCast

ERR_CODE_CAST_CONTROL_DRM_CONTENT_ERROR13+ 6616003

The DRM-protected content cannot be played.

Atomic service API: This API can be used in atomic services since API version 13.

System capability: SystemCapability.Multimedia.AVSession.AVCast

ERR_CODE_CAST_CONTROL_DRM_LICENSE_ACQUISITION_FAILED13+ 6616004

Obtaining a license fails.

Atomic service API: This API can be used in atomic services since API version 13.

System capability: SystemCapability.Multimedia.AVSession.AVCast

ERR_CODE_CAST_CONTROL_DRM_DISALLOWED_OPERATION13+ 6616005

The license policy does not allow this operation.

Atomic service API: This API can be used in atomic services since API version 13.

System capability: SystemCapability.Multimedia.AVSession.AVCast

ERR_CODE_CAST_CONTROL_DRM_SYSTEM_ERROR13+ 6616006

An error occurs in the DRM system.

Atomic service API: This API can be used in atomic services since API version 13.

System capability: SystemCapability.Multimedia.AVSession.AVCast

ERR_CODE_CAST_CONTROL_DRM_DEVICE_REVOKED13+ 6616007

The DRM permission has been revoked from the device.

Atomic service API: This API can be used in atomic services since API version 13.

System capability: SystemCapability.Multimedia.AVSession.AVCast

ERR_CODE_CAST_CONTROL_DRM_LICENSE_EXPIRED13+ 6616008

The DRM license that is being loaded has expired.

Atomic service API: This API can be used in atomic services since API version 13.

System capability: SystemCapability.Multimedia.AVSession.AVCast

ERR_CODE_CAST_CONTROL_DRM_PROVIDE_KEY_RESPONSE_ERROR13+ 6616100

An error occurs when the DRM processes the key response.

Atomic service API: This API can be used in atomic services since API version 13.

System capability: SystemCapability.Multimedia.AVSession.AVCast

SkipIntervals11+

Enumerates the fast-forward or rewind intervals supported by the media session.

System capability: SystemCapability.Multimedia.AVSession.Core

Name Value Description
SECONDS_10 10 The interval is 10s.
SECONDS_15 15 The interval is 15s.
SECONDS_30 30 The interval is 30s.

BackgroundPlayMode24+

Enumerates the background playback modes supported by the media session.

Model restriction: This API can be used only in the stage model.

System capability: SystemCapability.Multimedia.AVSession.Core

Name Value Description
ENABLE_BACKGROUND_PLAY 0 Background playback is supported.
DISABLE_BACKGROUND_PLAY 1 Background playback is not supported.

ExtraKey

Enumerates the extra keys used in different scenarios.

Since: 26.0.0

Model restriction: This API can be used only in the stage model.

Atomic service API: This API can be used in atomic services since API version 26.0.0.

Name Value Description
REQUIRE_ABILITY_LIST 'requireAbilityList'

Key passed to the setExtras API to set the capabilities required by the application.

System capability: SystemCapability.Multimedia.AVSession.Core

SUPPORT_URL_CASTING 'url-cast'

Used as the setExtras API to transfer the values of capabilities to the REQUIRE_ABILITY_LIST key to notify the system that the current application supports URL-based casting.

The input parameter {[avSession.ExtraKey.REQUIRE_ABILITY_LIST]: [avSession.ExtraKey.SUPPORT_URL_CASTING]} of the setExtras API indicates that the current application supports URL-based casting.

System capability: SystemCapability.Multimedia.AVSession.AVCast

DLNA_CURRENT_URI_METADATA 'CurrentURIMetadata'

Key that can be passed to the extras attribute in AVMediaDescription. The value is of the string type.

It is used to add content to the CurrentURIMetaData tag in the packet sent to the peer end in DLNA casting scenarios.

System capability: SystemCapability.Multimedia.AVSession.AVCast

DLNA_DIDL_LITE 'DIDL-Lite'

Key that can be passed to the extras attribute in AVMediaDescription. The value is of the string type.

It is used to add content to the DIDL-Lite tag in the packet sent to the peer end in DLNA projection scenarios.

System capability: SystemCapability.Multimedia.AVSession.AVCast