• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Interfaces (Others)
2<!--Kit: AVSession Kit-->
3<!--Subsystem: Multimedia-->
4<!--Owner: @ccfriend; @liao_qian-->
5<!--SE: @ccfriend-->
6<!--TSE: @chenmingxi1_huawei-->
7
8> **NOTE**
9>
10> 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.
11
12## AVCastControlCommand<sup>10+</sup>
13
14Describes the command that can be sent by a cast controller.
15
16**Atomic service API**: This API can be used in atomic services since API version 12.
17
18**System capability**: SystemCapability.Multimedia.AVSession.AVCast
19
20| Name     | Type                                             | Mandatory| Description          |
21| --------- | ------------------------------------------------- | ---- | -------------- |
22| command   | [AVCastControlCommandType](arkts-apis-avsession-t.md#avcastcontrolcommandtype10)     | Yes  | Command. The parameters carried in each command are different. For details, see [AVCastControlCommandType](arkts-apis-avsession-t.md#avcastcontrolcommandtype10).|
23| parameter | [media.PlaybackSpeed](../apis-media-kit/arkts-apis-media-e.md#playbackspeed8) &#124; number &#124; string &#124; [LoopMode](arkts-apis-avsession-e.md#loopmode10) | No  | Parameters carried in the command.|
24
25## CastDisplayInfo<sup>12+</sup>
26
27Describes the information about the cast display in the case of extended screens.
28
29**Atomic service API**: This API can be used in atomic services since API version 12.
30
31**System capability**: SystemCapability.Multimedia.AVSession.ExtendedDisplayCast
32
33| Name           | Type                     | Read-Only| Optional| Description              |
34| --------------- |-------------------------| ---- | ---- |---------------------------------------------------------------------|
35| id            | number                  | No   | No   | ID of the cast display. The value must be an integer. |
36| name     | string                  | No   | No   | Name of the cast display.          |
37| state          | [CastDisplayState](arkts-apis-avsession-e.md#castdisplaystate12)          | No   | No   |State of the cast display.           |
38| width          | number          | No   | No   | Screen width of the cast display, in px. The value must be an integer.         |
39| height          | number          | No   | No   | Screen height of the cast display, in px. The value must be an integer.           |
40
41## AVMetadata<sup>10+</sup>
42
43Describes the media metadata.
44
45**System capability**: SystemCapability.Multimedia.AVSession.Core
46
47| Name           | Type                     | Read-Only| Optional| Description              |
48| --------------- |-------------------------| ---- | ---- |---------------------------------------------------------------------|
49| assetId         | string                  | No  | No  | Media asset ID. It is the unique ID of a song and defined by the application.<br>**Atomic service API**: This API can be used in atomic services since API version 12.                                    |
50| title           | string                  | No  | Yes  | Title.<br>**Atomic service API**: This API can be used in atomic services since API version 12.             |
51| artist          | string                  | No  | Yes  | Artist.<br>**Atomic service API**: This API can be used in atomic services since API version 12.            |
52| author          | string                  | No  | Yes  | Author.<br>**Atomic service API**: This API can be used in atomic services since API version 12.           |
53| avQueueName<sup>12+</sup>       | string                  | No  | Yes  | Playlist name.           |
54| avQueueId<sup>11+</sup>       | string                  | No  | Yes  | Unique ID of the playlist.           |
55| avQueueImage<sup>11+</sup>    | [image.PixelMap](../apis-image-kit/arkts-apis-image-PixelMap.md) &#124; string | No  | Yes  | Cover image of the playlist, which can be pixel data of an image or an image path (local path or Internet path). Applications call **setAVMetadata** to set the image data.<br>- If the data type is set to **PixelMap**, the data obtained by calling **getAVMetadata** is the pixel data of an image.<br>- If the data type is set to **url**, the data obtained is an image path. |
56| album           | string                  | No  | Yes  | Album name.<br>**Atomic service API**: This API can be used in atomic services since API version 12.           |
57| writer          | string                  | No  | Yes  | Writer.<br>**Atomic service API**: This API can be used in atomic services since API version 12.            |
58| composer        | string                  | No  | Yes  | composer.            |
59| duration        | number                  | No  | Yes  | Media duration, in ms.<br>**Atomic service API**: This API can be used in atomic services since API version 12.                                                 |
60| mediaImage      | [image.PixelMap](../apis-image-kit/arkts-apis-image-PixelMap.md) &#124; string | No  | Yes  | Pixel map or image path (local path or network path) of the image. Applications call **setAVMetadata** to set the image data.<br>- If the data type is set to **PixelMap**, the data obtained by calling **getAVMetadata** is the pixel data of an image.<br>- If the data type is set to **url**, the data obtained is an image path.<br>**Atomic service API**: This API can be used in atomic services since API version 12.                            |
61| bundleIcon<sup>18+</sup>      | [image.PixelMap](../apis-image-kit/arkts-apis-image-PixelMap.md) | Yes  | Yes  | Pixel data of the image that is used as the application icon. It is read-only and cannot be set on the application side.|
62| publishDate     | Date                    | No  | Yes  | Release date.         |
63| subtitle        | string                  | No  | Yes  | Subtitle.<br>**Atomic service API**: This API can be used in atomic services since API version 12.            |
64| description     | string                  | No  | Yes  | Media description.<br>**Atomic service API**: This API can be used in atomic services since API version 12.           |
65| lyric           | string                  | No  | Yes  | Lyrics. The application needs to combine the lyrics into a string.<br>The string length must be less than 40960 bytes.<br>**NOTE**: The system supports lyrics in the simple LRC format. If the lyrics are not standard (for example, having duplicate timestamps), the lyrics fail to be parsed and cannot be displayed properly in the system.|
66| singleLyricText<sup>17+</sup> | string    | No  | Yes  | Lyrics of a single media asset. The application must combine the lyrics into a string (excluding the timestamp).<br>The string length must be less than 40960 bytes.<br>**Atomic service API**: This API can be used in atomic services since API version 17.|
67| previousAssetId | string                  | No  | Yes  | ID of the previous media asset.<br>**Atomic service API**: This API can be used in atomic services since API version 12.        |
68| nextAssetId     | string                  | No  | Yes  | ID of the next media asset.<br>**Atomic service API**: This API can be used in atomic services since API version 12.        |
69| filter<sup>11+</sup>        | number         | No  | Yes  | Protocol supported by the media session. The default value is **TYPE_CAST_PLUS_STREAM**. For details, see [ProtocolType](arkts-apis-avsession-e.md#protocoltype11).<br>**Atomic service API**: This API can be used in atomic services since API version 12.                  |
70| drmSchemes<sup>12+</sup>        | Array\<string>         | No  | Yes  | DRM scheme supported by the media session. The value is the UUID of the DRM scheme.|
71| skipIntervals<sup>11+</sup>  | [SkipIntervals](arkts-apis-avsession-e.md#skipintervals11)        | No  | Yes  | Intervals supported for fast-forwarding and rewinding. The default value is **SECONDS_15**, that is, 15 seconds.                           |
72|displayTags<sup>11+</sup>     | number                           | No  | Yes  | Display tags of the media asset. For details, see [DisplayTag](arkts-apis-avsession-e.md#displaytag11).      |
73
74## AVMediaDescription<sup>10+</sup>
75
76Describes the properties related to the media metadata in the playlist.
77
78| Name        | Type                   | Read-Only | Optional | Description                    |
79| ------------ | ----------------------- | ---- | ---- | ----------------------- |
80| assetId      | string                  | No  | No  | Media ID in the playlist.<br>**System capability**: SystemCapability.Multimedia.AVSession.Core<br>**Atomic service API**: This API can be used in atomic services since API version 12.|
81| title        | string                  | No  | Yes  | Name of the media asset in the playlist.<br>**System capability**: SystemCapability.Multimedia.AVSession.Core<br>**Atomic service API**: This API can be used in atomic services since API version 12.|
82| subtitle     | string                  | No  | Yes  | Subname of the media asset in the playlist.<br>**System capability**: SystemCapability.Multimedia.AVSession.Core<br>**Atomic service API**: This API can be used in atomic services since API version 12.|
83| description  | string                  | No  | Yes  | Description of the media asset in the playlist.<br>**System capability**: SystemCapability.Multimedia.AVSession.Core<br>**Atomic service API**: This API can be used in atomic services since API version 12.|
84| mediaImage | image.PixelMap \| string   | No  | Yes  | Pixel map of the image of the media asset in the playlist.<br>**System capability**: SystemCapability.Multimedia.AVSession.Core<br>**Atomic service API**: This API can be used in atomic services since API version 12.|
85| extras       | {[key: string]: Object}    | No  | Yes  | Additional fields of the media asset in the playlist.<br>**System capability**: SystemCapability.Multimedia.AVSession.Core|
86| mediaUri     | string                  | No  | Yes  | URI of the media asset in the playlist.<br>**System capability**: SystemCapability.Multimedia.AVSession.Core<br>**Atomic service API**: This API can be used in atomic services since API version 12.|
87| mediaType     | string                  | No  | Yes  | Type of the media asset in the playlist.<br>**System capability**: SystemCapability.Multimedia.AVSession.Core<br>**Atomic service API**: This API can be used in atomic services since API version 12.|
88| mediaSize     | number                  | No  | Yes  | Size of the media asset in the playlist.<br>**System capability**: SystemCapability.Multimedia.AVSession.Core<br>**Atomic service API**: This API can be used in atomic services since API version 12.|
89| albumTitle     | string                  | No  | Yes  | Album name of the media asset in the playlist.<br>**System capability**: SystemCapability.Multimedia.AVSession.Core<br>**Atomic service API**: This API can be used in atomic services since API version 12.|
90| albumCoverUri     | string                  | No  | Yes  | URI of the album title of the media asset in the playlist.<br>**System capability**: SystemCapability.Multimedia.AVSession.Core<br>**Atomic service API**: This API can be used in atomic services since API version 12.|
91| lyricContent     | string                  | No  | Yes  | Lyric content of the media asset in the playlist.<br>**System capability**: SystemCapability.Multimedia.AVSession.Core<br>**Atomic service API**: This API can be used in atomic services since API version 12.|
92| lyricUri     | string                  | No  | Yes  | Lyric URI of the media asset in the playlist.<br>**System capability**: SystemCapability.Multimedia.AVSession.Core<br>**Atomic service API**: This API can be used in atomic services since API version 12.|
93| artist     | string                  | No  | Yes  | Author of the lyric of the media asset in the playlist.<br>**System capability**: SystemCapability.Multimedia.AVSession.Core<br>**Atomic service API**: This API can be used in atomic services since API version 12.|
94| fdSrc     | media.AVFileDescriptor        | No  | Yes  | Handle to the local media file in the playlist.<br>**System capability**: SystemCapability.Multimedia.AVSession.Core<br>**Atomic service API**: This API can be used in atomic services since API version 12.|
95| dataSrc<sup>12+</sup>     | media.AVDataSrcDescriptor        | No  | Yes  | Descriptor of the data source in the playlist.<br>**System capability**: SystemCapability.Multimedia.AVSession.Core|
96| pcmSrc<sup>20+</sup>     | boolean        | No  | Yes  | Whether the playlist uses a PCM data source. **true** if the PCM data source used, **false** otherwise.<br>**System capability**: SystemCapability.Multimedia.AVSession.Core<br>Due to device limitations, this parameter is temporarily unavailable and will be supported in future versions.|
97| drmScheme<sup>12+</sup>     | string        | No  | Yes  | DRM scheme supported by the playlist. The value is the UUID of the DRM scheme.<br>**System capability**: SystemCapability.Multimedia.AVSession.Core|
98| duration     | number                  | No  | Yes  | Playback duration of the media asset in the playlist.<br>**System capability**: SystemCapability.Multimedia.AVSession.Core<br>**Atomic service API**: This API can be used in atomic services since API version 12.|
99| startPosition     | number                  | No  | Yes  | Start position for playing the media asset in the playlist.<br>**System capability**: SystemCapability.Multimedia.AVSession.Core<br>**Atomic service API**: This API can be used in atomic services since API version 12.|
100| creditsPosition     | number                  | No  | Yes  | Position for playing the closing credits of the media asset in the playlist.<br>**System capability**: SystemCapability.Multimedia.AVSession.Core<br>**Atomic service API**: This API can be used in atomic services since API version 12.|
101| appName     | string                  | No  | Yes  | Name of the application provided by the playlist.<br>**System capability**: SystemCapability.Multimedia.AVSession.Core<br>**Atomic service API**: This API can be used in atomic services since API version 12.|
102|displayTags<sup>11+</sup>     | number | No  | Yes  | Display tags of the media asset. For details, see [DisplayTag](arkts-apis-avsession-e.md#displaytag11).<br>**System capability**: SystemCapability.Multimedia.AVSession.Core<br>**Atomic service API**: This API can be used in atomic services since API version 12.|
103|launchClientData<sup>20+</sup> | string | No| Yes| Custom data sent by the application to the receiver during casting.<br>**System capability**: SystemCapability.Multimedia.AVSession.AVCast<br>**Atomic service API**: This API can be used in atomic services since API version 20.|
104
105## AVQueueItem<sup>10+</sup>
106
107Describes the properties of an item in the playlist.
108
109**Atomic service API**: This API can be used in atomic services since API version 12.
110
111**System capability**: SystemCapability.Multimedia.AVSession.Core
112
113| Name        | Type                                       | Mandatory| Description                       |
114| ------------ | ------------------------------------------ | ---- | --------------------------- |
115| itemId       | number                                     | Yes  | ID of an item in the playlist.         |
116| description  | [AVMediaDescription](#avmediadescription10)  | No  | Media metadata of the item in the playlist.  |
117
118## AVPlaybackState<sup>10+</sup>
119
120Describes the information related to the media playback state.
121
122**System capability**: SystemCapability.Multimedia.AVSession.Core
123
124| Name        | Type                                 | Mandatory| Description    |
125| ------------ | ------------------------------------- | ---- | ------- |
126| state        | [PlaybackState](arkts-apis-avsession-e.md#playbackstate10)       | No  | Playback state.<br>**Atomic service API**: This API can be used in atomic services since API version 12.|
127| speed        | number                                | No  | Playback speed.<br>**Atomic service API**: This API can be used in atomic services since API version 12.|
128| position     | [PlaybackPosition](#playbackposition10) | No  | Playback position.<br>**Atomic service API**: This API can be used in atomic services since API version 12.|
129| bufferedTime | number                                | No  | Buffered time.<br>**Atomic service API**: This API can be used in atomic services since API version 12.|
130| loopMode     | [LoopMode](arkts-apis-avsession-e.md#loopmode10)                 | No  | Loop mode.<br>**Atomic service API**: This API can be used in atomic services since API version 12.|
131| isFavorite   | boolean                               | No  | Whether the media asset is favorited. The value **true** means that the media asset is favorited.<br>**Atomic service API**: This API can be used in atomic services since API version 12.|
132| activeItemId<sup>10+</sup> | number                  | No  | ID of the item that is being played.<br>**Atomic service API**: This API can be used in atomic services since API version 12.|
133| volume<sup>10+</sup> | number                  | No  | Media volume.<br>**Atomic service API**: This API can be used in atomic services since API version 12.|
134| maxVolume<sup>11+</sup> | number                    | No  | Maximum volume.<br>**Atomic service API**: This API can be used in atomic services since API version 12.|
135| muted<sup>11+</sup>     | boolean                   | No  | Mute status. The value **true** means the muted state.<br>**Atomic service API**: This API can be used in atomic services since API version 12.|
136| duration<sup>11+</sup>     | number                   | No  | Duration of the media asset.|
137| videoWidth<sup>11+</sup>  | number                  | No  | Video width of the media asset, in px.<br>**Atomic service API**: This API can be used in atomic services since API version 12.|
138| videoHeight<sup>11+</sup> |  number                 | No  | Video height of the media asset, in px.<br>**Atomic service API**: This API can be used in atomic services since API version 12.|
139| extras<sup>10+</sup> | {[key: string]: Object}       | No  | Custom media data.<br>**Atomic service API**: This API can be used in atomic services since API version 12.|
140
141## PlaybackPosition<sup>10+</sup>
142
143Describes the information related to the playback position.
144
145**Atomic service API**: This API can be used in atomic services since API version 12.
146
147**System capability**: SystemCapability.Multimedia.AVSession.Core
148
149| Name       | Type  | Mandatory| Description              |
150| ----------- | ------ | ---- | ------------------ |
151| elapsedTime | number | Yes  | Elapsed time, in ms.|
152| updateTime  | number | Yes  | Updated time, in ms.|
153
154## CallMetadata<sup>11+</sup>
155
156Describes the properties related to call metadata.
157
158**Atomic service API**: This API can be used in atomic services since API version 12.
159
160**System capability**: SystemCapability.Multimedia.AVSession.Core
161
162| Name           | Type                     | Mandatory| Description              |
163| --------------- |-------------------------| ---- |---------------------------------------------------------------------|
164| name            | string                  | No   | Name (alias) of the caller.   |
165| phoneNumber     | string                  | No   | Phone number of the caller.           |
166| avatar          | [image.PixelMap](../apis-image-kit/arkts-apis-image-PixelMap.md)          | No   | Profile picture of the caller.           |
167
168## AVCallState<sup>11+</sup>
169
170Describes the properties related to the call state.
171
172**Atomic service API**: This API can be used in atomic services since API version 12.
173
174**System capability**: SystemCapability.Multimedia.AVSession.Core
175
176| Name           | Type                     | Mandatory| Description              |
177| --------------- |-------------------------  | ---- |---------------------------------------------------------------------|
178| state           | [CallState](arkts-apis-avsession-e.md#callstate11)                 | Yes   | Call state.     |
179| muted           | boolean                   | Yes   | Whether the microphone is muted.<br>**true**: The microphone is muted.<br>**false**: The microphone is not muted.|
180
181## DeviceInfo<sup>10+</sup>
182
183Describes the information related to the output device.
184
185| Name      | Type          | Mandatory| Description                  |
186| ---------- | -------------- | ---- | ---------------------- |
187| castCategory   | AVCastCategory        | Yes  | Cast category.<br> **System capability**: SystemCapability.Multimedia.AVSession.Core<br>**Atomic service API**: This API can be used in atomic services since API version 12.|
188| deviceId   | string | Yes  | ID of the output device.<br> **System capability**: SystemCapability.Multimedia.AVSession.Core<br>**Atomic service API**: This API can be used in atomic services since API version 12.|
189| deviceName | string | Yes  | Name of the output device.<br>**System capability**: SystemCapability.Multimedia.AVSession.Core<br>**Atomic service API**: This API can be used in atomic services since API version 12.|
190| deviceType | DeviceType | Yes  | Type of the output device.<br>**System capability**: SystemCapability.Multimedia.AVSession.Core<br>**Atomic service API**: This API can be used in atomic services since API version 12.|
191| supportedProtocols<sup>11+</sup> | number | No  | Protocol supported by the output device. The default value is **TYPE_LOCAL**. For details, see [ProtocolType](arkts-apis-avsession-e.md#protocoltype11).<br> **System capability**: SystemCapability.Multimedia.AVSession.AVCast<br>**Atomic service API**: This API can be used in atomic services since API version 12.|
192| supportedDrmCapabilities<sup>12+</sup> | Array\<string> | No  | DRM capability supported by the output device.<br> **System capability**: SystemCapability.Multimedia.AVSession.AVCast<br>**Atomic service API**: This API can be used in atomic services since API version 12.|
193| manufacturer<sup>13+</sup> | string | No  | Manufacturer of the output device.<br> **System capability**: SystemCapability.Multimedia.AVSession.AVCast<br>**Atomic service API**: This API can be used in atomic services since API version 13.|
194| modelName<sup>13+</sup> | string | No  | Model name of the output device.<br> **System capability**: SystemCapability.Multimedia.AVSession.AVCast<br>**Atomic service API**: This API can be used in atomic services since API version 13.|
195| audioCapabilities<sup>20+</sup> | [AudioCapabilities](#audiocapabilities20) | No  | Audio capabilities supported by the output device.<br> **System capability**: SystemCapability.Multimedia.AVSession.AVCast|
196| supportedPullClients<sup>20+</sup> | Array\<number> | No| IDs of supported pull clients. (This field is returned only for devices that support 4K casting.)<br>**System capability**: SystemCapability.Multimedia.AVSession.AVCast<br>**Atomic service API**: This API can be used in atomic services since API version 20.|
197
198## OutputDeviceInfo<sup>10+</sup>
199
200Describes the information related to the output device.
201
202**Atomic service API**: This API can be used in atomic services since API version 12.
203
204**System capability**: SystemCapability.Multimedia.AVSession.Core
205
206| Name      | Type          | Mandatory| Description                  |
207| ---------- | -------------- | ---- | ---------------------- |
208| devices | Array\<DeviceInfo\> | Yes  | Output devices.   |
209
210## AVControlCommand<sup>10+</sup>
211
212Describes the command that can be sent to the session.
213
214**Atomic service API**: This API can be used in atomic services since API version 12.
215
216**System capability**: SystemCapability.Multimedia.AVSession.Core
217
218| Name     | Type                                             | Mandatory| Description          |
219| --------- | ------------------------------------------------- | ---- | -------------- |
220| command   | [AVControlCommandType](arkts-apis-avsession-t.md#avcontrolcommandtype10)     | Yes  | Command. The parameters carried in each command are different. For details, see [AVControlCommandType](arkts-apis-avsession-t.md#avcontrolcommandtype10).      |
221| parameter | [LoopMode](arkts-apis-avsession-e.md#loopmode10) &#124; string &#124; number | No  | Parameters carried in the command.|
222
223## AVCastPickerOptions<sup>14+</sup>
224
225Describes the properties related to the semi-modal window that is started for casting purposes.
226
227**Atomic service API**: This API can be used in atomic services since API version 14.
228
229**System capability**: SystemCapability.Multimedia.AVSession.AVCast
230
231| Name           | Type                     | Mandatory| Description              |
232| --------------- |-------------------------| ---- |---------------------------------------------------------------------|
233| sessionType         | [AVSessionType](arkts-apis-avsession-t.md#avsessiontype10)  | No  | Session type. The default value is **'audio'**.<br>Currently, only the **'audio'** and **'video'** session types are supported. If **'voice_call'** and **'video_call'** are passed, they are treated as the default value **'audio'**.           |
234
235## AudioCapabilities<sup>20+</sup>
236
237Describes the audio capabilities supported by the casting device.
238
239**Atomic service API**: This API can be used in atomic services since API version 20.
240
241**System capability**: SystemCapability.Multimedia.AVSession.AVCast
242
243| Name           | Type                     | Read-Only| Optional| Description              |
244| --------------- |-------------------------| ---- | ---- |---------------------------------------------------------------------|
245| streamInfos            | Array\<[audio.AudioStreamInfo](../apis-audio-kit/arkts-apis-audio-i.md#audiostreaminfo8)>                  | Yes   | No   | Audio capability parameters. |
246