# Types > **NOTE** > > 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. ## AVSessionType10+ type AVSessionType = 'audio' | 'video' | 'voice_call' | 'video_call' Defines the session type supported by the session. You can use the strings listed in the following table. **Atomic service API**: This API can be used in atomic services since API version 12. **System capability**: SystemCapability.Multimedia.AVSession.Core | Type | Description| | ----- | ---- | | 'audio' | Audio session.| | 'video' | Video session.| | 'voice_call'11+ | Voice call.| | 'video_call'12+ | Video call.| ## AVCastControlCommandType10+ type AVCastControlCommandType = 'play' | 'pause' | 'stop' | 'playNext' | 'playPrevious' | 'fastForward' | 'rewind' | 'seek' | 'setVolume' | 'setSpeed' | 'setLoopMode' | 'toggleFavorite' | 'toggleMute' Defines the commands that can be sent by a cast controller. **Atomic service API**: This API can be used in atomic services since API version 12. **System capability**: SystemCapability.Multimedia.AVSession.AVCast | Type | Description | | ---------------- | ------------ | | 'play' | Play the media. No parameter is required.| | 'pause' | Pause the playback. No parameter is required. | | 'stop' | Stop the playback. No parameter is required. | | 'playNext' | Play the next media asset. No parameter is required. | | 'playPrevious' | Play the previous media asset. No parameter is required. | | 'fastForward' | Fast-forward. No parameter is required. | | 'rewind' | Rewind. No parameter is required. | | 'seek' | Seek to a playback position. The corresponding parameter is of the number type.| | 'setVolume' | Set the volume. The corresponding parameter is of the number type. You can use [AVPlaybackState.maxVolume](arkts-apis-avsession-i.md#avplaybackstate10) to obtain the maximum system volume. | | 'setSpeed' | Set the playback speed. The corresponding parameter is [media.PlaybackSpeed](../apis-media-kit/arkts-apis-media-e.md#playbackspeed8).| | 'setLoopMode' | Set the loop mode. The corresponding parameter is [LoopMode](arkts-apis-avsession-e.md#loopmode10).| | 'toggleFavorite' | Favorite the media asset. The corresponding parameter is [AVMetadata.assetId](arkts-apis-avsession-i.md#avmetadata10). | | 'toggleMute' | Set the muted status. No parameter is required.| ## ExtraInfo18+ type ExtraInfo = { [key: string]: Object; } Defines the custom media packet set by the provider. **System capability**: SystemCapability.Multimedia.AVSession.Core | Type | Description | | ----------------------------------- | ----------------------------- | | [key: string]: Object | **key** specifies the remote distributed event type. Currently, the following event types are supported:
**'AUDIO_GET_VOLUME'**: obtains the volume of the remote device.
**'AUDIO_GET_AVAILABLE_DEVICES'**: obtains all remote devices that can be connected.
**'AUDIO_GET_PREFERRED_OUTPUT_DEVICE_FOR_RENDERER_INFO'**: obtains the actual remote audio device.
The provider returns the corresponding media packet object based on the event type.| ## KeyRequestCallback12+ type KeyRequestCallback = (assetId: string, requestData: Uint8Array) => void Defines the callback invoked for the media key request event. **Atomic service API**: This API can be used in atomic services since API version 12. **System capability**: SystemCapability.Multimedia.AVSession.AVCast **Parameters** | Name| Type | Mandatory| Description | | ------ | ------ | ---- | ----------------------------------------- | | assetId | string | Yes | Media asset ID.| | requestData | Uint8Array | Yes | Data carried in the media key request. | **Example** ```ts let keyRequestCallback: avSession.KeyRequestCallback = async(assetId: string, requestData: Uint8Array) => { console.info(`Succeeded in keyRequestCallback. assetId: ${assetId}, requestData: ${requestData}`); } ``` ## AVControlCommandType10+ type AVControlCommandType = 'play' | 'pause' | 'stop' | 'playNext' | 'playPrevious' | 'fastForward' | 'rewind' | 'seek' | 'setSpeed' | 'setLoopMode' | 'setTargetLoopMode' | 'toggleFavorite' | 'playFromAssetId' | 'playWithAssetId' | 'answer' | 'hangUp' | 'toggleCallMute' Defines the commands that can be sent to a session. You can use the union of the strings listed in the following table. **Atomic service API**: This API can be used in atomic services since API version 12. **System capability**: SystemCapability.Multimedia.AVSession.Core | Type | Description | | ---------------- | ------------ | | 'play' | Play the media. No parameter is required.| | 'pause' | Pause the playback. No parameter is required.| | 'stop' | Stop the playback. No parameter is required.| | 'playNext' | Play the next media asset. No parameter is required.| | 'playPrevious' | Play the previous media asset. No parameter is required.| | 'fastForward' | Fast-forward. No parameter is required.| | 'rewind' | Rewind. No parameter is required.| | 'seek' | Seek to a playback position. The corresponding parameter is of the number type.| | 'setSpeed' | Set the playback speed. The corresponding parameter is of the number type.| | 'setLoopMode' | Set the loop mode. The corresponding parameter is [LoopMode](arkts-apis-avsession-e.md#loopmode10).| | 'setTargetLoopMode' 18+ | Set the target loop mode. The recommended parameter is [LoopMode](arkts-apis-avsession-e.md#loopmode10).| | 'toggleFavorite' | Favorite the media asset. The corresponding parameter is [AVMetadata.assetId](arkts-apis-avsession-i.md#avmetadata10). | | 'playFromAssetId'| Play the media asset with the specified asset ID.| | 'playWithAssetId' 20+ | Play the media asset with the specified asset ID. The corresponding parameter is [AVMetadata.assetId](arkts-apis-avsession-i.md#avmetadata10).
The string length must be less than 40960 bytes.
| |'answer' | Answer a call. No parameter is required. | | 'hangUp' | The call is disconnecting. No parameter is required. | |'toggleCallMute' | Set the mute status for a call. No parameter is required.|