• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1/*
2* Copyright (c) 2022-2024 Huawei Device Co., Ltd.
3* Licensed under the Apache License, Version 2.0 (the "License");
4* you may not use this file except in compliance with the License.
5* You may obtain a copy of the License at
6*
7* http://www.apache.org/licenses/LICENSE-2.0
8*
9* Unless required by applicable law or agreed to in writing, software
10* distributed under the License is distributed on an "AS IS" BASIS,
11* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12* See the License for the specific language governing permissions and
13* limitations under the License.
14*/
15
16/**
17 * @file
18 * @kit AVSessionKit
19 */
20
21import type { ErrorCallback, AsyncCallback, Callback } from './@ohos.base';
22import { WantAgent } from './@ohos.wantAgent';
23import { KeyEvent } from './@ohos.multimodalInput.keyEvent';
24import { ElementName } from './bundleManager/ElementName';
25import image from './@ohos.multimedia.image';
26import audio from './@ohos.multimedia.audio';
27import { AVCastPickerState, AVCastPickerColorMode } from './@ohos.multimedia.avCastPickerParam';
28import type media from './@ohos.multimedia.media';
29import type Context from './application/BaseContext';
30
31/**
32 * @namespace avSession
33 * @syscap SystemCapability.Multimedia.AVSession.Core
34 * @since 9
35 */
36/**
37 * @namespace avSession
38 * @syscap SystemCapability.Multimedia.AVSession.Core
39 * @atomicservice
40 * @since 12
41 */
42
43declare namespace avSession {
44  /**
45   * Create an AVSession instance. An ability can only create one AVSession
46   * @param { Context } context - The context of application
47   * @param { string } tag - A user-defined name for this session
48   * @param { AVSessionType } type - The type of session {@link AVSessionType}
49   * @param { AsyncCallback<AVSession> } callback - async callback for AVSession.
50   * @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
51   * 2.Parameter verification failed.
52   * @throws { BusinessError } 6600101 - Session service exception.
53   * @syscap SystemCapability.Multimedia.AVSession.Core
54   * @since 10
55   */
56  function createAVSession(context: Context, tag: string, type: AVSessionType, callback: AsyncCallback<AVSession>): void;
57
58  /**
59   * Create an AVSession instance. An ability can only create one AVSession
60   * @param { Context } context - The context of application
61   * @param { string } tag - A user-defined name for this session
62   * @param { AVSessionType } type - The type of session {@link AVSessionType}
63   * @returns { Promise<AVSession> } Promise for AVSession
64   * @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
65   * 2.Parameter verification failed.
66   * @throws { BusinessError } 6600101 - Session service exception.
67   * @syscap SystemCapability.Multimedia.AVSession.Core
68   * @since 10
69   */
70  /**
71   * Create an AVSession instance. An ability can only create one AVSession
72   * @param { Context } context - The context of application
73   * @param { string } tag - A user-defined name for this session
74   * @param { AVSessionType } type - The type of session {@link AVSessionType}
75   * @returns { Promise<AVSession> } Promise for AVSession
76   * @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
77   * 2.Parameter verification failed.
78   * @throws { BusinessError } 6600101 - Session service exception.
79   * @syscap SystemCapability.Multimedia.AVSession.Core
80   * @atomicservice
81   * @since 12
82   */
83  function createAVSession(context: Context, tag: string, type: AVSessionType): Promise<AVSession>;
84
85  /**
86   * Get all avsession descriptors of the system
87   * @permission ohos.permission.MANAGE_MEDIA_RESOURCES
88   * @param { AsyncCallback<Array<Readonly<AVSessionDescriptor>>> } callback - async callback for an array of AVSessionDescriptors.
89   * @throws { BusinessError } 201 - permission denied
90   * @throws { BusinessError } 202 - Not System App.
91   * @throws { BusinessError } 6600101 - Session service exception.
92   * @syscap SystemCapability.Multimedia.AVSession.Manager
93   * @systemapi
94   * @since 9
95   */
96  function getAllSessionDescriptors(callback: AsyncCallback<Array<Readonly<AVSessionDescriptor>>>): void;
97
98  /**
99   * Get all avsession descriptors of the system
100   * @permission ohos.permission.MANAGE_MEDIA_RESOURCES
101   * @returns { Promise<Array<Readonly<AVSessionDescriptor>>> } Promise for an array of AVSessionDescriptors
102   * @throws { BusinessError } 201 - permission denied
103   * @throws { BusinessError } 202 - Not System App.
104   * @throws { BusinessError } 6600101 - Session service exception.
105   * @syscap SystemCapability.Multimedia.AVSession.Manager
106   * @systemapi
107   * @since 9
108   */
109  function getAllSessionDescriptors(): Promise<Array<Readonly<AVSessionDescriptor>>>;
110
111  /**
112   * Get history avsession records. These sessions have been destroyed.
113   * @permission ohos.permission.MANAGE_MEDIA_RESOURCES
114   * @param { number } maxSize - Specifies the maximum size of the returned value array.
115   * @param { AsyncCallback<Array<Readonly<AVSessionDescriptor>>> } callback - async callback for an array of AVSessionDescriptors.
116   * If provided '0' or not provided, the maximum value is determined by the system.
117   * @throws { BusinessError } 201 - permission denied
118   * @throws { BusinessError } 202 - Not System App
119   * @throws { BusinessError } 401 - parameter check failed. Possible causes: 1.Mandatory parameters are left unspecified.
120   * 2.Incorrect parameter types.
121   * @throws { BusinessError } 6600101 - Session service exception.
122   * @syscap SystemCapability.Multimedia.AVSession.Manager
123   * @systemapi Hide this for inner system use
124   * @since 10
125   */
126  function getHistoricalSessionDescriptors(maxSize: number, callback: AsyncCallback<Array<Readonly<AVSessionDescriptor>>>): void;
127
128  /**
129   * Get history avsession records. These sessions have been destroyed.
130   * @permission ohos.permission.MANAGE_MEDIA_RESOURCES
131   * @param { number } maxSize - Specifies the maximum size of the returned value array.
132   * If provided '0' or not provided, the maximum value is determined by the system.
133   * @returns { Promise<Array<Readonly<AVSessionDescriptor>>> } Promise for an array of AVSessionDescriptors
134   * @throws { BusinessError } 201 - permission denied
135   * @throws { BusinessError } 202 - Not System App
136   * @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
137   * 2.Incorrect parameter types.
138   * @throws { BusinessError } 6600101 - Session service exception.
139   * @syscap SystemCapability.Multimedia.AVSession.Manager
140   * @systemapi Hide this for inner system use
141   * @since 10
142   */
143  function getHistoricalSessionDescriptors(maxSize?: number): Promise<Array<Readonly<AVSessionDescriptor>>>;
144
145  /**
146   * Get history play list information records.
147   * @permission ohos.permission.MANAGE_MEDIA_RESOURCES
148   * @param { number } maxSize - Specifies the maximum size of the returned value array.
149   * @param { number } maxAppSize - Specifies the maximum app size of the returned value array.
150   * @param { AsyncCallback<Array<Readonly<AVQueueInfo>>> } callback - async callback for an array of AVQueueInfo.
151   * If provided '0' or not provided, the maximum value is determined by the system.
152   * @throws { BusinessError } 201 - permission denied
153   * @throws { BusinessError } 202 - Not System App.
154   * @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
155   * 2.Incorrect parameter types.
156   * @throws { BusinessError } 6600101 - Session service exception.
157   * @syscap SystemCapability.Multimedia.AVSession.Manager
158   * @systemapi Hide this for inner system use
159   * @since 11
160   */
161  function getHistoricalAVQueueInfos(maxSize: number, maxAppSize: number, callback: AsyncCallback<Array<Readonly<AVQueueInfo>>>): void;
162
163  /**
164   * Get history play list information records.
165   * @permission ohos.permission.MANAGE_MEDIA_RESOURCES
166   * @param { number } maxSize - Specifies the maximum size of the returned value array.
167   * @param { number } maxAppSize - Specifies the maximum app size of the returned value array.
168   * @returns { Promise<Array<Readonly<AVQueueInfo>>> } Promise for an array of AVQueueInfo
169   * @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
170   * 2.Incorrect parameter types.
171   * @throws { BusinessError } 6600101 - Session service exception.
172   * @syscap SystemCapability.Multimedia.AVSession.Manager
173   * @systemapi Hide this for inner system use
174   * @since 11
175   */
176  function getHistoricalAVQueueInfos(maxSize: number, maxAppSize: number): Promise<Array<Readonly<AVQueueInfo>>>;
177
178  /**
179   * Create an avsession controller
180   * @permission ohos.permission.MANAGE_MEDIA_RESOURCES
181   * @param { string } sessionId - Specifies the sessionId to create the controller.
182   * @param { AsyncCallback<AVSessionController> } callback - async callback for AVSessionController.
183   * If provided 'default', the system will create a default controller, Used to control the system default session
184   * @throws { BusinessError } 201 - permission denied
185   * @throws { BusinessError } 202 - Not System App.
186   * @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
187   * 2.Parameter verification failed.
188   * @throws { BusinessError } 6600101 - Session service exception.
189   * @throws { BusinessError } 6600102 - The session does not exist.
190   * @syscap SystemCapability.Multimedia.AVSession.Manager
191   * @systemapi
192   * @since 9
193   */
194  function createController(sessionId: string, callback: AsyncCallback<AVSessionController>): void;
195
196  /**
197   * Create an avsession controller
198   * @permission ohos.permission.MANAGE_MEDIA_RESOURCES
199   * @param { string } sessionId - Specifies the sessionId to create the controller.
200   * If provided 'default', the system will create a default controller, Used to control the system default session
201   * @returns { Promise<AVSessionController> } Promise for AVSessionController
202   * @throws { BusinessError } 201 - permission denied
203   * @throws { BusinessError } 202 - Not System App.
204   * @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
205   * 2.Parameter verification failed.
206   * @throws { BusinessError } 6600101 - Session service exception.
207   * @throws { BusinessError } 6600102 - The session does not exist.
208   * @syscap SystemCapability.Multimedia.AVSession.Manager
209   * @systemapi
210   * @since 9
211   */
212  function createController(sessionId: string): Promise<AVSessionController>;
213
214  /**
215   * Cast Audio to the remote devices or cast back local device
216   * @permission ohos.permission.MANAGE_MEDIA_RESOURCES
217   * @param { SessionToken | 'all' } session - Specifies the sessionId which to send to remote.
218   * @param { Array<audio.AudioDeviceDescriptor> } audioDevices - Specifies the audio devices to cast.
219   * @param { AsyncCallback<void> } callback - The asyncCallback triggered when the command is executed successfully
220   * 'all' means cast all the media audio of this device to remote.
221   * @throws { BusinessError } 201 - permission denied
222   * @throws { BusinessError } 202 - Not System App.
223   * @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
224   * 2.Parameter verification failed.
225   * @throws { BusinessError } 6600101 - Session service exception.
226   * @throws { BusinessError } 6600102 - The session does not exist.
227   * @throws { BusinessError } 6600104 - The remote session connection failed.
228   * @syscap SystemCapability.Multimedia.AVSession.Manager
229   * @systemapi
230   * @since 9
231   */
232  function castAudio(session: SessionToken | 'all', audioDevices: Array<audio.AudioDeviceDescriptor>, callback: AsyncCallback<void>): void;
233
234  /**
235   * Cast Audio to the remote devices or cast back local device
236   * @permission ohos.permission.MANAGE_MEDIA_RESOURCES
237   * @param { SessionToken | 'all' } session - Specifies the sessionId which to send to remote.
238   * @param { Array<audio.AudioDeviceDescriptor> } audioDevices - Specifies the audio devices to cast.
239   * @returns { Promise<void> } void promise when executed successfully
240   * 'all' means cast all the media audio of this device to remote.
241   * @throws { BusinessError } 201 - permission denied
242   * @throws { BusinessError } 202 - Not System App.
243   * @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
244   * 2.Parameter verification failed.
245   * @throws { BusinessError } 6600101 - Session service exception.
246   * @throws { BusinessError } 6600102 - The session does not exist.
247   * @throws { BusinessError } 6600104 - The remote session  connection failed.
248   * @syscap SystemCapability.Multimedia.AVSession.Manager
249   * @systemapi
250   * @since 9
251   */
252  function castAudio(session: SessionToken | 'all', audioDevices: Array<audio.AudioDeviceDescriptor>): Promise<void>;
253
254  /**
255   * Start an application for media playback.
256   * @permission ohos.permission.MANAGE_MEDIA_RESOURCES
257   * @param { string } bundleName - Specifies the bundleName which to be started.
258   * @param { string } assetId - Specifies the assetId to be started.
259   * @returns { Promise<void> } void promise when executed successfully
260   * @throws { BusinessError } 201 - permission denied
261   * @throws { BusinessError } 202 - Not System App. Interface caller is not a system app.
262   * @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
263   * 2.Incorrect parameter types. 3.Parameter verification failed.
264   * @throws { BusinessError } 6600101 - Session service exception.
265   * @syscap SystemCapability.Multimedia.AVSession.Manager
266   * @systemapi
267   * @since 11
268   */
269  function startAVPlayback(bundleName: string, assetId: string): Promise<void>;
270
271  /**
272   * Session token. Used to judge the legitimacy of the session.
273   * @typedef SessionToken
274   * @syscap SystemCapability.Multimedia.AVSession.Manager
275   * @systemapi
276   * @since 9
277   */
278  interface SessionToken {
279    /**
280     * The unique session id of the avsession object
281     * @permission ohos.permission.MANAGE_MEDIA_RESOURCES
282     * @type { string }
283     * @syscap SystemCapability.Multimedia.AVSession.Manager
284     * @systemapi
285     * @since 9
286     */
287    sessionId: string;
288
289    /**
290     * Process id of session
291     * @permission ohos.permission.MANAGE_MEDIA_RESOURCES
292     * @type { ?number }
293     * @syscap SystemCapability.Multimedia.AVSession.Manager
294     * @systemapi
295     * @since 9
296     */
297    pid?: number;
298
299    /**
300     * User id
301     * @permission ohos.permission.MANAGE_MEDIA_RESOURCES
302     * @type { ?number }
303     * @syscap SystemCapability.Multimedia.AVSession.Manager
304     * @systemapi
305     * @since 9
306     */
307    uid?: number;
308  }
309
310  /**
311   * Register session create callback
312   * @param { 'sessionCreate' } type - Registration Type, 'sessionCreate'
313   * @param { function } callback - Used to handle ('sessionCreate' command)
314   * @throws { BusinessError } 202 - Not System App.
315   * @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
316   * 2.Incorrect parameter types.
317   * @throws { BusinessError } 6600101 - Session service exception.
318   * @syscap SystemCapability.Multimedia.AVSession.Manager
319   * @systemapi
320   * @since 9
321   */
322  function on(type: 'sessionCreate', callback: (session: AVSessionDescriptor) => void): void;
323
324  /**
325   * Register session destroy callback
326   * @param { 'sessionDestroy' } type - Registration Type, 'sessionDestroy'
327   * @param { function } callback - Used to handle ('sessionDestroy' command)
328   * @throws { BusinessError } 202 - Not System App.
329   * @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
330   * 2.Incorrect parameter types.
331   * @throws { BusinessError } 6600101 - Session service exception.
332   * @syscap SystemCapability.Multimedia.AVSession.Manager
333   * @systemapi
334   * @since 9
335   */
336  function on(type: 'sessionDestroy', callback: (session: AVSessionDescriptor) => void): void;
337
338  /**
339   * Register top session changed callback
340   * @param { 'topSessionChange' } type - Registration Type, top priority session change, 'topSessionChange'
341   * @param { function } callback - Used to handle ('topSessionChange' command)
342   * @throws { BusinessError } 202 - Not System App.
343   * @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
344   * 2.Incorrect parameter types.
345   * @throws { BusinessError } 6600101 - Session service exception.
346   * @syscap SystemCapability.Multimedia.AVSession.Manager
347   * @systemapi
348   * @since 9
349   */
350  function on(type: 'topSessionChange', callback: (session: AVSessionDescriptor) => void): void;
351
352  /**
353   * Unregister session create callback
354   * @param { 'sessionCreate' } type - Registration Type, session creation, 'sessionCreate'
355   * @param { function } callback - Used to unregister listener for ('sessionCreate') command
356   * @throws { BusinessError } 202 - Not System App.
357   * @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
358   * 2.Incorrect parameter types.
359   * @throws { BusinessError } 6600101 - Session service exception.
360   * @syscap SystemCapability.Multimedia.AVSession.Manager
361   * @systemapi
362   * @since 9
363   */
364  function off(type: 'sessionCreate', callback?: (session: AVSessionDescriptor) => void): void;
365
366  /**
367   * Unregister session destroy callback
368   * @param { 'sessionDestroy' } type - Registration Type, session deletion, 'sessionDestroy'
369   * @param { function } callback - Used to unregister listener for ('sessionDestroy') command
370   * @throws { BusinessError } 202 - Not System App.
371   * @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
372   * 2.Incorrect parameter types.
373   * @throws { BusinessError } 6600101 - Session service exception.
374   * @syscap SystemCapability.Multimedia.AVSession.Manager
375   * @systemapi
376   * @since 9
377   */
378  function off(type: 'sessionDestroy', callback?: (session: AVSessionDescriptor) => void): void;
379
380  /**
381   * Unregister top session changed callback
382   * @param { 'topSessionChange' } type - Registration Type, top priority session change, 'topSessionChange'
383   * @param { function } callback - Used to unregister listener for ('topSessionChange') command
384   * @throws { BusinessError } 202 - Not System App.
385   * @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
386   * 2.Incorrect parameter types.
387   * @throws { BusinessError } 6600101 - Session service exception.
388   * @syscap SystemCapability.Multimedia.AVSession.Manager
389   * @systemapi
390   * @since 9
391   */
392  function off(type: 'topSessionChange', callback?: (session: AVSessionDescriptor) => void): void;
393
394  /**
395   * Register Session service death callback, notifying the application to clean up resources.
396   * @param { 'sessionServiceDie' } type - Registration Type, 'sessionServiceDie'
397   * @param { function } callback - Used to handle ('sessionServiceDie') command.
398   * @throws { BusinessError } 202 - Not System App.
399   * @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
400   * 2.Incorrect parameter types.
401   * @throws { BusinessError } 6600101 - Session service exception.
402   * @syscap SystemCapability.Multimedia.AVSession.Core
403   * @systemapi
404   * @since 9
405   */
406  function on(type: 'sessionServiceDie', callback: () => void): void;
407
408  /**
409   * Unregister Session service death callback, notifying the application to clean up resources.
410   * @param { 'sessionServiceDie' } type - Registration Type, 'sessionServiceDie'
411   * @param { function } callback -  Used to unregister listener for ('sessionServiceDie') command.
412   * @throws { BusinessError } 202 - Not System App.
413   * @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
414   * 2.Incorrect parameter types.
415   * @throws { BusinessError } 6600101 - Session service exception.
416   * @syscap SystemCapability.Multimedia.AVSession.Core
417   * @systemapi
418   * @since 9
419   */
420  function off(type: 'sessionServiceDie', callback?: () => void): void;
421
422  /**
423   * Send system media key event.The system automatically selects the recipient.
424   * @permission ohos.permission.MANAGE_MEDIA_RESOURCES
425   * @param { KeyEvent } event - The key event to be sent
426   * @param { AsyncCallback<void> } callback - The asyncCallback triggered when the command is executed successfully
427   * @throws { BusinessError } 201 - permission denied
428   * @throws { BusinessError } 202 - Not System App.
429   * @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
430   * 2.Parameter verification failed.
431   * @throws { BusinessError } 6600101 - Session service exception.
432   * @throws { BusinessError } 6600105 - Invalid session command.
433   * @syscap SystemCapability.Multimedia.AVSession.Manager
434   * @systemapi
435   * @since 9
436   */
437  function sendSystemAVKeyEvent(event: KeyEvent, callback: AsyncCallback<void>): void;
438
439  /**
440   * Send system media key event.The system automatically selects the recipient.
441   * @permission ohos.permission.MANAGE_MEDIA_RESOURCES
442   * @param { KeyEvent } event - The key event to be sent
443   * @returns { Promise<void> } void promise when executed successfully
444   * @throws { BusinessError } 201 - permission denied
445   * @throws { BusinessError } 202 - Not System App.
446   * @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
447   * 2.Parameter verification failed.
448   * @throws { BusinessError } 6600101 - Session service exception.
449   * @throws { BusinessError } 6600105 - Invalid session command.
450   * @syscap SystemCapability.Multimedia.AVSession.Manager
451   * @systemapi
452   * @since 9
453   */
454  function sendSystemAVKeyEvent(event: KeyEvent): Promise<void>;
455
456  /**
457   * Send system control command.The system automatically selects the recipient.
458   * @permission ohos.permission.MANAGE_MEDIA_RESOURCES
459   * @param { AVControlCommand } command - The command to be sent. See {@link AVControlCommand}
460   * @param { AsyncCallback<void> } callback - The asyncCallback triggered when the command is executed successfully
461   * @throws { BusinessError } 201 - permission denied
462   * @throws { BusinessError } 202 - Not System App.
463   * @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
464   * 2.Parameter verification failed.
465   * @throws { BusinessError } 6600101 - Session service exception.
466   * @throws { BusinessError } 6600105 - Invalid session command.
467   * @throws { BusinessError } 6600107 - Too many commands or events.
468   * @syscap SystemCapability.Multimedia.AVSession.Manager
469   * @systemapi
470   * @since 9
471   */
472  function sendSystemControlCommand(command: AVControlCommand, callback: AsyncCallback<void>): void;
473
474  /**
475   * Send system control command.The system automatically selects the recipient.
476   * @permission ohos.permission.MANAGE_MEDIA_RESOURCES
477   * @param { AVControlCommand } command - The command to be sent. See {@link AVControlCommand}
478   * @returns { Promise<void> } void promise when executed successfully
479   * @throws { BusinessError } 201 - permission denied
480   * @throws { BusinessError } 202 - Not System App.
481   * @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
482   * 2.Parameter verification failed.
483   * @throws { BusinessError } 6600101 - Session service exception.
484   * @throws { BusinessError } 6600105 - Invalid session command.
485   * @throws { BusinessError } 6600107 - Too many commands or events.
486   * @syscap SystemCapability.Multimedia.AVSession.Manager
487   * @systemapi
488   * @since 9
489   */
490  function sendSystemControlCommand(command: AVControlCommand): Promise<void>;
491
492  /**
493   * Define different protocol capability
494   * @enum { number }
495   * @syscap SystemCapability.Multimedia.AVSession.AVCast
496   * @since 11
497   */
498  /**
499   * Define different protocol capability
500   * @enum { number }
501   * @syscap SystemCapability.Multimedia.AVSession.AVCast
502   * @atomicservice
503   * @since 12
504   */
505  enum ProtocolType {
506    /**
507     * The default cast type "local", media can be routed on the same device,
508     * including internal speakers or audio jack on the device itself, A2DP devices.
509     * @syscap SystemCapability.Multimedia.AVSession.AVCast
510     * @since 11
511     */
512    /**
513     * The default cast type "local", media can be routed on the same device,
514     * including internal speakers or audio jack on the device itself, A2DP devices.
515     * @syscap SystemCapability.Multimedia.AVSession.AVCast
516     * @atomicservice
517     * @since 12
518     */
519    TYPE_LOCAL = 0,
520
521    /**
522     * Cast+ mirror capability
523     * @syscap SystemCapability.Multimedia.AVSession.AVCast
524     * @systemapi
525     * @since 10
526     */
527    TYPE_CAST_PLUS_MIRROR = 1,
528
529    /**
530     * The Cast+ Stream indicating the media is presenting on a different device
531     * the application need get an AVCastController to control remote playback.
532     * @syscap SystemCapability.Multimedia.AVSession.AVCast
533     * @since 11
534     */
535    /**
536     * The Cast+ Stream indicating the media is presenting on a different device
537     * the application need get an AVCastController to control remote playback.
538     * @syscap SystemCapability.Multimedia.AVSession.AVCast
539     * @atomicservice
540     * @since 12
541     */
542    TYPE_CAST_PLUS_STREAM = 2,
543
544    /**
545     * The DLNA type indicates the device supports DLNA protocol,
546     * the application needs to get an AVCastController to control remote playback.
547     * @syscap SystemCapability.Multimedia.AVSession.AVCast
548     * @atomicservice
549     * @since 12
550     */
551    TYPE_DLNA = 4,
552  }
553
554  /**
555   * Start device discovery.
556   * @param { AsyncCallback<void> } callback a callback function
557   * @throws { BusinessError } 202 - Not System App.
558   * @syscap SystemCapability.Multimedia.AVSession.AVCast
559   * @systemapi
560   * @since 10
561   */
562  function startCastDeviceDiscovery(callback: AsyncCallback<void>): void;
563
564  /**
565   * Start device discovery.
566   * @param { number } filter device filter when discovering, can be an union of {@link ProtocolType}
567   * @param { AsyncCallback<void> } callback a callback function
568   * @throws { BusinessError } 202 - Not System App.
569   * @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
570   * 2.Parameter verification failed.
571   * @syscap SystemCapability.Multimedia.AVSession.AVCast
572   * @systemapi
573   * @since 10
574   */
575  function startCastDeviceDiscovery(filter: number, callback: AsyncCallback<void>): void;
576
577  /**
578   * Start device discovery.
579   * @param { number } filter device filter when discovering, can be an union of {@link ProtocolType}
580   * @returns { Promise<void> } Promise for the result
581   * @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
582   * 2.Parameter verification failed.
583   * @syscap SystemCapability.Multimedia.AVSession.AVCast
584   * @systemapi
585   * @since 10
586   */
587  /**
588   * Start device discovery.
589   * @param { number } [filter] - device filter when discovering, can be an union of {@link ProtocolType}
590   * @param { Array<string> } [drmSchemes] - filter drm-enabled devices which are represented by uuid.
591   * It is effective when protocol type is TYPE_CAST_PLUS_STREAM.
592   * @returns { Promise<void> } Promise for the result
593   * @throws { BusinessError } 202 - Not System App.
594   * @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
595   * 2.Incorrect parameter types. 3.Parameter verification failed.
596   * @syscap SystemCapability.Multimedia.AVSession.AVCast
597   * @systemapi
598   * @since 12
599   */
600  function startCastDeviceDiscovery(filter?: number, drmSchemes?: Array<string>): Promise<void>;
601
602  /**
603   * Stop device discovery.
604   * @param { AsyncCallback<void> } callback a callback function
605   * @throws { BusinessError } 202 - Not System App.
606   * @syscap SystemCapability.Multimedia.AVSession.AVCast
607   * @systemapi
608   * @since 10
609   */
610  function stopCastDeviceDiscovery(callback: AsyncCallback<void>): void;
611
612  /**
613   * Stop device discovery.
614   * @returns { Promise<void> } Promise for the result
615   * @throws { BusinessError } 202 - Not System App.
616   * @syscap SystemCapability.Multimedia.AVSession.AVCast
617   * @systemapi
618   * @since 10
619   */
620  function stopCastDeviceDiscovery(): Promise<void>;
621
622  /**
623   * Enable or disable device to be discoverable, used at sink side.
624   * @param { boolean } enable true: can be discoverable, false: cannot be discoverable.
625   * @param { AsyncCallback<void> } callback a callback function
626   * @throws { BusinessError } 202 - Not System App.
627   * @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
628   * 2.Parameter verification failed.
629   * @syscap SystemCapability.Multimedia.AVSession.AVCast
630   * @systemapi
631   * @since 10
632   */
633  function setDiscoverable(enable: boolean, callback: AsyncCallback<void>): void;
634
635  /**
636   * Enable or disable device to be discoverable, used at sink side.
637   * @param { boolean } enable true: can be discoverable, false: cannot be discoverable.
638   * @returns { Promise<void> } Promise for the result
639   * @throws { BusinessError } 202 - Not System App.
640   * @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
641   * 2.Parameter verification failed.
642   * @syscap SystemCapability.Multimedia.AVSession.AVCast
643   * @systemapi
644   * @since 10
645   */
646  function setDiscoverable(enable: boolean): Promise<void>;
647
648  /**
649   * Register device discovery callback
650   * @param { 'deviceAvailable' } type Registration Type
651   * @param { function } callback Used to returns the device info
652   * @throws { BusinessError } 202 - Not System App.
653   * @throws {BusinessError} 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
654   * 2.Incorrect parameter types.
655   * @syscap SystemCapability.Multimedia.AVSession.AVCast
656   * @systemapi
657   * @since 10
658   */
659  function on(type: 'deviceAvailable', callback: (device: OutputDeviceInfo) => void): void;
660
661  /**
662   * Unregister device discovery callback
663   * @param { 'deviceAvailable' } type Registration Type
664   * @param { function } callback Used to returns the device info
665   * @throws { BusinessError } 202 - Not System App.
666   * @throws {BusinessError} 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
667   * 2.Incorrect parameter types.
668   * @syscap SystemCapability.Multimedia.AVSession.AVCast
669   * @systemapi
670   * @since 10
671   */
672  function off(type: 'deviceAvailable', callback?: (device: OutputDeviceInfo) => void): void;
673
674  /**
675   * Register device offline callback
676   * @param { 'deviceOffline' } type - Registration Type
677   * @param { function } callback - Used to returns the device info
678   * @throws { BusinessError } 202 - Not System App.
679   * @throws {BusinessError} 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
680   * 2.Incorrect parameter types.
681   * @syscap SystemCapability.Multimedia.AVSession.AVCast
682   * @systemapi
683   * @since 11
684   */
685  function on(type: 'deviceOffline', callback: (deviceId: string) => void): void;
686
687  /**
688   * Unregister device offline callback
689   * @param { 'deviceOffline' } type - Registration Type
690   * @param { function } callback - Used to returns the device info
691   * @throws { BusinessError } 202 - Not System App.
692   * @throws {BusinessError} 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
693   * 2.Incorrect parameter types.
694   * @syscap SystemCapability.Multimedia.AVSession.AVCast
695   * @systemapi
696   * @since 11
697   */
698  function off(type: 'deviceOffline', callback?: (deviceId: string) => void): void;
699
700  /**
701   * Register a callback to retrieve an avsession cast controller.
702   * This function can be used at both side to get the same controller to do the playback control.
703   * @permission ohos.permission.MANAGE_MEDIA_RESOURCES
704   * @param { string } sessionId Specifies the sessionId to get controller.
705   * @param { AsyncCallback<AVCastController> } callback - async callback for the AVCastController.
706   * @throws {BusinessError} 201 - permission denied
707   * @throws { BusinessError } 202 - Not System App.
708   * @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
709   * 2.Parameter verification failed.
710   * @throws {BusinessError} 6600101 - Session service exception
711   * @throws {BusinessError} 6600102 - session does not exist
712   * @syscap SystemCapability.Multimedia.AVSession.AVCast
713   * @systemapi
714   * @since 10
715   */
716  function getAVCastController(sessionId: string, callback: AsyncCallback<AVCastController>): void;
717
718  /**
719   * Get the current session's remote controller client.
720   * If the avsession is not under casting state, the controller will return null.
721   * @permission ohos.permission.MANAGE_MEDIA_RESOURCES
722   * @param { string } sessionId Specifies the sessionId to get controller.
723   * @returns { Promise<AVCastController> } Promise for the AVCastController
724   * @throws {BusinessError} 201 - permission denied
725   * @throws { BusinessError } 202 - Not System App.
726   * @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
727   * 2.Parameter verification failed.
728   * @throws {BusinessError} 6600101 - server exception
729   * @throws {BusinessError} 6600102 - session does not exist
730   * @syscap SystemCapability.Multimedia.AVSession.AVCast
731   * @systemapi
732   * @since 10
733   */
734  function getAVCastController(sessionId: string): Promise<AVCastController>;
735
736  /**
737   * Cast resource to remote device.
738   * @permission ohos.permission.MANAGE_MEDIA_RESOURCES
739   * @param { SessionToken } session Specifies the sessionId which is to be casted.
740   * @param { OutputDeviceInfo } device Specifies the device to cast.
741   * @param { AsyncCallback<void> } callback A callback instance used to return when start casting.
742   * @throws {BusinessError} 201 - permission denied
743   * @throws { BusinessError } 202 - Not System App.
744   * @throws {BusinessError} 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
745   * 2.Incorrect parameter types. 3.Parameter verification failed.
746   * @throws {BusinessError} 6600101 - Session service exception
747   * @throws {BusinessError} 6600108 - Device connecting failed
748   * @syscap SystemCapability.Multimedia.AVSession.AVCast
749   * @systemapi
750   * @since 10
751   */
752  function startCasting(session: SessionToken, device: OutputDeviceInfo, callback: AsyncCallback<void>): void;
753
754  /**
755   * Cast resource to remote device.
756   * @permission ohos.permission.MANAGE_MEDIA_RESOURCES
757   * @param { SessionToken } session Specifies the sessionId which is to be casted.
758   * @param { OutputDeviceInfo } device Specifies the device to cast.
759   * @returns { Promise<void> } Promise for the result
760   * @throws {BusinessError} 201 - permission denied
761   * @throws { BusinessError } 202 - Not System App.
762   * @throws {BusinessError} 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
763   * 2.Incorrect parameter types. 3.Parameter verification failed.
764   * @throws {BusinessError} 6600101 - Session service exception
765   * @throws {BusinessError} 6600108 - Device connecting failed
766   * @syscap SystemCapability.Multimedia.AVSession.AVCast
767   * @systemapi
768   * @since 10
769   */
770  function startCasting(session: SessionToken, device: OutputDeviceInfo): Promise<void>;
771
772  /**
773   * Stop current cast and disconnect device connection.
774   * @param { SessionToken } session Specifies the sessionId which is to be stopped.
775   * @param { AsyncCallback<void> } callback A callback instance used to return when cast stopped completed.
776   * @throws { BusinessError } 202 - Not System App.
777   * @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
778   * 2.Incorrect parameter types. 3.Parameter verification failed.
779   * @throws { BusinessError } 6600109 - The remote connection is not established
780   * @syscap SystemCapability.Multimedia.AVSession.AVCast
781   * @systemapi
782   * @since 10
783   */
784  function stopCasting(session: SessionToken, callback: AsyncCallback<void>): void;
785
786  /**
787   * Stop current cast and disconnect device connection.
788   * @param { SessionToken } session Specifies the sessionId which is to be stopped.
789   * @returns { Promise<void> } Promise for the result
790   * @throws { BusinessError } 202 - Not System App.
791   * @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
792   * 2.Incorrect parameter types. 3.Parameter verification failed.
793   * @throws { BusinessError } 6600109 - The remote connection is not established
794   * @syscap SystemCapability.Multimedia.AVSession.AVCast
795   * @systemapi
796   * @since 10
797   */
798  function stopCasting(session: SessionToken): Promise<void>;
799
800  /**
801   * Begin to write device logs into a file descriptor for the purpose of problem locating.
802   * If the logs exceed max file size, no logs will be written and DEVICE_LOG_FULL event will be omitted.
803   * @param { string } url - The file descriptor to be written.
804   * @param { number } maxSize - The max size to be written in kilobyte.
805   * if not set, then written process will exit when there is no space to write.
806   * @returns { Promise<void> } Promise for the result
807   * @throws { BusinessError } 202 - Not System App.
808   * @throws { BusinessError } 401 - Parameter check failed. 1. Mandatory parameters are left unspecified.
809   * 2. Incorrect parameter types.
810   * @throws { BusinessError } 6600101 - Session service exception.
811   * @throws { BusinessError } 6600102 - The session does not exist.
812   * @syscap SystemCapability.Multimedia.AVSession.AVCast
813   * @systemapi
814   * @since 13
815   */
816  function startDeviceLogging(url: string, maxSize?: number): Promise<void>;
817
818  /**
819   * Stop the current device written even the discovery is ongoing.
820   * @returns { Promise<void> } Promise for the result
821   * @throws { BusinessError } 202 - Not System App.
822   * @throws { BusinessError } 6600101 - Session service exception.
823   * @throws { BusinessError } 6600102 - The session does not exist.
824   * @syscap SystemCapability.Multimedia.AVSession.AVCast
825   * @systemapi
826   * @since 13
827   */
828  function stopDeviceLogging(): Promise<void>;
829
830  /**
831   * Register log event callback.
832   * @param { 'deviceLogEvent' } type - Command to register 'deviceLogEvent'.
833   * @param { Callback<DeviceLogEventCode> } callback - Used to handle ('deviceLogEvent') command
834   * @throws { BusinessError } 202 - Not System App.
835   * @throws { BusinessError } 401 - Parameter check failed. 1. Mandatory parameters are left unspecified.
836   * 2. Incorrect parameter types.
837   * @throws { BusinessError } 6600101 - Session service exception.
838   * @throws { BusinessError } 6600102 - The session does not exist.
839   * @syscap SystemCapability.Multimedia.AVSession.AVCast
840   * @systemapi
841   * @since 13
842   */
843  function on(type: 'deviceLogEvent', callback: Callback<DeviceLogEventCode>): void;
844
845  /**
846   * UnRegister log event callback.
847   * @param { 'deviceLogEvent' } type - Command to register 'deviceLogEvent'.
848   * @param { Callback<DeviceLogEventCode> } callback - Used to handle ('deviceLogEvent') command
849   * @throws { BusinessError } 202 - Not System App.
850   * @throws { BusinessError } 401 - Parameter check failed. 1. Mandatory parameters are left unspecified.
851   * 2. Incorrect parameter types.
852   * @throws { BusinessError } 6600101 - Session service exception.
853   * @throws { BusinessError } 6600102 - The session does not exist.
854   * @syscap SystemCapability.Multimedia.AVSession.AVCast
855   * @systemapi
856   * @since 13
857   */
858  function off(type: 'deviceLogEvent', callback?: Callback<DeviceLogEventCode>): void;
859
860  /**
861   * Enumerates device log event code.
862   * @enum { number }
863   * @syscap SystemCapability.Multimedia.AVSession.AVCast
864   * @systemapi
865   * @since 13
866   */
867  enum DeviceLogEventCode {
868    /**
869      * Log is full.
870      * @syscap SystemCapability.Multimedia.AVSession.AVCast
871      * @systemapi
872      * @since 13
873      */
874    DEVICE_LOG_FULL = 1,
875
876    /**
877      * Log is written with exception, such as the fd cannot be written and so on.
878      * @syscap SystemCapability.Multimedia.AVSession.AVCast
879      * @systemapi
880      * @since 13
881      */
882    DEVICE_LOG_EXCEPTION = 2,
883  }
884
885  /**
886   * Session type, support audio & video
887   * @typedef { 'audio' | 'video' } AVSessionType
888   * @syscap SystemCapability.Multimedia.AVSession.Core
889   * @since 10
890   */
891  /**
892   * Session type, support audio & video, voice_call
893   * @typedef { 'audio' | 'video' | 'voice_call' } AVSessionType
894   * @syscap SystemCapability.Multimedia.AVSession.Core
895   * @since 11
896   */
897  /**
898   * Session type supports audio & video, voice_call, video_call
899   * @typedef { 'audio' | 'video' | 'voice_call' | 'video_call' } AVSessionType
900   * @syscap SystemCapability.Multimedia.AVSession.Core
901   * @atomicservice
902   * @since 12
903   */
904  type AVSessionType = 'audio' | 'video' | 'voice_call' | 'video_call';
905
906  /**
907   * AVSession object.
908   * @interface AVSession
909   * @syscap SystemCapability.Multimedia.AVSession.Core
910   * @since 10
911   */
912  /**
913   * AVSession object.
914   * @interface AVSession
915   * @syscap SystemCapability.Multimedia.AVSession.Core
916   * @atomicservice
917   * @since 12
918   */
919  interface AVSession {
920    /**
921     * unique session Id
922     * @syscap SystemCapability.Multimedia.AVSession.Core
923     * @since 10
924     */
925    /**
926     * unique session Id
927     * @type { string }
928     * @syscap SystemCapability.Multimedia.AVSession.Core
929     * @atomicservice
930     * @since 12
931     */
932    readonly sessionId: string;
933
934    /**
935     * Get current session type
936     * @type { AVSessionType }
937     * @syscap SystemCapability.Multimedia.AVSession.Core
938     * @since 10
939     */
940    /**
941     * Get current session type
942     * @type { AVSessionType }
943     * @syscap SystemCapability.Multimedia.AVSession.Core
944     * @atomicservice
945     * @since 12
946     */
947    readonly sessionType: AVSessionType;
948
949    /**
950     * Set the metadata of this session.
951     * In addition to the required properties, users can fill in partially supported properties
952     * @param { AVMetadata } data {@link AVMetadata}
953     * @param { AsyncCallback<void> } callback - The asyncCallback triggered when the command is executed successfully
954     * @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
955     * 2.Parameter verification failed.
956     * @throws { BusinessError } 6600101 - Session service exception.
957     * @throws { BusinessError } 6600102 - The session does not exist.
958     * @syscap SystemCapability.Multimedia.AVSession.Core
959     * @since 10
960     */
961    setAVMetadata(data: AVMetadata, callback: AsyncCallback<void>): void;
962
963    /**
964     * Set the metadata of this session.
965     * In addition to the required properties, users can fill in partially supported properties
966     * @param { AVMetadata } data {@link AVMetadata}
967     * @returns { Promise<void> } void promise when executed successfully
968     * @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
969     * 2.Parameter verification failed.
970     * @throws { BusinessError } 6600101 - Session service exception.
971     * @throws { BusinessError } 6600102 - The session does not exist.
972     * @syscap SystemCapability.Multimedia.AVSession.Core
973     * @since 10
974     */
975    /**
976     * Set the metadata of this session.
977     * In addition to the required properties, users can fill in partially supported properties
978     * @param { AVMetadata } data {@link AVMetadata}
979     * @returns { Promise<void> } void promise when executed successfully
980     * @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
981     * 2.Parameter verification failed.
982     * @throws { BusinessError } 6600101 - Session service exception.
983     * @throws { BusinessError } 6600102 - The session does not exist.
984     * @syscap SystemCapability.Multimedia.AVSession.Core
985     * @atomicservice
986     * @since 12
987     */
988    setAVMetadata(data: AVMetadata): Promise<void>;
989
990    /**
991     * Set the metadata related with current call.
992     * @param { CallMetadata } data - {@link CallMetadata}
993     * @param { AsyncCallback<void> } callback - The asyncCallback triggered when the command is executed successfully
994     * @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
995     * 2.Incorrect parameter types. 3.Parameter verification failed.
996     * @throws { BusinessError } 6600101 - Session service exception.
997     * @throws { BusinessError } 6600102 - The session does not exist.
998     * @syscap SystemCapability.Multimedia.AVSession.Core
999     * @since 11
1000     */
1001    setCallMetadata(data: CallMetadata, callback: AsyncCallback<void>): void;
1002
1003    /**
1004     * Set the metadata related with current call.
1005     * @param { CallMetadata } data - {@link CallMetadata}
1006     * @returns { Promise<void> } void promise when executed successfully
1007     * @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
1008     * 2.Incorrect parameter types. 3.Parameter verification failed.
1009     * @throws { BusinessError } 6600101 - Session service exception.
1010     * @throws { BusinessError } 6600102 - The session does not exist.
1011     * @syscap SystemCapability.Multimedia.AVSession.Core
1012     * @since 11
1013     */
1014    setCallMetadata(data: CallMetadata): Promise<void>;
1015
1016    /**
1017     * Set the playback state of this session.
1018     * @param { AVPlaybackState } state {@link AVPlaybackState}
1019     * @param { AsyncCallback<void> } callback - The asyncCallback triggered when the command is executed successfully
1020     * @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
1021     * 2.Parameter verification failed.
1022     * @throws { BusinessError } 6600101 - Session service exception.
1023     * @throws { BusinessError } 6600102 - The session does not exist.
1024     * @syscap SystemCapability.Multimedia.AVSession.Core
1025     * @since 10
1026     */
1027    setAVPlaybackState(state: AVPlaybackState, callback: AsyncCallback<void>): void;
1028
1029    /**
1030     * Set the playback state of this session.
1031     * @param { AVPlaybackState } state {@link AVPlaybackState}
1032     * @returns { Promise<void> } void promise when executed successfully
1033     * @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
1034     * 2.Parameter verification failed.
1035     * @throws { BusinessError } 6600101 - Session service exception.
1036     * @throws { BusinessError } 6600102 - The session does not exist.
1037     * @syscap SystemCapability.Multimedia.AVSession.Core
1038     * @since 10
1039     */
1040    /**
1041     * Set the playback state of this session.
1042     * @param { AVPlaybackState } state {@link AVPlaybackState}
1043     * @returns { Promise<void> } void promise when executed successfully
1044     * @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
1045     * 2.Parameter verification failed.
1046     * @throws { BusinessError } 6600101 - Session service exception.
1047     * @throws { BusinessError } 6600102 - The session does not exist.
1048     * @syscap SystemCapability.Multimedia.AVSession.Core
1049     * @atomicservice
1050     * @since 12
1051     */
1052    setAVPlaybackState(state: AVPlaybackState): Promise<void>;
1053
1054    /**
1055     * Set the call state of this session.
1056     * @param { AVCallState } state - {@link AVCallState}
1057     * @param { AsyncCallback<void> } callback - The asyncCallback triggered when the command is executed successfully
1058     * @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
1059     * 2.Parameter verification failed.
1060     * @throws { BusinessError } 6600101 - Session service exception.
1061     * @throws { BusinessError } 6600102 - The session does not exist.
1062     * @syscap SystemCapability.Multimedia.AVSession.Core
1063     * @since 11
1064     */
1065    setAVCallState(state: AVCallState, callback: AsyncCallback<void>): void;
1066
1067    /**
1068     * Set the call state of this session.
1069     * @param { AVCallState } state - {@link AVCallState}
1070     * @returns { Promise<void> } void promise when executed successfully
1071     * @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
1072     * 2.Parameter verification failed.
1073     * @throws { BusinessError } 6600101 - Session service exception.
1074     * @throws { BusinessError } 6600102 - The session does not exist.
1075     * @syscap SystemCapability.Multimedia.AVSession.Core
1076     * @since 11
1077     */
1078    setAVCallState(state: AVCallState): Promise<void>;
1079
1080    /**
1081     * Set the ability to start the session corresponding to
1082     * @param { WantAgent } ability - The WantAgent for launch the ability
1083     * @param { AsyncCallback<void> } callback - The asyncCallback triggered when the command is executed successfully
1084     * @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
1085     * 2.Parameter verification failed.
1086     * @throws { BusinessError } 6600101 - Session service exception.
1087     * @throws { BusinessError } 6600102 - The session does not exist.
1088     * @syscap SystemCapability.Multimedia.AVSession.Core
1089     * @since 10
1090     */
1091    setLaunchAbility(ability: WantAgent, callback: AsyncCallback<void>): void;
1092
1093    /**
1094     * Set the ability to start the session corresponding to
1095     * @param { WantAgent } ability - The WantAgent for launch the ability
1096     * @returns { Promise<void> } void promise when executed successfully
1097     * @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
1098     * 2.Parameter verification failed.
1099     * @throws { BusinessError } 6600101 - Session service exception.
1100     * @throws { BusinessError } 6600102 - The session does not exist.
1101     * @syscap SystemCapability.Multimedia.AVSession.Core
1102     * @since 10
1103     */
1104    /**
1105     * Set the ability to start the session corresponding to
1106     * @param { WantAgent } ability - The WantAgent for launch the ability
1107     * @returns { Promise<void> } void promise when executed successfully
1108     * @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
1109     * 2.Parameter verification failed.
1110     * @throws { BusinessError } 6600101 - Session service exception.
1111     * @throws { BusinessError } 6600102 - The session does not exist.
1112     * @syscap SystemCapability.Multimedia.AVSession.Core
1113     * @atomicservice
1114     * @since 12
1115     */
1116    setLaunchAbility(ability: WantAgent): Promise<void>;
1117
1118    /**
1119     * Dispatch the session event of this session.
1120     * @param { string } event - Session event name to dispatch
1121     * @param { object } args - The parameters of session event
1122     * @param { AsyncCallback<void>} callback - The asyncCallback triggered when the command is executed successfully
1123     * @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
1124     * 2.Incorrect parameter types. 3.Parameter verification failed.
1125     * @throws { BusinessError } 6600101 - Session service exception.
1126     * @throws { BusinessError } 6600102 - The session does not exist.
1127     * @syscap SystemCapability.Multimedia.AVSession.Core
1128     * @since 10
1129     */
1130    dispatchSessionEvent(event: string, args: {[key: string]: Object}, callback: AsyncCallback<void>): void;
1131
1132    /**
1133     * Dispatch the session event of this session.
1134     * @param { string } event - Session event name to dispatch
1135     * @param { object } args - The parameters of session event
1136     * @returns { Promise<void> } void promise when executed successfully
1137     * @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
1138     * 2.Incorrect parameter types. 3.Parameter verification failed.
1139     * @throws { BusinessError } 6600101 - Session service exception.
1140     * @throws { BusinessError } 6600102 - The session does not exist.
1141     * @syscap SystemCapability.Multimedia.AVSession.Core
1142     * @since 10
1143     */
1144    /**
1145     * Dispatch the session event of this session.
1146     * @param { string } event - Session event name to dispatch
1147     * @param { object } args - The parameters of session event
1148     * @returns { Promise<void> } void promise when executed successfully
1149     * @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
1150     * 2.Incorrect parameter types. 3.Parameter verification failed.
1151     * @throws { BusinessError } 6600101 - Session service exception.
1152     * @throws { BusinessError } 6600102 - The session does not exist.
1153     * @syscap SystemCapability.Multimedia.AVSession.Core
1154     * @atomicservice
1155     * @since 12
1156     */
1157    dispatchSessionEvent(event: string, args: {[key: string]: Object}): Promise<void>;
1158
1159    /**
1160     * Set the playlist of queueItem. Identifies the content of the playlist presented by this session.
1161     * @param { Array<AVQueueItem> } items - An array of the AVQueueItem
1162     * @param { AsyncCallback<void> } callback - The asyncCallback triggered when the command is executed successfully.
1163     * @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
1164     * 2.Parameter verification failed.
1165     * @throws { BusinessError } 6600101 - Session service exception.
1166     * @throws { BusinessError } 6600102 - The session does not exist.
1167     * @syscap SystemCapability.Multimedia.AVSession.Core
1168     * @since 10
1169     */
1170    setAVQueueItems(items: Array<AVQueueItem>, callback: AsyncCallback<void>): void;
1171
1172    /**
1173     * Set the playlist of queueItem. Identifies the content of the playlist presented by this session.
1174     * @param { Array<AVQueueItem> } items - An array of the AVQueueItem
1175     * @returns { Promise<void> } void promise when executed successfully
1176     * @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
1177     * 2.Parameter verification failed.
1178     * @throws { BusinessError } 6600101 - Session service exception.
1179     * @throws { BusinessError } 6600102 - The session does not exist.
1180     * @syscap SystemCapability.Multimedia.AVSession.Core
1181     * @since 10
1182     */
1183    /**
1184     * Set the playlist of queueItem. Identifies the content of the playlist presented by this session.
1185     * @param { Array<AVQueueItem> } items - An array of the AVQueueItem
1186     * @returns { Promise<void> } void promise when executed successfully
1187     * @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
1188     * 2.Parameter verification failed.
1189     * @throws { BusinessError } 6600101 - Session service exception.
1190     * @throws { BusinessError } 6600102 - The session does not exist.
1191     * @syscap SystemCapability.Multimedia.AVSession.Core
1192     * @atomicservice
1193     * @since 12
1194     */
1195    setAVQueueItems(items: Array<AVQueueItem>): Promise<void>;
1196
1197    /**
1198     * Set the name of the playlist presented by this session.
1199     * @param { string } title - The name of the playlist
1200     * @param { AsyncCallback<void> } callback - The asyncCallback triggered when the command is executed successfully.
1201     * @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
1202     * 2.Parameter verification failed.
1203     * @throws { BusinessError } 6600101 - Session service exception.
1204     * @throws { BusinessError } 6600102 - The session does not exist.
1205     * @syscap SystemCapability.Multimedia.AVSession.Core
1206     * @since 10
1207     */
1208    setAVQueueTitle(title: string, callback: AsyncCallback<void>): void;
1209
1210    /**
1211     * Set the name of the playlist presented by this session.
1212     * @param { string } title - The name of the playlist
1213     * @returns { Promise<void> } void promise when executed successfully
1214     * @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
1215     * 2.Parameter verification failed.
1216     * @throws { BusinessError } 6600101 - Session service exception.
1217     * @throws { BusinessError } 6600102 - The session does not exist.
1218     * @syscap SystemCapability.Multimedia.AVSession.Core
1219     * @since 10
1220     */
1221    /**
1222     * Set the name of the playlist presented by this session.
1223     * @param { string } title - The name of the playlist
1224     * @returns { Promise<void> } void promise when executed successfully
1225     * @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
1226     * 2.Parameter verification failed.
1227     * @throws { BusinessError } 6600101 - Session service exception.
1228     * @throws { BusinessError } 6600102 - The session does not exist.
1229     * @syscap SystemCapability.Multimedia.AVSession.Core
1230     * @atomicservice
1231     * @since 12
1232     */
1233    setAVQueueTitle(title: string): Promise<void>;
1234
1235    /**
1236     * Set the custom media packets for this session.
1237     * @param { object } extras - The custom media packets
1238     * @param { AsyncCallback<void> } callback - The asyncCallback triggered when the command is executed successfully.
1239     * @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
1240     * 2.Parameter verification failed.
1241     * @throws { BusinessError } 6600101 - Session service exception.
1242     * @throws { BusinessError } 6600102 - The session does not exist.
1243     * @syscap SystemCapability.Multimedia.AVSession.Core
1244     * @since 10
1245     */
1246    setExtras(extras: {[key: string]: Object}, callback: AsyncCallback<void>): void;
1247
1248    /**
1249     * Set the custom media packets for this session.
1250     * @param { object } extras - The custom media packets
1251     * @returns { Promise<void> } void promise when executed successfully
1252     * @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
1253     * 2.Parameter verification failed.
1254     * @throws { BusinessError } 6600101 - Session service exception.
1255     * @throws { BusinessError } 6600102 - The session does not exist.
1256     * @syscap SystemCapability.Multimedia.AVSession.Core
1257     * @since 10
1258     */
1259    /**
1260     * Set the custom media packets for this session.
1261     * @param { object } extras - The custom media packets
1262     * @returns { Promise<void> } void promise when executed successfully
1263     * @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
1264     * 2.Parameter verification failed.
1265     * @throws { BusinessError } 6600101 - Session service exception.
1266     * @throws { BusinessError } 6600102 - The session does not exist.
1267     * @syscap SystemCapability.Multimedia.AVSession.Core
1268     * @atomicservice
1269     * @since 12
1270     */
1271    setExtras(extras: {[key: string]: Object}): Promise<void>;
1272
1273    /**
1274     * Get the current session's own controller
1275     * @param { AsyncCallback<AVSessionController> } callback - async callback for the AVSessionController.
1276     * @throws { BusinessError } 6600101 - Session service exception.
1277     * @throws { BusinessError } 6600102 - The session does not exist.
1278     * @syscap SystemCapability.Multimedia.AVSession.Core
1279     * @since 10
1280     */
1281    getController(callback: AsyncCallback<AVSessionController>): void;
1282
1283    /**
1284     * Get the current session's own controller
1285     * @returns { Promise<AVSessionController> } Promise for the AVSessionController
1286     * @throws { BusinessError } 6600101 - Session service exception.
1287     * @throws { BusinessError } 6600102 - The session does not exist.
1288     * @syscap SystemCapability.Multimedia.AVSession.Core
1289     * @since 10
1290     */
1291    /**
1292     * Get the current session's own controller
1293     * @returns { Promise<AVSessionController> } Promise for the AVSessionController
1294     * @throws { BusinessError } 6600101 - Session service exception.
1295     * @throws { BusinessError } 6600102 - The session does not exist.
1296     * @syscap SystemCapability.Multimedia.AVSession.Core
1297     * @atomicservice
1298     * @since 12
1299     */
1300    getController(): Promise<AVSessionController>;
1301
1302    /**
1303     * Get the cast controller when the session is casted to remote device.
1304     * If the avsession is not under casting state, the controller will return null.
1305     * @param { AsyncCallback<AVCastController> } callback - async callback for the AVCastController.
1306     * @throws {BusinessError} 6600102 - The session does not exist
1307     * @throws {BusinessError} 6600109 - The remote connection is not established
1308     * @syscap SystemCapability.Multimedia.AVSession.AVCast
1309     * @since 10
1310     */
1311    getAVCastController(callback: AsyncCallback<AVCastController>): void;
1312
1313    /**
1314     * Get the cast controller when the session is casted to remote device.
1315     * If the avsession is not under casting state, the controller will return null.
1316     * @returns { Promise<AVCastController> } Promise for the AVCastController
1317     * @throws {BusinessError} 6600102 - The session does not exist
1318     * @throws {BusinessError} 6600109 - The remote connection is not established
1319     * @syscap SystemCapability.Multimedia.AVSession.AVCast
1320     * @since 10
1321     */
1322    /**
1323     * Get the cast controller when the session is casted to remote device.
1324     * If the avsession is not under casting state, the controller will return null.
1325     * @returns { Promise<AVCastController> } Promise for the AVCastController
1326     * @throws {BusinessError} 6600102 - The session does not exist
1327     * @throws {BusinessError} 6600109 - The remote connection is not established
1328     * @syscap SystemCapability.Multimedia.AVSession.AVCast
1329     * @atomicservice
1330     * @since 12
1331     */
1332    getAVCastController(): Promise<AVCastController>;
1333
1334    /**
1335     * Get output device information
1336     * @param { AsyncCallback<OutputDeviceInfo> } callback - async callback for the OutputDeviceInfo.
1337     * @throws { BusinessError } 6600101 - Session service exception.
1338     * @throws { BusinessError } 6600102 - The session does not exist.
1339     * @syscap SystemCapability.Multimedia.AVSession.Core
1340     * @since 10
1341     */
1342    getOutputDevice(callback: AsyncCallback<OutputDeviceInfo>): void;
1343
1344    /**
1345     * Get output device information
1346     * @returns { Promise<OutputDeviceInfo> } Promise for the OutputDeviceInfo
1347     * @throws { BusinessError } 6600101 - Session service exception.
1348     * @throws { BusinessError } 6600102 - The session does not exist.
1349     * @syscap SystemCapability.Multimedia.AVSession.Core
1350     * @since 10
1351     */
1352    /**
1353     * Get output device information
1354     * @returns { Promise<OutputDeviceInfo> } Promise for the OutputDeviceInfo
1355     * @throws { BusinessError } 6600101 - Session service exception.
1356     * @throws { BusinessError } 6600102 - The session does not exist.
1357     * @syscap SystemCapability.Multimedia.AVSession.Core
1358     * @atomicservice
1359     * @since 12
1360     */
1361    getOutputDevice(): Promise<OutputDeviceInfo>;
1362
1363    /**
1364     * Get output device information
1365     * @returns { OutputDeviceInfo } the OutputDeviceInfo
1366     * @throws { BusinessError } 6600101 - Session service exception.
1367     * @throws { BusinessError } 6600102 - The session does not exist.
1368     * @syscap SystemCapability.Multimedia.AVSession.Core
1369     * @since 10
1370     */
1371    /**
1372     * Get output device information
1373     * @returns { OutputDeviceInfo } the OutputDeviceInfo
1374     * @throws { BusinessError } 6600101 - Session service exception.
1375     * @throws { BusinessError } 6600102 - The session does not exist.
1376     * @syscap SystemCapability.Multimedia.AVSession.Core
1377     * @atomicservice
1378     * @since 12
1379     */
1380    getOutputDeviceSync(): OutputDeviceInfo;
1381
1382    /**
1383     * Get all the current virtual display information for extended display.
1384     * @returns { Promise<Array<CastDisplayInfo>> } Promise for the CastDisplayInfo
1385     * @throws { BusinessError } 6600101 - Session service exception.
1386     * @throws { BusinessError } 6600102 - The session does not exist.
1387     * @syscap SystemCapability.Multimedia.AVSession.ExtendedDisplayCast
1388     * @atomicservice
1389     * @since 12
1390     */
1391    getAllCastDisplays(): Promise<Array<CastDisplayInfo>>;
1392
1393    /**
1394     * Register play command callback.
1395     * As long as it is registered, it means that the ability supports this command.
1396     * If you cancel the callback, you need to call off {@link off}
1397     * When canceling the callback, need to update the supported commands list.
1398     * Each playback command only supports registering one callback,
1399     * and the new callback will replace the previous one.
1400     * @param { 'play' } type - Command to register 'play'.
1401     * @param { function } callback - Used to handle ('play') command
1402     * @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
1403     * 2.Incorrect parameter types.
1404     * @throws { BusinessError } 6600101 - Session service exception.
1405     * @throws { BusinessError } 6600102 - The session does not exist.
1406     * @syscap SystemCapability.Multimedia.AVSession.Core
1407     * @since 10
1408     */
1409    /**
1410     * Register play command callback.
1411     * As long as it is registered, it means that the ability supports this command.
1412     * If you cancel the callback, you need to call off {@link off}
1413     * When canceling the callback, need to update the supported commands list.
1414     * Each playback command only supports registering one callback,
1415     * and the new callback will replace the previous one.
1416     * @param { 'play' } type - Command to register 'play'.
1417     * @param { function } callback - Used to handle ('play') command
1418     * @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
1419     * 2.Incorrect parameter types.
1420     * @throws { BusinessError } 6600101 - Session service exception.
1421     * @throws { BusinessError } 6600102 - The session does not exist.
1422     * @syscap SystemCapability.Multimedia.AVSession.Core
1423     * @atomicservice
1424     * @since 12
1425     */
1426    on(type: 'play', callback: () => void): void;
1427
1428    /**
1429     * Register pause command callback.
1430     * As long as it is registered, it means that the ability supports this command.
1431     * If you cancel the callback, you need to call off {@link off}
1432     * When canceling the callback, need to update the supported commands list.
1433     * Each playback command only supports registering one callback,
1434     * and the new callback will replace the previous one.
1435     * @param { 'pause' } type - Command to register 'pause'.
1436     * @param { function } callback - Used to handle ('pause') command
1437     * @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
1438     * 2.Incorrect parameter types.
1439     * @throws { BusinessError } 6600101 - Session service exception.
1440     * @throws { BusinessError } 6600102 - The session does not exist.
1441     * @syscap SystemCapability.Multimedia.AVSession.Core
1442     * @since 10
1443     */
1444    /**
1445     * Register pause command callback.
1446     * As long as it is registered, it means that the ability supports this command.
1447     * If you cancel the callback, you need to call off {@link off}
1448     * When canceling the callback, need to update the supported commands list.
1449     * Each playback command only supports registering one callback,
1450     * and the new callback will replace the previous one.
1451     * @param { 'pause' } type - Command to register 'pause'.
1452     * @param { function } callback - Used to handle ('pause') command
1453     * @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
1454     * 2.Incorrect parameter types.
1455     * @throws { BusinessError } 6600101 - Session service exception.
1456     * @throws { BusinessError } 6600102 - The session does not exist.
1457     * @syscap SystemCapability.Multimedia.AVSession.Core
1458     * @atomicservice
1459     * @since 12
1460     */
1461    on(type: 'pause', callback: () => void): void;
1462
1463    /**
1464     * Register stop command callback.
1465     * As long as it is registered, it means that the ability supports this command.
1466     * If you cancel the callback, you need to call off {@link off}
1467     * When canceling the callback, need to update the supported commands list.
1468     * Each playback command only supports registering one callback,
1469     * and the new callback will replace the previous one.
1470     * @param { 'stop' } type - Command to register 'stop'.
1471     * @param { function } callback - Used to handle ('stop') command
1472     * @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
1473     * 2.Incorrect parameter types.
1474     * @throws { BusinessError } 6600101 - Session service exception.
1475     * @throws { BusinessError } 6600102 - The session does not exist.
1476     * @syscap SystemCapability.Multimedia.AVSession.Core
1477     * @since 10
1478     */
1479    /**
1480     * Register stop command callback.
1481     * As long as it is registered, it means that the ability supports this command.
1482     * If you cancel the callback, you need to call off {@link off}
1483     * When canceling the callback, need to update the supported commands list.
1484     * Each playback command only supports registering one callback,
1485     * and the new callback will replace the previous one.
1486     * @param { 'stop' } type - Command to register 'stop'.
1487     * @param { function } callback - Used to handle ('stop') command
1488     * @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
1489     * 2.Incorrect parameter types.
1490     * @throws { BusinessError } 6600101 - Session service exception.
1491     * @throws { BusinessError } 6600102 - The session does not exist.
1492     * @syscap SystemCapability.Multimedia.AVSession.Core
1493     * @atomicservice
1494     * @since 12
1495     */
1496    on(type: 'stop', callback: () => void): void;
1497
1498    /**
1499     * Register playNext command callback.
1500     * As long as it is registered, it means that the ability supports this command.
1501     * If you cancel the callback, you need to call off {@link off}
1502     * When canceling the callback, need to update the supported commands list.
1503     * Each playback command only supports registering one callback,
1504     * and the new callback will replace the previous one.
1505     * @param { 'playNext' } type - Command to register 'playNext'.
1506     * @param { function } callback - Used to handle ('playNext') command
1507     * @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
1508     * 2.Incorrect parameter types.
1509     * @throws { BusinessError } 6600101 - Session service exception.
1510     * @throws { BusinessError } 6600102 - The session does not exist.
1511     * @syscap SystemCapability.Multimedia.AVSession.Core
1512     * @since 10
1513     */
1514    /**
1515     * Register playNext command callback.
1516     * As long as it is registered, it means that the ability supports this command.
1517     * If you cancel the callback, you need to call off {@link off}
1518     * When canceling the callback, need to update the supported commands list.
1519     * Each playback command only supports registering one callback,
1520     * and the new callback will replace the previous one.
1521     * @param { 'playNext' } type - Command to register 'playNext'.
1522     * @param { function } callback - Used to handle ('playNext') command
1523     * @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
1524     * 2.Incorrect parameter types.
1525     * @throws { BusinessError } 6600101 - Session service exception.
1526     * @throws { BusinessError } 6600102 - The session does not exist.
1527     * @syscap SystemCapability.Multimedia.AVSession.Core
1528     * @atomicservice
1529     * @since 12
1530     */
1531    on(type: 'playNext', callback: () => void): void;
1532
1533    /**
1534     * Register playPrevious command callback.
1535     * As long as it is registered, it means that the ability supports this command.
1536     * If you cancel the callback, you need to call off {@link off}
1537     * When canceling the callback, need to update the supported commands list.
1538     * Each playback command only supports registering one callback,
1539     * and the new callback will replace the previous one.
1540     * @param { 'playPrevious' } type - Command to register 'playPrevious'.
1541     * @param { function } callback - Used to handle ('playPrevious') command
1542     * @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
1543     * 2.Incorrect parameter types.
1544     * @throws { BusinessError } 6600101 - Session service exception.
1545     * @throws { BusinessError } 6600102 - The session does not exist.
1546     * @syscap SystemCapability.Multimedia.AVSession.Core
1547     * @since 10
1548     */
1549    /**
1550     * Register playPrevious command callback.
1551     * As long as it is registered, it means that the ability supports this command.
1552     * If you cancel the callback, you need to call off {@link off}
1553     * When canceling the callback, need to update the supported commands list.
1554     * Each playback command only supports registering one callback,
1555     * and the new callback will replace the previous one.
1556     * @param { 'playPrevious' } type - Command to register 'playPrevious'.
1557     * @param { function } callback - Used to handle ('playPrevious') command
1558     * @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
1559     * 2.Incorrect parameter types.
1560     * @throws { BusinessError } 6600101 - Session service exception.
1561     * @throws { BusinessError } 6600102 - The session does not exist.
1562     * @syscap SystemCapability.Multimedia.AVSession.Core
1563     * @atomicservice
1564     * @since 12
1565     */
1566    on(type: 'playPrevious', callback: () => void): void;
1567
1568    /**
1569     * Register fastForward command callback.
1570     * As long as it is registered, it means that the ability supports this command.
1571     * If you cancel the callback, you need to call off {@link off}
1572     * When canceling the callback, need to update the supported commands list.
1573     * Each playback command only supports registering one callback,
1574     * and the new callback will replace the previous one.
1575     * @param { 'fastForward' } type - Command to register 'fastForward'.
1576     * @param { function } callback - Used to handle ('fastForward') command
1577     * @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
1578     * 2.Incorrect parameter types.
1579     * @throws { BusinessError } 6600101 - Session service exception.
1580     * @throws { BusinessError } 6600102 - The session does not exist.
1581     * @syscap SystemCapability.Multimedia.AVSession.Core
1582     * @since 10
1583     */
1584    /**
1585     * Register fastForward command callback.
1586     * As long as it is registered, it means that the ability supports this command.
1587     * If you cancel the callback, you need to call off {@link off}
1588     * When canceling the callback, need to update the supported commands list.
1589     * Each playback command only supports registering one callback,
1590     * and the new callback will replace the previous one.
1591     * @param { 'fastForward' } type - Command to register 'fastForward'.
1592     * @param { function } callback - Used to handle ('fastForward') command
1593     * @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
1594     * 2.Incorrect parameter types.
1595     * @throws { BusinessError } 6600101 - Session service exception.
1596     * @throws { BusinessError } 6600102 - The session does not exist.
1597     * @syscap SystemCapability.Multimedia.AVSession.Core
1598     * @atomicservice
1599     * @since 12
1600     */
1601    on(type: 'fastForward', callback: (time ?: number) => void): void;
1602
1603    /**
1604     * Register rewind command callback.
1605     * As long as it is registered, it means that the ability supports this command.
1606     * If you cancel the callback, you need to call off {@link off}
1607     * When canceling the callback, need to update the supported commands list.
1608     * Each playback command only supports registering one callback,
1609     * and the new callback will replace the previous one.
1610     * @param { 'rewind' } type - Command to register 'rewind'.
1611     * @param { function } callback - Used to handle ('rewind') command
1612     * @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
1613     * 2.Incorrect parameter types.
1614     * @throws { BusinessError } 6600101 - Session service exception.
1615     * @throws { BusinessError } 6600102 - The session does not exist.
1616     * @syscap SystemCapability.Multimedia.AVSession.Core
1617     * @since 10
1618     */
1619    /**
1620     * Register rewind command callback.
1621     * As long as it is registered, it means that the ability supports this command.
1622     * If you cancel the callback, you need to call off {@link off}
1623     * When canceling the callback, need to update the supported commands list.
1624     * Each playback command only supports registering one callback,
1625     * and the new callback will replace the previous one.
1626     * @param { 'rewind' } type - Command to register 'rewind'.
1627     * @param { function } callback - Used to handle ('rewind') command
1628     * @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
1629     * 2.Incorrect parameter types.
1630     * @throws { BusinessError } 6600101 - Session service exception.
1631     * @throws { BusinessError } 6600102 - The session does not exist.
1632     * @syscap SystemCapability.Multimedia.AVSession.Core
1633     * @atomicservice
1634     * @since 12
1635     */
1636    on(type: 'rewind', callback: (time ?: number) => void): void;
1637
1638    /**
1639     * Unregister play command callback.
1640     * When canceling the callback, need to update the supported commands list.
1641     * @param { 'play' } type - Command to register 'play'.
1642     * @param { function } callback - Used to handle ('play') command
1643     * @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
1644     * 2.Incorrect parameter types.
1645     * @throws { BusinessError } 6600101 - Session service exception.
1646     * @throws { BusinessError } 6600102 - The session does not exist.
1647     * @syscap SystemCapability.Multimedia.AVSession.Core
1648     * @since 10
1649     */
1650    /**
1651     * Unregister play command callback.
1652     * When canceling the callback, need to update the supported commands list.
1653     * @param { 'play' } type - Command to register 'play'.
1654     * @param { function } callback - Used to handle ('play') command
1655     * @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
1656     * 2.Incorrect parameter types.
1657     * @throws { BusinessError } 6600101 - Session service exception.
1658     * @throws { BusinessError } 6600102 - The session does not exist.
1659     * @syscap SystemCapability.Multimedia.AVSession.Core
1660     * @atomicservice
1661     * @since 12
1662     */
1663    off(type: 'play', callback?: () => void): void;
1664
1665    /**
1666     * Unregister pause command callback.
1667     * When canceling the callback, need to update the supported commands list.
1668     * @param { 'pause' } type - Command to register 'pause'.
1669     * @param { function } callback - Used to handle ('pause') command
1670     * @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
1671     * 2.Incorrect parameter types.
1672     * @throws { BusinessError } 6600101 - Session service exception.
1673     * @throws { BusinessError } 6600102 - The session does not exist.
1674     * @syscap SystemCapability.Multimedia.AVSession.Core
1675     * @since 10
1676     */
1677    /**
1678     * Unregister pause command callback.
1679     * When canceling the callback, need to update the supported commands list.
1680     * @param { 'pause' } type - Command to register 'pause'.
1681     * @param { function } callback - Used to handle ('pause') command
1682     * @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
1683     * 2.Incorrect parameter types.
1684     * @throws { BusinessError } 6600101 - Session service exception.
1685     * @throws { BusinessError } 6600102 - The session does not exist.
1686     * @syscap SystemCapability.Multimedia.AVSession.Core
1687     * @atomicservice
1688     * @since 12
1689     */
1690    off(type: 'pause', callback?: () => void): void;
1691
1692    /**
1693     * Unregister stop command callback.
1694     * When canceling the callback, need to update the supported commands list.
1695     * @param { 'stop' } type - Command to register 'stop'.
1696     * @param { function } callback - Used to handle ('stop') command
1697     * @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
1698     * 2.Incorrect parameter types.
1699     * @throws { BusinessError } 6600101 - Session service exception.
1700     * @throws { BusinessError } 6600102 - The session does not exist.
1701     * @syscap SystemCapability.Multimedia.AVSession.Core
1702     * @since 10
1703     */
1704    /**
1705     * Unregister stop command callback.
1706     * When canceling the callback, need to update the supported commands list.
1707     * @param { 'stop' } type - Command to register 'stop'.
1708     * @param { function } callback - Used to handle ('stop') command
1709     * @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
1710     * 2.Incorrect parameter types.
1711     * @throws { BusinessError } 6600101 - Session service exception.
1712     * @throws { BusinessError } 6600102 - The session does not exist.
1713     * @syscap SystemCapability.Multimedia.AVSession.Core
1714     * @atomicservice
1715     * @since 12
1716     */
1717    off(type: 'stop', callback?: () => void): void;
1718
1719    /**
1720     * Unregister playNext command callback.
1721     * When canceling the callback, need to update the supported commands list.
1722     * @param { 'playNext' } type - Command to register 'playNext'.
1723     * @param { function } callback - Used to handle ('playNext') command
1724     * @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
1725     * 2.Incorrect parameter types.
1726     * @throws { BusinessError } 6600101 - Session service exception.
1727     * @throws { BusinessError } 6600102 - The session does not exist.
1728     * @syscap SystemCapability.Multimedia.AVSession.Core
1729     * @since 10
1730     */
1731    /**
1732     * Unregister playNext command callback.
1733     * When canceling the callback, need to update the supported commands list.
1734     * @param { 'playNext' } type - Command to register 'playNext'.
1735     * @param { function } callback - Used to handle ('playNext') command
1736     * @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
1737     * 2.Incorrect parameter types.
1738     * @throws { BusinessError } 6600101 - Session service exception.
1739     * @throws { BusinessError } 6600102 - The session does not exist.
1740     * @syscap SystemCapability.Multimedia.AVSession.Core
1741     * @atomicservice
1742     * @since 12
1743     */
1744    off(type: 'playNext', callback?: () => void): void;
1745
1746    /**
1747     * Unregister playPrevious command callback.
1748     * When canceling the callback, need to update the supported commands list.
1749     * @param { 'playPrevious' } type - Command to register 'playPrevious'.
1750     * @param { function } callback - Used to handle ('playPrevious') command
1751     * @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
1752     * 2.Incorrect parameter types.
1753     * @throws { BusinessError } 6600101 - Session service exception.
1754     * @throws { BusinessError } 6600102 - The session does not exist.
1755     * @syscap SystemCapability.Multimedia.AVSession.Core
1756     * @since 10
1757     */
1758    /**
1759     * Unregister playPrevious command callback.
1760     * When canceling the callback, need to update the supported commands list.
1761     * @param { 'playPrevious' } type - Command to register 'playPrevious'.
1762     * @param { function } callback - Used to handle ('playPrevious') command
1763     * @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
1764     * 2.Incorrect parameter types.
1765     * @throws { BusinessError } 6600101 - Session service exception.
1766     * @throws { BusinessError } 6600102 - The session does not exist.
1767     * @syscap SystemCapability.Multimedia.AVSession.Core
1768     * @atomicservice
1769     * @since 12
1770     */
1771    off(type: 'playPrevious', callback?: () => void): void;
1772
1773    /**
1774     * Unregister fastForward command callback.
1775     * When canceling the callback, need to update the supported commands list.
1776     * @param { 'fastForward' } type - Command to register 'fastForward'.
1777     * @param { function } callback - Used to handle ('fastForward') command
1778     * @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
1779     * 2.Incorrect parameter types.
1780     * @throws { BusinessError } 6600101 - Session service exception.
1781     * @throws { BusinessError } 6600102 - The session does not exist.
1782     * @syscap SystemCapability.Multimedia.AVSession.Core
1783     * @since 10
1784     */
1785    /**
1786     * Unregister fastForward command callback.
1787     * When canceling the callback, need to update the supported commands list.
1788     * @param { 'fastForward' } type - Command to register 'fastForward'.
1789     * @param { function } callback - Used to handle ('fastForward') command
1790     * @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
1791     * 2.Incorrect parameter types.
1792     * @throws { BusinessError } 6600101 - Session service exception.
1793     * @throws { BusinessError } 6600102 - The session does not exist.
1794     * @syscap SystemCapability.Multimedia.AVSession.Core
1795     * @atomicservice
1796     * @since 12
1797     */
1798    off(type: 'fastForward', callback?: () => void): void;
1799
1800    /**
1801     * Unregister rewind command callback.
1802     * When canceling the callback, need to update the supported commands list.
1803     * @param { 'rewind' } type - Command to register 'rewind'.
1804     * @param { function } callback - Used to handle ('rewind') command
1805     * @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
1806     * 2.Incorrect parameter types.
1807     * @throws { BusinessError } 6600101 - Session service exception.
1808     * @throws { BusinessError } 6600102 - The session does not exist.
1809     * @syscap SystemCapability.Multimedia.AVSession.Core
1810     * @since 10
1811     */
1812    /**
1813     * Unregister rewind command callback.
1814     * When canceling the callback, need to update the supported commands list.
1815     * @param { 'rewind' } type - Command to register 'rewind'.
1816     * @param { function } callback - Used to handle ('rewind') command
1817     * @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
1818     * 2.Incorrect parameter types.
1819     * @throws { BusinessError } 6600101 - Session service exception.
1820     * @throws { BusinessError } 6600102 - The session does not exist.
1821     * @syscap SystemCapability.Multimedia.AVSession.Core
1822     * @atomicservice
1823     * @since 12
1824     */
1825    off(type: 'rewind', callback?: () => void): void;
1826
1827    /**
1828     * Register playFromAssetId command callback.
1829     * As long as it is registered, it means that the ability supports this command.
1830     * If you cancel the callback, you need to call off {@link off}
1831     * When canceling the callback, need to update the supported commands list.
1832     * Each playback command only supports registering one callback,
1833     * and the new callback will replace the previous one.
1834     * @param { 'playFromAssetId' } type - Command to register 'playFromAssetId'.
1835     * @param { function } callback - Used to handle ('playFromAssetId') command
1836     * @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
1837     * 2.Incorrect parameter types.
1838     * @throws { BusinessError } 6600101 - Session service exception.
1839     * @throws { BusinessError } 6600102 - The session does not exist.
1840     * @syscap SystemCapability.Multimedia.AVSession.Core
1841     * @since 11
1842     */
1843    /**
1844     * Register playFromAssetId command callback.
1845     * As long as it is registered, it means that the ability supports this command.
1846     * If you cancel the callback, you need to call off {@link off}
1847     * When canceling the callback, need to update the supported commands list.
1848     * Each playback command only supports registering one callback,
1849     * and the new callback will replace the previous one.
1850     * @param { 'playFromAssetId' } type - Command to register 'playFromAssetId'.
1851     * @param { function } callback - Used to handle ('playFromAssetId') command
1852     * @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
1853     * 2.Incorrect parameter types.
1854     * @throws { BusinessError } 6600101 - Session service exception.
1855     * @throws { BusinessError } 6600102 - The session does not exist.
1856     * @syscap SystemCapability.Multimedia.AVSession.Core
1857     * @atomicservice
1858     * @since 12
1859     */
1860    on(type: 'playFromAssetId', callback: (assetId: number) => void): void;
1861
1862    /**
1863     * Unregister playFromAssetId command callback.
1864     * @param { 'playFromAssetId' } type - Command to register 'playFromAssetId'.
1865     * @param { function } callback - Used to handle ('playFromAssetId') command
1866     * @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
1867     * 2.Incorrect parameter types.
1868     * @throws { BusinessError } 6600101 - Session service exception.
1869     * @throws { BusinessError } 6600102 - The session does not exist.
1870     * @syscap SystemCapability.Multimedia.AVSession.Core
1871     * @since 11
1872     */
1873    /**
1874     * Unregister playFromAssetId command callback.
1875     * @param { 'playFromAssetId' } type - Command to register 'playFromAssetId'.
1876     * @param { function } callback - Used to handle ('playFromAssetId') command
1877     * @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
1878     * 2.Incorrect parameter types.
1879     * @throws { BusinessError } 6600101 - Session service exception.
1880     * @throws { BusinessError } 6600102 - The session does not exist.
1881     * @syscap SystemCapability.Multimedia.AVSession.Core
1882     * @atomicservice
1883     * @since 12
1884     */
1885    off(type: 'playFromAssetId', callback?: (assetId: number) => void): void;
1886
1887    /**
1888     * Register seek command callback
1889     * @param { 'seek' } type - Registration Type 'seek'
1890     * @param { function } callback - Used to handle seek command.The callback provides the seek time(ms)
1891     * @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
1892     * 2.Incorrect parameter types.
1893     * @throws { BusinessError } 6600101 - Session service exception.
1894     * @throws { BusinessError } 6600102 - The session does not exist.
1895     * @syscap SystemCapability.Multimedia.AVSession.Core
1896     * @since 10
1897     */
1898    /**
1899     * Register seek command callback
1900     * @param { 'seek' } type - Registration Type 'seek'
1901     * @param { function } callback - Used to handle seek command.The callback provides the seek time(ms)
1902     * @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
1903     * 2.Incorrect parameter types.
1904     * @throws { BusinessError } 6600101 - Session service exception.
1905     * @throws { BusinessError } 6600102 - The session does not exist.
1906     * @syscap SystemCapability.Multimedia.AVSession.Core
1907     * @atomicservice
1908     * @since 12
1909     */
1910    on(type: 'seek', callback: (time: number) => void): void;
1911
1912    /**
1913     * Unregister seek command callback
1914     * @param { 'seek' } type - Registration Type 'seek'
1915     * @param { function } callback - Used to handle seek command.The callback provides the seek time(ms)
1916     * @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
1917     * 2.Incorrect parameter types.
1918     * @throws { BusinessError } 6600101 - Session service exception.
1919     * @throws { BusinessError } 6600102 - The session does not exist.
1920     * @syscap SystemCapability.Multimedia.AVSession.Core
1921     * @since 10
1922     */
1923    /**
1924     * Unregister seek command callback
1925     * @param { 'seek' } type - Registration Type 'seek'
1926     * @param { function } callback - Used to handle seek command.The callback provides the seek time(ms)
1927     * @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
1928     * 2.Incorrect parameter types.
1929     * @throws { BusinessError } 6600101 - Session service exception.
1930     * @throws { BusinessError } 6600102 - The session does not exist.
1931     * @syscap SystemCapability.Multimedia.AVSession.Core
1932     * @atomicservice
1933     * @since 12
1934     */
1935    off(type: 'seek', callback?: (time: number) => void): void;
1936
1937    /**
1938     * Register setSpeed command callback
1939     * @param { 'setSpeed' } type - Registration Type 'setSpeed'
1940     * @param { function } callback - Used to handle setSpeed command.The callback provides the speed value
1941     * @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
1942     * 2.Incorrect parameter types.
1943     * @throws { BusinessError } 6600101 - Session service exception.
1944     * @throws { BusinessError } 6600102 - The session does not exist.
1945     * @syscap SystemCapability.Multimedia.AVSession.Core
1946     * @since 10
1947     */
1948    /**
1949     * Register setSpeed command callback
1950     * @param { 'setSpeed' } type - Registration Type 'setSpeed'
1951     * @param { function } callback - Used to handle setSpeed command.The callback provides the speed value
1952     * @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
1953     * 2.Incorrect parameter types.
1954     * @throws { BusinessError } 6600101 - Session service exception.
1955     * @throws { BusinessError } 6600102 - The session does not exist.
1956     * @syscap SystemCapability.Multimedia.AVSession.Core
1957     * @atomicservice
1958     * @since 12
1959     */
1960    on(type: 'setSpeed', callback: (speed: number) => void): void;
1961
1962    /**
1963     * Unregister setSpeed command callback
1964     * @param { 'setSpeed' } type - Registration Type 'setSpeed'
1965     * @param { function } callback - Used to handle setSpeed command.The callback provides the speed value
1966     * @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
1967     * 2.Incorrect parameter types.
1968     * @throws { BusinessError } 6600101 - Session service exception.
1969     * @throws { BusinessError } 6600102 - The session does not exist.
1970     * @syscap SystemCapability.Multimedia.AVSession.Core
1971     * @since 10
1972     */
1973    /**
1974     * Unregister setSpeed command callback
1975     * @param { 'setSpeed' } type - Registration Type 'setSpeed'
1976     * @param { function } callback - Used to handle setSpeed command.The callback provides the speed value
1977     * @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
1978     * 2.Incorrect parameter types.
1979     * @throws { BusinessError } 6600101 - Session service exception.
1980     * @throws { BusinessError } 6600102 - The session does not exist.
1981     * @syscap SystemCapability.Multimedia.AVSession.Core
1982     * @atomicservice
1983     * @since 12
1984     */
1985    off(type: 'setSpeed', callback?: (speed: number) => void): void;
1986
1987    /**
1988     * Register setLoopMode command callback
1989     * @param { 'setLoopMode' } type - Registration Type 'setLoopMode'
1990     * @param { function } callback - Used to handle setLoopMode command.The callback provides the {@link LoopMode}
1991     * @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
1992     * 2.Incorrect parameter types.
1993     * @throws { BusinessError } 6600101 - Session service exception.
1994     * @throws { BusinessError } 6600102 - The session does not exist.
1995     * @syscap SystemCapability.Multimedia.AVSession.Core
1996     * @since 10
1997     */
1998    /**
1999     * Register setLoopMode command callback
2000     * @param { 'setLoopMode' } type - Registration Type 'setLoopMode'
2001     * @param { function } callback - Used to handle setLoopMode command.The callback provides the {@link LoopMode}
2002     * @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
2003     * 2.Incorrect parameter types.
2004     * @throws { BusinessError } 6600101 - Session service exception.
2005     * @throws { BusinessError } 6600102 - The session does not exist.
2006     * @syscap SystemCapability.Multimedia.AVSession.Core
2007     * @atomicservice
2008     * @since 12
2009     */
2010    on(type: 'setLoopMode', callback: (mode: LoopMode) => void): void;
2011
2012    /**
2013     * Unregister setLoopMode command callback
2014     * @param { 'setLoopMode' } type - Registration Type 'setLoopMode'
2015     * @param { function } callback - Used to handle setLoopMode command.The callback provides the {@link LoopMode}
2016     * @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
2017     * 2.Incorrect parameter types.
2018     * @throws { BusinessError } 6600101 - Session service exception.
2019     * @throws { BusinessError } 6600102 - The session does not exist.
2020     * @syscap SystemCapability.Multimedia.AVSession.Core
2021     * @since 10
2022     */
2023    /**
2024     * Unregister setLoopMode command callback
2025     * @param { 'setLoopMode' } type - Registration Type 'setLoopMode'
2026     * @param { function } callback - Used to handle setLoopMode command.The callback provides the {@link LoopMode}
2027     * @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
2028     * 2.Incorrect parameter types.
2029     * @throws { BusinessError } 6600101 - Session service exception.
2030     * @throws { BusinessError } 6600102 - The session does not exist.
2031     * @syscap SystemCapability.Multimedia.AVSession.Core
2032     * @atomicservice
2033     * @since 12
2034     */
2035    off(type: 'setLoopMode', callback?: (mode: LoopMode) => void): void;
2036
2037    /**
2038     * Register toggle favorite command callback
2039     * @param { 'toggleFavorite' } type - Registration Type 'toggleFavorite'
2040     * @param { function } callback - Used to handle toggleFavorite command.The callback provides
2041     * the assetId for which the favorite status needs to be switched.
2042     * @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
2043     * 2.Incorrect parameter types.
2044     * @throws { BusinessError } 6600101 - Session service exception.
2045     * @throws { BusinessError } 6600102 - The session does not exist.
2046     * @syscap SystemCapability.Multimedia.AVSession.Core
2047     * @since 10
2048     */
2049    /**
2050     * Register toggle favorite command callback
2051     * @param { 'toggleFavorite' } type - Registration Type 'toggleFavorite'
2052     * @param { function } callback - Used to handle toggleFavorite command.The callback provides
2053     * the assetId for which the favorite status needs to be switched.
2054     * @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
2055     * 2.Incorrect parameter types.
2056     * @throws { BusinessError } 6600101 - Session service exception.
2057     * @throws { BusinessError } 6600102 - The session does not exist.
2058     * @syscap SystemCapability.Multimedia.AVSession.Core
2059     * @atomicservice
2060     * @since 12
2061     */
2062    on(type: 'toggleFavorite', callback: (assetId: string) => void): void;
2063
2064    /**
2065     * Unregister toggle favorite command callback
2066     * @param { 'toggleFavorite' } type - Registration Type 'toggleFavorite'
2067     * @param { function } callback - Used to handle toggleFavorite command.The callback provides
2068     * the assetId for which the favorite status needs to be switched.
2069     * @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
2070     * 2.Incorrect parameter types.
2071     * @throws { BusinessError } 6600101 - Session service exception.
2072     * @throws { BusinessError } 6600102 - The session does not exist.
2073     * @syscap SystemCapability.Multimedia.AVSession.Core
2074     * @since 10
2075     */
2076    /**
2077     * Unregister toggle favorite command callback
2078     * @param { 'toggleFavorite' } type - Registration Type 'toggleFavorite'
2079     * @param { function } callback - Used to handle toggleFavorite command.The callback provides
2080     * the assetId for which the favorite status needs to be switched.
2081     * @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
2082     * 2.Incorrect parameter types.
2083     * @throws { BusinessError } 6600101 - Session service exception.
2084     * @throws { BusinessError } 6600102 - The session does not exist.
2085     * @syscap SystemCapability.Multimedia.AVSession.Core
2086     * @atomicservice
2087     * @since 12
2088     */
2089    off(type: 'toggleFavorite', callback?: (assetId: string) => void): void;
2090
2091    /**
2092     * Register media key handling callback
2093     * @param { 'handleKeyEvent' } type - Registration Type 'handleKeyEvent'
2094     * @param { function } callback - Used to handle key events.The callback provides the KeyEvent
2095     * @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
2096     * 2.Incorrect parameter types.
2097     * @throws { BusinessError } 6600101 - Session service exception.
2098     * @throws { BusinessError } 6600102 - The session does not exist.
2099     * @syscap SystemCapability.Multimedia.AVSession.Core
2100     * @since 10
2101     */
2102    /**
2103     * Register media key handling callback
2104     * @param { 'handleKeyEvent' } type - Registration Type 'handleKeyEvent'
2105     * @param { function } callback - Used to handle key events.The callback provides the KeyEvent
2106     * @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
2107     * 2.Incorrect parameter types.
2108     * @throws { BusinessError } 6600101 - Session service exception.
2109     * @throws { BusinessError } 6600102 - The session does not exist.
2110     * @syscap SystemCapability.Multimedia.AVSession.Core
2111     * @atomicservice
2112     * @since 12
2113     */
2114    on(type: 'handleKeyEvent', callback: (event: KeyEvent) => void): void;
2115
2116    /**
2117     * Unregister media key handling callback
2118     * @param { 'handleKeyEvent' } type - Registration Type 'handleKeyEvent'
2119     * @param { function } callback - Used to handle key events.The callback provides the KeyEvent
2120     * @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
2121     * 2.Incorrect parameter types.
2122     * @throws { BusinessError } 6600101 - Session service exception.
2123     * @throws { BusinessError } 6600102 - The session does not exist.
2124     * @syscap SystemCapability.Multimedia.AVSession.Core
2125     * @since 10
2126     */
2127    /**
2128     * Unregister media key handling callback
2129     * @param { 'handleKeyEvent' } type - Registration Type 'handleKeyEvent'
2130     * @param { function } callback - Used to handle key events.The callback provides the KeyEvent
2131     * @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
2132     * 2.Incorrect parameter types.
2133     * @throws { BusinessError } 6600101 - Session service exception.
2134     * @throws { BusinessError } 6600102 - The session does not exist.
2135     * @syscap SystemCapability.Multimedia.AVSession.Core
2136     * @atomicservice
2137     * @since 12
2138     */
2139    off(type: 'handleKeyEvent', callback?: (event: KeyEvent) => void): void;
2140
2141    /**
2142     * Register session output device change callback
2143     * @param { 'outputDeviceChange' } type - Registration Type 'outputDeviceChange'
2144     * @param { function } callback - Used to handle output device changed.
2145     * The callback provide the new device info {@link OutputDeviceInfo} and related connection state {@link ConnectionState}.
2146     * @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
2147     * 2.Incorrect parameter types.
2148     * @throws { BusinessError } 6600101 - Session service exception
2149     * @throws { BusinessError } 6600102 - The session does not exist
2150     * @syscap SystemCapability.Multimedia.AVSession.Core
2151     * @since 10
2152     */
2153    /**
2154     * Register session output device change callback
2155     * @param { 'outputDeviceChange' } type - Registration Type 'outputDeviceChange'
2156     * @param { function } callback - Used to handle output device changed.
2157     * The callback provide the new device info {@link OutputDeviceInfo} and related connection state {@link ConnectionState}.
2158     * @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
2159     * 2.Incorrect parameter types.
2160     * @throws { BusinessError } 6600101 - Session service exception
2161     * @throws { BusinessError } 6600102 - The session does not exist
2162     * @syscap SystemCapability.Multimedia.AVSession.Core
2163     * @atomicservice
2164     * @since 12
2165     */
2166    on(type: 'outputDeviceChange', callback: (state: ConnectionState, device: OutputDeviceInfo) => void): void;
2167
2168    /**
2169     * Unregister session output device change callback
2170     * @param { 'outputDeviceChange' } type - Registration Type 'outputDeviceChange'
2171     * @param { function } callback - Used to handle output device changed.
2172     * The callback provide the new device info {@link OutputDeviceInfo} and related connection state {@link ConnectionState}.
2173     * @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
2174     * 2.Incorrect parameter types.
2175     * @throws { BusinessError } 6600101 - Session service exception
2176     * @throws { BusinessError } 6600102 - The session does not exist
2177     * @syscap SystemCapability.Multimedia.AVSession.Core
2178     * @since 10
2179     */
2180    /**
2181     * Unregister session output device change callback
2182     * @param { 'outputDeviceChange' } type - Registration Type 'outputDeviceChange'
2183     * @param { function } callback - Used to handle output device changed.
2184     * The callback provide the new device info {@link OutputDeviceInfo} and related connection state {@link ConnectionState}.
2185     * @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
2186     * 2.Incorrect parameter types.
2187     * @throws { BusinessError } 6600101 - Session service exception
2188     * @throws { BusinessError } 6600102 - The session does not exist
2189     * @syscap SystemCapability.Multimedia.AVSession.Core
2190     * @atomicservice
2191     * @since 12
2192     */
2193    off(type: 'outputDeviceChange', callback?: (state: ConnectionState, device: OutputDeviceInfo) => void): void;
2194
2195    /**
2196     * Register session custom command change callback
2197     * @param { 'commonCommand' } type - Registration Type 'commonCommand'
2198     * @param { function } callback - Used to handle event when the common command is received
2199     * The callback provide the command name and command args
2200     * @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
2201     * 2.Incorrect parameter types.
2202     * @throws { BusinessError } 6600101 - Session service exception.
2203     * @throws { BusinessError } 6600102 - The session does not exist.
2204     * @syscap SystemCapability.Multimedia.AVSession.Core
2205     * @since 10
2206     */
2207    /**
2208     * Register session custom command change callback
2209     * @param { 'commonCommand' } type - Registration Type 'commonCommand'
2210     * @param { function } callback - Used to handle event when the common command is received
2211     * The callback provide the command name and command args
2212     * @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
2213     * 2.Incorrect parameter types.
2214     * @throws { BusinessError } 6600101 - Session service exception.
2215     * @throws { BusinessError } 6600102 - The session does not exist.
2216     * @syscap SystemCapability.Multimedia.AVSession.Core
2217     * @atomicservice
2218     * @since 12
2219     */
2220    on(type: 'commonCommand', callback: (command: string, args: {[key: string]: Object}) => void): void;
2221
2222    /**
2223     * Unregister session custom command change callback
2224     * @param { 'commonCommand' } type - Registration Type 'commonCommand'
2225     * @param { function } callback - Used to cancel a specific listener
2226     * The callback provide the command name and command args
2227     * @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
2228     * 2.Incorrect parameter types.
2229     * @throws { BusinessError } 6600101 - Session service exception.
2230     * @throws { BusinessError } 6600102 - The session does not exist.
2231     * @syscap SystemCapability.Multimedia.AVSession.Core
2232     * @since 10
2233     */
2234    /**
2235     * Unregister session custom command change callback
2236     * @param { 'commonCommand' } type - Registration Type 'commonCommand'
2237     * @param { function } callback - Used to cancel a specific listener
2238     * The callback provide the command name and command args
2239     * @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
2240     * 2.Incorrect parameter types.
2241     * @throws { BusinessError } 6600101 - Session service exception.
2242     * @throws { BusinessError } 6600102 - The session does not exist.
2243     * @syscap SystemCapability.Multimedia.AVSession.Core
2244     * @atomicservice
2245     * @since 12
2246     */
2247    off(type: 'commonCommand', callback?: (command: string, args: {[key: string]: Object}) => void): void;
2248
2249    /**
2250     * Register the item to play from the playlist change callback
2251     * @param { 'skipToQueueItem' } type - Registration Type 'skipToQueueItem'
2252     * @param { function } callback - Used to handle the item to be played.
2253     * The callback provide the new device info {@link OutputDeviceInfo}
2254     * @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
2255     * 2.Incorrect parameter types.
2256     * @throws { BusinessError } 6600101 - Session service exception.
2257     * @throws { BusinessError } 6600102 - The session does not exist.
2258     * @syscap SystemCapability.Multimedia.AVSession.Core
2259     * @since 10
2260     */
2261    /**
2262     * Register the item to play from the playlist change callback
2263     * @param { 'skipToQueueItem' } type - Registration Type 'skipToQueueItem'
2264     * @param { function } callback - Used to handle the item to be played.
2265     * The callback provide the new device info {@link OutputDeviceInfo}
2266     * @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
2267     * 2.Incorrect parameter types.
2268     * @throws { BusinessError } 6600101 - Session service exception.
2269     * @throws { BusinessError } 6600102 - The session does not exist.
2270     * @syscap SystemCapability.Multimedia.AVSession.Core
2271     * @atomicservice
2272     * @since 12
2273     */
2274    on(type: 'skipToQueueItem', callback: (itemId: number) => void): void;
2275
2276    /**
2277     * Unregister the item to play from the playlist change callback
2278     * @param { 'skipToQueueItem' } type - Registration Type 'skipToQueueItem'
2279     * @param { function } callback - Used to handle the item to be played.
2280     * The callback provide the new device info {@link OutputDeviceInfo}
2281     * @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
2282     * 2.Incorrect parameter types.
2283     * @throws { BusinessError } 6600101 - Session service exception.
2284     * @throws { BusinessError } 6600102 - The session does not exist.
2285     * @syscap SystemCapability.Multimedia.AVSession.Core
2286     * @since 10
2287     */
2288    /**
2289     * Unregister the item to play from the playlist change callback
2290     * @param { 'skipToQueueItem' } type - Registration Type 'skipToQueueItem'
2291     * @param { function } callback - Used to handle the item to be played.
2292     * The callback provide the new device info {@link OutputDeviceInfo}
2293     * @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
2294     * 2.Incorrect parameter types.
2295     * @throws { BusinessError } 6600101 - Session service exception.
2296     * @throws { BusinessError } 6600102 - The session does not exist.
2297     * @syscap SystemCapability.Multimedia.AVSession.Core
2298     * @atomicservice
2299     * @since 12
2300     */
2301    off(type: 'skipToQueueItem', callback?: (itemId: number) => void): void;
2302
2303    /**
2304     * Register answer command callback.
2305     * As long as it is registered, it means that the ability supports this command.
2306     * If you cancel the callback, you need to call off {@link off}
2307     * @param { 'answer' } type - Command to register 'answer'.
2308     * @param { Callback<void> } callback - Used to handle ('answer') command
2309     * @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
2310     * 2.Incorrect parameter types.
2311     * @throws { BusinessError } 6600101 - Session service exception.
2312     * @throws { BusinessError } 6600102 - The session does not exist.
2313     * @syscap SystemCapability.Multimedia.AVSession.Core
2314     * @since 11
2315     */
2316    /**
2317     * Register answer command callback.
2318     * As long as it is registered, it means that the ability supports this command.
2319     * If you cancel the callback, you need to call off {@link off}
2320     * @param { 'answer' } type - Command to register 'answer'.
2321     * @param { Callback<void> } callback - Used to handle ('answer') command
2322     * @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
2323     * 2.Incorrect parameter types.
2324     * @throws { BusinessError } 6600101 - Session service exception.
2325     * @throws { BusinessError } 6600102 - The session does not exist.
2326     * @syscap SystemCapability.Multimedia.AVSession.Core
2327     * @atomicservice
2328     * @since 12
2329     */
2330    on(type: 'answer', callback: Callback<void>): void;
2331
2332    /**
2333     * Unregister answer command callback.
2334     * @param { 'answer' } type - Command to register 'answer'.
2335     * @param { Callback<void> } callback - Used to handle ('answer') command
2336     * @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
2337     * 2.Incorrect parameter types.
2338     * @throws { BusinessError } 6600101 - Session service exception.
2339     * @throws { BusinessError } 6600102 - The session does not exist.
2340     * @syscap SystemCapability.Multimedia.AVSession.Core
2341     * @since 11
2342     */
2343    /**
2344     * Unregister answer command callback.
2345     * @param { 'answer' } type - Command to register 'answer'.
2346     * @param { Callback<void> } callback - Used to handle ('answer') command
2347     * @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
2348     * 2.Incorrect parameter types.
2349     * @throws { BusinessError } 6600101 - Session service exception.
2350     * @throws { BusinessError } 6600102 - The session does not exist.
2351     * @syscap SystemCapability.Multimedia.AVSession.Core
2352     * @atomicservice
2353     * @since 12
2354     */
2355    off(type: 'answer', callback?: Callback<void>): void;
2356
2357    /**
2358     * Register hangUp command callback.
2359     * As long as it is registered, it means that the ability supports this command.
2360     * If you cancel the callback, you need to call off {@link off}
2361     * @param { 'hangUp' } type - Command to register 'hangUp'.
2362     * @param { Callback<void> } callback - Used to handle ('hangUp') command
2363     * @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
2364     * 2.Incorrect parameter types.
2365     * @throws { BusinessError } 6600101 - Session service exception.
2366     * @throws { BusinessError } 6600102 - The session does not exist.
2367     * @syscap SystemCapability.Multimedia.AVSession.Core
2368     * @since 11
2369     */
2370    /**
2371     * Register hangUp command callback.
2372     * As long as it is registered, it means that the ability supports this command.
2373     * If you cancel the callback, you need to call off {@link off}
2374     * @param { 'hangUp' } type - Command to register 'hangUp'.
2375     * @param { Callback<void> } callback - Used to handle ('hangUp') command
2376     * @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
2377     * 2.Incorrect parameter types.
2378     * @throws { BusinessError } 6600101 - Session service exception.
2379     * @throws { BusinessError } 6600102 - The session does not exist.
2380     * @syscap SystemCapability.Multimedia.AVSession.Core
2381     * @atomicservice
2382     * @since 12
2383     */
2384    on(type: 'hangUp', callback: Callback<void>): void;
2385
2386    /**
2387     * Unregister hangUp command callback.
2388     * @param { 'hangUp' } type - Command to register 'hangUp'.
2389     * @param { Callback<void> } callback - Used to handle ('hangUp') command
2390     * @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
2391     * 2.Incorrect parameter types.
2392     * @throws { BusinessError } 6600101 - Session service exception.
2393     * @throws { BusinessError } 6600102 - The session does not exist.
2394     * @syscap SystemCapability.Multimedia.AVSession.Core
2395     * @since 11
2396     */
2397    /**
2398     * Unregister hangUp command callback.
2399     * @param { 'hangUp' } type - Command to register 'hangUp'.
2400     * @param { Callback<void> } callback - Used to handle ('hangUp') command
2401     * @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
2402     * 2.Incorrect parameter types.
2403     * @throws { BusinessError } 6600101 - Session service exception.
2404     * @throws { BusinessError } 6600102 - The session does not exist.
2405     * @syscap SystemCapability.Multimedia.AVSession.Core
2406     * @atomicservice
2407     * @since 12
2408     */
2409    off(type: 'hangUp', callback?: Callback<void>): void;
2410
2411    /**
2412     * Register toggleCallMute command callback.
2413     * As long as it is registered, it means that the ability supports this command.
2414     * If you cancel the callback, you need to call off {@link off}
2415     * @param { 'toggleCallMute' } type - Command to register 'toggleCallMute'.
2416     * @param { Callback<void> } callback - Used to handle ('toggleCallMute') command
2417     * @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
2418     * 2.Incorrect parameter types.
2419     * @throws { BusinessError } 6600101 - Session service exception.
2420     * @throws { BusinessError } 6600102 - The session does not exist.
2421     * @syscap SystemCapability.Multimedia.AVSession.Core
2422     * @since 11
2423     */
2424    /**
2425     * Register toggleCallMute command callback.
2426     * As long as it is registered, it means that the ability supports this command.
2427     * If you cancel the callback, you need to call off {@link off}
2428     * @param { 'toggleCallMute' } type - Command to register 'toggleCallMute'.
2429     * @param { Callback<void> } callback - Used to handle ('toggleCallMute') command
2430     * @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
2431     * 2.Incorrect parameter types.
2432     * @throws { BusinessError } 6600101 - Session service exception.
2433     * @throws { BusinessError } 6600102 - The session does not exist.
2434     * @syscap SystemCapability.Multimedia.AVSession.Core
2435     * @atomicservice
2436     * @since 12
2437     */
2438    on(type: 'toggleCallMute', callback: Callback<void>): void;
2439
2440    /**
2441     * Unregister toggleCallMute command callback.
2442     * @param { 'toggleCallMute' } type - Command to register 'toggleCallMute'.
2443     * @param { Callback<void> } callback - Used to handle ('toggleCallMute') command
2444     * @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.2.Incorrect parameter types.
2445     * @throws { BusinessError } 6600101 - Session service exception.
2446     * @throws { BusinessError } 6600102 - The session does not exist.
2447     * @syscap SystemCapability.Multimedia.AVSession.Core
2448     * @since 11
2449     */
2450    /**
2451     * Unregister toggleCallMute command callback.
2452     * @param { 'toggleCallMute' } type - Command to register 'toggleCallMute'.
2453     * @param { Callback<void> } callback - Used to handle ('toggleCallMute') command
2454     * @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.2.Incorrect parameter types.
2455     * @throws { BusinessError } 6600101 - Session service exception.
2456     * @throws { BusinessError } 6600102 - The session does not exist.
2457     * @syscap SystemCapability.Multimedia.AVSession.Core
2458     * @atomicservice
2459     * @since 12
2460     */
2461    off(type: 'toggleCallMute', callback?: Callback<void>): void;
2462
2463    /**
2464     * Register listener for cast display information changed.
2465     * @param { 'castDisplayChange' } type - Type of the 'castDisplayChange' to listen for.
2466     * @param { Callback<CastDisplayInfo> } callback - Callback used to return cast display information.
2467     * @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
2468     * 2.Incorrect parameter types.
2469     * @throws { BusinessError } 6600101 - Session service exception
2470     * @throws { BusinessError } 6600102 - The session does not exist
2471     * @syscap SystemCapability.Multimedia.AVSession.ExtendedDisplayCast
2472     * @atomicservice
2473     * @since 12
2474     */
2475    on(type: 'castDisplayChange', callback: Callback<CastDisplayInfo>): void;
2476
2477    /**
2478     * Unregister listener for cast display information changed.
2479     * @param { 'castDisplayChange' } type - Type of the 'castDisplayChange' to listen for.
2480     * @param { Callback<CastDisplayInfo> } callback - Callback used to return cast display information.
2481     * @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
2482     * 2.Incorrect parameter types.
2483     * @throws { BusinessError } 6600101 - Session service exception
2484     * @throws { BusinessError } 6600102 - The session does not exist
2485     * @syscap SystemCapability.Multimedia.AVSession.ExtendedDisplayCast
2486     * @atomicservice
2487     * @since 12
2488     */
2489    off(type: 'castDisplayChange', callback?: Callback<CastDisplayInfo>): void;
2490
2491    /**
2492     * Stop current cast and disconnect device connection.
2493     * @param { AsyncCallback<void> } callback A callback instance used to return when cast stopped completed.
2494     * @throws { BusinessError } 6600109 - The remote connection is not established
2495     * @syscap SystemCapability.Multimedia.AVSession.AVCast
2496     * @since 10
2497     */
2498    stopCasting(callback: AsyncCallback<void>): void;
2499
2500    /**
2501     * Stop current cast and disconnect device connection.
2502     * @returns { Promise<void> } void result promise when executed successfully
2503     * @throws { BusinessError } 6600109 - The remote connection is not established
2504     * @syscap SystemCapability.Multimedia.AVSession.AVCast
2505     * @since 10
2506     */
2507    /**
2508     * Stop current cast and disconnect device connection.
2509     * @returns { Promise<void> } void result promise when executed successfully
2510     * @throws { BusinessError } 6600109 - The remote connection is not established
2511     * @syscap SystemCapability.Multimedia.AVSession.AVCast
2512     * @atomicservice
2513     * @since 12
2514     */
2515    stopCasting(): Promise<void>;
2516
2517    /**
2518     * Activate the session, indicating that the session can accept control commands
2519     * @param { AsyncCallback<void> } callback - The asyncCallback triggered when the session is activated.
2520     * @throws { BusinessError } 6600101 - Session service exception.
2521     * @throws { BusinessError } 6600102 - The session does not exist.
2522     * @syscap SystemCapability.Multimedia.AVSession.Core
2523     * @since 10
2524     */
2525    activate(callback: AsyncCallback<void>): void;
2526
2527    /**
2528     * Activate the session, indicating that the session can accept control commands
2529     * @returns { Promise<void> } void result promise when executed successfully
2530     * @throws { BusinessError } 6600101 - Session service exception.
2531     * @throws { BusinessError } 6600102 - The session does not exist.
2532     * @syscap SystemCapability.Multimedia.AVSession.Core
2533     * @since 10
2534     */
2535    /**
2536     * Activate the session, indicating that the session can accept control commands
2537     * @returns { Promise<void> } void result promise when executed successfully
2538     * @throws { BusinessError } 6600101 - Session service exception.
2539     * @throws { BusinessError } 6600102 - The session does not exist.
2540     * @syscap SystemCapability.Multimedia.AVSession.Core
2541     * @atomicservice
2542     * @since 12
2543     */
2544    activate(): Promise<void>;
2545
2546    /**
2547     * Deactivate the session, indicating that the session not ready to accept control commands
2548     * @param { AsyncCallback<void> } callback - The asyncCallback triggered when the session is deactivated.
2549     * @throws { BusinessError } 6600101 - Session service exception.
2550     * @throws { BusinessError } 6600102 - The session does not exist.
2551     * @syscap SystemCapability.Multimedia.AVSession.Core
2552     * @since 10
2553     */
2554    deactivate(callback: AsyncCallback<void>): void;
2555
2556    /**
2557     * Deactivate the session, indicating that the session not ready to accept control commands
2558     * @returns { Promise<void> } void promise when executed successfully
2559     * @throws { BusinessError } 6600101 - Session service exception.
2560     * @throws { BusinessError } 6600102 - The session does not exist.
2561     * @syscap SystemCapability.Multimedia.AVSession.Core
2562     * @since 10
2563     */
2564    /**
2565     * Deactivate the session, indicating that the session not ready to accept control commands
2566     * @returns { Promise<void> } void promise when executed successfully
2567     * @throws { BusinessError } 6600101 - Session service exception.
2568     * @throws { BusinessError } 6600102 - The session does not exist.
2569     * @syscap SystemCapability.Multimedia.AVSession.Core
2570     * @atomicservice
2571     * @since 12
2572     */
2573    deactivate(): Promise<void>;
2574
2575    /**
2576     * Destroy this session, the server will clean up the session resources
2577     * @param { AsyncCallback<void> } callback - The asyncCallback triggered when the command is executed successfully
2578     * @throws { BusinessError } 6600101 - Session service exception.
2579     * @throws { BusinessError } 6600102 - The session does not exist.
2580     * @syscap SystemCapability.Multimedia.AVSession.Core
2581     * @since 10
2582     */
2583    destroy(callback: AsyncCallback<void>): void;
2584
2585    /**
2586     * Destroy this session, the server will clean up the session resources
2587     * @returns { Promise<void> } void promise when executed successfully
2588     * @throws { BusinessError } 6600101 - Session service exception.
2589     * @throws { BusinessError } 6600102 - The session does not exist.
2590     * @syscap SystemCapability.Multimedia.AVSession.Core
2591     * @since 10
2592     */
2593    /**
2594     * Destroy this session, the server will clean up the session resources
2595     * @returns { Promise<void> } void promise when executed successfully
2596     * @throws { BusinessError } 6600101 - Session service exception.
2597     * @throws { BusinessError } 6600102 - The session does not exist.
2598     * @syscap SystemCapability.Multimedia.AVSession.Core
2599     * @atomicservice
2600     * @since 12
2601     */
2602    destroy(): Promise<void>;
2603  }
2604
2605  /**
2606   * The type of control command
2607   * @typedef { 'play' | 'pause' | 'stop' | 'playNext' | 'playPrevious' | 'fastForward' | 'rewind' | 'seek' |
2608   *     'setVolume' | 'setSpeed' | 'setLoopMode' | 'toggleFavorite' | 'toggleMute' } AVCastControlCommandType
2609   * @syscap SystemCapability.Multimedia.AVSession.AVCast
2610   * @since 10
2611   */
2612  /**
2613   * The type of control command
2614   * @typedef { 'play' | 'pause' | 'stop' | 'playNext' | 'playPrevious' | 'fastForward' | 'rewind' | 'seek' |
2615   *     'setVolume' | 'setSpeed' | 'setLoopMode' | 'toggleFavorite' | 'toggleMute' } AVCastControlCommandType
2616   * @syscap SystemCapability.Multimedia.AVSession.AVCast
2617   * @atomicservice
2618   * @since 12
2619   */
2620  type AVCastControlCommandType = 'play' | 'pause' | 'stop' | 'playNext' | 'playPrevious' | 'fastForward' | 'rewind' |
2621  'seek' | 'setVolume' | 'setSpeed' | 'setLoopMode' | 'toggleFavorite' | 'toggleMute';
2622
2623  /**
2624   * The definition of command to be sent to the session
2625   * @interface AVCastControlCommand
2626   * @syscap SystemCapability.Multimedia.AVSession.AVCast
2627   * @since 10
2628   */
2629  /**
2630   * The definition of command to be sent to the session
2631   * @interface AVCastControlCommand
2632   * @syscap SystemCapability.Multimedia.AVSession.AVCast
2633   * @atomicservice
2634   * @since 12
2635   */
2636  interface AVCastControlCommand {
2637    /**
2638     * The command value {@link AVCastControlCommandType}
2639     *
2640     * @syscap SystemCapability.Multimedia.AVSession.AVCast
2641     * @since 10
2642     */
2643    /**
2644     * The command value {@link AVCastControlCommandType}
2645     * @type { AVCastControlCommandType }
2646     * @syscap SystemCapability.Multimedia.AVSession.AVCast
2647     * @atomicservice
2648     * @since 12
2649     */
2650    command: AVCastControlCommandType;
2651
2652    /**
2653     * Parameter carried in the command.
2654     * The seek command must carry the number parameter.
2655     * The setVolume command must carry the number parameter.
2656     * The toggleFavorite command must carry the {@link AVMediaDescription.assetId} parameter.
2657     * The setSpeed command must carry the {@link #media.PlaybackSpeed} parameter.
2658     * The setLoopMode command must carry the {@link LoopMode} parameter.
2659     * Other commands do not need to carry parameters.
2660     * @type { ?(media.PlaybackSpeed | number | string | LoopMode) }
2661     * @syscap SystemCapability.Multimedia.AVSession.AVCast
2662     * @since 10
2663     */
2664    /**
2665     * Parameter carried in the command.
2666     * The seek command must carry the number parameter.
2667     * The setVolume command must carry the number parameter.
2668     * The toggleFavorite command must carry the {@link AVMediaDescription.assetId} parameter.
2669     * The setSpeed command must carry the {@link #media.PlaybackSpeed} parameter.
2670     * The setLoopMode command must carry the {@link LoopMode} parameter.
2671     * Other commands do not need to carry parameters.
2672     * @type { ?(media.PlaybackSpeed | number | string | LoopMode) }
2673     * @syscap SystemCapability.Multimedia.AVSession.AVCast
2674     * @atomicservice
2675     * @since 12
2676     */
2677    parameter?: media.PlaybackSpeed | number | string | LoopMode;
2678  }
2679
2680  /**
2681   * AVCastController definition used to implement a remote control when a cast is connected
2682   * @interface AVCastController
2683   * @syscap SystemCapability.Multimedia.AVSession.AVCast
2684   * @since 10
2685   */
2686  /**
2687   * AVCastController definition used to implement a remote control when a cast is connected
2688   * @interface AVCastController
2689   * @syscap SystemCapability.Multimedia.AVSession.AVCast
2690   * @atomicservice
2691   * @since 12
2692   */
2693  interface AVCastController {
2694    /**
2695     * Set a surface instance to display playing view, used at sink side.
2696     * @param { string } surfaceId - surface id, video player will use this id get a surface instance.
2697     * @param { AsyncCallback<void> } callback - A callback instance used to return when set surface completed.
2698     * @throws { BusinessError } 202 - Not System App.
2699     * @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
2700     * 2.Parameter verification failed.
2701     * @throws { BusinessError } 6600109 - The remote connection is not established
2702     * @syscap SystemCapability.Multimedia.AVSession.AVCast
2703     * @systemapi
2704     * @since 10
2705     */
2706    setDisplaySurface(surfaceId: string, callback: AsyncCallback<void>): void;
2707
2708    /**
2709     * Set a surface instance to display playing view, used at sink side.
2710     * @param { string } surfaceId - surface id, video player will use this id get a surface instance.
2711     * @returns { Promise<void> } Promise used to return the result.
2712     * @throws { BusinessError } 202 - Not System App.
2713     * @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
2714     * 2.Parameter verification failed.
2715     * @throws { BusinessError } 6600109 - The remote connection is not established
2716     * @syscap SystemCapability.Multimedia.AVSession.AVCast
2717     * @systemapi
2718     * @since 10
2719     */
2720    setDisplaySurface(surfaceId: string): Promise<void>;
2721
2722    /**
2723     * Get the playback status of the current player
2724     * @param { AsyncCallback<AVPlaybackState> } callback - The triggered asyncCallback when (getAVPlaybackState).
2725     * @throws { BusinessError } 6600101 - Session service exception
2726     * @syscap SystemCapability.Multimedia.AVSession.AVCast
2727     * @since 10
2728     */
2729    getAVPlaybackState(callback: AsyncCallback<AVPlaybackState>): void;
2730
2731    /**
2732     * Get the playback status of the current player
2733     * @returns { Promise<AVPlaybackState> } (AVPlaybackState) returned through promise
2734     * @throws { BusinessError } 6600101 - Session service exception
2735     * @syscap SystemCapability.Multimedia.AVSession.AVCast
2736     * @since 10
2737     */
2738    /**
2739     * Get the playback status of the current player
2740     * @returns { Promise<AVPlaybackState> } (AVPlaybackState) returned through promise
2741     * @throws { BusinessError } 6600101 - Session service exception
2742     * @syscap SystemCapability.Multimedia.AVSession.AVCast
2743     * @atomicservice
2744     * @since 12
2745     */
2746    getAVPlaybackState(): Promise<AVPlaybackState>;
2747
2748    /**
2749     * Send control commands to remote player
2750     * @param { AVCastControlCommand } command The command to be send.
2751     * @param { AsyncCallback<void> } callback - The asyncCallback triggered when the command is executed successfully
2752     * @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
2753     * 2.Parameter verification failed.
2754     * @throws { BusinessError } 6600101 - Session service exception
2755     * @throws { BusinessError } 6600105 - Invalid session command
2756     * @throws { BusinessError } 6600109 - The remote connection is not established
2757     * @syscap SystemCapability.Multimedia.AVSession.AVCast
2758     * @since 10
2759     */
2760    sendControlCommand(command: AVCastControlCommand, callback: AsyncCallback<void>): void;
2761
2762    /**
2763     * Send control commands to remote player
2764     * @param { AVCastControlCommand } command The command to be send.
2765     * @returns { Promise<void> } Promise used to return the result.
2766     * @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
2767     * 2.Parameter verification failed.
2768     * @throws { BusinessError } 6600101 - Session service exception
2769     * @throws { BusinessError } 6600105 - Invalid session command
2770     * @throws { BusinessError } 6600109 - The remote connection is not established
2771     * @syscap SystemCapability.Multimedia.AVSession.AVCast
2772     * @since 10
2773     */
2774     /**
2775     * Send control commands to remote player
2776     * @param { AVCastControlCommand } command The command to be send.
2777     * @returns { Promise<void> } Promise used to return the result.
2778     * @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
2779     * 2.Parameter verification failed.
2780     * @throws { BusinessError } 6600101 - Session service exception
2781     * @throws { BusinessError } 6600105 - Invalid session command
2782     * @throws { BusinessError } 6600109 - The remote connection is not established
2783     * @syscap SystemCapability.Multimedia.AVSession.AVCast
2784     * @atomicservice
2785     * @since 12
2786     */
2787    sendControlCommand(command: AVCastControlCommand): Promise<void>;
2788
2789    /**
2790     * Play the current item, should contain mediaUri otherwise the playback will fail.
2791     * @param { AVQueueItem } item media item info.
2792     * @param { AsyncCallback<void> } callback - The asyncCallback triggered when the command is executed successfully
2793     * @throws {BusinessError} 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
2794     * 2.Parameter verification failed.
2795     * @throws {BusinessError} 6600101 - Session service exception
2796     * @throws {BusinessError} 6600109 - The remote connection is not established
2797     * @syscap SystemCapability.Multimedia.AVSession.AVCast
2798     * @since 10
2799     */
2800    start(item: AVQueueItem, callback: AsyncCallback<void>): void;
2801
2802    /**
2803     * Play the current item, should contain mediaUri otherwise the playback will fail.
2804     * @param { AVQueueItem } item media item info.
2805     * @returns { Promise<void> } Promise used to return the result.
2806     * @throws {BusinessError} 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
2807     * 2.Parameter verification failed.
2808     * @throws {BusinessError} 6600101 - Session service exception
2809     * @throws {BusinessError} 6600109 - The remote connection is not established
2810     * @syscap SystemCapability.Multimedia.AVSession.AVCast
2811     * @since 10
2812     */
2813    /**
2814     * Play the current item, should contain mediaUri otherwise the playback will fail.
2815     * @param { AVQueueItem } item media item info.
2816     * @returns { Promise<void> } Promise used to return the result.
2817     * @throws {BusinessError} 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
2818     * 2.Parameter verification failed.
2819     * @throws {BusinessError} 6600101 - Session service exception
2820     * @throws {BusinessError} 6600109 - The remote connection is not established
2821     * @syscap SystemCapability.Multimedia.AVSession.AVCast
2822     * @atomicservice
2823     * @since 12
2824     */
2825    start(item: AVQueueItem): Promise<void>;
2826
2827    /**
2828     * Load the current item and mediaUri can be null, this is needed for sink media information displaying
2829     * @param { AVQueueItem } item media item info.
2830     * @param { AsyncCallback<void> } callback - The asyncCallback triggered when the command is executed successfully
2831     * @throws {BusinessError} 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
2832     * 2.Parameter verification failed.
2833     * @throws {BusinessError} 6600101 - Session service exception
2834     * @throws {BusinessError} 6600109 - The remote connection is not established
2835     * @syscap SystemCapability.Multimedia.AVSession.AVCast
2836     * @since 10
2837     */
2838    prepare(item: AVQueueItem, callback: AsyncCallback<void>): void;
2839
2840    /**
2841     * Load the current item and mediaUri can be null, this is needed for sink media information displaying
2842     * @param { AVQueueItem } item media item info.
2843     * @returns { Promise<void> } Promise used to return the result.
2844     * @throws {BusinessError} 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
2845     * 2.Parameter verification failed.
2846     * @throws {BusinessError} 6600101 - Session service exception
2847     * @throws {BusinessError} 6600109 - The remote connection is not established
2848     * @syscap SystemCapability.Multimedia.AVSession.AVCast
2849     * @since 10
2850     */
2851    /**
2852     * Load the current item and mediaUri can be null, this is needed for sink media information displaying
2853     * @param { AVQueueItem } item media item info.
2854     * @returns { Promise<void> } Promise used to return the result.
2855     * @throws {BusinessError} 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
2856     * 2.Parameter verification failed.
2857     * @throws {BusinessError} 6600101 - Session service exception
2858     * @throws {BusinessError} 6600109 - The remote connection is not established
2859     * @syscap SystemCapability.Multimedia.AVSession.AVCast
2860     * @atomicservice
2861     * @since 12
2862     */
2863    prepare(item: AVQueueItem): Promise<void>;
2864
2865    /**
2866     * Get the current playing item
2867     * @param { AsyncCallback<AVQueueItem> } callback - The triggered asyncCallback.
2868     * @throws { BusinessError } 6600101 - Session service exception
2869     * @syscap SystemCapability.Multimedia.AVSession.AVCast
2870     * @since 10
2871     */
2872    getCurrentItem(callback: AsyncCallback<AVQueueItem>): void;
2873
2874    /**
2875     * Get the current playing item
2876     * @returns { Promise<AVQueueItem> } (AVQueueItem) returned through promise
2877     * @throws { BusinessError } 6600101 - Session service exception
2878     * @syscap SystemCapability.Multimedia.AVSession.AVCast
2879     * @since 10
2880     */
2881    /**
2882     * Get the current playing item
2883     * @returns { Promise<AVQueueItem> } (AVQueueItem) returned through promise
2884     * @throws { BusinessError } 6600101 - Session service exception
2885     * @syscap SystemCapability.Multimedia.AVSession.AVCast
2886     * @atomicservice
2887     * @since 12
2888     */
2889    getCurrentItem(): Promise<AVQueueItem>;
2890
2891    /**
2892     * Get commands supported by the current cast controller
2893     * @param { AsyncCallback<Array<AVCastControlCommandType>> } callback - The triggered asyncCallback when (getValidCommands).
2894     * @throws { BusinessError } 6600101 - Session service exception.
2895     * @syscap SystemCapability.Multimedia.AVSession.AVCast
2896     * @since 11
2897     */
2898    getValidCommands(callback: AsyncCallback<Array<AVCastControlCommandType>>): void;
2899
2900    /**
2901     * Get commands supported by the current cast controller
2902     * @returns { Promise<Array<AVCastControlCommandType>> } array of AVCastControlCommandType promise
2903     * @throws { BusinessError } 6600101 - Session service exception.
2904     * @syscap SystemCapability.Multimedia.AVSession.AVCast
2905     * @since 11
2906     */
2907    getValidCommands(): Promise<Array<AVCastControlCommandType>>;
2908
2909    /**
2910     * Process the response corresponding to the media key request obtained by the application.
2911     * @param { string } assetId - The assetId of resource which provides the response.
2912     * @param { Uint8Array } response - Response corresponding to the request.
2913     * @returns { Promise<void> } void promise when executed successfully
2914     * @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
2915     * 2.Parameter verification failed.
2916     * @throws { BusinessError } 6600101 - Session service exception
2917     * @syscap SystemCapability.Multimedia.AVSession.AVCast
2918     * @atomicservice
2919     * @since 12
2920     */
2921    processMediaKeyResponse(assetId: string, response: Uint8Array): Promise<void>;
2922
2923    /**
2924     * Destroy the controller
2925     * @param { AsyncCallback<void> } callback - The asyncCallback triggered when the command is executed successfully.
2926     * @throws { BusinessError } 6600101 - Session service exception.
2927     * @syscap SystemCapability.Multimedia.AVSession.AVCast
2928     * @since 11
2929     */
2930    release(callback: AsyncCallback<void>): void;
2931
2932    /**
2933     * Destroy the controller
2934     * @returns { Promise<void> } void promise when executed successfully
2935     * @throws { BusinessError } 6600101 - Session service exception.
2936     * @syscap SystemCapability.Multimedia.AVSession.AVCast
2937     * @since 11
2938     */
2939    /**
2940     * Destroy the controller
2941     * @returns { Promise<void> } void promise when executed successfully
2942     * @throws { BusinessError } 6600101 - Session service exception.
2943     * @syscap SystemCapability.Multimedia.AVSession.AVCast
2944     * @atomicservice
2945     * @since 12
2946     */
2947    release(): Promise<void>;
2948
2949    /**
2950     * Register playback state changed callback
2951     * @param { 'playbackStateChange' } type
2952     * @param { Array<keyof AVPlaybackState> | 'all' } filter - The properties of {@link AVPlaybackState} that you cared about
2953     * @param { function } callback - The callback used to handle playback state changed event.
2954     * The callback function provides the {@link AVPlaybackState} parameter.
2955     * @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
2956     * 2.Incorrect parameter types.
2957     * @throws { BusinessError } 6600101 - Session service exception
2958     * @syscap SystemCapability.Multimedia.AVSession.AVCast
2959     * @since 10
2960     */
2961    /**
2962     * Register playback state changed callback
2963     * @param { 'playbackStateChange' } type
2964     * @param { Array<keyof AVPlaybackState> | 'all' } filter - The properties of {@link AVPlaybackState} that you cared about
2965     * @param { function } callback - The callback used to handle playback state changed event.
2966     * The callback function provides the {@link AVPlaybackState} parameter.
2967     * @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
2968     * 2.Incorrect parameter types.
2969     * @throws { BusinessError } 6600101 - Session service exception
2970     * @syscap SystemCapability.Multimedia.AVSession.AVCast
2971     * @atomicservice
2972     * @since 12
2973     */
2974    on(type: 'playbackStateChange', filter: Array<keyof AVPlaybackState> | 'all', callback: (state: AVPlaybackState) => void): void;
2975
2976    /**
2977     * Unregister playback state changed callback
2978     * @param { 'playbackStateChange' } type
2979     * @param { function } callback - The callback used to handle playback state changed event.
2980     * The callback function provides the {@link AVPlaybackState} parameter.
2981     * @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
2982     * 2.Incorrect parameter types.
2983     * @throws { BusinessError } 6600101 - Session service exception
2984     * @syscap SystemCapability.Multimedia.AVSession.AVCast
2985     * @since 10
2986     */
2987    /**
2988     * Unregister playback state changed callback
2989     * @param { 'playbackStateChange' } type
2990     * @param { function } callback - The callback used to handle playback state changed event.
2991     * The callback function provides the {@link AVPlaybackState} parameter.
2992     * @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
2993     * 2.Incorrect parameter types.
2994     * @throws { BusinessError } 6600101 - Session service exception
2995     * @syscap SystemCapability.Multimedia.AVSession.AVCast
2996     * @atomicservice
2997     * @since 12
2998     */
2999    off(type: 'playbackStateChange', callback?: (state: AVPlaybackState) => void): void;
3000
3001    /**
3002     * Register listener for current media item playback events.
3003     * @param { 'mediaItemChange' } type Type of the playback event to listen for.
3004     * @param { Callback<AVQueueItem> } callback Callback used to listen for current item changed.
3005     * @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
3006     * 2.Incorrect parameter types.
3007     * @throws { BusinessError } 6600101 - Session service exception
3008     * @syscap SystemCapability.Multimedia.AVSession.AVCast
3009     * @since 10
3010     */
3011    /**
3012     * Register listener for current media item playback events.
3013     * @param { 'mediaItemChange' } type Type of the playback event to listen for.
3014     * @param { Callback<AVQueueItem> } callback Callback used to listen for current item changed.
3015     * @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
3016     * 2.Incorrect parameter types.
3017     * @throws { BusinessError } 6600101 - Session service exception
3018     * @syscap SystemCapability.Multimedia.AVSession.AVCast
3019     * @atomicservice
3020     * @since 12
3021     */
3022    on(type: 'mediaItemChange', callback: Callback<AVQueueItem>): void;
3023
3024    /**
3025     * Unregister listener for current media item playback events.
3026     * @param { 'mediaItemChange' } type Type of the playback event to listen for.
3027     * @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
3028     * 2.Incorrect parameter types.
3029     * @throws { BusinessError } 6600101 - Session service exception
3030     * @syscap SystemCapability.Multimedia.AVSession.AVCast
3031     * @since 10
3032     */
3033    /**
3034     * Unregister listener for current media item playback events.
3035     * @param { 'mediaItemChange' } type Type of the playback event to listen for.
3036     * @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
3037     * 2.Incorrect parameter types.
3038     * @throws { BusinessError } 6600101 - Session service exception
3039     * @syscap SystemCapability.Multimedia.AVSession.AVCast
3040     * @atomicservice
3041     * @since 12
3042     */
3043    off(type: 'mediaItemChange'): void;
3044
3045    /**
3046     * Register playback command callback sent by remote side or media center.
3047     * Application needs update the new media resource when receive these commands by using playItem.
3048     * @param { 'playNext' } type - Type of the 'playNext' event to listen for.
3049     * @param { Callback<void> } callback - Used to handle 'playNext' command
3050     * @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
3051     * 2.Incorrect parameter types.
3052     * @throws { BusinessError } 6600101 - Session service exception
3053     * @syscap SystemCapability.Multimedia.AVSession.AVCast
3054     * @since 10
3055     */
3056    /**
3057     * Register playback command callback sent by remote side or media center.
3058     * Application needs update the new media resource when receive these commands by using playItem.
3059     * @param { 'playNext' } type - Type of the 'playNext' event to listen for.
3060     * @param { Callback<void> } callback - Used to handle 'playNext' command
3061     * @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
3062     * 2.Incorrect parameter types.
3063     * @throws { BusinessError } 6600101 - Session service exception
3064     * @syscap SystemCapability.Multimedia.AVSession.AVCast
3065     * @atomicservice
3066     * @since 12
3067     */
3068    on(type: 'playNext', callback: Callback<void>): void;
3069
3070    /**
3071     * Unregister playback command callback sent by remote side or media center.
3072     * When canceling the callback, need to update the supported commands list.
3073     * @param { 'playNext' } type - Type of the 'playNext' event to listen for.
3074     * @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
3075     * 2.Incorrect parameter types.
3076     * @throws { BusinessError } 6600101 - Session service exception
3077     * @syscap SystemCapability.Multimedia.AVSession.AVCast
3078     * @since 10
3079     */
3080    /**
3081     * Unregister playback command callback sent by remote side or media center.
3082     * When canceling the callback, need to update the supported commands list.
3083     * @param { 'playNext' } type - Type of the 'playNext' event to listen for.
3084     * @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
3085     * 2.Incorrect parameter types.
3086     * @throws { BusinessError } 6600101 - Session service exception
3087     * @syscap SystemCapability.Multimedia.AVSession.AVCast
3088     * @atomicservice
3089     * @since 12
3090     */
3091    off(type: 'playNext'): void;
3092
3093    /**
3094     * Register playback command callback sent by remote side or media center.
3095     * Application needs update the new media resource when receive these commands by using playItem.
3096     * @param { 'playPrevious' } type - Type of the 'playPrevious' to listen for.
3097     * @param { Callback<void> } callback - Used to handle 'playPrevious' command
3098     * @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
3099     * 2.Incorrect parameter types.
3100     * @throws { BusinessError } 6600101 - Session service exception
3101     * @syscap SystemCapability.Multimedia.AVSession.AVCast
3102     * @since 10
3103     */
3104    /**
3105     * Register playback command callback sent by remote side or media center.
3106     * Application needs update the new media resource when receive these commands by using playItem.
3107     * @param { 'playPrevious' } type - Type of the 'playPrevious' to listen for.
3108     * @param { Callback<void> } callback - Used to handle 'playPrevious' command
3109     * @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
3110     * 2.Incorrect parameter types.
3111     * @throws { BusinessError } 6600101 - Session service exception
3112     * @syscap SystemCapability.Multimedia.AVSession.AVCast
3113     * @atomicservice
3114     * @since 12
3115     */
3116    on(type: 'playPrevious', callback: Callback<void>): void;
3117
3118    /**
3119     * Unregister playback command callback sent by remote side or media center.
3120     * When canceling the callback, need to update the supported commands list.
3121     * @param { 'playPrevious' } type - Type of the 'playPrevious' to listen for.
3122     * @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
3123     * 2.Incorrect parameter types.
3124     * @throws { BusinessError } 6600101 - Session service exception
3125     * @syscap SystemCapability.Multimedia.AVSession.AVCast
3126     * @since 10
3127     */
3128    /**
3129     * Unregister playback command callback sent by remote side or media center.
3130     * When canceling the callback, need to update the supported commands list.
3131     * @param { 'playPrevious' } type - Type of the 'playPrevious' to listen for.
3132     * @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
3133     * 2.Incorrect parameter types.
3134     * @throws { BusinessError } 6600101 - Session service exception
3135     * @syscap SystemCapability.Multimedia.AVSession.AVCast
3136     * @atomicservice
3137     * @since 12
3138     */
3139    off(type: 'playPrevious'): void;
3140
3141    /**
3142     * Register requested playback command callback sent by remote side or media center.
3143     * The AVQueueItem may include the requested assetId, starting position and other configurations.
3144     * @param { 'requestPlay' } type - Type of the 'requestPlay' to listen for.
3145     * @param { Callback<AVQueueItem> } callback - Used to handle 'requestPlay' command
3146     * @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
3147     * 2.Incorrect parameter types.
3148     * @throws { BusinessError } 6600101 - Session service exception
3149     * @syscap SystemCapability.Multimedia.AVSession.AVCast
3150     * @since 11
3151     */
3152    on(type: 'requestPlay', callback: Callback<AVQueueItem>): void;
3153
3154    /**
3155     * Unregister requested playback command callback sent by remote side or media center.
3156     * @param { 'requestPlay' } type - Type of the 'requestPlay' to listen for.
3157     * @param { Callback<AVQueueItem> } callback - Used to handle 'requestPlay' command
3158     * @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
3159     * 2.Incorrect parameter types.
3160     * @throws { BusinessError } 6600101 - Session service exception
3161     * @syscap SystemCapability.Multimedia.AVSession.AVCast
3162     * @since 11
3163     */
3164    off(type: 'requestPlay', callback?: Callback<AVQueueItem>): void;
3165
3166    /**
3167     * Register endOfStream state callback.
3168     * Application needs update the new media resource when receive these commands by using playItem.
3169     * @param { 'endOfStream' } type - Type of the 'endOfStream' to listen for.
3170     * @param { Callback<void> } callback - Used to handle 'endOfStream' command
3171     * @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
3172     * 2.Incorrect parameter types.
3173     * @throws { BusinessError } 6600101 - Session service exception
3174     * @syscap SystemCapability.Multimedia.AVSession.AVCast
3175     * @since 11
3176     */
3177    on(type: 'endOfStream', callback: Callback<void>): void;
3178
3179    /**
3180     * Unregister endOfStream state callback.
3181     * @param { 'endOfStream' } type - Type of the 'endOfStream' to listen for.
3182     * @param { Callback<void> } callback - Used to handle 'endOfStream' command
3183     * @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
3184     * 2.Incorrect parameter types.
3185     * @throws { BusinessError } 6600101 - Session service exception
3186     * @syscap SystemCapability.Multimedia.AVSession.AVCast
3187     * @since 11
3188     */
3189    off(type: 'endOfStream', callback?: Callback<void>): void;
3190
3191    /**
3192     * Register listens for playback events.
3193     * @param { 'seekDone' } type - Type of the 'seekDone' to listen for.
3194     * @param { Callback<number> } callback - Callback used to listen for the playback seekDone event.
3195     * @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
3196     * 2.Incorrect parameter types.
3197     * @throws { BusinessError } 6600101 - Session service exception
3198     * @syscap SystemCapability.Multimedia.AVSession.AVCast
3199     * @since 10
3200     */
3201    /**
3202     * Register listens for playback events.
3203     * @param { 'seekDone' } type - Type of the 'seekDone' to listen for.
3204     * @param { Callback<number> } callback - Callback used to listen for the playback seekDone event.
3205     * @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
3206     * 2.Incorrect parameter types.
3207     * @throws { BusinessError } 6600101 - Session service exception
3208     * @syscap SystemCapability.Multimedia.AVSession.AVCast
3209     * @atomicservice
3210     * @since 12
3211     */
3212    on(type: 'seekDone', callback: Callback<number>): void;
3213
3214    /**
3215     * Unregister listens for playback events.
3216     * @param { 'seekDone' } type - Type of the 'seekDone' to listen for.
3217     * @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
3218     * 2.Incorrect parameter types.
3219     * @throws { BusinessError } 6600101 - Session service exception
3220     * @syscap SystemCapability.Multimedia.AVSession.AVCast
3221     * @since 10
3222     */
3223    /**
3224     * Unregister listens for playback events.
3225     * @param { 'seekDone' } type - Type of the 'seekDone' to listen for.
3226     * @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
3227     * 2.Incorrect parameter types.
3228     * @throws { BusinessError } 6600101 - Session service exception
3229     * @syscap SystemCapability.Multimedia.AVSession.AVCast
3230     * @atomicservice
3231     * @since 12
3232     */
3233    off(type: 'seekDone'): void;
3234
3235    /**
3236     * Register the valid commands of the casted session changed callback
3237     * @param { 'validCommandChange' } type - 'validCommandChange'
3238     * @param { Callback<Array<AVCastControlCommandType>> } callback - The callback used to handle the changes.
3239     * The callback function provides an array of AVCastControlCommandType.
3240     * @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
3241     * 2.Incorrect parameter types.
3242     * @throws { BusinessError } 6600101 - Session service exception.
3243     * @throws { BusinessError } 6600103 - The session controller does not exist.
3244     * @syscap SystemCapability.Multimedia.AVSession.AVCast
3245     * @since 11
3246     */
3247    on(type: 'validCommandChange', callback: Callback<Array<AVCastControlCommandType>>);
3248
3249    /**
3250     * Unregister the valid commands of the casted session changed callback
3251     * @param { 'validCommandChange' } type - 'validCommandChange'
3252     * @param { Callback<Array<AVCastControlCommandType>> } callback - The callback used to handle the changes.
3253     * The callback function provides an array of AVCastControlCommandType.
3254     * @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
3255     * 2.Incorrect parameter types.
3256     * @throws { BusinessError } 6600101 - Session service exception.
3257     * @throws { BusinessError } 6600103 - The session controller does not exist.
3258     * @syscap SystemCapability.Multimedia.AVSession.AVCast
3259     * @since 11
3260     */
3261    off(type: 'validCommandChange', callback?: Callback<Array<AVCastControlCommandType>>);
3262
3263    /**
3264     * Register listener for video size change event, used at remote side.
3265     * @param { 'videoSizeChange' } type - Type of the 'videoSizeChange' to listen for.
3266     * @param { function } callback - Callback used to return video size.
3267     * @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
3268     * 2.Incorrect parameter types.
3269     * @throws { BusinessError } 6600101 - Session service exception
3270     * @syscap SystemCapability.Multimedia.AVSession.AVCast
3271     * @since 12
3272     */
3273    on(type: 'videoSizeChange', callback: (width: number, height: number) => void): void;
3274
3275    /**
3276     * Unregister listener for video size change event, used at remote side.
3277     * @param { 'videoSizeChange' } type - Type of the 'videoSizeChange' to listen for.
3278     * @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
3279     * 2.Incorrect parameter types.
3280     * @throws { BusinessError } 6600101 - Session service exception
3281     * @syscap SystemCapability.Multimedia.AVSession.AVCast
3282     * @since 12
3283     */
3284    off(type: 'videoSizeChange'): void;
3285
3286    /**
3287     * Register listeners for playback error events.
3288     * @param { 'error' } type Type of the 'error' to listen for.
3289     * @param { ErrorCallback } callback Callback used to listen for the playback error event.
3290     * @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
3291     * 2.Incorrect parameter types.
3292     * @throws { BusinessError } 5400101 - No memory.
3293     * @throws { BusinessError } 5400102 - Operation not allowed.
3294     * @throws { BusinessError } 5400103 - I/O error.
3295     * @throws { BusinessError } 5400104 - Time out.
3296     * @throws { BusinessError } 5400105 - Service died.
3297     * @throws { BusinessError } 5400106 - Unsupport format.
3298     * @throws { BusinessError } 6600101 - Session service exception
3299     * @syscap SystemCapability.Multimedia.AVSession.AVCast
3300     * @since 10
3301     */
3302    /**
3303     * Register listeners for playback error events.
3304     * @param { 'error' } type Type of the 'error' to listen for.
3305     * @param { ErrorCallback } callback Callback used to listen for the playback error event.
3306     * @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
3307     * 2.Incorrect parameter types.
3308     * @throws { BusinessError } 5400101 - No memory.
3309     * @throws { BusinessError } 5400102 - Operation not allowed.
3310     * @throws { BusinessError } 5400103 - I/O error.
3311     * @throws { BusinessError } 5400104 - Time out.
3312     * @throws { BusinessError } 5400105 - Service died.
3313     * @throws { BusinessError } 5400106 - Unsupport format.
3314     * @throws { BusinessError } 6600101 - Session service exception
3315     * @syscap SystemCapability.Multimedia.AVSession.AVCast
3316     * @atomicservice
3317     * @since 12
3318     */
3319    on(type: 'error', callback: ErrorCallback): void;
3320
3321    /**
3322     * Unregister listens for playback error events.
3323     * @param { 'error' } type Type of the 'error' to listen for.
3324     * @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
3325     * 2.Incorrect parameter types.
3326     * @throws { BusinessError } 5400101 - No memory.
3327     * @throws { BusinessError } 5400102 - Operation not allowed.
3328     * @throws { BusinessError } 5400103 - I/O error.
3329     * @throws { BusinessError } 5400104 - Time out.
3330     * @throws { BusinessError } 5400105 - Service died.
3331     * @throws { BusinessError } 5400106 - Unsupport format.
3332     * @throws { BusinessError } 6600101 - Session service exception
3333     * @syscap SystemCapability.Multimedia.AVSession.AVCast
3334     * @since 10
3335     */
3336    /**
3337     * Unregister listens for playback error events.
3338     * @param { 'error' } type Type of the 'error' to listen for.
3339     * @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
3340     * 2.Incorrect parameter types.
3341     * @throws { BusinessError } 5400101 - No memory.
3342     * @throws { BusinessError } 5400102 - Operation not allowed.
3343     * @throws { BusinessError } 5400103 - I/O error.
3344     * @throws { BusinessError } 5400104 - Time out.
3345     * @throws { BusinessError } 5400105 - Service died.
3346     * @throws { BusinessError } 5400106 - Unsupport format.
3347     * @throws { BusinessError } 6600101 - Session service exception
3348     * @syscap SystemCapability.Multimedia.AVSession.AVCast
3349     * @atomicservice
3350     * @since 12
3351     */
3352    off(type: 'error'): void;
3353
3354    /**
3355     * Register listeners for cast control generic error events.
3356     * @param { 'castControlGenericError' } type Type of the 'castControlGenericError' to listen for.
3357     * @param { ErrorCallback } callback Callback used to listen for the cast control error event.
3358     * @throws { BusinessError } 401 - Parameter check failed. 1. Mandatory parameters are left unspecified.
3359     * 2. Incorrect parameter types.
3360     * @throws { BusinessError } 6611000 - The error code for cast control is unspecified.
3361     * @throws { BusinessError } 6611001 - An unspecified error occurs in the remote player.
3362     * @throws { BusinessError } 6611002 - The playback position falls behind the live window.
3363     * @throws { BusinessError } 6611003 - The process of cast control times out.
3364     * @throws { BusinessError } 6611004 - The runtime check failed.
3365     * @throws { BusinessError } 6611100 - Cross-device data transmission is locked.
3366     * @throws { BusinessError } 6611101 - The specified seek mode is not supported.
3367     * @throws { BusinessError } 6611102 - The position to seek to is out of the range of the media asset
3368     * or the specified seek mode is not supported.
3369     * @throws { BusinessError } 6611103 - The specified playback mode is not supported.
3370     * @throws { BusinessError } 6611104 - The specified playback speed is not supported.
3371     * @throws { BusinessError } 6611105 - The action failed because either the media source device or the media sink device has been revoked.
3372     * @throws { BusinessError } 6611106 - The parameter is invalid, for example, the url is illegal to play.
3373     * @throws { BusinessError } 6611107 - Allocation of memory failed.
3374     * @throws { BusinessError } 6611108 - Operation is not allowed.
3375     * @syscap SystemCapability.Multimedia.AVSession.AVCast
3376     * @atomicservice
3377     * @since 13
3378     */
3379    on(type: 'castControlGenericError', callback: ErrorCallback): void;
3380
3381    /**
3382     * Unregister listeners for cast control generic error events.
3383     * @param { 'castControlGenericError' } type Type of the 'castControlGenericError' to listen for.
3384     * @param { ErrorCallback } callback Callback used to listen for the cast control error event.
3385     * @throws { BusinessError } 401 - Parameter check failed. 1. Mandatory parameters are left unspecified.
3386     * 2. Incorrect parameter types.
3387     * @syscap SystemCapability.Multimedia.AVSession.AVCast
3388     * @atomicservice
3389     * @since 13
3390     */
3391    off(type: 'castControlGenericError', callback?: ErrorCallback): void;
3392
3393    /**
3394     * Register listeners for cast control input/output error events.
3395     * @param { 'castControlIoError' } type Type of the 'castControlIoError' to listen for.
3396     * @param { ErrorCallback } callback Callback used to listen for the cast control error event.
3397     * @throws { BusinessError } 401 - Parameter check failed. 1. Mandatory parameters are left unspecified.
3398     * 2. Incorrect parameter types.
3399     * @throws { BusinessError } 6612000 - An unspecified input/output error occurs.
3400     * @throws { BusinessError } 6612001 - Network connection failure.
3401     * @throws { BusinessError } 6612002 - Network timeout.
3402     * @throws { BusinessError } 6612003 - Invalid "Content-Type" HTTP header.
3403     * @throws { BusinessError } 6612004 - The HTTP server returns an unexpected HTTP response status code.
3404     * @throws { BusinessError } 6612005 - The file does not exist.
3405     * @throws { BusinessError } 6612006 - No permission is granted to perform the IO operation.
3406     * @throws { BusinessError } 6612007 - Access to cleartext HTTP traffic is not allowed by the app's network security configuration.
3407     * @throws { BusinessError } 6612008 - Reading data out of the data bound.
3408     * @throws { BusinessError } 6612100 - The media does not contain any contents that can be played.
3409     * @throws { BusinessError } 6612101 - The media cannot be read, for example, because of dust or scratches.
3410     * @throws { BusinessError } 6612102 - This resource is already in use.
3411     * @throws { BusinessError } 6612103 - The content using the validity interval has expired.
3412     * @throws { BusinessError } 6612104 - Using the requested content to play is not allowed.
3413     * @throws { BusinessError } 6612105 - The use of the allowed content cannot be verified.
3414     * @throws { BusinessError } 6612106 - The number of times this content has been used as requested has reached the maximum allowed number of uses.
3415     * @throws { BusinessError } 6612107 - An error occurs when sending packet from source device to sink device.
3416     * @syscap SystemCapability.Multimedia.AVSession.AVCast
3417     * @atomicservice
3418     * @since 13
3419     */
3420    on(type: 'castControlIoError', callback: ErrorCallback): void;
3421
3422    /**
3423     * Unregister listeners for cast control input/output error events.
3424     * @param { 'castControlIoError' } type Type of the 'castControlIoError' to listen for.
3425     * @param { ErrorCallback } callback Callback used to listen for the cast control error event.
3426     * @throws { BusinessError } 401 - Parameter check failed. 1. Mandatory parameters are left unspecified.
3427     * 2. Incorrect parameter types.
3428     * @syscap SystemCapability.Multimedia.AVSession.AVCast
3429     * @atomicservice
3430     * @since 13
3431     */
3432    off(type: 'castControlIoError', callback?: ErrorCallback): void;
3433
3434    /**
3435     * Register listeners for cast control parsing error events.
3436     * @param { 'castControlParsingError' } type Type of the 'castControlParsingError' to listen for.
3437     * @param { ErrorCallback } callback Callback used to listen for the cast control error event.
3438     * @throws { BusinessError } 401 - Parameter check failed. 1. Mandatory parameters are left unspecified.
3439     * 2. Incorrect parameter types.
3440     * @throws { BusinessError } 6613000 - Unspecified error related to content parsing.
3441     * @throws { BusinessError } 6613001 - Parsing error associated with media container format bit streams.
3442     * @throws { BusinessError } 6613002 - Parsing error associated with the media manifest.
3443     * @throws { BusinessError } 6613003 - An error occurs when attempting to extract a file with an unsupported media container format
3444     * or an unsupported media container feature.
3445     * @throws { BusinessError } 6613004 - Unsupported feature in the media manifest.
3446     * @syscap SystemCapability.Multimedia.AVSession.AVCast
3447     * @atomicservice
3448     * @since 13
3449     */
3450    on(type: 'castControlParsingError', callback: ErrorCallback): void;
3451
3452    /**
3453     * Unregister listeners for cast control parsing error events.
3454     * @param { 'castControlParsingError' } type Type of the 'castControlParsingError' to listen for.
3455     * @param { ErrorCallback } callback Callback used to listen for the cast control error event.
3456     * @throws { BusinessError } 401 - Parameter check failed. 1. Mandatory parameters are left unspecified.
3457     * 2. Incorrect parameter types.
3458     * @syscap SystemCapability.Multimedia.AVSession.AVCast
3459     * @atomicservice
3460     * @since 13
3461     */
3462    off(type: 'castControlParsingError', callback?: ErrorCallback): void;
3463
3464    /**
3465     * Register listeners for cast control decoding error events.
3466     * @param { 'castControlDecodingError' } type Type of the 'castControlDecodingError' to listen for.
3467     * @param { ErrorCallback } callback Callback used to listen for the cast control error event.
3468     * @throws { BusinessError } 401 - Parameter check failed. 1. Mandatory parameters are left unspecified.
3469     * 2. Incorrect parameter types.
3470     * @throws { BusinessError } 6614000 - Unspecified decoding error.
3471     * @throws { BusinessError } 6614001 - Decoder initialization failed.
3472     * @throws { BusinessError } 6614002 - Decoder query failed.
3473     * @throws { BusinessError } 6614003 - Decoding the media samples failed.
3474     * @throws { BusinessError } 6614004 - The format of the content to decode exceeds the capabilities of the device.
3475     * @throws { BusinessError } 6614005 - The format of the content to decode is not supported.
3476     * @syscap SystemCapability.Multimedia.AVSession.AVCast
3477     * @atomicservice
3478     * @since 13
3479     */
3480    on(type: 'castControlDecodingError', callback: ErrorCallback): void;
3481
3482    /**
3483     * Unregister listeners for cast control decoding error events.
3484     * @param { 'castControlDecodingError' } type Type of the 'castControlDecodingError' to listen for.
3485     * @param { ErrorCallback } callback Callback used to listen for the cast control error event.
3486     * @throws { BusinessError } 401 - Parameter check failed. 1. Mandatory parameters are left unspecified.
3487     * 2. Incorrect parameter types.
3488     * @syscap SystemCapability.Multimedia.AVSession.AVCast
3489     * @atomicservice
3490     * @since 13
3491     */
3492    off(type: 'castControlDecodingError', callback?: ErrorCallback): void;
3493
3494    /**
3495     * Register listeners for cast control audio renderer error error events.
3496     * @param { 'castControlAudioRendererError' } type Type of the 'castControlAudioRendererError' to listen for.
3497     * @param { ErrorCallback } callback Callback used to listen for the cast control error event.
3498     * @throws { BusinessError } 401 - Parameter check failed. 1. Mandatory parameters are left unspecified.
3499     * 2. Incorrect parameter types.
3500     * @throws { BusinessError } 6615000 - Unspecified errors related to the audio renderer.
3501     * @throws { BusinessError } 6615001 - Initializing the audio renderer failed.
3502     * @throws { BusinessError } 6615002 - The audio renderer fails to write data.
3503     * @syscap SystemCapability.Multimedia.AVSession.AVCast
3504     * @atomicservice
3505     * @since 13
3506     */
3507    on(type: 'castControlAudioRendererError', callback: ErrorCallback): void;
3508
3509    /**
3510     * Unregister listeners for cast control audio renderer error events.
3511     * @param { 'castControlAudioRendererError' } type Type of the 'castControlAudioRendererError' to listen for.
3512     * @param { ErrorCallback } callback Callback used to listen for the cast control error event.
3513     * @throws { BusinessError } 401 - Parameter check failed. 1. Mandatory parameters are left unspecified.
3514     * 2. Incorrect parameter types.
3515     * @syscap SystemCapability.Multimedia.AVSession.AVCast
3516     * @atomicservice
3517     * @since 13
3518     */
3519    off(type: 'castControlAudioRendererError', callback?: ErrorCallback): void;
3520
3521    /**
3522     * Register listeners for cast control drm error events.
3523     * @param { 'castControlDrmError' } type Type of the 'castControlDrmError' to listen for.
3524     * @param { ErrorCallback } callback Callback used to listen for the cast control error event.
3525     * @throws { BusinessError } 401 - Parameter check failed. 1. Mandatory parameters are left unspecified.
3526     * 2. Incorrect parameter types.
3527     * @throws { BusinessError } 6616000 - Unspecified error related to DRM.
3528     * @throws { BusinessError } 6616001 - The chosen DRM protection scheme is not supported by the device.
3529     * @throws { BusinessError } 6616002 - Device provisioning failed.
3530     * @throws { BusinessError } 6616003 - The DRM-protected content to play is incompatible.
3531     * @throws { BusinessError } 6616004 - Failed to obtain a license.
3532     * @throws { BusinessError } 6616005 - The operation is disallowed by the license policy.
3533     * @throws { BusinessError } 6616006 - An error occurs in the DRM system.
3534     * @throws { BusinessError } 6616007 - The device has revoked DRM privileges.
3535     * @throws { BusinessError } 6616008 - The DRM license being loaded into the open DRM session has expired.
3536     * @throws { BusinessError } 6616100 - An error occurs when the DRM processes the key response.
3537     * @syscap SystemCapability.Multimedia.AVSession.AVCast
3538     * @atomicservice
3539     * @since 13
3540     */
3541    on(type: 'castControlDrmError', callback: ErrorCallback): void;
3542
3543    /**
3544     * Unregister listeners for cast control drm error events.
3545     * @param { 'castControlDrmError' } type Type of the 'castControlDrmError' to listen for.
3546     * @param { ErrorCallback } callback Callback used to listen for the cast control error event.
3547     * @throws { BusinessError } 401 - Parameter check failed. 1. Mandatory parameters are left unspecified.
3548     * 2. Incorrect parameter types.
3549     * @syscap SystemCapability.Multimedia.AVSession.AVCast
3550     * @atomicservice
3551     * @since 13
3552     */
3553    off(type: 'castControlDrmError', callback?: ErrorCallback): void;
3554
3555    /**
3556     * Register listener for drm key request.
3557     * @param { 'keyRequest' } type - Type of the 'keyRequest' to listen for.
3558     * @param { KeyRequestCallback } callback - Callback used to request drm key.
3559     * @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
3560     * 2.Incorrect parameter types.
3561     * @throws { BusinessError } 6600101 - Session service exception
3562     * @syscap SystemCapability.Multimedia.AVSession.AVCast
3563     * @atomicservice
3564     * @since 12
3565     */
3566    on(type: 'keyRequest', callback: KeyRequestCallback): void;
3567
3568    /**
3569     * Unregister listener for drm key request.
3570     * @param { 'keyRequest' } type - Type of the 'keyRequest' to listen for.
3571     * @param { KeyRequestCallback } callback - Callback used to request drm key.
3572     * @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
3573     * 2.Incorrect parameter types.
3574     * @throws { BusinessError } 6600101 - Session service exception
3575     * @syscap SystemCapability.Multimedia.AVSession.AVCast
3576     * @atomicservice
3577     * @since 12
3578     */
3579    off(type: 'keyRequest', callback?: KeyRequestCallback): void;
3580  }
3581
3582  /**
3583   * A helper to enable a picker to select output devices
3584   *
3585   * @syscap SystemCapability.Multimedia.AVSession.AVCast
3586   * @atomicservice
3587   * @since 14
3588   */
3589  class AVCastPickerHelper {
3590    /**
3591     * The constructor used to create a AVCastPickerHelper object.
3592     *
3593     * @param { Context } context - represents the context.
3594     * @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
3595     * 2.Incorrect parameter types.
3596     * @throws { BusinessError } 6600101 - Session service exception.
3597     * @syscap SystemCapability.Multimedia.AVSession.AVCast
3598     * @atomicservice
3599     * @since 14
3600     */
3601    constructor(context: Context);
3602
3603    /**
3604     * Pull up the avcastpicker based on the options.
3605     *
3606     * @param { AVCastPickerOptions } [options] - represents the options provided to  the picker.
3607     * @returns { Promise<void> } void promise when executed successfully
3608     * @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
3609     * 2.Incorrect parameter types.
3610     * @syscap SystemCapability.Multimedia.AVSession.AVCast
3611     * @atomicservice
3612     * @since 14
3613     */
3614    select(options?: AVCastPickerOptions): Promise<void>;
3615
3616    /**
3617     * Register picker state change callback.
3618     * @param { 'pickerStateChange' } type - 'pickerStateChange'
3619     * @param { Callback<AVCastPickerState> } callback - The callback used to handle picker state changed event.
3620     * @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
3621     * 2.Incorrect parameter types.
3622     * @throws { BusinessError } 6600101 - Session service exception.
3623     * @syscap SystemCapability.Multimedia.AVSession.AVCast
3624     * @atomicservice
3625     * @since 14
3626     */
3627    on(type: 'pickerStateChange', callback: Callback<AVCastPickerState>) : void;
3628
3629    /**
3630     * Unregister picker state change callback.
3631     * @param { 'pickerStateChange' } type - 'pickerStateChange'
3632     * @param { Callback<AVCastPickerState> } callback - The callback used to handle picker state changed event.
3633     * @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
3634     * 2.Incorrect parameter types.
3635     * @throws { BusinessError } 6600101 - Session service exception.
3636     * @syscap SystemCapability.Multimedia.AVSession.AVCast
3637     * @atomicservice
3638     * @since 14
3639     */
3640    off(type: 'pickerStateChange', callback?: Callback<AVCastPickerState>) : void;
3641  }
3642
3643  /**
3644   * An option to make different picker usage
3645   *
3646   * @typedef AVCastPickerOptions
3647   * @syscap SystemCapability.Multimedia.AVSession.AVCast
3648   * @atomicservice
3649   * @since 14
3650   */
3651  interface AVCastPickerOptions {
3652    /**
3653     * Indicates current session type to show different picker ui.
3654     * If not set, default value is 'audio'.
3655     *
3656     * @type { ? AVSessionType }
3657     * @syscap SystemCapability.Multimedia.AVSession.AVCast
3658     * @atomicservice
3659     * @since 14
3660     */
3661    sessionType?: AVSessionType;
3662  }
3663
3664  /**
3665   * The callback of key request.
3666   *
3667   * @typedef { function } KeyRequestCallback
3668   * @param { string } assetId - request key for current assetId
3669   * @param { Uint8Array } requestData - media key request data sent to media key server
3670   * @syscap SystemCapability.Multimedia.AVSession.AVCast
3671   * @atomicservice
3672   * @since 12
3673   */
3674  type KeyRequestCallback = (assetId: string, requestData: Uint8Array) => void;
3675
3676  /**
3677   * Enumerates the cast display states.
3678   *
3679   * @enum { number }
3680   * @syscap SystemCapability.Multimedia.AVSession.ExtendedDisplayCast
3681   * @atomicservice
3682   * @since 12
3683   */
3684  enum CastDisplayState {
3685    /**
3686     * Screen off.
3687     *
3688     * @syscap SystemCapability.Multimedia.AVSession.ExtendedDisplayCast
3689     * @atomicservice
3690     * @since 12
3691     */
3692    STATE_OFF = 1,
3693
3694    /**
3695     * Screen on.
3696     *
3697     * @syscap SystemCapability.Multimedia.AVSession.ExtendedDisplayCast
3698     * @atomicservice
3699     * @since 12
3700     */
3701    STATE_ON = 2,
3702  }
3703
3704  /**
3705   * Define the information for extended display screen.
3706   * @typedef CastDisplayInfo
3707   * @syscap SystemCapability.Multimedia.AVSession.ExtendedDisplayCast
3708   * @atomicservice
3709   * @since 12
3710   */
3711  interface CastDisplayInfo {
3712    /**
3713     * Display ID.
3714     * The application can get more display information based on the same id from display interface.
3715     * @type { number }
3716     * @syscap SystemCapability.Multimedia.AVSession.ExtendedDisplayCast
3717     * @atomicservice
3718     * @since 12
3719     */
3720    id: number;
3721
3722    /**
3723     * Display name.
3724     * @type { string }
3725     * @syscap SystemCapability.Multimedia.AVSession.ExtendedDisplayCast
3726     * @atomicservice
3727     * @since 12
3728     */
3729    name: string;
3730
3731    /**
3732     * The state of display.
3733     * @type { CastDisplayState }
3734     * @syscap SystemCapability.Multimedia.AVSession.ExtendedDisplayCast
3735     * @atomicservice
3736     * @since 12
3737     */
3738    state: CastDisplayState;
3739
3740    /**
3741     * Display width, in pixels.
3742     * @type { number }
3743     * @syscap SystemCapability.Multimedia.AVSession.ExtendedDisplayCast
3744     * @atomicservice
3745     * @since 12
3746     */
3747    width: number;
3748
3749    /**
3750     * Display height, in pixels.
3751     * @type { number }
3752     * @syscap SystemCapability.Multimedia.AVSession.ExtendedDisplayCast
3753     * @atomicservice
3754     * @since 12
3755     */
3756    height: number;
3757  }
3758
3759  /**
3760   * Define the device connection state.
3761   * @enum { number }
3762   * @syscap SystemCapability.Multimedia.AVSession.Core
3763   * @since 10
3764   */
3765  /**
3766   * Define the device connection state.
3767   * @enum { number }
3768   * @syscap SystemCapability.Multimedia.AVSession.Core
3769   * @atomicservice
3770   * @since 12
3771   */
3772  enum ConnectionState {
3773    /**
3774     * A connection state indicating the device is in the process of connecting.
3775     * @syscap SystemCapability.Multimedia.AVSession.Core
3776     * @since 10
3777     */
3778    /**
3779     * A connection state indicating the device is in the process of connecting.
3780     * @syscap SystemCapability.Multimedia.AVSession.Core
3781     * @atomicservice
3782     * @since 12
3783     */
3784    STATE_CONNECTING = 0,
3785
3786    /**
3787     * A connection state indicating the device is connected.
3788     * @syscap SystemCapability.Multimedia.AVSession.Core
3789     * @since 10
3790     */
3791    /**
3792     * A connection state indicating the device is connected.
3793     * @syscap SystemCapability.Multimedia.AVSession.Core
3794     * @atomicservice
3795     * @since 12
3796     */
3797    STATE_CONNECTED = 1,
3798
3799    /**
3800     * The default connection state indicating the device is disconnected.
3801     * @syscap SystemCapability.Multimedia.AVSession.Core
3802     * @since 10
3803     */
3804    /**
3805     * The default connection state indicating the device is disconnected.
3806     * @syscap SystemCapability.Multimedia.AVSession.Core
3807     * @atomicservice
3808     * @since 12
3809     */
3810    STATE_DISCONNECTED = 6,
3811  }
3812
3813  /**
3814   * The pre-defined display tag by system.
3815   * @enum { number }
3816   * @syscap SystemCapability.Multimedia.AVSession.Core
3817   * @since 11
3818   */
3819  enum DisplayTag {
3820    /**
3821     * Indicate the AUDIO VIVID property of current media resource.
3822     * @syscap SystemCapability.Multimedia.AVSession.Core
3823     * @since 11
3824     */
3825    TAG_AUDIO_VIVID = 1,
3826  }
3827
3828  /**
3829   * The play list information definition.
3830   * @interface AVQueueInfo
3831   * @syscap SystemCapability.Multimedia.AVSession.Core
3832   * @systemapi
3833   * @since 11
3834   */
3835  interface AVQueueInfo {
3836    /**
3837     * The bundle name of application which current play list belongs to.
3838     * @type { string }
3839     * @syscap SystemCapability.Multimedia.AVSession.Core
3840     * @systemapi
3841     * @since 11
3842     */
3843    bundleName: string;
3844
3845    /**
3846     * The name of play list
3847     * @type { string }
3848     * @syscap SystemCapability.Multimedia.AVSession.Core
3849     * @systemapi
3850     * @since 11
3851     */
3852    avQueueName: string;
3853
3854    /**
3855     * The id of play list
3856     * @type { string }
3857     * @syscap SystemCapability.Multimedia.AVSession.Core
3858     * @systemapi
3859     * @since 11
3860     */
3861    avQueueId: string;
3862
3863    /**
3864     * The artwork of play list, can be a {@link PixelMap} or a URI formatted string,
3865     * @type { image.PixelMap | string }
3866     * @syscap SystemCapability.Multimedia.AVSession.Core
3867     * @systemapi
3868     * @since 11
3869     */
3870    avQueueImage: image.PixelMap | string;
3871
3872    /**
3873     * The time when the user last played the playlist.
3874     * The time format can be system, such as 1611081385000, it means 2021-01-20 02:36:25.
3875     * @type { ?number }
3876     * @syscap SystemCapability.Multimedia.AVSession.Core
3877     * @systemapi
3878     * @since 11
3879     */
3880    lastPlayedTime?: number;
3881  }
3882
3883  /**
3884   * The metadata of the current media.Used to set the properties of the current media file
3885   * @interface AVMetadata
3886   * @syscap SystemCapability.Multimedia.AVSession.Core
3887   * @since 10
3888   */
3889  /**
3890   * The metadata of the current media.Used to set the properties of the current media file
3891   * @interface AVMetadata
3892   * @syscap SystemCapability.Multimedia.AVSession.Core
3893   * @atomicservice
3894   * @since 12
3895   */
3896  interface AVMetadata {
3897    /**
3898     * Unique ID used to represent this media.
3899     * @type { string }
3900     * @syscap SystemCapability.Multimedia.AVSession.Core
3901     * @since 10
3902     */
3903    /**
3904     * Unique ID used to represent this media.
3905     * @type { string }
3906     * @syscap SystemCapability.Multimedia.AVSession.Core
3907     * @atomicservice
3908     * @since 12
3909     */
3910    assetId: string;
3911
3912    /**
3913     * The title of this media, for display in media center.
3914     * @type { ?string }
3915     * @syscap SystemCapability.Multimedia.AVSession.Core
3916     * @since 10
3917     */
3918    /**
3919     * The title of this media, for display in media center.
3920     * @type { ?string }
3921     * @syscap SystemCapability.Multimedia.AVSession.Core
3922     * @atomicservice
3923     * @since 12
3924     */
3925    title?: string;
3926
3927    /**
3928     * The artist of this media
3929     * @type { ?string }
3930     * @syscap SystemCapability.Multimedia.AVSession.Core
3931     * @since 10
3932     */
3933    /**
3934     * The artist of this media
3935     * @type { ?string }
3936     * @syscap SystemCapability.Multimedia.AVSession.Core
3937     * @atomicservice
3938     * @since 12
3939     */
3940    artist?: string;
3941
3942    /**
3943     * The author of this media
3944     * @type { ?string }
3945     * @syscap SystemCapability.Multimedia.AVSession.Core
3946     * @since 10
3947     */
3948    /**
3949     * The author of this media
3950     * @type { ?string }
3951     * @syscap SystemCapability.Multimedia.AVSession.Core
3952     * @atomicservice
3953     * @since 12
3954     */
3955    author?: string;
3956
3957    /**
3958     * The name of play list which current media belongs to
3959     * @type { ?string }
3960     * @syscap SystemCapability.Multimedia.AVSession.Core
3961     * @since 12
3962     */
3963    avQueueName?: string;
3964
3965    /**
3966     * The id of play list which current media belongs to, it should be an unique identifier in the application.
3967     * @type { ?string }
3968     * @syscap SystemCapability.Multimedia.AVSession.Core
3969     * @since 11
3970     */
3971    avQueueId?: string;
3972
3973    /**
3974     * The artwork of play list as a {@link PixelMap} or an uri formatted String,
3975     * @type { ?(image.PixelMap | string) }
3976     * @syscap SystemCapability.Multimedia.AVSession.Core
3977     * @since 11
3978     */
3979    avQueueImage?: image.PixelMap | string;
3980
3981    /**
3982     * The album of this media
3983     * @type { ?string }
3984     * @syscap SystemCapability.Multimedia.AVSession.Core
3985     * @since 10
3986     */
3987    /**
3988     * The album of this media
3989     * @type { ?string }
3990     * @syscap SystemCapability.Multimedia.AVSession.Core
3991     * @atomicservice
3992     * @since 12
3993     */
3994    album?: string;
3995
3996    /**
3997     * The writer of this media
3998     * @type { ?string }
3999     * @syscap SystemCapability.Multimedia.AVSession.Core
4000     * @since 10
4001     */
4002    /**
4003     * The writer of this media
4004     * @type { ?string }
4005     * @syscap SystemCapability.Multimedia.AVSession.Core
4006     * @atomicservice
4007     * @since 12
4008     */
4009    writer?: string;
4010
4011    /**
4012     * The composer of this media
4013     * @type { ?string }
4014     * @syscap SystemCapability.Multimedia.AVSession.Core
4015     * @since 10
4016     */
4017    composer?: string;
4018
4019    /**
4020     * The duration of this media, used to automatically calculate playback position
4021     * @type { ?number }
4022     * @syscap SystemCapability.Multimedia.AVSession.Core
4023     * @since 10
4024     */
4025    /**
4026     * The duration of this media, used to automatically calculate playback position
4027     * @type { ?number }
4028     * @syscap SystemCapability.Multimedia.AVSession.Core
4029     * @atomicservice
4030     * @since 12
4031     */
4032    duration?: number;
4033
4034    /**
4035     * The image of the media as a {@link PixelMap} or an uri formatted String,
4036     * used to display in media center.
4037     * @type { ?(image.PixelMap | string) }
4038     * @syscap SystemCapability.Multimedia.AVSession.Core
4039     * @since 10
4040     */
4041    /**
4042     * The image of the media as a {@link PixelMap} or an uri formatted String,
4043     * used to display in media center.
4044     * @type { ?(image.PixelMap | string) }
4045     * @syscap SystemCapability.Multimedia.AVSession.Core
4046     * @atomicservice
4047     * @since 12
4048     */
4049    mediaImage?: image.PixelMap | string;
4050
4051    /**
4052     * The publishDate of the media
4053     * @type { ?Date }
4054     * @syscap SystemCapability.Multimedia.AVSession.Core
4055     * @since 10
4056     */
4057    publishDate?: Date;
4058
4059    /**
4060     * The subtitle of the media, used for display
4061     * @type { ?string }
4062     * @syscap SystemCapability.Multimedia.AVSession.Core
4063     * @since 10
4064     */
4065    /**
4066     * The subtitle of the media, used for display
4067     * @type { ?string }
4068     * @syscap SystemCapability.Multimedia.AVSession.Core
4069     * @atomicservice
4070     * @since 12
4071     */
4072    subtitle?: string;
4073
4074    /**
4075     * The discription of the media, used for display
4076     * @type { ?string }
4077     * @syscap SystemCapability.Multimedia.AVSession.Core
4078     * @since 10
4079     */
4080    /**
4081     * The discription of the media, used for display
4082     * @type { ?string }
4083     * @syscap SystemCapability.Multimedia.AVSession.Core
4084     * @atomicservice
4085     * @since 12
4086     */
4087    description?: string;
4088
4089    /**
4090     * The lyric of the media, it should be in standard lyric format
4091     * @type { ?string }
4092     * @syscap SystemCapability.Multimedia.AVSession.Core
4093     * @since 10
4094     */
4095    lyric?: string;
4096
4097    /**
4098     * The previous playable media id.
4099     * Used to tell the controller if there is a previous playable media
4100     * @type { ?string }
4101     * @syscap SystemCapability.Multimedia.AVSession.Core
4102     * @since 10
4103     */
4104    /**
4105     * The previous playable media id.
4106     * Used to tell the controller if there is a previous playable media
4107     * @type { ?string }
4108     * @syscap SystemCapability.Multimedia.AVSession.Core
4109     * @atomicservice
4110     * @since 12
4111     */
4112    previousAssetId?: string;
4113
4114    /**
4115     * The next playable media id.
4116     * Used to tell the controller if there is a next playable media
4117     * @type { ?string }
4118     * @syscap SystemCapability.Multimedia.AVSession.Core
4119     * @since 10
4120     */
4121    /**
4122     * The next playable media id.
4123     * Used to tell the controller if there is a next playable media
4124     * @type { ?string }
4125     * @syscap SystemCapability.Multimedia.AVSession.Core
4126     * @atomicservice
4127     * @since 12
4128     */
4129    nextAssetId?: string;
4130
4131    /**
4132     * The protocols supported by this session, if not set, the default is {@link TYPE_CAST_PLUS_STREAM}.
4133     * See {@link ProtocolType}
4134     * @type { ?number }
4135     * @syscap SystemCapability.Multimedia.AVSession.Core
4136     * @since 11
4137     */
4138    /**
4139     * The protocols supported by this session, if not set, the default is {@link TYPE_CAST_PLUS_STREAM}.
4140     * See {@link ProtocolType}
4141     * @type { ?number }
4142     * @syscap SystemCapability.Multimedia.AVSession.Core
4143     * @atomicservice
4144     * @since 12
4145     */
4146    filter?: number;
4147
4148    /**
4149     * The drm schemes supported by this session which are represented by uuid.
4150     * @type { ?Array<string> }
4151     * @syscap SystemCapability.Multimedia.AVSession.Core
4152     * @since 12
4153     */
4154    drmSchemes?: Array<string>;
4155
4156    /**
4157     * The supported skipIntervals when doing fast forward and rewind operation, the default is {@link SECONDS_15}.
4158     * See {@link SkipIntervals}
4159     * @type { ?SkipIntervals }
4160     * @syscap SystemCapability.Multimedia.AVSession.Core
4161     * @since 11
4162     */
4163    skipIntervals?: SkipIntervals;
4164
4165    /**
4166     * The display tags supported by application to be displayed on media center
4167     * @type { ?number }
4168     * @syscap SystemCapability.Multimedia.AVSession.Core
4169     * @since 11
4170     */
4171    displayTags?: number;
4172  }
4173
4174  /**
4175   * The description of the media for an item in the playlist of the session
4176   * @interface AVMediaDescription
4177   * @syscap SystemCapability.Multimedia.AVSession.Core
4178   * @since 10
4179   */
4180  /**
4181   * The description of the media for an item in the playlist of the session
4182   * @interface AVMediaDescription
4183   * @syscap SystemCapability.Multimedia.AVSession.Core
4184   * @atomicservice
4185   * @since 12
4186   */
4187  interface AVMediaDescription {
4188    /**
4189     * Unique ID used to represent this media.
4190     * @type { string }
4191     * @syscap SystemCapability.Multimedia.AVSession.Core
4192     * @since 10
4193     */
4194    /**
4195     * Unique ID used to represent this media.
4196     * @type { string }
4197     * @syscap SystemCapability.Multimedia.AVSession.Core
4198     * @atomicservice
4199     * @since 12
4200     */
4201    assetId: string;
4202    /**
4203     * The title of this media, for display in media center.
4204     * @type { ?string }
4205     * @syscap SystemCapability.Multimedia.AVSession.Core
4206     * @since 10
4207     */
4208    /**
4209     * The title of this media, for display in media center.
4210     * @type { ?string }
4211     * @syscap SystemCapability.Multimedia.AVSession.Core
4212     * @atomicservice
4213     * @since 12
4214     */
4215    title?: string;
4216
4217    /**
4218     * The subtitle of the media, used for display
4219     * @type { ?string }
4220     * @syscap SystemCapability.Multimedia.AVSession.Core
4221     * @since 10
4222     */
4223    /**
4224     * The subtitle of the media, used for display
4225     * @type { ?string }
4226     * @syscap SystemCapability.Multimedia.AVSession.Core
4227     * @atomicservice
4228     * @since 12
4229     */
4230    subtitle?: string;
4231
4232    /**
4233     * The description of this media
4234     * @type { ?string }
4235     * @syscap SystemCapability.Multimedia.AVSession.Core
4236     * @since 10
4237     */
4238    /**
4239     * The description of this media
4240     * @type { ?string }
4241     * @syscap SystemCapability.Multimedia.AVSession.Core
4242     * @atomicservice
4243     * @since 12
4244     */
4245    description?: string;
4246
4247    /**
4248     * The image of this media asset displayed in the media center.
4249     * It can be a {@link PixelMap} or a URI formatted string,
4250     * @type { ?(image.PixelMap | string) }
4251     * @syscap SystemCapability.Multimedia.AVSession.Core
4252     * @since 10
4253     */
4254    /**
4255     * The image of this media asset displayed in the media center.
4256     * It can be a {@link PixelMap} or a URI formatted string,
4257     * @type { ?(image.PixelMap | string) }
4258     * @syscap SystemCapability.Multimedia.AVSession.Core
4259     * @atomicservice
4260     * @since 12
4261     */
4262    mediaImage?: image.PixelMap | string;
4263    /**
4264     * Any additional attributes that can be represented as key-value pairs
4265     * @type { ?object }
4266     * @syscap SystemCapability.Multimedia.AVSession.Core
4267     * @since 10
4268     */
4269    extras?: {[key: string]: Object};
4270
4271    /**
4272     * The type of this media, such as video, audio and so on.
4273     * @type { ?string }
4274     * @syscap SystemCapability.Multimedia.AVSession.Core
4275     * @since 10
4276     */
4277    /**
4278     * The type of this media, such as video, audio and so on.
4279     * @type { ?string }
4280     * @syscap SystemCapability.Multimedia.AVSession.Core
4281     * @atomicservice
4282     * @since 12
4283     */
4284    mediaType?: string;
4285
4286    /**
4287     * The size of this media.
4288     * @type { ?number }
4289     * @syscap SystemCapability.Multimedia.AVSession.Core
4290     * @since 10
4291     */
4292    /**
4293     * The size of this media.
4294     * @type { ?number }
4295     * @syscap SystemCapability.Multimedia.AVSession.Core
4296     * @atomicservice
4297     * @since 12
4298     */
4299    mediaSize?: number;
4300
4301    /**
4302     * The album title of this media
4303     * @type { ?string }
4304     * @syscap SystemCapability.Multimedia.AVSession.Core
4305     * @since 10
4306     */
4307    /**
4308     * The album title of this media
4309     * @type { ?string }
4310     * @syscap SystemCapability.Multimedia.AVSession.Core
4311     * @atomicservice
4312     * @since 12
4313     */
4314    albumTitle?: string;
4315
4316    /**
4317     * The album cover uri of this media
4318     * @type { ?string }
4319     * @syscap SystemCapability.Multimedia.AVSession.Core
4320     * @since 10
4321     */
4322    /**
4323     * The album cover uri of this media
4324     * @type { ?string }
4325     * @syscap SystemCapability.Multimedia.AVSession.Core
4326     * @atomicservice
4327     * @since 12
4328     */
4329    albumCoverUri?: string;
4330
4331    /**
4332     * The lyric content of the media, it should be in standard lyric format
4333     * @type { ?string }
4334     * @syscap SystemCapability.Multimedia.AVSession.Core
4335     * @since 10
4336     */
4337    /**
4338     * The lyric content of the media, it should be in standard lyric format
4339     * @type { ?string }
4340     * @syscap SystemCapability.Multimedia.AVSession.Core
4341     * @atomicservice
4342     * @since 12
4343     */
4344    lyricContent?: string;
4345
4346    /**
4347     * The lyric uri of the media.
4348     * @type { ?string }
4349     * @syscap SystemCapability.Multimedia.AVSession.Core
4350     * @since 10
4351     */
4352    /**
4353     * The lyric uri of the media.
4354     * @type { ?string }
4355     * @syscap SystemCapability.Multimedia.AVSession.Core
4356     * @atomicservice
4357     * @since 12
4358     */
4359    lyricUri?: string;
4360
4361    /**
4362     * The artist of this media.
4363     * @type { ?string }
4364     * @syscap SystemCapability.Multimedia.AVSession.Core
4365     * @since 10
4366     */
4367    /**
4368     * The artist of this media.
4369     * @type { ?string }
4370     * @syscap SystemCapability.Multimedia.AVSession.Core
4371     * @atomicservice
4372     * @since 12
4373     */
4374    artist?: string;
4375
4376    /**
4377     * The uri of the media, used to locate the media in some special cases
4378     * @type { ?string }
4379     * @syscap SystemCapability.Multimedia.AVSession.Core
4380     * @since 10
4381     */
4382    /**
4383     * The uri of the media, used to locate the media in some special cases
4384     * @type { ?string }
4385     * @syscap SystemCapability.Multimedia.AVSession.Core
4386     * @atomicservice
4387     * @since 12
4388     */
4389    mediaUri?: string;
4390
4391    /**
4392     * Media file descriptor.
4393     * @type { ?media.AVFileDescriptor }
4394     * @syscap SystemCapability.Multimedia.AVSession.Core
4395     * @since 10
4396     */
4397    /**
4398     * Media file descriptor.
4399     * @type { ?media.AVFileDescriptor }
4400     * @syscap SystemCapability.Multimedia.AVSession.Core
4401     * @atomicservice
4402     * @since 12
4403     */
4404    fdSrc?: media.AVFileDescriptor;
4405
4406    /**
4407     * DataSource descriptor. The caller ensures the fileSize and callback are valid.
4408     * @type { ?media.AVDataSrcDescriptor }
4409     * @syscap SystemCapability.Multimedia.AVSession.Core
4410     * @since 12
4411     */
4412    dataSrc?: media.AVDataSrcDescriptor;
4413
4414    /**
4415     * The drm scheme supported by this resource which is represented by uuid.
4416     * @type { ?string }
4417     * @syscap SystemCapability.Multimedia.AVSession.Core
4418     * @since 12
4419     */
4420    drmScheme?: string;
4421
4422    /**
4423     * The duration of this media
4424     * @type { ?number }
4425     * @syscap SystemCapability.Multimedia.AVSession.Core
4426     * @since 10
4427     */
4428    /**
4429     * The duration of this media
4430     * @type { ?number }
4431     * @syscap SystemCapability.Multimedia.AVSession.Core
4432     * @atomicservice
4433     * @since 12
4434     */
4435    duration?: number;
4436
4437    /**
4438     * Media start position, described by milliseconds.
4439     * @type { ?number }
4440     * @syscap SystemCapability.Multimedia.AVSession.Core
4441     * @since 10
4442     */
4443    /**
4444     * Media start position, described by milliseconds.
4445     * @type { ?number }
4446     * @syscap SystemCapability.Multimedia.AVSession.Core
4447     * @atomicservice
4448     * @since 12
4449     */
4450    startPosition?: number;
4451
4452    /**
4453     * Media credits position, described by milliseconds.
4454     * @type { ?number }
4455     * @syscap SystemCapability.Multimedia.AVSession.Core
4456     * @since 10
4457     */
4458    /**
4459     * Media credits position, described by milliseconds.
4460     * @type { ?number }
4461     * @syscap SystemCapability.Multimedia.AVSession.Core
4462     * @atomicservice
4463     * @since 12
4464     */
4465    creditsPosition?: number;
4466
4467    /**
4468     * Application name.
4469     * @type { ?string }
4470     * @syscap SystemCapability.Multimedia.AVSession.Core
4471     * @since 10
4472     */
4473    /**
4474     * Application name.
4475     * @type { ?string }
4476     * @syscap SystemCapability.Multimedia.AVSession.Core
4477     * @atomicservice
4478     * @since 12
4479     */
4480    appName?: string;
4481
4482    /**
4483     * The display tags supported by application to be displayed on media center
4484     * @type { ?number }
4485     * @syscap SystemCapability.Multimedia.AVSession.Core
4486     * @since 11
4487     */
4488    /**
4489     * The display tags supported by application to be displayed on media center
4490     * @type { ?number }
4491     * @syscap SystemCapability.Multimedia.AVSession.Core
4492     * @atomicservice
4493     * @since 12
4494     */
4495    displayTags?: number;
4496  }
4497
4498  /**
4499   * The item in the playlist of the session
4500   * @interface AVQueueItem
4501   * @syscap SystemCapability.Multimedia.AVSession.Core
4502   * @since 10
4503   */
4504  /**
4505   * The item in the playlist of the session
4506   * @interface AVQueueItem
4507   * @syscap SystemCapability.Multimedia.AVSession.Core
4508   * @atomicservice
4509   * @since 12
4510   */
4511  interface AVQueueItem {
4512    /**
4513     * Sequence number of the item in the playlist.
4514     * @type { number }
4515     * @syscap SystemCapability.Multimedia.AVSession.Core
4516     * @since 10
4517     */
4518    /**
4519     * Sequence number of the item in the playlist.
4520     * @type { number }
4521     * @syscap SystemCapability.Multimedia.AVSession.Core
4522     * @atomicservice
4523     * @since 12
4524     */
4525    itemId: number;
4526
4527    /**
4528     * The media description of the item in the playlist.
4529     * @type { ?AVMediaDescription }
4530     * @syscap SystemCapability.Multimedia.AVSession.Core
4531     * @since 10
4532     */
4533    /**
4534     * The media description of the item in the playlist.
4535     * @type { ?AVMediaDescription }
4536     * @syscap SystemCapability.Multimedia.AVSession.Core
4537     * @atomicservice
4538     * @since 12
4539     */
4540    description?: AVMediaDescription;
4541  }
4542
4543  /**
4544   * Used to indicate the playback state of the current media.
4545   * If the playback state of the media changes, it needs to be updated synchronously
4546   * @interface AVPlaybackState
4547   * @syscap SystemCapability.Multimedia.AVSession.Core
4548   * @since 10
4549   */
4550  /**
4551   * Used to indicate the playback state of the current media.
4552   * If the playback state of the media changes, it needs to be updated synchronously
4553   * @interface AVPlaybackState
4554   * @syscap SystemCapability.Multimedia.AVSession.Core
4555   * @atomicservice
4556   * @since 12
4557   */
4558  interface AVPlaybackState {
4559    /**
4560     * Current playback state. See {@link PlaybackState}
4561     * @type { ?PlaybackState }
4562     * @syscap SystemCapability.Multimedia.AVSession.Core
4563     * @since 10
4564     */
4565    /**
4566     * Current playback state. See {@link PlaybackState}
4567     * @type { ?PlaybackState }
4568     * @syscap SystemCapability.Multimedia.AVSession.Core
4569     * @atomicservice
4570     * @since 12
4571     */
4572    state?: PlaybackState;
4573
4574    /**
4575     * Current playback speed
4576     * @type { ?number }
4577     * @syscap SystemCapability.Multimedia.AVSession.Core
4578     * @since 10
4579     */
4580    /**
4581     * Current playback speed
4582     * @type { ?number }
4583     * @syscap SystemCapability.Multimedia.AVSession.Core
4584     * @atomicservice
4585     * @since 12
4586     */
4587    speed?: number;
4588
4589    /**
4590     * Current playback position of this media. See {@link PlaybackPosition}
4591     * @type { ?PlaybackPosition }
4592     * @syscap SystemCapability.Multimedia.AVSession.Core
4593     * @since 10
4594     */
4595    /**
4596     * Current playback position of this media. See {@link PlaybackPosition}
4597     * @type { ?PlaybackPosition }
4598     * @syscap SystemCapability.Multimedia.AVSession.Core
4599     * @atomicservice
4600     * @since 12
4601     */
4602    position?: PlaybackPosition;
4603
4604    /**
4605     * The current buffered time, the maximum playable position
4606     * @type { ?number }
4607     * @syscap SystemCapability.Multimedia.AVSession.Core
4608     * @since 10
4609     */
4610    /**
4611     * The current buffered time, the maximum playable position
4612     * @type { ?number }
4613     * @syscap SystemCapability.Multimedia.AVSession.Core
4614     * @atomicservice
4615     * @since 12
4616     */
4617    bufferedTime?: number;
4618
4619    /**
4620     * Current playback loop mode. See {@link LoopMode}
4621     * @type { ?LoopMode }
4622     * @syscap SystemCapability.Multimedia.AVSession.Core
4623     * @since 10
4624     */
4625    /**
4626     * Current playback loop mode. See {@link LoopMode}
4627     * @type { ?LoopMode }
4628     * @syscap SystemCapability.Multimedia.AVSession.Core
4629     * @atomicservice
4630     * @since 12
4631     */
4632    loopMode?: LoopMode;
4633
4634    /**
4635     * Current Favorite Status
4636     * @type { ?boolean }
4637     * @syscap SystemCapability.Multimedia.AVSession.Core
4638     * @since 10
4639     */
4640    /**
4641     * Current Favorite Status
4642     * @type { ?boolean }
4643     * @syscap SystemCapability.Multimedia.AVSession.Core
4644     * @atomicservice
4645     * @since 12
4646     */
4647    isFavorite?: boolean;
4648
4649    /**
4650     * Current active item id
4651     * @type { ?number }
4652     * @syscap SystemCapability.Multimedia.AVSession.Core
4653     * @since 10
4654     */
4655    /**
4656     * Current active item id
4657     * @type { ?number }
4658     * @syscap SystemCapability.Multimedia.AVSession.Core
4659     * @atomicservice
4660     * @since 12
4661     */
4662    activeItemId?: number;
4663
4664    /**
4665     * Current player volume
4666     * @type { ?number }
4667     * @syscap SystemCapability.Multimedia.AVSession.Core
4668     * @since 10
4669     */
4670    /**
4671     * Current player volume
4672     * @type { ?number }
4673     * @syscap SystemCapability.Multimedia.AVSession.Core
4674     * @atomicservice
4675     * @since 12
4676     */
4677    volume?: number;
4678
4679    /**
4680     * maximum  volume
4681     * @type { ?number }
4682     * @syscap SystemCapability.Multimedia.AVSession.Core
4683     * @since 11
4684     */
4685    /**
4686     * maximum  volume
4687     * @type { ?number }
4688     * @syscap SystemCapability.Multimedia.AVSession.Core
4689     * @atomicservice
4690     * @since 12
4691     */
4692    maxVolume?: number;
4693
4694    /**
4695     * Current muted status
4696     * @type { ?boolean }
4697     * @syscap SystemCapability.Multimedia.AVSession.Core
4698     * @since 11
4699     */
4700    /**
4701     * Current muted status
4702     * @type { ?boolean }
4703     * @syscap SystemCapability.Multimedia.AVSession.Core
4704     * @atomicservice
4705     * @since 12
4706     */
4707    muted?: boolean;
4708
4709    /**
4710     * The duration of this media asset.
4711     * @type { ?number }
4712     * @syscap SystemCapability.Multimedia.AVSession.Core
4713     * @since 11
4714     */
4715    duration?: number;
4716
4717    /**
4718     * The video width of this media asset.
4719     * @type { ?number }
4720     * @syscap SystemCapability.Multimedia.AVSession.Core
4721     * @since 11
4722     */
4723    /**
4724     * The video width of this media asset.
4725     * @type { ?number }
4726     * @syscap SystemCapability.Multimedia.AVSession.Core
4727     * @atomicservice
4728     * @since 12
4729     */
4730    videoWidth?: number;
4731
4732    /**
4733     * The video height of this media asset.
4734     * @type { ?number }
4735     * @syscap SystemCapability.Multimedia.AVSession.Core
4736     * @since 11
4737     */
4738    /**
4739     * The video height of this media asset.
4740     * @type { ?number }
4741     * @syscap SystemCapability.Multimedia.AVSession.Core
4742     * @atomicservice
4743     * @since 12
4744     */
4745    videoHeight?: number;
4746
4747    /**
4748     * Current custom media packets
4749     * @type { ?object }
4750     * @syscap SystemCapability.Multimedia.AVSession.Core
4751     * @since 10
4752     */
4753    /**
4754     * Current custom media packets
4755     * @type { ?object }
4756     * @syscap SystemCapability.Multimedia.AVSession.Core
4757     * @atomicservice
4758     * @since 12
4759     */
4760    extras?: {[key: string]: Object};
4761  }
4762
4763  /**
4764   * Playback position definition
4765   * @interface PlaybackPosition
4766   * @syscap SystemCapability.Multimedia.AVSession.Core
4767   * @since 10
4768   */
4769  /**
4770   * Playback position definition
4771   * @interface PlaybackPosition
4772   * @syscap SystemCapability.Multimedia.AVSession.Core
4773   * @atomicservice
4774   * @since 12
4775   */
4776  interface PlaybackPosition {
4777    /**
4778     * Elapsed time(position) of this media set by the app.
4779     * @type { number }
4780     * @syscap SystemCapability.Multimedia.AVSession.Core
4781     * @since 10
4782     */
4783    /**
4784     * Elapsed time(position) of this media set by the app.
4785     * @type { number }
4786     * @syscap SystemCapability.Multimedia.AVSession.Core
4787     * @atomicservice
4788     * @since 12
4789     */
4790    elapsedTime: number;
4791
4792    /**
4793     * Record the system time when elapsedTime is set.
4794     * @type { number }
4795     * @syscap SystemCapability.Multimedia.AVSession.Core
4796     * @since 10
4797     */
4798    /**
4799     * Record the system time when elapsedTime is set.
4800     * @type { number }
4801     * @syscap SystemCapability.Multimedia.AVSession.Core
4802     * @atomicservice
4803     * @since 12
4804     */
4805    updateTime: number;
4806  }
4807
4808  /**
4809   * The metadata of the current call.
4810   * @interface CallMetadata
4811   * @syscap SystemCapability.Multimedia.AVSession.Core
4812   * @since 11
4813   */
4814  /**
4815   * The metadata of the current call.
4816   * @typedef CallMetadata
4817   * @syscap SystemCapability.Multimedia.AVSession.Core
4818   * @atomicservice
4819   * @since 12
4820   */
4821  interface CallMetadata {
4822    /**
4823     * The displayed user name of current call.
4824     * @type { ?string }
4825     * @syscap SystemCapability.Multimedia.AVSession.Core
4826     * @since 11
4827     */
4828    /**
4829     * The displayed user name of current call.
4830     * @type { ?string }
4831     * @syscap SystemCapability.Multimedia.AVSession.Core
4832     * @atomicservice
4833     * @since 12
4834     */
4835    name?: string;
4836
4837    /**
4838     * The phone number of current call.
4839     * @type { ?string }
4840     * @syscap SystemCapability.Multimedia.AVSession.Core
4841     * @since 11
4842     */
4843    /**
4844     * The phone number of current call.
4845     * @type { ?string }
4846     * @syscap SystemCapability.Multimedia.AVSession.Core
4847     * @atomicservice
4848     * @since 12
4849     */
4850    phoneNumber?: string;
4851
4852    /**
4853     * The displayed picture that represents a particular user.
4854     * @type { ?image.PixelMap }
4855     * @syscap SystemCapability.Multimedia.AVSession.Core
4856     * @since 11
4857     */
4858    /**
4859     * The displayed picture that represents a particular user.
4860     * @type { ?image.PixelMap }
4861     * @syscap SystemCapability.Multimedia.AVSession.Core
4862     * @atomicservice
4863     * @since 12
4864     */
4865    avatar?: image.PixelMap;
4866  }
4867
4868  /**
4869   * Used to indicate the call state of the current call.
4870   * @interface AVCallState
4871   * @syscap SystemCapability.Multimedia.AVSession.Core
4872   * @since 11
4873   */
4874  /**
4875   * Used to indicate the call state of the current call.
4876   * @typedef AVCallState
4877   * @syscap SystemCapability.Multimedia.AVSession.Core
4878   * @atomicservice
4879   * @since 12
4880   */
4881  interface AVCallState {
4882    /**
4883     * Current call state. See {@link CallState}
4884     * @type { CallState }
4885     * @syscap SystemCapability.Multimedia.AVSession.Core
4886     * @since 11
4887     */
4888    /**
4889     * Current call state. See {@link CallState}
4890     * @type { CallState }
4891     * @syscap SystemCapability.Multimedia.AVSession.Core
4892     * @atomicservice
4893     * @since 12
4894     */
4895    state: CallState;
4896
4897    /**
4898     * Current muted status.
4899     * @type { boolean }
4900     * @syscap SystemCapability.Multimedia.AVSession.Core
4901     * @since 11
4902     */
4903    /**
4904     * Current muted status.
4905     * @type { boolean }
4906     * @syscap SystemCapability.Multimedia.AVSession.Core
4907     * @atomicservice
4908     * @since 12
4909     */
4910    muted: boolean;
4911  }
4912
4913  /**
4914   * Enumeration of current call state
4915   * @enum { number }
4916   * @syscap SystemCapability.Multimedia.AVSession.Core
4917   * @since 11
4918   */
4919  /**
4920   * Enumeration of current call state
4921   * @enum { number }
4922   * @syscap SystemCapability.Multimedia.AVSession.Core
4923   * @atomicservice
4924   * @since 12
4925   */
4926  enum CallState {
4927    /**
4928     * Idle state.
4929     * @syscap SystemCapability.Multimedia.AVSession.Core
4930     * @since 11
4931     */
4932    /**
4933     * Idle state.
4934     * @syscap SystemCapability.Multimedia.AVSession.Core
4935     * @atomicservice
4936     * @since 12
4937     */
4938    CALL_STATE_IDLE = 0,
4939
4940    /**
4941     * Incoming state.
4942     * @syscap SystemCapability.Multimedia.AVSession.Core
4943     * @since 11
4944     */
4945    /**
4946     * Incoming state.
4947     * @syscap SystemCapability.Multimedia.AVSession.Core
4948     * @atomicservice
4949     * @since 12
4950     */
4951    CALL_STATE_INCOMING = 1,
4952
4953    /**
4954     * Active state in calling.
4955     * @syscap SystemCapability.Multimedia.AVSession.Core
4956     * @since 11
4957     */
4958    /**
4959     * Active state in calling.
4960     * @syscap SystemCapability.Multimedia.AVSession.Core
4961     * @atomicservice
4962     * @since 12
4963     */
4964    CALL_STATE_ACTIVE = 2,
4965
4966    /**
4967     * Dialing state.
4968     * @syscap SystemCapability.Multimedia.AVSession.Core
4969     * @since 11
4970     */
4971    /**
4972     * Dialing state.
4973     * @syscap SystemCapability.Multimedia.AVSession.Core
4974     * @atomicservice
4975     * @since 12
4976     */
4977    CALL_STATE_DIALING = 3,
4978
4979    /**
4980     * Waiting state.
4981     * @syscap SystemCapability.Multimedia.AVSession.Core
4982     * @since 11
4983     */
4984    /**
4985     * Waiting state.
4986     * @syscap SystemCapability.Multimedia.AVSession.Core
4987     * @atomicservice
4988     * @since 12
4989     */
4990    CALL_STATE_WAITING = 4,
4991
4992    /**
4993     * Holding state.
4994     * @syscap SystemCapability.Multimedia.AVSession.Core
4995     * @since 11
4996     */
4997    /**
4998     * Holding state.
4999     * @syscap SystemCapability.Multimedia.AVSession.Core
5000     * @atomicservice
5001     * @since 12
5002     */
5003    CALL_STATE_HOLDING = 5,
5004
5005    /**
5006     * Disconnecting state.
5007     * @syscap SystemCapability.Multimedia.AVSession.Core
5008     * @since 11
5009     */
5010    /**
5011     * Disconnecting state.
5012     * @syscap SystemCapability.Multimedia.AVSession.Core
5013     * @atomicservice
5014     * @since 12
5015     */
5016    CALL_STATE_DISCONNECTING = 6,
5017  }
5018
5019  /**
5020   * cast category indicating different playback scenes
5021   * @enum { number }
5022   * @syscap SystemCapability.Multimedia.AVSession.AVCast
5023   * @since 10
5024   */
5025  /**
5026   * cast category indicating different playback scenes
5027   * @enum { number }
5028   * @syscap SystemCapability.Multimedia.AVSession.AVCast
5029   * @atomicservice
5030   * @since 12
5031   */
5032  enum AVCastCategory {
5033    /**
5034     * The default cast type "local", media can be routed on the same device,
5035     * including internal speakers or audio jack on the device itself, A2DP devices.
5036     * @syscap SystemCapability.Multimedia.AVSession.AVCast
5037     * @since 10
5038     */
5039    /**
5040     * The default cast type "local", media can be routed on the same device,
5041     * including internal speakers or audio jack on the device itself, A2DP devices.
5042     * @syscap SystemCapability.Multimedia.AVSession.AVCast
5043     * @atomicservice
5044     * @since 12
5045     */
5046    CATEGORY_LOCAL = 0,
5047
5048    /**
5049     * The remote category indicating the media is presenting on a remote device,
5050     * the application needs to get an AVCastController to control remote playback.
5051     * @syscap SystemCapability.Multimedia.AVSession.AVCast
5052     * @since 10
5053     */
5054    /**
5055     * The remote category indicating the media is presenting on a remote device,
5056     * the application needs to get an AVCastController to control remote playback.
5057     * @syscap SystemCapability.Multimedia.AVSession.AVCast
5058     * @atomicservice
5059     * @since 12
5060     */
5061    CATEGORY_REMOTE = 1,
5062  }
5063  /**
5064   * Device type definition
5065   * @enum { number }
5066   * @syscap SystemCapability.Multimedia.AVSession.Core
5067   * @since 10
5068   */
5069  /**
5070   * Device type definition
5071   * @enum { number }
5072   * @syscap SystemCapability.Multimedia.AVSession.Core
5073   * @atomicservice
5074   * @since 12
5075   */
5076  enum DeviceType {
5077    /**
5078     * A device type indicating the route is on internal speakers or audio jack on the device itself.
5079     * @syscap SystemCapability.Multimedia.AVSession.Core
5080     * @since 10
5081     */
5082    /**
5083     * A device type indicating the route is on internal speakers or audio jack on the device itself.
5084     * @syscap SystemCapability.Multimedia.AVSession.Core
5085     * @atomicservice
5086     * @since 12
5087     */
5088    DEVICE_TYPE_LOCAL = 0,
5089
5090    /**
5091     * A device type indicating the route is on a TV.
5092     * @syscap SystemCapability.Multimedia.AVSession.AVCast
5093     * @since 10
5094     */
5095    /**
5096     * A device type indicating the route is on a TV.
5097     * @syscap SystemCapability.Multimedia.AVSession.AVCast
5098     * @atomicservice
5099     * @since 12
5100     */
5101    DEVICE_TYPE_TV = 2,
5102
5103    /**
5104     * A device type indicating the route is on a smart speaker.
5105     * @syscap SystemCapability.Multimedia.AVSession.AVCast
5106     * @since 10
5107     */
5108    /**
5109     * A device type indicating the route is on a smart speaker.
5110     * @syscap SystemCapability.Multimedia.AVSession.AVCast
5111     * @atomicservice
5112     * @since 12
5113     */
5114    DEVICE_TYPE_SMART_SPEAKER = 3,
5115
5116    /**
5117     * A device type indicating the route is on a bluetooth device.
5118     * @syscap SystemCapability.Multimedia.AVSession.Core
5119     * @since 10
5120     */
5121    /**
5122     * A device type indicating the route is on a bluetooth device.
5123     * @syscap SystemCapability.Multimedia.AVSession.Core
5124     * @atomicservice
5125     * @since 12
5126     */
5127    DEVICE_TYPE_BLUETOOTH = 10,
5128  }
5129
5130  /**
5131   * Device Information Definition
5132   * @interface DeviceInfo
5133   * @syscap SystemCapability.Multimedia.AVSession.Core
5134   * @since 10
5135   */
5136  /**
5137   * Device Information Definition
5138   * @interface DeviceInfo
5139   * @syscap SystemCapability.Multimedia.AVSession.Core
5140   * @atomicservice
5141   * @since 12
5142   */
5143  interface DeviceInfo {
5144    /**
5145     * The playback type supported by the device. See {@link AVCastCategory}
5146     * @type { AVCastCategory }
5147     * @syscap SystemCapability.Multimedia.AVSession.Core
5148     * @since 10
5149     */
5150    /**
5151     * The playback type supported by the device. See {@link AVCastCategory}
5152     * @type { AVCastCategory }
5153     * @syscap SystemCapability.Multimedia.AVSession.Core
5154     * @atomicservice
5155     * @since 12
5156     */
5157    castCategory: AVCastCategory;
5158    /**
5159     * Audio device id.The length of the audioDeviceId array is greater than 1
5160     * if output to multiple devices at the same time.
5161     * @type { string }
5162     * @syscap SystemCapability.Multimedia.AVSession.Core
5163     * @since 10
5164     */
5165    /**
5166     * Audio device id.The length of the audioDeviceId array is greater than 1
5167     * if output to multiple devices at the same time.
5168     * @type { string }
5169     * @syscap SystemCapability.Multimedia.AVSession.Core
5170     * @atomicservice
5171     * @since 12
5172     */
5173    deviceId: string;
5174
5175    /**
5176     * Device name. The length of the deviceName array is greater than 1
5177     * if output to multiple devices at the same time.
5178     * @type { string }
5179     * @syscap SystemCapability.Multimedia.AVSession.Core
5180     * @since 10
5181     */
5182    /**
5183     * Device name. The length of the deviceName array is greater than 1
5184     * if output to multiple devices at the same time.
5185     * @type { string }
5186     * @syscap SystemCapability.Multimedia.AVSession.Core
5187     * @atomicservice
5188     * @since 12
5189     */
5190    deviceName: string;
5191
5192    /**
5193     * device type.
5194     * @type { DeviceType }
5195     * @syscap SystemCapability.Multimedia.AVSession.Core
5196     * @since 10
5197     */
5198    /**
5199     * device type.
5200     * @type { DeviceType }
5201     * @syscap SystemCapability.Multimedia.AVSession.Core
5202     * @atomicservice
5203     * @since 12
5204     */
5205    deviceType: DeviceType;
5206
5207    /**
5208     * Device manufacturer.
5209     * @type { ?string }
5210     * @syscap SystemCapability.Multimedia.AVSession.AVCast
5211     * @atomicservice
5212     * @since 13
5213     */
5214    manufacturer?: string;
5215
5216    /**
5217     * Device model name.
5218     * @type { ?string }
5219     * @syscap SystemCapability.Multimedia.AVSession.AVCast
5220     * @atomicservice
5221     * @since 13
5222     */
5223    modelName?: string;
5224
5225    /**
5226     * Network id.
5227     * @type { ?string }
5228     * @syscap SystemCapability.Multimedia.AVSession.AVCast
5229     * @systemapi
5230     * @since 13
5231     */
5232    networkId?: string;
5233
5234    /**
5235     * device ip address if available.
5236     * @type { ?string }
5237     * @syscap SystemCapability.Multimedia.AVSession.AVCast
5238     * @systemapi
5239     * @since 10
5240     */
5241    ipAddress?: string;
5242
5243    /**
5244     * device provider which supplies the route capability.
5245     * @type { ?number }
5246     * @syscap SystemCapability.Multimedia.AVSession.AVCast
5247     * @systemapi
5248     * @since 10
5249     */
5250    providerId?: number;
5251
5252    /**
5253     * The protocols supported by current device, can be union of {@link ProtocolType}.
5254     * @type { ?number }
5255     * @syscap SystemCapability.Multimedia.AVSession.AVCast
5256     * @since 11
5257     */
5258    /**
5259     * The protocols supported by current device, can be union of {@link ProtocolType}.
5260     * @type { ?number }
5261     * @syscap SystemCapability.Multimedia.AVSession.AVCast
5262     * @atomicservice
5263     * @since 12
5264     */
5265    supportedProtocols?: number;
5266
5267    /**
5268     * The drm capability supported by current device, each drm is represented by uuid.
5269     * @type { ?Array<string> }
5270     * @syscap SystemCapability.Multimedia.AVSession.AVCast
5271     * @atomicservice
5272     * @since 12
5273     */
5274    supportedDrmCapabilities?: Array<string>;
5275
5276    /**
5277     * Define different authentication status.
5278     * 0: Device not authenticated.
5279     * 1: Device already authenticated.
5280     * @type { ?number }
5281     * @syscap SystemCapability.Multimedia.AVSession.AVCast
5282     * @systemapi
5283     * @since 11
5284     */
5285    authenticationStatus?: number;
5286
5287    /**
5288     * Indicates the current device is legacy or not.
5289     * @type { ?boolean }
5290     * @syscap SystemCapability.Multimedia.AVSession.AVCast
5291     * @systemapi
5292     * @since 13
5293     */
5294    isLegacy?: boolean;
5295
5296    /**
5297     * Medium types used to discover devices.
5298     * 1: BLE
5299     * 2: COAP
5300     * @type { ?number }
5301     * @syscap SystemCapability.Multimedia.AVSession.AVCast
5302     * @systemapi
5303     * @since 13
5304     */
5305    mediumTypes?: number;
5306  }
5307
5308  /**
5309   * Target Device Information Definition
5310   * @interface OutputDeviceInfo
5311   * @syscap SystemCapability.Multimedia.AVSession.Core
5312   * @since 10
5313   */
5314  /**
5315   * Target Device Information Definition
5316   * @interface OutputDeviceInfo
5317   * @syscap SystemCapability.Multimedia.AVSession.Core
5318   * @atomicservice
5319   * @since 12
5320   */
5321  interface OutputDeviceInfo {
5322    /**
5323     * Arrays of device information
5324     * @type { Array<DeviceInfo> }
5325     * @syscap SystemCapability.Multimedia.AVSession.Core
5326     * @since 10
5327     */
5328    /**
5329     * Arrays of device information
5330     * @type { Array<DeviceInfo> }
5331     * @syscap SystemCapability.Multimedia.AVSession.Core
5332     * @atomicservice
5333     * @since 12
5334     */
5335    devices: Array<DeviceInfo>;
5336  }
5337
5338  /**
5339   * Loop Play Mode Definition
5340   * @enum { number }
5341   * @syscap SystemCapability.Multimedia.AVSession.Core
5342   * @since 10
5343   */
5344  /**
5345   * Loop Play Mode Definition
5346   * @enum { number }
5347   * @syscap SystemCapability.Multimedia.AVSession.Core
5348   * @atomicservice
5349   * @since 12
5350   */
5351  enum LoopMode {
5352    /**
5353     * The default mode is sequential playback
5354     * @syscap SystemCapability.Multimedia.AVSession.Core
5355     * @since 10
5356     */
5357    /**
5358     * The default mode is sequential playback
5359     * @syscap SystemCapability.Multimedia.AVSession.Core
5360     * @atomicservice
5361     * @since 12
5362     */
5363    LOOP_MODE_SEQUENCE = 0,
5364
5365    /**
5366     * Single loop mode
5367     * @syscap SystemCapability.Multimedia.AVSession.Core
5368     * @since 10
5369     */
5370    /**
5371     * Single loop mode
5372     * @syscap SystemCapability.Multimedia.AVSession.Core
5373     * @atomicservice
5374     * @since 12
5375     */
5376    LOOP_MODE_SINGLE = 1,
5377
5378    /**
5379     * List loop mode
5380     * @syscap SystemCapability.Multimedia.AVSession.Core
5381     * @since 10
5382     */
5383    /**
5384     * List loop mode
5385     * @syscap SystemCapability.Multimedia.AVSession.Core
5386     * @atomicservice
5387     * @since 12
5388     */
5389    LOOP_MODE_LIST = 2,
5390
5391    /**
5392     * Shuffle playback mode
5393     * @syscap SystemCapability.Multimedia.AVSession.Core
5394     * @since 10
5395     */
5396    /**
5397     * Shuffle playback mode
5398     * @syscap SystemCapability.Multimedia.AVSession.Core
5399     * @atomicservice
5400     * @since 12
5401     */
5402    LOOP_MODE_SHUFFLE = 3,
5403
5404    /**
5405     * Custom playback mode supported by application
5406     * @syscap SystemCapability.Multimedia.AVSession.Core
5407     * @since 11
5408     */
5409    /**
5410     * Custom playback mode supported by application
5411     * @syscap SystemCapability.Multimedia.AVSession.Core
5412     * @atomicservice
5413     * @since 12
5414     */
5415    LOOP_MODE_CUSTOM = 4,
5416  }
5417
5418  /**
5419   * Supported skip intervals definition
5420   * @enum { number }
5421   * @syscap SystemCapability.Multimedia.AVSession.Core
5422   * @since 11
5423   */
5424  enum SkipIntervals {
5425    /**
5426     * 10 seconds
5427     * @syscap SystemCapability.Multimedia.AVSession.Core
5428     * @since 11
5429     */
5430    SECONDS_10 = 10,
5431    /**
5432     * 15 seconds
5433     * @syscap SystemCapability.Multimedia.AVSession.Core
5434     * @since 11
5435     */
5436    SECONDS_15 = 15,
5437    /**
5438     * 30 seconds
5439     * @syscap SystemCapability.Multimedia.AVSession.Core
5440     * @since 11
5441     */
5442    SECONDS_30 = 30,
5443  }
5444
5445  /**
5446   * Definition of current playback state
5447   * @enum { number }
5448   * @syscap SystemCapability.Multimedia.AVSession.Core
5449   * @since 10
5450   */
5451  /**
5452   * Definition of current playback state
5453   * @enum { number }
5454   * @syscap SystemCapability.Multimedia.AVSession.Core
5455   * @atomicservice
5456   * @since 12
5457   */
5458  enum PlaybackState {
5459    /**
5460     * Initial state. The initial state of media file
5461     * @syscap SystemCapability.Multimedia.AVSession.Core
5462     * @since 10
5463     */
5464    /**
5465     * Initial state. The initial state of media file
5466     * @syscap SystemCapability.Multimedia.AVSession.Core
5467     * @atomicservice
5468     * @since 12
5469     */
5470    PLAYBACK_STATE_INITIAL = 0,
5471
5472    /**
5473     * Preparing state. Indicates that the media file is not ready to play,
5474     * the media is loading or buffering
5475     * @syscap SystemCapability.Multimedia.AVSession.Core
5476     * @since 10
5477     */
5478    /**
5479     * Preparing state. Indicates that the media file is not ready to play,
5480     * the media is loading or buffering
5481     * @syscap SystemCapability.Multimedia.AVSession.Core
5482     * @atomicservice
5483     * @since 12
5484     */
5485    PLAYBACK_STATE_PREPARE = 1,
5486
5487    /**
5488     * Playing state.
5489     * @syscap SystemCapability.Multimedia.AVSession.Core
5490     * @since 10
5491     */
5492    /**
5493     * Playing state.
5494     * @syscap SystemCapability.Multimedia.AVSession.Core
5495     * @atomicservice
5496     * @since 12
5497     */
5498    PLAYBACK_STATE_PLAY = 2,
5499
5500    /**
5501     * Paused state.
5502     * @syscap SystemCapability.Multimedia.AVSession.Core
5503     * @since 10
5504     */
5505    /**
5506     * Paused state.
5507     * @syscap SystemCapability.Multimedia.AVSession.Core
5508     * @atomicservice
5509     * @since 12
5510     */
5511    PLAYBACK_STATE_PAUSE = 3,
5512
5513    /**
5514     * Fast forwarding state.
5515     * @syscap SystemCapability.Multimedia.AVSession.Core
5516     * @since 10
5517     */
5518    /**
5519     * Fast forwarding state.
5520     * @syscap SystemCapability.Multimedia.AVSession.Core
5521     * @atomicservice
5522     * @since 12
5523     */
5524    PLAYBACK_STATE_FAST_FORWARD = 4,
5525
5526    /**
5527     * Rewinding state.
5528     * @syscap SystemCapability.Multimedia.AVSession.Core
5529     * @since 10
5530     */
5531    /**
5532     * Rewinding state.
5533     * @syscap SystemCapability.Multimedia.AVSession.Core
5534     * @atomicservice
5535     * @since 12
5536     */
5537    PLAYBACK_STATE_REWIND = 5,
5538
5539    /**
5540     * Stopped state.The server will clear the media playback position and other information.
5541     * @syscap SystemCapability.Multimedia.AVSession.Core
5542     * @since 10
5543     */
5544    /**
5545     * Stopped state.The server will clear the media playback position and other information.
5546     * @syscap SystemCapability.Multimedia.AVSession.Core
5547     * @atomicservice
5548     * @since 12
5549     */
5550    PLAYBACK_STATE_STOP = 6,
5551
5552    /**
5553     * Completed state.
5554     * @syscap SystemCapability.Multimedia.AVSession.Core
5555     * @since 10
5556     */
5557    /**
5558     * Completed state.
5559     * @syscap SystemCapability.Multimedia.AVSession.Core
5560     * @atomicservice
5561     * @since 12
5562     */
5563    PLAYBACK_STATE_COMPLETED = 7,
5564
5565    /**
5566     * Released state.
5567     * @syscap SystemCapability.Multimedia.AVSession.Core
5568     * @since 10
5569     */
5570    /**
5571     * Released state.
5572     * @syscap SystemCapability.Multimedia.AVSession.Core
5573     * @atomicservice
5574     * @since 12
5575     */
5576    PLAYBACK_STATE_RELEASED = 8,
5577
5578    /**
5579     * error state.
5580     * @syscap SystemCapability.Multimedia.AVSession.Core
5581     * @since 10
5582     */
5583    /**
5584     * error state.
5585     * @syscap SystemCapability.Multimedia.AVSession.Core
5586     * @atomicservice
5587     * @since 12
5588     */
5589    PLAYBACK_STATE_ERROR = 9,
5590
5591    /**
5592     * Idle state.
5593     * @syscap SystemCapability.Multimedia.AVSession.Core
5594     * @since 11
5595     */
5596    /**
5597     * Idle state.
5598     * @syscap SystemCapability.Multimedia.AVSession.Core
5599     * @atomicservice
5600     * @since 12
5601     */
5602    PLAYBACK_STATE_IDLE = 10,
5603
5604    /**
5605     * Buffering state.
5606     * @syscap SystemCapability.Multimedia.AVSession.Core
5607     * @since 11
5608     */
5609    /**
5610     * Buffering state.
5611     * @syscap SystemCapability.Multimedia.AVSession.Core
5612     * @atomicservice
5613     * @since 12
5614     */
5615    PLAYBACK_STATE_BUFFERING = 11,
5616  }
5617
5618  /**
5619   * The description of the session
5620   * @interface AVSessionDescriptor
5621   * @syscap SystemCapability.Multimedia.AVSession.Manager
5622   * @systemapi
5623   * @since 9
5624   */
5625  interface AVSessionDescriptor {
5626    /**
5627     * Unique ID of the session
5628     * @type { string }
5629     * @syscap SystemCapability.Multimedia.AVSession.Manager
5630     * @systemapi
5631     * @since 9
5632     */
5633    sessionId: string;
5634
5635    /**
5636     * Session type, currently supports audio or video
5637     * @type { AVSessionType }
5638     * @syscap SystemCapability.Multimedia.AVSession.Manager
5639     * @systemapi
5640     * @since 9
5641     */
5642    type: AVSessionType;
5643
5644    /**
5645     * The session tag set by the application
5646     * @type { string }
5647     * @syscap SystemCapability.Multimedia.AVSession.Manager
5648     * @systemapi
5649     * @since 9
5650     */
5651    sessionTag: string;
5652
5653    /**
5654     * The elementName of the ability that created this session. See {@link ElementName} in bundle/elementName.d.ts
5655     * @type { ElementName }
5656     * @syscap SystemCapability.Multimedia.AVSession.Manager
5657     * @systemapi
5658     * @since 9
5659     */
5660    elementName: ElementName;
5661
5662    /**
5663     * Session active state
5664     * @type { boolean }
5665     * @syscap SystemCapability.Multimedia.AVSession.Manager
5666     * @systemapi
5667     * @since 9
5668     */
5669    isActive: boolean;
5670
5671    /**
5672     * Is it the top priority session
5673     * @type { boolean }
5674     * @syscap SystemCapability.Multimedia.AVSession.Manager
5675     * @systemapi
5676     * @since 9
5677     */
5678    isTopSession: boolean;
5679
5680    /**
5681     * The current output device information.
5682     * It will be undefined if this is a local session.
5683     * @type { OutputDeviceInfo }
5684     * @syscap SystemCapability.Multimedia.AVSession.Manager
5685     * @systemapi
5686     * @since 9
5687     */
5688    outputDevice: OutputDeviceInfo;
5689  }
5690
5691  /**
5692   * Session controller,used to control media playback and get media information
5693   * @interface AVSessionController
5694   * @syscap SystemCapability.Multimedia.AVSession.Core
5695   * @since 10
5696   */
5697  /**
5698   * Session controller,used to control media playback and get media information
5699   * @typedef AVSessionController
5700   * @syscap SystemCapability.Multimedia.AVSession.Core
5701   * @atomicservice
5702   * @since 12
5703   */
5704  interface AVSessionController {
5705    /**
5706     * Unique session Id
5707     * @type { string }
5708     * @syscap SystemCapability.Multimedia.AVSession.Core
5709     * @since 10
5710     */
5711    /**
5712     * Unique session Id
5713     * @type { string }
5714     * @syscap SystemCapability.Multimedia.AVSession.Core
5715     * @atomicservice
5716     * @since 12
5717     */
5718    readonly sessionId: string;
5719
5720    /**
5721     * Get the playback status of the current session
5722     * @param { AsyncCallback<AVPlaybackState> } callback - The triggered asyncCallback when (getAVPlaybackState).
5723     * @throws { BusinessError } 6600101 - Session service exception.
5724     * @throws { BusinessError } 6600102 - The session does not exist.
5725     * @throws { BusinessError } 6600103 - The session controller does not exist.
5726     * @syscap SystemCapability.Multimedia.AVSession.Core
5727     * @since 10
5728     */
5729    getAVPlaybackState(callback: AsyncCallback<AVPlaybackState>): void;
5730
5731    /**
5732     * Get the playback status of the current session
5733     * @returns { Promise<AVPlaybackState> } (AVPlaybackState) returned through promise
5734     * @throws { BusinessError } 6600101 - Session service exception.
5735     * @throws { BusinessError } 6600102 - The session does not exist.
5736     * @throws { BusinessError } 6600103 - The session controller does not exist.
5737     * @syscap SystemCapability.Multimedia.AVSession.Core
5738     * @since 10
5739     */
5740    /**
5741     * Get the playback status of the current session
5742     * @returns { Promise<AVPlaybackState> } (AVPlaybackState) returned through promise
5743     * @throws { BusinessError } 6600101 - Session service exception.
5744     * @throws { BusinessError } 6600102 - The session does not exist.
5745     * @throws { BusinessError } 6600103 - The session controller does not exist.
5746     * @syscap SystemCapability.Multimedia.AVSession.Core
5747     * @atomicservice
5748     * @since 12
5749     */
5750    getAVPlaybackState(): Promise<AVPlaybackState>;
5751
5752    /**
5753     * Get the playback status of the current session
5754     * @returns { AVPlaybackState } (AVPlaybackState) returned
5755     * @throws { BusinessError } 6600101 - Session service exception.
5756     * @throws { BusinessError } 6600102 - The session does not exist.
5757     * @throws { BusinessError } 6600103 - The session controller does not exist.
5758     * @syscap SystemCapability.Multimedia.AVSession.Core
5759     * @since 10
5760     */
5761    /**
5762     * Get the playback status of the current session
5763     * @returns { AVPlaybackState } (AVPlaybackState) returned
5764     * @throws { BusinessError } 6600101 - Session service exception.
5765     * @throws { BusinessError } 6600102 - The session does not exist.
5766     * @throws { BusinessError } 6600103 - The session controller does not exist.
5767     * @syscap SystemCapability.Multimedia.AVSession.Core
5768     * @atomicservice
5769     * @since 12
5770     */
5771    getAVPlaybackStateSync(): AVPlaybackState;
5772
5773    /**
5774     * Get the metadata of the current session
5775     * @param { AsyncCallback<AVMetadata> } callback - The triggered asyncCallback when (getAVMetadata).
5776     * @throws { BusinessError } 6600101 - Session service exception.
5777     * @throws { BusinessError } 6600102 - The session does not exist.
5778     * @throws { BusinessError } 6600103 - The session controller does not exist.
5779     * @syscap SystemCapability.Multimedia.AVSession.Core
5780     * @since 10
5781     */
5782    getAVMetadata(callback: AsyncCallback<AVMetadata>): void;
5783
5784    /**
5785     * Get the metadata of the current session
5786     * @returns { Promise<AVMetadata> } (AVMetadata) returned through promise
5787     * @throws { BusinessError } 6600101 - Session service exception.
5788     * @throws { BusinessError } 6600102 - The session does not exist.
5789     * @throws { BusinessError } 6600103 - The session controller does not exist.
5790     * @syscap SystemCapability.Multimedia.AVSession.Core
5791     * @since 10
5792     */
5793    /**
5794     * Get the metadata of the current session
5795     * @returns { Promise<AVMetadata> } (AVMetadata) returned through promise
5796     * @throws { BusinessError } 6600101 - Session service exception.
5797     * @throws { BusinessError } 6600102 - The session does not exist.
5798     * @throws { BusinessError } 6600103 - The session controller does not exist.
5799     * @syscap SystemCapability.Multimedia.AVSession.Core
5800     * @atomicservice
5801     * @since 12
5802     */
5803    getAVMetadata(): Promise<AVMetadata>;
5804
5805    /**
5806     * Get the metadata of the current session
5807     * @returns { AVMetadata } (AVMetadata) returned
5808     * @throws { BusinessError } 6600101 - Session service exception.
5809     * @throws { BusinessError } 6600102 - The session does not exist.
5810     * @throws { BusinessError } 6600103 - The session controller does not exist.
5811     * @syscap SystemCapability.Multimedia.AVSession.Core
5812     * @since 10
5813     */
5814    /**
5815     * Get the metadata of the current session
5816     * @returns { AVMetadata } (AVMetadata) returned
5817     * @throws { BusinessError } 6600101 - Session service exception.
5818     * @throws { BusinessError } 6600102 - The session does not exist.
5819     * @throws { BusinessError } 6600103 - The session controller does not exist.
5820     * @syscap SystemCapability.Multimedia.AVSession.Core
5821     * @atomicservice
5822     * @since 12
5823     */
5824    getAVMetadataSync(): AVMetadata;
5825
5826    /**
5827     * Get the call status of the current session
5828     * @param { AsyncCallback<AVCallState> } callback - The triggered asyncCallback when (getAVCallState).
5829     * @throws { BusinessError } 6600101 - Session service exception.
5830     * @throws { BusinessError } 6600102 - The session does not exist.
5831     * @throws { BusinessError } 6600103 - The session controller does not exist.
5832     * @syscap SystemCapability.Multimedia.AVSession.Core
5833     * @since 11
5834     */
5835    getAVCallState(callback: AsyncCallback<AVCallState>): void;
5836
5837    /**
5838     * Get the call status of the current session
5839     * @returns { Promise<AVCallState> } (AVCallState) returned through promise
5840     * @throws { BusinessError } 6600101 - Session service exception.
5841     * @throws { BusinessError } 6600102 - The session does not exist.
5842     * @throws { BusinessError } 6600103 - The session controller does not exist.
5843     * @syscap SystemCapability.Multimedia.AVSession.Core
5844     * @since 11
5845     */
5846    getAVCallState(): Promise<AVCallState>;
5847
5848    /**
5849     * Get the call metadata of the current session
5850     * @param { AsyncCallback<CallMetadata> } callback - The triggered asyncCallback when (getCallMetadata).
5851     * @throws { BusinessError } 6600101 - Session service exception.
5852     * @throws { BusinessError } 6600102 - The session does not exist.
5853     * @throws { BusinessError } 6600103 - The session controller does not exist.
5854     * @syscap SystemCapability.Multimedia.AVSession.Core
5855     * @since 11
5856     */
5857    getCallMetadata(callback: AsyncCallback<CallMetadata>): void;
5858
5859    /**
5860     * Get the call metadata of the current session
5861     * @returns { Promise<CallMetadata> } (CallMetadata) returned through promise
5862     * @throws { BusinessError } 6600101 - Session service exception.
5863     * @throws { BusinessError } 6600102 - The session does not exist.
5864     * @throws { BusinessError } 6600103 - The session controller does not exist.
5865     * @syscap SystemCapability.Multimedia.AVSession.Core
5866     * @since 11
5867     */
5868    getCallMetadata(): Promise<CallMetadata>;
5869
5870    /**
5871     * Get the name of the playlist of the current session
5872     * @param { AsyncCallback<string> } callback - The triggered asyncCallback when (getAVQueueTitle).
5873     * @throws { BusinessError } 6600101 - Session service exception.
5874     * @throws { BusinessError } 6600102 - The session does not exist.
5875     * @throws { BusinessError } 6600103 - The session controller does not exist.
5876     * @syscap SystemCapability.Multimedia.AVSession.Core
5877     * @since 10
5878     */
5879    getAVQueueTitle(callback: AsyncCallback<string>): void;
5880
5881    /**
5882     * Get the name of the playlist of the current session
5883     * @returns { Promise<string> } (string) returned through promise
5884     * @throws { BusinessError } 6600101 - Session service exception.
5885     * @throws { BusinessError } 6600102 - The session does not exist.
5886     * @throws { BusinessError } 6600103 - The session controller does not exist.
5887     * @syscap SystemCapability.Multimedia.AVSession.Core
5888     * @since 10
5889     */
5890    /**
5891     * Get the name of the playlist of the current session
5892     * @returns { Promise<string> } (string) returned through promise
5893     * @throws { BusinessError } 6600101 - Session service exception.
5894     * @throws { BusinessError } 6600102 - The session does not exist.
5895     * @throws { BusinessError } 6600103 - The session controller does not exist.
5896     * @syscap SystemCapability.Multimedia.AVSession.Core
5897     * @atomicservice
5898     * @since 12
5899     */
5900    getAVQueueTitle(): Promise<string>;
5901
5902    /**
5903     * Get the name of the playlist of the current session
5904     * @returns { string } (string) returned
5905     * @throws { BusinessError } 6600101 - Session service exception.
5906     * @throws { BusinessError } 6600102 - The session does not exist.
5907     * @throws { BusinessError } 6600103 - The session controller does not exist.
5908     * @syscap SystemCapability.Multimedia.AVSession.Core
5909     * @since 10
5910     */
5911    /**
5912     * Get the name of the playlist of the current session
5913     * @returns { string } (string) returned
5914     * @throws { BusinessError } 6600101 - Session service exception.
5915     * @throws { BusinessError } 6600102 - The session does not exist.
5916     * @throws { BusinessError } 6600103 - The session controller does not exist.
5917     * @syscap SystemCapability.Multimedia.AVSession.Core
5918     * @atomicservice
5919     * @since 12
5920     */
5921    getAVQueueTitleSync(): string;
5922
5923    /**
5924     * Get the playlist of the current session
5925     * @param { AsyncCallback<Array<AVQueueItem>> } callback - The triggered asyncCallback when (getAVQueueItems).
5926     * @throws { BusinessError } 6600101 - Session service exception.
5927     * @throws { BusinessError } 6600102 - The session does not exist.
5928     * @throws { BusinessError } 6600103 - The session controller does not exist.
5929     * @syscap SystemCapability.Multimedia.AVSession.Core
5930     * @since 10
5931     */
5932    getAVQueueItems(callback: AsyncCallback<Array<AVQueueItem>>): void;
5933
5934    /**
5935     * Get the playlist of the current session
5936     * @returns { Promise<Array<AVQueueItem>> } (Array<AVQueueItem>) returned through promise
5937     * @throws { BusinessError } 6600101 - Session service exception.
5938     * @throws { BusinessError } 6600102 - The session does not exist.
5939     * @throws { BusinessError } 6600103 - The session controller does not exist.
5940     * @syscap SystemCapability.Multimedia.AVSession.Core
5941     * @since 10
5942     */
5943    /**
5944     * Get the playlist of the current session
5945     * @returns { Promise<Array<AVQueueItem>> } (Array<AVQueueItem>) returned through promise
5946     * @throws { BusinessError } 6600101 - Session service exception.
5947     * @throws { BusinessError } 6600102 - The session does not exist.
5948     * @throws { BusinessError } 6600103 - The session controller does not exist.
5949     * @syscap SystemCapability.Multimedia.AVSession.Core
5950     * @atomicservice
5951     * @since 12
5952     */
5953    getAVQueueItems(): Promise<Array<AVQueueItem>>;
5954
5955    /**
5956     * Get the playlist of the current session
5957     * @returns { Array<AVQueueItem> } (Array<AVQueueItem>) returned
5958     * @throws { BusinessError } 6600101 - Session service exception.
5959     * @throws { BusinessError } 6600102 - The session does not exist.
5960     * @throws { BusinessError } 6600103 - The session controller does not exist.
5961     * @syscap SystemCapability.Multimedia.AVSession.Core
5962     * @since 10
5963     */
5964    /**
5965     * Get the playlist of the current session
5966     * @returns { Array<AVQueueItem> } (Array<AVQueueItem>) returned
5967     * @throws { BusinessError } 6600101 - Session service exception.
5968     * @throws { BusinessError } 6600102 - The session does not exist.
5969     * @throws { BusinessError } 6600103 - The session controller does not exist.
5970     * @syscap SystemCapability.Multimedia.AVSession.Core
5971     * @atomicservice
5972     * @since 12
5973     */
5974    getAVQueueItemsSync(): Array<AVQueueItem>;
5975
5976    /**
5977     * Set the item in the playlist to be played
5978     * @param { number } itemId - The serial number of the item to be played
5979     * @param { AsyncCallback<void> } callback - The asyncCallback triggered when the command is executed successfully
5980     * @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
5981     * 2.Parameter verification failed.
5982     * @throws { BusinessError } 6600101 - Session service exception.
5983     * @throws { BusinessError } 6600102 - The session does not exist.
5984     * @throws { BusinessError } 6600103 - The session controller does not exist.
5985     * @syscap SystemCapability.Multimedia.AVSession.Core
5986     * @since 10
5987     */
5988    skipToQueueItem(itemId: number, callback: AsyncCallback<void>): void;
5989
5990    /**
5991     * Set the item in the playlist to be played
5992     * @param { number } itemId - The serial number of the item to be played
5993     * @returns { Promise<void> } void promise when executed successfully
5994     * @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
5995     * 2.Parameter verification failed.
5996     * @throws { BusinessError } 6600101 - Session service exception.
5997     * @throws { BusinessError } 6600102 - The session does not exist.
5998     * @throws { BusinessError } 6600103 - The session controller does not exist.
5999     * @syscap SystemCapability.Multimedia.AVSession.Core
6000     * @since 10
6001     */
6002    /**
6003     * Set the item in the playlist to be played
6004     * @param { number } itemId - The serial number of the item to be played
6005     * @returns { Promise<void> } void promise when executed successfully
6006     * @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
6007     * 2.Parameter verification failed.
6008     * @throws { BusinessError } 6600101 - Session service exception.
6009     * @throws { BusinessError } 6600102 - The session does not exist.
6010     * @throws { BusinessError } 6600103 - The session controller does not exist.
6011     * @syscap SystemCapability.Multimedia.AVSession.Core
6012     * @atomicservice
6013     * @since 12
6014     */
6015    skipToQueueItem(itemId: number): Promise<void>;
6016
6017    /**
6018     * Get output device information
6019     * @param { AsyncCallback<OutputDeviceInfo> } callback - The triggered asyncCallback when (getOutputDevice).
6020     * @throws { BusinessError } 600101 - Session service exception.
6021     * @throws { BusinessError } 600103 - The session controller does not exist.
6022     * @syscap SystemCapability.Multimedia.AVSession.Core
6023     * @since 10
6024     */
6025    getOutputDevice(callback: AsyncCallback<OutputDeviceInfo>): void;
6026
6027    /**
6028     * Get output device information
6029     * @returns { Promise<OutputDeviceInfo> } (OutputDeviceInfo) returned through promise
6030     * @throws { BusinessError } 600101 - Session service exception.
6031     * @throws { BusinessError } 600103 - The session controller does not exist.
6032     * @syscap SystemCapability.Multimedia.AVSession.Core
6033     * @since 10
6034     */
6035    /**
6036     * Get output device information
6037     * @returns { Promise<OutputDeviceInfo> } (OutputDeviceInfo) returned through promise
6038     * @throws { BusinessError } 600101 - Session service exception.
6039     * @throws { BusinessError } 600103 - The session controller does not exist.
6040     * @syscap SystemCapability.Multimedia.AVSession.Core
6041     * @atomicservice
6042     * @since 12
6043     */
6044    getOutputDevice(): Promise<OutputDeviceInfo>;
6045
6046    /**
6047     * Get output device information
6048     * @returns { OutputDeviceInfo } (OutputDeviceInfo) returned
6049     * @throws { BusinessError } 6600101 - Session service exception.
6050     * @throws { BusinessError } 6600103 - The session controller does not exist.
6051     * @syscap SystemCapability.Multimedia.AVSession.Core
6052     * @since 10
6053     */
6054    /**
6055     * Get output device information
6056     * @returns { OutputDeviceInfo } (OutputDeviceInfo) returned
6057     * @throws { BusinessError } 6600101 - Session service exception.
6058     * @throws { BusinessError } 6600103 - The session controller does not exist.
6059     * @syscap SystemCapability.Multimedia.AVSession.Core
6060     * @atomicservice
6061     * @since 12
6062     */
6063    getOutputDeviceSync(): OutputDeviceInfo;
6064
6065    /**
6066     * Send media key event to this session
6067     * @param { KeyEvent } event - The KeyEvent
6068     * @param { AsyncCallback<void> } callback - The asyncCallback triggered when the command is executed successfully.
6069     * @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
6070     * 2.Parameter verification failed.
6071     * @throws { BusinessError } 600101 - Session service exception.
6072     * @throws { BusinessError } 600102 - The session does not exist.
6073     * @throws { BusinessError } 600103 - The session controller does not exist.
6074     * @throws { BusinessError } 600105 - Invalid session command.
6075     * @throws { BusinessError } 600106 - The session is not activated.
6076     * @syscap SystemCapability.Multimedia.AVSession.Core
6077     * @since 10
6078     */
6079    sendAVKeyEvent(event: KeyEvent, callback: AsyncCallback<void>): void;
6080
6081    /**
6082     * Send media key event to this session
6083     * @param { KeyEvent } event - The KeyEvent
6084     * @returns { Promise<void> } void promise when executed successfully
6085     * @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
6086     * 2.Parameter verification failed.
6087     * @throws { BusinessError } 600101 - Session service exception.
6088     * @throws { BusinessError } 600102 - The session does not exist.
6089     * @throws { BusinessError } 600103 - The session controller does not exist.
6090     * @throws { BusinessError } 600105 - Invalid session command.
6091     * @throws { BusinessError } 600106 - The session is not activated.
6092     * @syscap SystemCapability.Multimedia.AVSession.Core
6093     * @since 10
6094     */
6095    /**
6096     * Send media key event to this session
6097     * @param { KeyEvent } event - The KeyEvent
6098     * @returns { Promise<void> } void promise when executed successfully
6099     * @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
6100     * 2.Parameter verification failed.
6101     * @throws { BusinessError } 600101 - Session service exception.
6102     * @throws { BusinessError } 600102 - The session does not exist.
6103     * @throws { BusinessError } 600103 - The session controller does not exist.
6104     * @throws { BusinessError } 600105 - Invalid session command.
6105     * @throws { BusinessError } 600106 - The session is not activated.
6106     * @syscap SystemCapability.Multimedia.AVSession.Core
6107     * @atomicservice
6108     * @since 12
6109     */
6110    sendAVKeyEvent(event: KeyEvent): Promise<void>;
6111
6112    /**
6113     * Get the {@link WantAgent} of this session that can launch the session ability
6114     * @param { AsyncCallback<WantAgent> } callback - The asyncCallback triggered when getting the WantAgent.
6115     * @throws { BusinessError } 6600101 - Session service exception.
6116     * @throws { BusinessError } 6600102 - The session does not exist.
6117     * @throws { BusinessError } 6600103 - The session controller does not exist.
6118     * @syscap SystemCapability.Multimedia.AVSession.Core
6119     * @since 10
6120     */
6121    getLaunchAbility(callback: AsyncCallback<WantAgent>): void;
6122
6123    /**
6124     * Get the {@link WantAgent} of this session that can launch the session ability
6125     * @returns { Promise<WantAgent> } WantAgent promise
6126     * @throws { BusinessError } 6600101 - Session service exception.
6127     * @throws { BusinessError } 6600102 - The session does not exist.
6128     * @throws { BusinessError } 6600103 - The session controller does not exist.
6129     * @syscap SystemCapability.Multimedia.AVSession.Core
6130     * @since 10
6131     */
6132    /**
6133     * Get the {@link WantAgent} of this session that can launch the session ability
6134     * @returns { Promise<WantAgent> } WantAgent promise
6135     * @throws { BusinessError } 6600101 - Session service exception.
6136     * @throws { BusinessError } 6600102 - The session does not exist.
6137     * @throws { BusinessError } 6600103 - The session controller does not exist.
6138     * @syscap SystemCapability.Multimedia.AVSession.Core
6139     * @atomicservice
6140     * @since 12
6141     */
6142    getLaunchAbility(): Promise<WantAgent>;
6143
6144    /**
6145     * Get the adjusted playback position. The time automatically calculated by the system
6146     * taking into account factors such as playback status, playback speed, and application update time.
6147     * @returns { number } current playback position in ms.Note that the returns value of each call will be different.
6148     * @throws { BusinessError } 6600101 - Session service exception.
6149     * @throws { BusinessError } 6600103 - The session controller does not exist.
6150     * @syscap SystemCapability.Multimedia.AVSession.Core
6151     * @since 10
6152     */
6153    /**
6154     * Get the adjusted playback position. The time automatically calculated by the system
6155     * taking into account factors such as playback status, playback speed, and application update time.
6156     * @returns { number } current playback position in ms.Note that the returns value of each call will be different.
6157     * @throws { BusinessError } 6600101 - Session service exception.
6158     * @throws { BusinessError } 6600103 - The session controller does not exist.
6159     * @syscap SystemCapability.Multimedia.AVSession.Core
6160     * @atomicservice
6161     * @since 12
6162     */
6163    getRealPlaybackPositionSync(): number;
6164
6165    /**
6166     * Check if the current session is active
6167     * @param { AsyncCallback<boolean> } callback - The triggered asyncCallback when (isActive).
6168     * @throws { BusinessError } 6600101 - Session service exception.
6169     * @throws { BusinessError } 6600102 - The session does not exist.
6170     * @throws { BusinessError } 6600103 - The session controller does not exist.
6171     * @syscap SystemCapability.Multimedia.AVSession.Core
6172     * @since 10
6173     */
6174    isActive(callback: AsyncCallback<boolean>): void;
6175
6176    /**
6177     * Check if the current session is active
6178     * @returns { Promise<boolean> } boolean promise
6179     * @throws { BusinessError } 6600101 - Session service exception.
6180     * @throws { BusinessError } 6600102 - The session does not exist.
6181     * @throws { BusinessError } 6600103 - The session controller does not exist.
6182     * @syscap SystemCapability.Multimedia.AVSession.Core
6183     * @since 10
6184     */
6185    /**
6186     * Check if the current session is active
6187     * @returns { Promise<boolean> } boolean promise
6188     * @throws { BusinessError } 6600101 - Session service exception.
6189     * @throws { BusinessError } 6600102 - The session does not exist.
6190     * @throws { BusinessError } 6600103 - The session controller does not exist.
6191     * @syscap SystemCapability.Multimedia.AVSession.Core
6192     * @atomicservice
6193     * @since 12
6194     */
6195    isActive(): Promise<boolean>;
6196
6197    /**
6198     * Check if the current session is active
6199     * @returns { boolean } boolean
6200     * @throws { BusinessError } 6600101 - Session service exception.
6201     * @throws { BusinessError } 6600102 - The session does not exist.
6202     * @throws { BusinessError } 6600103 - The session controller does not exist.
6203     * @syscap SystemCapability.Multimedia.AVSession.Core
6204     * @since 10
6205     */
6206    /**
6207     * Check if the current session is active
6208     * @returns { boolean } boolean
6209     * @throws { BusinessError } 6600101 - Session service exception.
6210     * @throws { BusinessError } 6600102 - The session does not exist.
6211     * @throws { BusinessError } 6600103 - The session controller does not exist.
6212     * @syscap SystemCapability.Multimedia.AVSession.Core
6213     * @atomicservice
6214     * @since 12
6215     */
6216    isActiveSync(): boolean;
6217
6218    /**
6219     * Destroy the server controller
6220     * @param { AsyncCallback<void> } callback - The asyncCallback triggered when the command is executed successfully.
6221     * @throws { BusinessError } 6600101 - Session service exception.
6222     * @throws { BusinessError } 6600103 - The session controller does not exist.
6223     * @syscap SystemCapability.Multimedia.AVSession.Core
6224     * @since 10
6225     */
6226    destroy(callback: AsyncCallback<void>): void;
6227
6228    /**
6229     * Destroy the server controller
6230     * @returns { Promise<void> } void promise when executed successfully
6231     * @throws { BusinessError } 6600101 - Session service exception.
6232     * @throws { BusinessError } 6600103 - The session controller does not exist.
6233     * @syscap SystemCapability.Multimedia.AVSession.Core
6234     * @since 10
6235     */
6236    /**
6237     * Destroy the server controller
6238     * @returns { Promise<void> } void promise when executed successfully
6239     * @throws { BusinessError } 6600101 - Session service exception.
6240     * @throws { BusinessError } 6600103 - The session controller does not exist.
6241     * @syscap SystemCapability.Multimedia.AVSession.Core
6242     * @atomicservice
6243     * @since 12
6244     */
6245    destroy(): Promise<void>;
6246
6247    /**
6248     * Get commands supported by the current session
6249     * @param { AsyncCallback<Array<AVControlCommandType>> } callback - The triggered asyncCallback when (getValidCommands).
6250     * @throws { BusinessError } 6600101 - Session service exception.
6251     * @throws { BusinessError } 6600102 - The session does not exist.
6252     * @throws { BusinessError } 6600103 - The session controller does not exist.
6253     * @syscap SystemCapability.Multimedia.AVSession.Core
6254     * @since 10
6255     */
6256    getValidCommands(callback: AsyncCallback<Array<AVControlCommandType>>): void;
6257
6258    /**
6259     * Get commands supported by the current session
6260     * @returns { Promise<Array<AVControlCommandType>> } array of AVControlCommandType promise
6261     * @throws { BusinessError } 6600101 - Session service exception.
6262     * @throws { BusinessError } 6600102 - The session does not exist.
6263     * @throws { BusinessError } 6600103 - The session controller does not exist.
6264     * @syscap SystemCapability.Multimedia.AVSession.Core
6265     * @since 10
6266     */
6267    /**
6268     * Get commands supported by the current session
6269     * @returns { Promise<Array<AVControlCommandType>> } array of AVControlCommandType promise
6270     * @throws { BusinessError } 6600101 - Session service exception.
6271     * @throws { BusinessError } 6600102 - The session does not exist.
6272     * @throws { BusinessError } 6600103 - The session controller does not exist.
6273     * @syscap SystemCapability.Multimedia.AVSession.Core
6274     * @atomicservice
6275     * @since 12
6276     */
6277    getValidCommands(): Promise<Array<AVControlCommandType>>;
6278
6279    /**
6280     * Get commands supported by the current session
6281     * @returns {Array<AVControlCommandType> } array of AVControlCommandType
6282     * @throws { BusinessError } 6600101 - Session service exception.
6283     * @throws { BusinessError } 6600102 - The session does not exist.
6284     * @throws { BusinessError } 6600103 - The session controller does not exist.
6285     * @syscap SystemCapability.Multimedia.AVSession.Core
6286     * @since 10
6287     */
6288    /**
6289     * Get commands supported by the current session
6290     * @returns {Array<AVControlCommandType> } array of AVControlCommandType
6291     * @throws { BusinessError } 6600101 - Session service exception.
6292     * @throws { BusinessError } 6600102 - The session does not exist.
6293     * @throws { BusinessError } 6600103 - The session controller does not exist.
6294     * @syscap SystemCapability.Multimedia.AVSession.Core
6295     * @atomicservice
6296     * @since 12
6297     */
6298    getValidCommandsSync(): Array<AVControlCommandType>;
6299
6300    /**
6301     * Send control commands to this session
6302     * @param { AVControlCommand } command - The command to be sent. See {@link AVControlCommand}
6303     * @param { AsyncCallback<void> } callback - The asyncCallback triggered when the command is executed successfully.
6304     * @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
6305     * 2.Parameter verification failed.
6306     * @throws { BusinessError } 6600101 - Session service exception.
6307     * @throws { BusinessError } 6600102 - The session does not exist.
6308     * @throws { BusinessError } 6600103 - The session controller does not exist.
6309     * @throws { BusinessError } 6600105 - Invalid session command.
6310     * @throws { BusinessError } 6600106 - The session is not activated.
6311     * @throws { BusinessError } 6600107 - Too many commands or events.
6312     * @syscap SystemCapability.Multimedia.AVSession.Core
6313     * @since 10
6314     */
6315    sendControlCommand(command: AVControlCommand, callback: AsyncCallback<void>): void;
6316
6317    /**
6318     * Send control commands to this session
6319     * @param { AVControlCommand } command - The command to be sent. See {@link AVControlCommand}
6320     * @returns { Promise<void> } void promise when executed successfully
6321     * @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
6322     * 2.Parameter verification failed.
6323     * @throws { BusinessError } 6600101 - Session service exception.
6324     * @throws { BusinessError } 6600102 - The session does not exist.
6325     * @throws { BusinessError } 6600103 - The session controller does not exist.
6326     * @throws { BusinessError } 6600105 - Invalid session command.
6327     * @throws { BusinessError } 6600106 - The session is not activated.
6328     * @throws { BusinessError } 6600107 - Too many commands or events.
6329     * @syscap SystemCapability.Multimedia.AVSession.Core
6330     * @since 10
6331     */
6332    /**
6333     * Send control commands to this session
6334     * @param { AVControlCommand } command - The command to be sent. See {@link AVControlCommand}
6335     * @returns { Promise<void> } void promise when executed successfully
6336     * @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
6337     * 2.Parameter verification failed.
6338     * @throws { BusinessError } 6600101 - Session service exception.
6339     * @throws { BusinessError } 6600102 - The session does not exist.
6340     * @throws { BusinessError } 6600103 - The session controller does not exist.
6341     * @throws { BusinessError } 6600105 - Invalid session command.
6342     * @throws { BusinessError } 6600106 - The session is not activated.
6343     * @throws { BusinessError } 6600107 - Too many commands or events.
6344     * @syscap SystemCapability.Multimedia.AVSession.Core
6345     * @atomicservice
6346     * @since 12
6347     */
6348    sendControlCommand(command: AVControlCommand): Promise<void>;
6349
6350    /**
6351     * Send common commands to this session
6352     * @param { string } command - The command name to be sent.
6353     * @param { object } args - The parameters of session event
6354     * @param { AsyncCallback<void> } callback - The asyncCallback triggered when the command is executed successfully.
6355     * @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
6356     * 2.Parameter verification failed.
6357     * @throws { BusinessError } 6600101 - Session service exception.
6358     * @throws { BusinessError } 6600102 - The session does not exist.
6359     * @throws { BusinessError } 6600103 - The session controller does not exist.
6360     * @throws { BusinessError } 6600105 - Invalid session command.
6361     * @throws { BusinessError } 6600106 - The session is not activated.
6362     * @throws { BusinessError } 6600107 - Too many commands or events.
6363     * @syscap SystemCapability.Multimedia.AVSession.Core
6364     * @since 10
6365     */
6366    sendCommonCommand(command: string, args: {[key: string]: Object}, callback: AsyncCallback<void>): void;
6367
6368    /**
6369     * Send common commands to this session
6370     * @param { string } command - The command name to be sent.
6371     * @param { object } args - The parameters of session event
6372     * @returns { Promise<void> } void promise when executed successfully
6373     * @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
6374     * 2.Parameter verification failed.
6375     * @throws { BusinessError } 6600101 - Session service exception.
6376     * @throws { BusinessError } 6600102 - The session does not exist.
6377     * @throws { BusinessError } 6600103 - The session controller does not exist.
6378     * @throws { BusinessError } 6600105 - Invalid session command.
6379     * @throws { BusinessError } 6600106 - The session is not activated.
6380     * @throws { BusinessError } 6600107 - Too many commands or events.
6381     * @syscap SystemCapability.Multimedia.AVSession.Core
6382     * @since 10
6383     */
6384    /**
6385     * Send common commands to this session
6386     * @param { string } command - The command name to be sent.
6387     * @param { object } args - The parameters of session event
6388     * @returns { Promise<void> } void promise when executed successfully
6389     * @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
6390     * 2.Parameter verification failed.
6391     * @throws { BusinessError } 6600101 - Session service exception.
6392     * @throws { BusinessError } 6600102 - The session does not exist.
6393     * @throws { BusinessError } 6600103 - The session controller does not exist.
6394     * @throws { BusinessError } 6600105 - Invalid session command.
6395     * @throws { BusinessError } 6600106 - The session is not activated.
6396     * @throws { BusinessError } 6600107 - Too many commands or events.
6397     * @syscap SystemCapability.Multimedia.AVSession.Core
6398     * @atomicservice
6399     * @since 12
6400     */
6401    sendCommonCommand(command: string, args: {[key: string]: Object}): Promise<void>;
6402
6403    /**
6404     * Get custom media packets provided by the corresponding session
6405     * @param { AsyncCallback<{[key: string]: Object}> } callback - The triggered asyncCallback when (getExtras).
6406     * @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
6407     * 2.Incorrect parameter types. 3.Parameter verification failed.
6408     * @throws { BusinessError } 6600101 - Session service exception.
6409     * @throws { BusinessError } 6600102 - The session does not exist.
6410     * @throws { BusinessError } 6600103 - The session controller does not exist.
6411     * @throws { BusinessError } 6600105 - Invalid session command.
6412     * @throws { BusinessError } 6600107 - Too many commands or events.
6413     * @syscap SystemCapability.Multimedia.AVSession.Core
6414     * @since 10
6415     */
6416    getExtras(callback: AsyncCallback<{[key: string]: Object}>): void;
6417
6418    /**
6419     * Get custom media packets provided by the corresponding session
6420     * @returns { Promise<{[key: string]: Object}> } the parameters of extras
6421     * @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
6422     * 2.Incorrect parameter types. 3.Parameter verification failed.
6423     * @throws { BusinessError } 6600101 - Session service exception.
6424     * @throws { BusinessError } 6600102 - The session does not exist.
6425     * @throws { BusinessError } 6600103 - The session controller does not exist.
6426     * @throws { BusinessError } 6600105 - Invalid session command.
6427     * @throws { BusinessError } 6600107 - Too many commands or events.
6428     * @syscap SystemCapability.Multimedia.AVSession.Core
6429     * @since 10
6430     */
6431    /**
6432     * Get custom media packets provided by the corresponding session
6433     * @returns { Promise<{[key: string]: Object}> } the parameters of extras
6434     * @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
6435     * 2.Incorrect parameter types. 3.Parameter verification failed.
6436     * @throws { BusinessError } 6600101 - Session service exception.
6437     * @throws { BusinessError } 6600102 - The session does not exist.
6438     * @throws { BusinessError } 6600103 - The session controller does not exist.
6439     * @throws { BusinessError } 6600105 - Invalid session command.
6440     * @throws { BusinessError } 6600107 - Too many commands or events.
6441     * @syscap SystemCapability.Multimedia.AVSession.Core
6442     * @atomicservice
6443     * @since 12
6444     */
6445    getExtras(): Promise<{[key: string]: Object}>;
6446
6447    /**
6448     * Register metadata changed callback
6449     * @param { 'metadataChange' } type
6450     * @param { Array<keyof AVMetadata> | 'all' } filter - The properties of {@link AVMetadata} that you cared about
6451     * @param { function } callback - The callback used to handle metadata changed event.
6452     * The callback function provides the {@link AVMetadata} parameter.
6453     * It only contains the properties set in the filter.
6454     * @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
6455     * 2.Incorrect parameter types.
6456     * @throws { BusinessError } 6600101 - Session service exception.
6457     * @throws { BusinessError } 6600103 - The session controller does not exist.
6458     * @syscap SystemCapability.Multimedia.AVSession.Core
6459     * @since 10
6460     */
6461    /**
6462     * Register metadata changed callback
6463     * @param { 'metadataChange' } type
6464     * @param { Array<keyof AVMetadata> | 'all' } filter - The properties of {@link AVMetadata} that you cared about
6465     * @param { function } callback - The callback used to handle metadata changed event.
6466     * The callback function provides the {@link AVMetadata} parameter.
6467     * It only contains the properties set in the filter.
6468     * @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
6469     * 2.Incorrect parameter types.
6470     * @throws { BusinessError } 6600101 - Session service exception.
6471     * @throws { BusinessError } 6600103 - The session controller does not exist.
6472     * @syscap SystemCapability.Multimedia.AVSession.Core
6473     * @atomicservice
6474     * @since 12
6475     */
6476    on(type: 'metadataChange', filter: Array<keyof AVMetadata> | 'all', callback: (data: AVMetadata) => void);
6477
6478    /**
6479     * Unregister metadata changed callback
6480     * @param { 'metadataChange' } type
6481     * @param { function } callback - The callback used to handle metadata changed event.
6482     * The callback function provides the {@link AVMetadata} parameter.
6483     * It only contains the properties set in the filter.
6484     * @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
6485     * 2.Incorrect parameter types.
6486     * @throws { BusinessError } 6600101 - Session service exception.
6487     * @throws { BusinessError } 6600103 - The session controller does not exist.
6488     * @syscap SystemCapability.Multimedia.AVSession.Core
6489     * @since 10
6490     */
6491    /**
6492     * Unregister metadata changed callback
6493     * @param { 'metadataChange' } type
6494     * @param { function } callback - The callback used to handle metadata changed event.
6495     * The callback function provides the {@link AVMetadata} parameter.
6496     * It only contains the properties set in the filter.
6497     * @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
6498     * 2.Incorrect parameter types.
6499     * @throws { BusinessError } 6600101 - Session service exception.
6500     * @throws { BusinessError } 6600103 - The session controller does not exist.
6501     * @syscap SystemCapability.Multimedia.AVSession.Core
6502     * @atomicservice
6503     * @since 12
6504     */
6505    off(type: 'metadataChange', callback?: (data: AVMetadata) => void);
6506
6507    /**
6508     * Register playback state changed callback
6509     * @param { 'playbackStateChange' } type
6510     * @param { Array<keyof AVPlaybackState> | 'all' } filter - The properties of {@link AVPlaybackState} that you cared about
6511     * @param { function } callback - The callback used to handle playback state changed event.
6512     * The callback function provides the {@link AVPlaybackState} parameter.
6513     * @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
6514     * 2.Incorrect parameter types.
6515     * @throws { BusinessError } 6600101 - Session service exception.
6516     * @throws { BusinessError } 6600103 - The session controller does not exist.
6517     * @syscap SystemCapability.Multimedia.AVSession.Core
6518     * @since 10
6519     */
6520    /**
6521     * Register playback state changed callback
6522     * @param { 'playbackStateChange' } type
6523     * @param { Array<keyof AVPlaybackState> | 'all' } filter - The properties of {@link AVPlaybackState} that you cared about
6524     * @param { function } callback - The callback used to handle playback state changed event.
6525     * The callback function provides the {@link AVPlaybackState} parameter.
6526     * @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
6527     * 2.Incorrect parameter types.
6528     * @throws { BusinessError } 6600101 - Session service exception.
6529     * @throws { BusinessError } 6600103 - The session controller does not exist.
6530     * @syscap SystemCapability.Multimedia.AVSession.Core
6531     * @atomicservice
6532     * @since 12
6533     */
6534    on(type: 'playbackStateChange', filter: Array<keyof AVPlaybackState> | 'all', callback: (state: AVPlaybackState) => void);
6535
6536    /**
6537     * Unregister playback state changed callback
6538     * @param { 'playbackStateChange' } type
6539     * @param { function } callback - The callback used to handle playback state changed event.
6540     * The callback function provides the {@link AVPlaybackState} parameter.
6541     * @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
6542     * 2.Incorrect parameter types.
6543     * @throws { BusinessError } 6600101 - Session service exception.
6544     * @throws { BusinessError } 6600103 - The session controller does not exist.
6545     * @syscap SystemCapability.Multimedia.AVSession.Core
6546     * @since 10
6547     */
6548    /**
6549     * Unregister playback state changed callback
6550     * @param { 'playbackStateChange' } type
6551     * @param { function } callback - The callback used to handle playback state changed event.
6552     * The callback function provides the {@link AVPlaybackState} parameter.
6553     * @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
6554     * 2.Incorrect parameter types.
6555     * @throws { BusinessError } 6600101 - Session service exception.
6556     * @throws { BusinessError } 6600103 - The session controller does not exist.
6557     * @syscap SystemCapability.Multimedia.AVSession.Core
6558     * @atomicservice
6559     * @since 12
6560     */
6561    off(type: 'playbackStateChange', callback?: (state: AVPlaybackState) => void);
6562
6563    /**
6564     * Register call metadata changed callback
6565     * @param { 'callMetadataChange' } type - 'callMetadataChange'
6566     * @param { Array<keyof CallMetadata> | 'all' } filter - The properties of {@link CallMetadata} that you cared about
6567     * @param { Callback<CallMetadata> } callback - The callback used to handle call metadata changed event.
6568     * The callback function provides the {@link CallMetadata} parameter.
6569     * It only contains the properties set in the filter.
6570     * @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
6571     * 2.Incorrect parameter types.
6572     * @throws { BusinessError } 6600101 - Session service exception.
6573     * @throws { BusinessError } 6600103 - The session controller does not exist.
6574     * @syscap SystemCapability.Multimedia.AVSession.Core
6575     * @since 11
6576     */
6577    /**
6578     * Register call metadata changed callback
6579     * @param { 'callMetadataChange' } type - 'callMetadataChange'
6580     * @param { Array<keyof CallMetadata> | 'all' } filter - The properties of {@link CallMetadata} that you cared about
6581     * @param { Callback<CallMetadata> } callback - The callback used to handle call metadata changed event.
6582     * The callback function provides the {@link CallMetadata} parameter.
6583     * It only contains the properties set in the filter.
6584     * @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
6585     * 2.Incorrect parameter types.
6586     * @throws { BusinessError } 6600101 - Session service exception.
6587     * @throws { BusinessError } 6600103 - The session controller does not exist.
6588     * @syscap SystemCapability.Multimedia.AVSession.Core
6589     * @atomicservice
6590     * @since 12
6591     */
6592    on(type: 'callMetadataChange', filter: Array<keyof CallMetadata> | 'all', callback: Callback<CallMetadata>): void;
6593
6594    /**
6595     * Unregister call metadata changed callback
6596     * @param { 'callMetadataChange' } type - 'callMetadataChange'
6597     * @param { Callback<CallMetadata> } callback - The callback used to handle call metadata changed event.
6598     * The callback function provides the {@link CallMetadata} parameter.
6599     * It only contains the properties set in the filter.
6600     * @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
6601     * 2.Incorrect parameter types.
6602     * @throws { BusinessError } 6600101 - Session service exception.
6603     * @throws { BusinessError } 6600103 - The session controller does not exist.
6604     * @syscap SystemCapability.Multimedia.AVSession.Core
6605     * @since 11
6606     */
6607    /**
6608     * Unregister call metadata changed callback
6609     * @param { 'callMetadataChange' } type - 'callMetadataChange'
6610     * @param { Callback<CallMetadata> } callback - The callback used to handle call metadata changed event.
6611     * The callback function provides the {@link CallMetadata} parameter.
6612     * It only contains the properties set in the filter.
6613     * @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
6614     * 2.Incorrect parameter types.
6615     * @throws { BusinessError } 6600101 - Session service exception.
6616     * @throws { BusinessError } 6600103 - The session controller does not exist.
6617     * @syscap SystemCapability.Multimedia.AVSession.Core
6618     * @atomicservice
6619     * @since 12
6620     */
6621    off(type: 'callMetadataChange', callback?: Callback<CallMetadata>): void;
6622
6623    /**
6624     * Register call state changed callback
6625     * @param { 'callStateChange' } type - 'callStateChange'
6626     * @param { Array<keyof AVCallState> | 'all' } filter - The properties of {@link AVCallState} that you cared about
6627     * @param { Callback<AVCallState> } callback - The callback used to handle call state changed event.
6628     * The callback function provides the {@link AVCallState} parameter.
6629     * @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
6630     * 2.Incorrect parameter types.
6631     * @throws { BusinessError } 6600101 - Session service exception.
6632     * @throws { BusinessError } 6600103 - The session controller does not exist.
6633     * @syscap SystemCapability.Multimedia.AVSession.Core
6634     * @since 11
6635     */
6636    /**
6637     * Register call state changed callback
6638     * @param { 'callStateChange' } type - 'callStateChange'
6639     * @param { Array<keyof AVCallState> | 'all' } filter - The properties of {@link AVCallState} that you cared about
6640     * @param { Callback<AVCallState> } callback - The callback used to handle call state changed event.
6641     * The callback function provides the {@link AVCallState} parameter.
6642     * @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
6643     * 2.Incorrect parameter types.
6644     * @throws { BusinessError } 6600101 - Session service exception.
6645     * @throws { BusinessError } 6600103 - The session controller does not exist.
6646     * @syscap SystemCapability.Multimedia.AVSession.Core
6647     * @atomicservice
6648     * @since 12
6649     */
6650    on(type: 'callStateChange', filter: Array<keyof AVCallState> | 'all', callback: Callback<AVCallState>): void;
6651
6652    /**
6653     * Unregister playback state changed callback
6654     * @param { 'callStateChange' } type - 'callStateChange'
6655     * @param { Callback<AVCallState> } callback - The callback used to handle call state changed event.
6656     * The callback function provides the {@link AVCallState} parameter.
6657     * @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
6658     * 2.Incorrect parameter types.
6659     * @throws { BusinessError } 6600101 - Session service exception.
6660     * @throws { BusinessError } 6600103 - The session controller does not exist.
6661     * @syscap SystemCapability.Multimedia.AVSession.Core
6662     * @since 11
6663     */
6664    /**
6665     * Unregister playback state changed callback
6666     * @param { 'callStateChange' } type - 'callStateChange'
6667     * @param { Callback<AVCallState> } callback - The callback used to handle call state changed event.
6668     * The callback function provides the {@link AVCallState} parameter.
6669     * @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
6670     * 2.Incorrect parameter types.
6671     * @throws { BusinessError } 6600101 - Session service exception.
6672     * @throws { BusinessError } 6600103 - The session controller does not exist.
6673     * @syscap SystemCapability.Multimedia.AVSession.Core
6674     * @atomicservice
6675     * @since 12
6676     */
6677    off(type: 'callStateChange', callback?: Callback<AVCallState>): void;
6678
6679    /**
6680     * Register current session destroyed callback
6681     * @param { 'sessionDestroy' } type
6682     * @param { function } callback - The callback used to handle current session destroyed event.
6683     * @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
6684     * 2.Incorrect parameter types.
6685     * @throws { BusinessError } 6600101 - Session service exception.
6686     * @throws { BusinessError } 6600103 - The session controller does not exist.
6687     * @syscap SystemCapability.Multimedia.AVSession.Core
6688     * @since 10
6689     */
6690    /**
6691     * Register current session destroyed callback
6692     * @param { 'sessionDestroy' } type
6693     * @param { function } callback - The callback used to handle current session destroyed event.
6694     * @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
6695     * 2.Incorrect parameter types.
6696     * @throws { BusinessError } 6600101 - Session service exception.
6697     * @throws { BusinessError } 6600103 - The session controller does not exist.
6698     * @syscap SystemCapability.Multimedia.AVSession.Core
6699     * @atomicservice
6700     * @since 12
6701     */
6702    on(type: 'sessionDestroy', callback: () => void);
6703
6704    /**
6705     * Unregister current session destroyed callback
6706     * @param { 'sessionDestroy' } type - 'sessionDestroy'
6707     * @param { function } callback - The callback used to handle current session destroyed event.
6708     * @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
6709     * 2.Incorrect parameter types.
6710     * @throws { BusinessError } 6600101 - Session service exception.
6711     * @throws { BusinessError } 6600103 - The session controller does not exist.
6712     * @syscap SystemCapability.Multimedia.AVSession.Core
6713     * @since 10
6714     */
6715    /**
6716     * Unregister current session destroyed callback
6717     * @param { 'sessionDestroy' } type - 'sessionDestroy'
6718     * @param { function } callback - The callback used to handle current session destroyed event.
6719     * @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
6720     * 2.Incorrect parameter types.
6721     * @throws { BusinessError } 6600101 - Session service exception.
6722     * @throws { BusinessError } 6600103 - The session controller does not exist.
6723     * @syscap SystemCapability.Multimedia.AVSession.Core
6724     * @atomicservice
6725     * @since 12
6726     */
6727    off(type: 'sessionDestroy', callback?: () => void);
6728
6729    /**
6730     * Register the active state of this session changed callback
6731     * @param { 'activeStateChange' } type - 'activeStateChange'
6732     * @param { function } callback - The callback used to handle the active state of this session changed event.
6733     * The callback function provides the changed session state.
6734     * @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
6735     * 2.Incorrect parameter types.
6736     * @throws { BusinessError } 6600101 - Session service exception.
6737     * @throws { BusinessError } 6600103 - The session controller does not exist.
6738     * @syscap SystemCapability.Multimedia.AVSession.Core
6739     * @since 10
6740     */
6741    /**
6742     * Register the active state of this session changed callback
6743     * @param { 'activeStateChange' } type - 'activeStateChange'
6744     * @param { function } callback - The callback used to handle the active state of this session changed event.
6745     * The callback function provides the changed session state.
6746     * @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
6747     * 2.Incorrect parameter types.
6748     * @throws { BusinessError } 6600101 - Session service exception.
6749     * @throws { BusinessError } 6600103 - The session controller does not exist.
6750     * @syscap SystemCapability.Multimedia.AVSession.Core
6751     * @atomicservice
6752     * @since 12
6753     */
6754    on(type: 'activeStateChange', callback: (isActive: boolean) => void);
6755
6756    /**
6757     * Unregister the active state of this session changed callback
6758     * @param { 'activeStateChange' } type - 'activeStateChange'
6759     * @param { function } callback - The callback used to handle the active state of this session changed event.
6760     * The callback function provides the changed session state.
6761     * @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
6762     * 2.Incorrect parameter types.
6763     * @throws { BusinessError } 6600101 - Session service exception.
6764     * @throws { BusinessError } 6600103 - The session controller does not exist.
6765     * @syscap SystemCapability.Multimedia.AVSession.Core
6766     * @since 10
6767     */
6768    /**
6769     * Unregister the active state of this session changed callback
6770     * @param { 'activeStateChange' } type - 'activeStateChange'
6771     * @param { function } callback - The callback used to handle the active state of this session changed event.
6772     * The callback function provides the changed session state.
6773     * @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
6774     * 2.Incorrect parameter types.
6775     * @throws { BusinessError } 6600101 - Session service exception.
6776     * @throws { BusinessError } 6600103 - The session controller does not exist.
6777     * @syscap SystemCapability.Multimedia.AVSession.Core
6778     * @atomicservice
6779     * @since 12
6780     */
6781    off(type: 'activeStateChange', callback?: (isActive: boolean) => void);
6782
6783    /**
6784     * Register the valid commands of the session changed callback
6785     * @param { 'validCommandChange' } type - 'validCommandChange'
6786     * @param { function } callback - The callback used to handle the changes.
6787     * The callback function provides an array of AVControlCommandType.
6788     * @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
6789     * 2.Incorrect parameter types.
6790     * @throws { BusinessError } 6600101 - Session service exception.
6791     * @throws { BusinessError } 6600103 - The session controller does not exist.
6792     * @syscap SystemCapability.Multimedia.AVSession.Core
6793     * @since 10
6794     */
6795    /**
6796     * Register the valid commands of the session changed callback
6797     * @param { 'validCommandChange' } type - 'validCommandChange'
6798     * @param { function } callback - The callback used to handle the changes.
6799     * The callback function provides an array of AVControlCommandType.
6800     * @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
6801     * 2.Incorrect parameter types.
6802     * @throws { BusinessError } 6600101 - Session service exception.
6803     * @throws { BusinessError } 6600103 - The session controller does not exist.
6804     * @syscap SystemCapability.Multimedia.AVSession.Core
6805     * @atomicservice
6806     * @since 12
6807     */
6808    on(type: 'validCommandChange', callback: (commands: Array<AVControlCommandType>) => void);
6809
6810    /**
6811     * Unregister the valid commands of the session changed callback
6812     * @param { 'validCommandChange' } type - 'validCommandChange'
6813     * @param { function } callback - The callback used to handle the changes.
6814     * The callback function provides an array of AVControlCommandType.
6815     * @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
6816     * 2.Incorrect parameter types.
6817     * @throws { BusinessError } 6600101 - Session service exception.
6818     * @throws { BusinessError } 6600103 - The session controller does not exist.
6819     * @syscap SystemCapability.Multimedia.AVSession.Core
6820     * @since 10
6821     */
6822    /**
6823     * Unregister the valid commands of the session changed callback
6824     * @param { 'validCommandChange' } type - 'validCommandChange'
6825     * @param { function } callback - The callback used to handle the changes.
6826     * The callback function provides an array of AVControlCommandType.
6827     * @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
6828     * 2.Incorrect parameter types.
6829     * @throws { BusinessError } 6600101 - Session service exception.
6830     * @throws { BusinessError } 6600103 - The session controller does not exist.
6831     * @syscap SystemCapability.Multimedia.AVSession.Core
6832     * @atomicservice
6833     * @since 12
6834     */
6835    off(type: 'validCommandChange', callback?: (commands: Array<AVControlCommandType>) => void);
6836
6837    /**
6838     * Register session output device change callback
6839     * @param { 'outputDeviceChange' } type - Registration Type 'outputDeviceChange'
6840     * @param { function } callback - Used to handle output device changed.
6841     * The callback provide the new device info {@link OutputDeviceInfo} and related connection state {@link ConnectionState}.
6842     * @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
6843     * 2.Incorrect parameter types.
6844     * @throws { BusinessError } 6600101 - Session service exception
6845     * @throws { BusinessError } 6600103 - The session controller does not exist
6846     * @syscap SystemCapability.Multimedia.AVSession.Core
6847     * @since 10
6848     */
6849    /**
6850     * Register session output device change callback
6851     * @param { 'outputDeviceChange' } type - Registration Type 'outputDeviceChange'
6852     * @param { function } callback - Used to handle output device changed.
6853     * The callback provide the new device info {@link OutputDeviceInfo} and related connection state {@link ConnectionState}.
6854     * @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
6855     * 2.Incorrect parameter types.
6856     * @throws { BusinessError } 6600101 - Session service exception
6857     * @throws { BusinessError } 6600103 - The session controller does not exist
6858     * @syscap SystemCapability.Multimedia.AVSession.Core
6859     * @atomicservice
6860     * @since 12
6861     */
6862    on(type: 'outputDeviceChange', callback: (state: ConnectionState, device: OutputDeviceInfo) => void): void;
6863
6864    /**
6865     * Unregister session output device change callback
6866     * @param { 'outputDeviceChange' } type - Registration Type 'outputDeviceChange'
6867     * @param { function } callback - Used to handle output device changed.
6868     * The callback provide the new device info {@link OutputDeviceInfo} and related connection state {@link ConnectionState}.
6869     * @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
6870     * 2.Incorrect parameter types.
6871     * @throws { BusinessError } 6600101 - Session service exception
6872     * @throws { BusinessError } 6600103 - The session controller does not exist
6873     * @syscap SystemCapability.Multimedia.AVSession.Core
6874     * @since 10
6875     */
6876    /**
6877     * Unregister session output device change callback
6878     * @param { 'outputDeviceChange' } type - Registration Type 'outputDeviceChange'
6879     * @param { function } callback - Used to handle output device changed.
6880     * The callback provide the new device info {@link OutputDeviceInfo} and related connection state {@link ConnectionState}.
6881     * @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
6882     * 2.Incorrect parameter types.
6883     * @throws { BusinessError } 6600101 - Session service exception
6884     * @throws { BusinessError } 6600103 - The session controller does not exist
6885     * @syscap SystemCapability.Multimedia.AVSession.Core
6886     * @atomicservice
6887     * @since 12
6888     */
6889    off(type: 'outputDeviceChange', callback?: (state: ConnectionState, device: OutputDeviceInfo) => void): void;
6890
6891    /**
6892     * Register session event callback
6893     * @param { 'sessionEvent' } type - 'sessionEvent'
6894     * @param { function } callback - The callback used to handle session event changed event.
6895     * The callback function provides the event string and key-value pair parameters.
6896     * @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
6897     * 2.Incorrect parameter types.
6898     * @throws { BusinessError } 6600101 - Session service exception.
6899     * @throws { BusinessError } 6600103 - The session controller does not exist.
6900     * @syscap SystemCapability.Multimedia.AVSession.Core
6901     * @since 10
6902     */
6903    /**
6904     * Register session event callback
6905     * @param { 'sessionEvent' } type - 'sessionEvent'
6906     * @param { function } callback - The callback used to handle session event changed event.
6907     * The callback function provides the event string and key-value pair parameters.
6908     * @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
6909     * 2.Incorrect parameter types.
6910     * @throws { BusinessError } 6600101 - Session service exception.
6911     * @throws { BusinessError } 6600103 - The session controller does not exist.
6912     * @syscap SystemCapability.Multimedia.AVSession.Core
6913     * @atomicservice
6914     * @since 12
6915     */
6916    on(type: 'sessionEvent', callback: (sessionEvent: string, args: {[key: string]: Object}) => void): void;
6917
6918    /**
6919     * Unregister session event callback
6920     * @param { 'sessionEvent' } type - 'sessionEvent'
6921     * @param { function } callback - Used to cancel a specific listener
6922     * The callback function provides the event string and key-value pair parameters.
6923     * @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
6924     * 2.Incorrect parameter types.
6925     * @throws { BusinessError } 6600101 - Session service exception.
6926     * @throws { BusinessError } 6600103 - The session controller does not exist.
6927     * @syscap SystemCapability.Multimedia.AVSession.Core
6928     * @since 10
6929     */
6930    /**
6931     * Unregister session event callback
6932     * @param { 'sessionEvent' } type - 'sessionEvent'
6933     * @param { function } callback - Used to cancel a specific listener
6934     * The callback function provides the event string and key-value pair parameters.
6935     * @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
6936     * 2.Incorrect parameter types.
6937     * @throws { BusinessError } 6600101 - Session service exception.
6938     * @throws { BusinessError } 6600103 - The session controller does not exist.
6939     * @syscap SystemCapability.Multimedia.AVSession.Core
6940     * @atomicservice
6941     * @since 12
6942     */
6943    off(type: 'sessionEvent', callback?: (sessionEvent: string, args: {[key: string]: Object}) => void): void;
6944
6945    /**
6946     * Register session playlist change callback
6947     * @param { 'queueItemsChange' } type - Registration Type 'queueItemsChange'
6948     * @param { function } callback - Used to handle playlist changed.
6949     * The callback provides the new array of AVQueueItem {@link AVQueueItem}
6950     * @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
6951     * 2.Incorrect parameter types.
6952     * @throws { BusinessError } 6600101 - Session service exception.
6953     * @throws { BusinessError } 6600103 - The session controller does not exist.
6954     * @syscap SystemCapability.Multimedia.AVSession.Core
6955     * @since 10
6956     */
6957    /**
6958     * Register session playlist change callback
6959     * @param { 'queueItemsChange' } type - Registration Type 'queueItemsChange'
6960     * @param { function } callback - Used to handle playlist changed.
6961     * The callback provides the new array of AVQueueItem {@link AVQueueItem}
6962     * @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
6963     * 2.Incorrect parameter types.
6964     * @throws { BusinessError } 6600101 - Session service exception.
6965     * @throws { BusinessError } 6600103 - The session controller does not exist.
6966     * @syscap SystemCapability.Multimedia.AVSession.Core
6967     * @atomicservice
6968     * @since 12
6969     */
6970    on(type: 'queueItemsChange', callback: (items: Array<AVQueueItem>) => void): void;
6971
6972    /**
6973     * Unregister session playlist change callback
6974     * @param { 'queueItemsChange' } type - Registration Type 'queueItemsChange'
6975     * @param { function } callback - Used to handle playlist changed.
6976     * The callback provides the new array of AVQueueItem {@link AVQueueItem}
6977     * @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
6978     * 2.Incorrect parameter types.
6979     * @throws { BusinessError } 6600101 - Session service exception.
6980     * @throws { BusinessError } 6600103 - The session controller does not exist.
6981     * @syscap SystemCapability.Multimedia.AVSession.Core
6982     * @since 10
6983     */
6984    /**
6985     * Unregister session playlist change callback
6986     * @param { 'queueItemsChange' } type - Registration Type 'queueItemsChange'
6987     * @param { function } callback - Used to handle playlist changed.
6988     * The callback provides the new array of AVQueueItem {@link AVQueueItem}
6989     * @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
6990     * 2.Incorrect parameter types.
6991     * @throws { BusinessError } 6600101 - Session service exception.
6992     * @throws { BusinessError } 6600103 - The session controller does not exist.
6993     * @syscap SystemCapability.Multimedia.AVSession.Core
6994     * @atomicservice
6995     * @since 12
6996     */
6997    off(type: 'queueItemsChange', callback?: (items: Array<AVQueueItem>) => void): void;
6998
6999    /**
7000     * Register the name of session playlist change callback
7001     * @param { 'queueTitleChange' } type - Registration Type 'queueTitleChange'
7002     * @param { function } callback - Used to handle name of playlist changed.
7003     * The callback provides the new name.
7004     * @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
7005     * 2.Incorrect parameter types.
7006     * @throws { BusinessError } 6600101 - Session service exception.
7007     * @throws { BusinessError } 6600103 - The session controller does not exist.
7008     * @syscap SystemCapability.Multimedia.AVSession.Core
7009     * @since 10
7010     */
7011    /**
7012     * Register the name of session playlist change callback
7013     * @param { 'queueTitleChange' } type - Registration Type 'queueTitleChange'
7014     * @param { function } callback - Used to handle name of playlist changed.
7015     * The callback provides the new name.
7016     * @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
7017     * 2.Incorrect parameter types.
7018     * @throws { BusinessError } 6600101 - Session service exception.
7019     * @throws { BusinessError } 6600103 - The session controller does not exist.
7020     * @syscap SystemCapability.Multimedia.AVSession.Core
7021     * @atomicservice
7022     * @since 12
7023     */
7024    on(type: 'queueTitleChange', callback: (title: string) => void): void;
7025
7026    /**
7027     * Unregister the name of session playlist change callback
7028     * @param { 'queueTitleChange' } type - Registration Type 'queueTitleChange'
7029     * @param { function } callback - Used to handle name of playlist changed.
7030     * The callback provides the new name.
7031     * @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
7032     * 2.Incorrect parameter types.
7033     * @throws { BusinessError } 6600101 - Session service exception.
7034     * @throws { BusinessError } 6600103 - The session controller does not exist.
7035     * @syscap SystemCapability.Multimedia.AVSession.Core
7036     * @since 10
7037     */
7038    /**
7039     * Unregister the name of session playlist change callback
7040     * @param { 'queueTitleChange' } type - Registration Type 'queueTitleChange'
7041     * @param { function } callback - Used to handle name of playlist changed.
7042     * The callback provides the new name.
7043     * @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
7044     * 2.Incorrect parameter types.
7045     * @throws { BusinessError } 6600101 - Session service exception.
7046     * @throws { BusinessError } 6600103 - The session controller does not exist.
7047     * @syscap SystemCapability.Multimedia.AVSession.Core
7048     * @atomicservice
7049     * @since 12
7050     */
7051    off(type: 'queueTitleChange', callback?: (title: string) => void): void;
7052
7053    /**
7054     * Register the custom media packets change callback
7055     * @param { 'extrasChange' } type - Registration Type 'extrasChange'
7056     * @param { function } callback - Used to handle custom media packets changed.
7057     * The callback provides the new media packets.
7058     * @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
7059     * 2.Incorrect parameter types.
7060     * @throws { BusinessError } 6600101 - Session service exception.
7061     * @throws { BusinessError } 6600103 - The session controller does not exist.
7062     * @syscap SystemCapability.Multimedia.AVSession.Core
7063     * @since 10
7064     */
7065    /**
7066     * Register the custom media packets change callback
7067     * @param { 'extrasChange' } type - Registration Type 'extrasChange'
7068     * @param { function } callback - Used to handle custom media packets changed.
7069     * The callback provides the new media packets.
7070     * @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
7071     * 2.Incorrect parameter types.
7072     * @throws { BusinessError } 6600101 - Session service exception.
7073     * @throws { BusinessError } 6600103 - The session controller does not exist.
7074     * @syscap SystemCapability.Multimedia.AVSession.Core
7075     * @atomicservice
7076     * @since 12
7077     */
7078    on(type: 'extrasChange', callback: (extras: {[key: string]: Object}) => void): void;
7079
7080    /**
7081     * Unregister the custom media packets change callback
7082     * @param { 'extrasChange' } type - Registration Type 'extrasChange'
7083     * @param { function } callback - Used to handle custom media packets changed.
7084     * The callback provides the new media packets.
7085     * @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
7086     * 2.Incorrect parameter types.
7087     * @throws { BusinessError } 6600101 - Session service exception.
7088     * @throws { BusinessError } 6600103 - The session controller does not exist.
7089     * @syscap SystemCapability.Multimedia.AVSession.Core
7090     * @since 10
7091     */
7092    /**
7093     * Unregister the custom media packets change callback
7094     * @param { 'extrasChange' } type - Registration Type 'extrasChange'
7095     * @param { function } callback - Used to handle custom media packets changed.
7096     * The callback provides the new media packets.
7097     * @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
7098     * 2.Incorrect parameter types.
7099     * @throws { BusinessError } 6600101 - Session service exception.
7100     * @throws { BusinessError } 6600103 - The session controller does not exist.
7101     * @syscap SystemCapability.Multimedia.AVSession.Core
7102     * @atomicservice
7103     * @since 12
7104     */
7105    off(type: 'extrasChange', callback?: (extras: {[key: string]: Object}) => void): void;
7106  }
7107
7108  /**
7109   * The type of control command
7110   * @typedef { 'play' | 'pause' | 'stop' | 'playNext' | 'playPrevious' | 'fastForward' | 'rewind' | 'seek' |
7111   *     'setSpeed' | 'setLoopMode' | 'toggleFavorite' } AVControlCommandType
7112   * @syscap SystemCapability.Multimedia.AVSession.Core
7113   * @since 10
7114   */
7115  /**
7116   * The type of control command, add new support 'playFromAssetId' | 'answer' | 'hangUp' | 'toggleCallMute'
7117   * @typedef { 'play' | 'pause' | 'stop' | 'playNext' | 'playPrevious' | 'fastForward' | 'rewind' | 'seek' |
7118   *     'setSpeed' | 'setLoopMode' | 'toggleFavorite' | 'playFromAssetId' | 'answer' | 'hangUp' |
7119   *     'toggleCallMute' } AVControlCommandType
7120   * @syscap SystemCapability.Multimedia.AVSession.Core
7121   * @since 11
7122   */
7123  /**
7124   * The type of control command, add new support 'playFromAssetId' | 'answer' | 'hangUp' | 'toggleCallMute'
7125   * @typedef { 'play' | 'pause' | 'stop' | 'playNext' | 'playPrevious' | 'fastForward' | 'rewind' | 'seek' |
7126   *     'setSpeed' | 'setLoopMode' | 'toggleFavorite' | 'playFromAssetId' | 'answer' | 'hangUp' |
7127   *     'toggleCallMute' } AVControlCommandType
7128   * @syscap SystemCapability.Multimedia.AVSession.Core
7129   * @atomicservice
7130   * @since 12
7131   */
7132  type AVControlCommandType = 'play' | 'pause' | 'stop' | 'playNext' | 'playPrevious' | 'fastForward' | 'rewind' |
7133  'seek' | 'setSpeed' | 'setLoopMode' | 'toggleFavorite' | 'playFromAssetId' | 'answer' | 'hangUp' | 'toggleCallMute';
7134
7135  /**
7136   * The definition of command to be sent to the session
7137   * @interface AVControlCommand
7138   * @syscap SystemCapability.Multimedia.AVSession.Core
7139   * @since 10
7140   */
7141  /**
7142   * The definition of command to be sent to the session
7143   * @typedef AVControlCommand
7144   * @syscap SystemCapability.Multimedia.AVSession.Core
7145   * @atomicservice
7146   * @since 12
7147   */
7148  interface AVControlCommand {
7149    /**
7150     * The command value {@link AVControlCommandType}
7151     * @type { AVControlCommandType }
7152     * @syscap SystemCapability.Multimedia.AVSession.Core
7153     * @since 10
7154     */
7155    /**
7156     * The command value {@link AVControlCommandType}
7157     * @type { AVControlCommandType }
7158     * @syscap SystemCapability.Multimedia.AVSession.Core
7159     * @atomicservice
7160     * @since 12
7161     */
7162    command: AVControlCommandType;
7163
7164    /**
7165     * parameter of the command. Whether this command requires parameters, see {@link AVSessionCommand}
7166     * seek command requires a number parameter
7167     * setSpeed command requires a number parameter
7168     * setLoopMode command requires a {@link LoopMode} parameter.
7169     * toggleFavorite command requires assetId {@link AVMetadata.assetId} parameter
7170     * other commands need no parameter
7171     * @type { ?(LoopMode | string | number) }
7172     * @syscap SystemCapability.Multimedia.AVSession.Core
7173     * @since 10
7174     */
7175    /**
7176     * parameter of the command. Whether this command requires parameters, see {@link AVSessionCommand}
7177     * seek command requires a number parameter
7178     * setSpeed command requires a number parameter
7179     * setLoopMode command requires a {@link LoopMode} parameter.
7180     * toggleFavorite command requires assetId {@link AVMetadata.assetId} parameter
7181     * other commands need no parameter
7182     * @type { ?(LoopMode | string | number) }
7183     * @syscap SystemCapability.Multimedia.AVSession.Core
7184     * @atomicservice
7185     * @since 12
7186     */
7187    parameter?: LoopMode | string | number;
7188  }
7189
7190  /**
7191   * Enumerates ErrorCode types, returns in BusinessError.code.
7192   * @enum { number }
7193   * @syscap SystemCapability.Multimedia.AVSession.Core
7194   * @since 10
7195   */
7196  /**
7197   * Enumerates ErrorCode types, returns in BusinessError.code.
7198   * @enum { number }
7199   * @syscap SystemCapability.Multimedia.AVSession.Core
7200   * @atomicservice
7201   * @since 12
7202   */
7203  enum AVSessionErrorCode {
7204    /**
7205     * Session service exception.
7206     * @syscap SystemCapability.Multimedia.AVSession.Core
7207     * @since 10
7208     */
7209    /**
7210     * Session service exception.
7211     * @syscap SystemCapability.Multimedia.AVSession.Core
7212     * @atomicservice
7213     * @since 12
7214     */
7215    ERR_CODE_SERVICE_EXCEPTION = 6600101,
7216
7217    /**
7218     * The session does not exist
7219     * @syscap SystemCapability.Multimedia.AVSession.Core
7220     * @since 10
7221     */
7222    /**
7223     * The session does not exist
7224     * @syscap SystemCapability.Multimedia.AVSession.Core
7225     * @atomicservice
7226     * @since 12
7227     */
7228    ERR_CODE_SESSION_NOT_EXIST = 6600102,
7229
7230    /**
7231     * The session controller does not exist.
7232     * @syscap SystemCapability.Multimedia.AVSession.Core
7233     * @since 10
7234     */
7235    /**
7236     * The session controller does not exist.
7237     * @syscap SystemCapability.Multimedia.AVSession.Core
7238     * @atomicservice
7239     * @since 12
7240     */
7241    ERR_CODE_CONTROLLER_NOT_EXIST = 6600103,
7242
7243    /**
7244     * The remote session connection failed.
7245     * @syscap SystemCapability.Multimedia.AVSession.Core
7246     * @since 10
7247     */
7248    /**
7249     * The remote session connection failed.
7250     * @syscap SystemCapability.Multimedia.AVSession.Core
7251     * @atomicservice
7252     * @since 12
7253     */
7254    ERR_CODE_REMOTE_CONNECTION_ERR = 6600104,
7255
7256    /**
7257     * Invalid session command.
7258     * @syscap SystemCapability.Multimedia.AVSession.Core
7259     * @since 10
7260     */
7261    /**
7262     * Invalid session command.
7263     * @syscap SystemCapability.Multimedia.AVSession.Core
7264     * @atomicservice
7265     * @since 12
7266     */
7267    ERR_CODE_COMMAND_INVALID = 6600105,
7268
7269    /**
7270     * The session is not activated.
7271     * @syscap SystemCapability.Multimedia.AVSession.Core
7272     * @since 10
7273     */
7274    /**
7275     * The session is not activated.
7276     * @syscap SystemCapability.Multimedia.AVSession.Core
7277     * @atomicservice
7278     * @since 12
7279     */
7280    ERR_CODE_SESSION_INACTIVE = 6600106,
7281
7282    /**
7283     * Too many commands or events.
7284     * @syscap SystemCapability.Multimedia.AVSession.Core
7285     * @since 10
7286     */
7287    /**
7288     * Too many commands or events.
7289     * @syscap SystemCapability.Multimedia.AVSession.Core
7290     * @atomicservice
7291     * @since 12
7292     */
7293    ERR_CODE_MESSAGE_OVERLOAD = 6600107,
7294
7295    /**
7296     * Device connecting failed.
7297     * @syscap SystemCapability.Multimedia.AVSession.Core
7298     * @since 10
7299     */
7300    /**
7301     * Device connecting failed.
7302     * @syscap SystemCapability.Multimedia.AVSession.Core
7303     * @atomicservice
7304     * @since 12
7305     */
7306    ERR_CODE_DEVICE_CONNECTION_FAILED = 6600108,
7307
7308    /**
7309     * The remote connection is not established.
7310     * @syscap SystemCapability.Multimedia.AVSession.Core
7311     * @since 10
7312     */
7313    /**
7314     * The remote connection is not established.
7315     * @syscap SystemCapability.Multimedia.AVSession.Core
7316     * @atomicservice
7317     * @since 12
7318     */
7319    ERR_CODE_REMOTE_CONNECTION_NOT_EXIST = 6600109,
7320
7321    /**
7322     * The error code for cast control is unspecified.
7323     * @syscap SystemCapability.Multimedia.AVSession.AVCast
7324     * @atomicservice
7325     * @since 13
7326     */
7327    ERR_CODE_CAST_CONTROL_UNSPECIFIED = 6611000,
7328
7329    /**
7330     * An unspecified error occurs in the remote player.
7331     * @syscap SystemCapability.Multimedia.AVSession.AVCast
7332     * @atomicservice
7333     * @since 13
7334     */
7335    ERR_CODE_CAST_CONTROL_REMOTE_ERROR = 6611001,
7336
7337    /**
7338     * The playback position falls behind the live window.
7339     * @syscap SystemCapability.Multimedia.AVSession.AVCast
7340     * @atomicservice
7341     * @since 13
7342     */
7343    ERR_CODE_CAST_CONTROL_BEHIND_LIVE_WINDOW = 6611002,
7344
7345    /**
7346     * The process of cast control times out.
7347     * @syscap SystemCapability.Multimedia.AVSession.AVCast
7348     * @atomicservice
7349     * @since 13
7350     */
7351    ERR_CODE_CAST_CONTROL_TIMEOUT = 6611003,
7352
7353    /**
7354     * The runtime check failed.
7355     * @syscap SystemCapability.Multimedia.AVSession.AVCast
7356     * @atomicservice
7357     * @since 13
7358     */
7359    ERR_CODE_CAST_CONTROL_RUNTIME_CHECK_FAILED = 6611004,
7360
7361    /**
7362     * Cross-device data transmission is locked.
7363     * @syscap SystemCapability.Multimedia.AVSession.AVCast
7364     * @atomicservice
7365     * @since 13
7366     */
7367    ERR_CODE_CAST_CONTROL_PLAYER_NOT_WORKING = 6611100,
7368
7369    /**
7370     * The specified seek mode is not supported.
7371     * @syscap SystemCapability.Multimedia.AVSession.AVCast
7372     * @atomicservice
7373     * @since 13
7374     */
7375    ERR_CODE_CAST_CONTROL_SEEK_MODE_UNSUPPORTED = 6611101,
7376
7377    /**
7378     * The position to seek to is out of the range of the media asset or the specified seek mode is not supported.
7379     * @syscap SystemCapability.Multimedia.AVSession.AVCast
7380     * @atomicservice
7381     * @since 13
7382     */
7383    ERR_CODE_CAST_CONTROL_ILLEGAL_SEEK_TARGET = 6611102,
7384
7385    /**
7386     * The specified playback mode is not supported.
7387     * @syscap SystemCapability.Multimedia.AVSession.AVCast
7388     * @atomicservice
7389     * @since 13
7390     */
7391    ERR_CODE_CAST_CONTROL_PLAY_MODE_UNSUPPORTED = 6611103,
7392
7393    /**
7394     * The specified playback speed is not supported.
7395     * @syscap SystemCapability.Multimedia.AVSession.AVCast
7396     * @atomicservice
7397     * @since 13
7398     */
7399    ERR_CODE_CAST_CONTROL_PLAY_SPEED_UNSUPPORTED = 6611104,
7400
7401    /**
7402     * The action failed because either the media source device or the media sink device has been revoked.
7403     * @syscap SystemCapability.Multimedia.AVSession.AVCast
7404     * @atomicservice
7405     * @since 13
7406     */
7407    ERR_CODE_CAST_CONTROL_DEVICE_MISSING = 6611105,
7408
7409    /**
7410     * The parameter is invalid, for example, the url is illegal to play.
7411     * @syscap SystemCapability.Multimedia.AVSession.AVCast
7412     * @atomicservice
7413     * @since 13
7414     */
7415    ERR_CODE_CAST_CONTROL_INVALID_PARAM = 6611106,
7416
7417    /**
7418     * Allocation of memory failed.
7419     * @syscap SystemCapability.Multimedia.AVSession.AVCast
7420     * @atomicservice
7421     * @since 13
7422     */
7423    ERR_CODE_CAST_CONTROL_NO_MEMORY = 6611107,
7424
7425    /**
7426     * Operation is not allowed.
7427     * @syscap SystemCapability.Multimedia.AVSession.AVCast
7428     * @atomicservice
7429     * @since 13
7430     */
7431    ERR_CODE_CAST_CONTROL_OPERATION_NOT_ALLOWED = 6611108,
7432
7433    /**
7434     * An unspecified input/output error occurs.
7435     * @syscap SystemCapability.Multimedia.AVSession.AVCast
7436     * @atomicservice
7437     * @since 13
7438     */
7439    ERR_CODE_CAST_CONTROL_IO_UNSPECIFIED = 6612000,
7440
7441    /**
7442     * Network connection failure.
7443     * @syscap SystemCapability.Multimedia.AVSession.AVCast
7444     * @atomicservice
7445     * @since 13
7446     */
7447    ERR_CODE_CAST_CONTROL_IO_NETWORK_CONNECTION_FAILED = 6612001,
7448
7449    /**
7450     * Network timeout.
7451     * @syscap SystemCapability.Multimedia.AVSession.AVCast
7452     * @atomicservice
7453     * @since 13
7454     */
7455    ERR_CODE_CAST_CONTROL_IO_NETWORK_CONNECTION_TIMEOUT = 6612002,
7456
7457    /**
7458     * Invalid "Content-Type" HTTP header.
7459     * @syscap SystemCapability.Multimedia.AVSession.AVCast
7460     * @atomicservice
7461     * @since 13
7462     */
7463    ERR_CODE_CAST_CONTROL_IO_INVALID_HTTP_CONTENT_TYPE = 6612003,
7464
7465    /**
7466     * The HTTP server returns an unexpected HTTP response status code.
7467     * @syscap SystemCapability.Multimedia.AVSession.AVCast
7468     * @atomicservice
7469     * @since 13
7470     */
7471    ERR_CODE_CAST_CONTROL_IO_BAD_HTTP_STATUS = 6612004,
7472
7473    /**
7474     * The file does not exist.
7475     * @syscap SystemCapability.Multimedia.AVSession.AVCast
7476     * @atomicservice
7477     * @since 13
7478     */
7479    ERR_CODE_CAST_CONTROL_IO_FILE_NOT_FOUND = 6612005,
7480
7481    /**
7482     * No permission is granted to perform the IO operation.
7483     * @syscap SystemCapability.Multimedia.AVSession.AVCast
7484     * @atomicservice
7485     * @since 13
7486     */
7487    ERR_CODE_CAST_CONTROL_IO_NO_PERMISSION = 6612006,
7488
7489    /**
7490     * Access to cleartext HTTP traffic is not allowed by the app's network security configuration.
7491     * @syscap SystemCapability.Multimedia.AVSession.AVCast
7492     * @atomicservice
7493     * @since 13
7494     */
7495    ERR_CODE_CAST_CONTROL_IO_CLEARTEXT_NOT_PERMITTED = 6612007,
7496
7497    /**
7498     * Reading data out of the data bound.
7499     * @syscap SystemCapability.Multimedia.AVSession.AVCast
7500     * @atomicservice
7501     * @since 13
7502     */
7503    ERR_CODE_CAST_CONTROL_IO_READ_POSITION_OUT_OF_RANGE = 6612008,
7504
7505    /**
7506     * The media does not contain any contents that can be played.
7507     * @syscap SystemCapability.Multimedia.AVSession.AVCast
7508     * @atomicservice
7509     * @since 13
7510     */
7511    ERR_CODE_CAST_CONTROL_IO_NO_CONTENTS = 6612100,
7512
7513    /**
7514     * The media cannot be read, for example, because of dust or scratches.
7515     * @syscap SystemCapability.Multimedia.AVSession.AVCast
7516     * @atomicservice
7517     * @since 13
7518     */
7519    ERR_CODE_CAST_CONTROL_IO_READ_ERROR = 6612101,
7520
7521    /**
7522     * This resource is already in use.
7523     * @syscap SystemCapability.Multimedia.AVSession.AVCast
7524     * @atomicservice
7525     * @since 13
7526     */
7527    ERR_CODE_CAST_CONTROL_IO_CONTENT_BUSY = 6612102,
7528
7529    /**
7530     * The content using the validity interval has expired.
7531     * @syscap SystemCapability.Multimedia.AVSession.AVCast
7532     * @atomicservice
7533     * @since 13
7534     */
7535    ERR_CODE_CAST_CONTROL_IO_CONTENT_EXPIRED = 6612103,
7536
7537    /**
7538     * Using the requested content to play is not allowed.
7539     * @syscap SystemCapability.Multimedia.AVSession.AVCast
7540     * @atomicservice
7541     * @since 13
7542     */
7543    ERR_CODE_CAST_CONTROL_IO_USE_FORBIDDEN = 6612104,
7544
7545    /**
7546     * The use of the allowed content cannot be verified.
7547     * @syscap SystemCapability.Multimedia.AVSession.AVCast
7548     * @atomicservice
7549     * @since 13
7550     */
7551    ERR_CODE_CAST_CONTROL_IO_NOT_VERIFIED = 6612105,
7552
7553    /**
7554     * The number of times this content has been used as requested has reached the maximum allowed number of uses.
7555     * @syscap SystemCapability.Multimedia.AVSession.AVCast
7556     * @atomicservice
7557     * @since 13
7558     */
7559    ERR_CODE_CAST_CONTROL_IO_EXHAUSTED_ALLOWED_USES = 6612106,
7560
7561    /**
7562     * An error occurs when sending packet from source device to sink device.
7563     * @syscap SystemCapability.Multimedia.AVSession.AVCast
7564     * @atomicservice
7565     * @since 13
7566     */
7567    ERR_CODE_CAST_CONTROL_IO_NETWORK_PACKET_SENDING_FAILED = 6612107,
7568
7569    /**
7570     * Unspecified error related to content parsing.
7571     * @syscap SystemCapability.Multimedia.AVSession.AVCast
7572     * @atomicservice
7573     * @since 13
7574     */
7575    ERR_CODE_CAST_CONTROL_PARSING_UNSPECIFIED = 6613000,
7576
7577    /**
7578     * Parsing error associated with media container format bit streams.
7579     * @syscap SystemCapability.Multimedia.AVSession.AVCast
7580     * @atomicservice
7581     * @since 13
7582     */
7583    ERR_CODE_CAST_CONTROL_PARSING_CONTAINER_MALFORMED = 6613001,
7584
7585    /**
7586     * Parsing error associated with the media manifest.
7587     * @syscap SystemCapability.Multimedia.AVSession.AVCast
7588     * @atomicservice
7589     * @since 13
7590     */
7591    ERR_CODE_CAST_CONTROL_PARSING_MANIFEST_MALFORMED = 6613002,
7592
7593    /**
7594     * An error occurs when attempting to extract a file with an unsupported media container format
7595     * or an unsupported media container feature.
7596     * @syscap SystemCapability.Multimedia.AVSession.AVCast
7597     * @atomicservice
7598     * @since 13
7599     */
7600    ERR_CODE_CAST_CONTROL_PARSING_CONTAINER_UNSUPPORTED = 6613003,
7601
7602    /**
7603     * Unsupported feature in the media manifest.
7604     * @syscap SystemCapability.Multimedia.AVSession.AVCast
7605     * @atomicservice
7606     * @since 13
7607     */
7608    ERR_CODE_CAST_CONTROL_PARSING_MANIFEST_UNSUPPORTED = 6613004,
7609
7610    /**
7611     * Unspecified decoding error.
7612     * @syscap SystemCapability.Multimedia.AVSession.AVCast
7613     * @atomicservice
7614     * @since 13
7615     */
7616    ERR_CODE_CAST_CONTROL_DECODING_UNSPECIFIED = 6614000,
7617
7618    /**
7619     * Decoder initialization failed.
7620     * @syscap SystemCapability.Multimedia.AVSession.AVCast
7621     * @atomicservice
7622     * @since 13
7623     */
7624    ERR_CODE_CAST_CONTROL_DECODING_INIT_FAILED = 6614001,
7625
7626    /**
7627     * Decoder query failed.
7628     * @syscap SystemCapability.Multimedia.AVSession.AVCast
7629     * @atomicservice
7630     * @since 13
7631     */
7632    ERR_CODE_CAST_CONTROL_DECODING_QUERY_FAILED = 6614002,
7633
7634    /**
7635     * Decoding the media samples failed.
7636     * @syscap SystemCapability.Multimedia.AVSession.AVCast
7637     * @atomicservice
7638     * @since 13
7639     */
7640    ERR_CODE_CAST_CONTROL_DECODING_FAILED = 6614003,
7641
7642    /**
7643     * The format of the content to decode exceeds the capabilities of the device.
7644     * @syscap SystemCapability.Multimedia.AVSession.AVCast
7645     * @atomicservice
7646     * @since 13
7647     */
7648    ERR_CODE_CAST_CONTROL_DECODING_FORMAT_EXCEEDS_CAPABILITIES = 6614004,
7649
7650    /**
7651     * The format of the content to decode is not supported.
7652     * @syscap SystemCapability.Multimedia.AVSession.AVCast
7653     * @atomicservice
7654     * @since 13
7655     */
7656    ERR_CODE_CAST_CONTROL_DECODING_FORMAT_UNSUPPORTED = 6614005,
7657
7658    /**
7659     * Unspecified errors related to the audio renderer.
7660     * @syscap SystemCapability.Multimedia.AVSession.AVCast
7661     * @atomicservice
7662     * @since 13
7663     */
7664    ERR_CODE_CAST_CONTROL_AUDIO_RENDERER_UNSPECIFIED = 6615000,
7665
7666    /**
7667     * Initializing the audio renderer failed.
7668     * @syscap SystemCapability.Multimedia.AVSession.AVCast
7669     * @atomicservice
7670     * @since 13
7671     */
7672    ERR_CODE_CAST_CONTROL_AUDIO_RENDERER_INIT_FAILED = 6615001,
7673
7674    /**
7675     * The audio renderer fails to write data.
7676     * @syscap SystemCapability.Multimedia.AVSession.AVCast
7677     * @atomicservice
7678     * @since 13
7679     */
7680    ERR_CODE_CAST_CONTROL_AUDIO_RENDERER_WRITE_FAILED = 6615002,
7681
7682    /**
7683     * Unspecified error related to DRM.
7684     * @syscap SystemCapability.Multimedia.AVSession.AVCast
7685     * @atomicservice
7686     * @since 13
7687     */
7688    ERR_CODE_CAST_CONTROL_DRM_UNSPECIFIED = 6616000,
7689
7690    /**
7691     * The chosen DRM protection scheme is not supported by the device.
7692     * @syscap SystemCapability.Multimedia.AVSession.AVCast
7693     * @atomicservice
7694     * @since 13
7695     */
7696    ERR_CODE_CAST_CONTROL_DRM_SCHEME_UNSUPPORTED = 6616001,
7697
7698    /**
7699     * Device provisioning failed.
7700     * @syscap SystemCapability.Multimedia.AVSession.AVCast
7701     * @atomicservice
7702     * @since 13
7703     */
7704    ERR_CODE_CAST_CONTROL_DRM_PROVISIONING_FAILED = 6616002,
7705
7706    /**
7707     * The DRM-protected content to play is incompatible.
7708     * @syscap SystemCapability.Multimedia.AVSession.AVCast
7709     * @atomicservice
7710     * @since 13
7711     */
7712    ERR_CODE_CAST_CONTROL_DRM_CONTENT_ERROR = 6616003,
7713
7714    /**
7715     * Failed to obtain a license.
7716     * @syscap SystemCapability.Multimedia.AVSession.AVCast
7717     * @atomicservice
7718     * @since 13
7719     */
7720    ERR_CODE_CAST_CONTROL_DRM_LICENSE_ACQUISITION_FAILED = 6616004,
7721
7722    /**
7723     * The operation is disallowed by the license policy.
7724     * @syscap SystemCapability.Multimedia.AVSession.AVCast
7725     * @atomicservice
7726     * @since 13
7727     */
7728    ERR_CODE_CAST_CONTROL_DRM_DISALLOWED_OPERATION = 6616005,
7729
7730    /**
7731     * An error occurs in the DRM system.
7732     * @syscap SystemCapability.Multimedia.AVSession.AVCast
7733     * @atomicservice
7734     * @since 13
7735     */
7736    ERR_CODE_CAST_CONTROL_DRM_SYSTEM_ERROR = 6616006,
7737
7738    /**
7739     * The device has revoked DRM privileges.
7740     * @syscap SystemCapability.Multimedia.AVSession.AVCast
7741     * @atomicservice
7742     * @since 13
7743     */
7744    ERR_CODE_CAST_CONTROL_DRM_DEVICE_REVOKED = 6616007,
7745
7746    /**
7747     * The DRM license being loaded into the open DRM session has expired.
7748     * @syscap SystemCapability.Multimedia.AVSession.AVCast
7749     * @atomicservice
7750     * @since 13
7751     */
7752    ERR_CODE_CAST_CONTROL_DRM_LICENSE_EXPIRED = 6616008,
7753
7754    /**
7755     * An error occurs when the DRM processes the key response.
7756     * @syscap SystemCapability.Multimedia.AVSession.AVCast
7757     * @atomicservice
7758     * @since 13
7759     */
7760    ERR_CODE_CAST_CONTROL_DRM_PROVIDE_KEY_RESPONSE_ERROR = 6616100,
7761  }
7762}
7763
7764export default avSession;
7765