未验证 提交 b2f3a4f6 编写于 作者: O openharmony_ci 提交者: Gitee

!15739 update avsession

Merge pull request !15739 from li-yifan2/master
......@@ -26,6 +26,8 @@ createAVSession(context: Context, tag: string, type: AVSessionType): Promise\<AV
**系统能力:** SystemCapability.Multimedia.AVSession.Core
**系统接口:** 该接口为系统接口
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
......@@ -74,6 +76,8 @@ createAVSession(context: Context, tag: string, type: AVSessionType, callback: As
**系统能力:** SystemCapability.Multimedia.AVSession.Core
**系统接口:** 该接口为系统接口
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
......@@ -596,6 +600,8 @@ on(type: 'sessionServiceDie', callback: () => void): void
**系统能力:** SystemCapability.Multimedia.AVSession.Core
**系统接口:** 该接口为系统接口
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
......@@ -626,6 +632,8 @@ off(type: 'sessionServiceDie', callback?: () => void): void
**系统能力:** SystemCapability.Multimedia.AVSession.Core
**系统接口:** 该接口为系统接口
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
......@@ -858,6 +866,8 @@ avSession.sendSystemControlCommand(avcommand, function (err) {
**系统能力:** SystemCapability.Multimedia.AVSession.Core
**系统接口:** 该接口为系统接口
| 名称 | 类型 | 可读 | 可写 | 说明 |
| :-------- | :----- | :--- | :--- | :---------------------------- |
......@@ -877,6 +887,8 @@ setAVMetadata(data: AVMetadata): Promise\<void>
**系统能力:** SystemCapability.Multimedia.AVSession.Core
**系统接口:** 该接口为系统接口
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
......@@ -931,6 +943,8 @@ setAVMetadata(data: AVMetadata, callback: AsyncCallback\<void>): void
**系统能力:** SystemCapability.Multimedia.AVSession.Core
**系统接口:** 该接口为系统接口
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
......@@ -982,6 +996,8 @@ setAVPlaybackState(state: AVPlaybackState): Promise\<void>
**系统能力:** SystemCapability.Multimedia.AVSession.Core
**系统接口:** 该接口为系统接口
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
......@@ -1028,6 +1044,8 @@ setAVPlaybackState(state: AVPlaybackState, callback: AsyncCallback\<void>): void
**系统能力:** SystemCapability.Multimedia.AVSession.Core
**系统接口:** 该接口为系统接口
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
......@@ -1281,6 +1299,8 @@ setLaunchAbility(ability: WantAgent): Promise\<void>
**系统能力:** SystemCapability.Multimedia.AVSession.Core
**系统接口:** 该接口为系统接口
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
......@@ -1351,6 +1371,8 @@ setLaunchAbility(ability: WantAgent, callback: AsyncCallback\<void>): void
**系统能力:** SystemCapability.Multimedia.AVSession.Core
**系统接口:** 该接口为系统接口
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
......@@ -1501,6 +1523,8 @@ getController(): Promise\<AVSessionController>
**系统能力:** SystemCapability.Multimedia.AVSession.Core
**系统接口:** 该接口为系统接口
**返回值:**
| 类型 | 说明 |
......@@ -1535,6 +1559,8 @@ getController(callback: AsyncCallback\<AVSessionController>): void
**系统能力:** SystemCapability.Multimedia.AVSession.Core
**系统接口:** 该接口为系统接口
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
......@@ -1571,6 +1597,8 @@ getOutputDevice(): Promise\<OutputDeviceInfo>
**系统能力:** SystemCapability.Multimedia.AVSession.Core
**系统接口:** 该接口为系统接口
**返回值:**
| 类型 | 说明 |
......@@ -1603,6 +1631,8 @@ getOutputDevice(callback: AsyncCallback\<OutputDeviceInfo>): void
**系统能力:** SystemCapability.Multimedia.AVSession.Core
**系统接口:** 该接口为系统接口
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
......@@ -1637,6 +1667,8 @@ activate(): Promise\<void>
**系统能力:** SystemCapability.Multimedia.AVSession.Core
**系统接口:** 该接口为系统接口
**返回值:**
| 类型 | 说明 |
......@@ -1669,6 +1701,8 @@ activate(callback: AsyncCallback\<void>): void
**系统能力:** SystemCapability.Multimedia.AVSession.Core
**系统接口:** 该接口为系统接口
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
......@@ -1703,6 +1737,8 @@ deactivate(): Promise\<void>
**系统能力:** SystemCapability.Multimedia.AVSession.Core
**系统接口:** 该接口为系统接口
**返回值:**
| 类型 | 说明 |
......@@ -1737,6 +1773,8 @@ deactivate(callback: AsyncCallback\<void>): void
**系统能力:** SystemCapability.Multimedia.AVSession.Core
**系统接口:** 该接口为系统接口
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
......@@ -1771,6 +1809,8 @@ destroy(): Promise\<void>
**系统能力:** SystemCapability.Multimedia.AVSession.Core
**系统接口:** 该接口为系统接口
**返回值:**
| 类型 | 说明 |
......@@ -1801,9 +1841,10 @@ destroy(callback: AsyncCallback\<void>): void
销毁当前会话,使当前会话完全失效。结果通过callback异步回调方式返回。
**系统能力:** SystemCapability.Multimedia.AVSession.Core
**系统接口:** 该接口为系统接口
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
......@@ -1838,6 +1879,8 @@ on(type: 'play'|'pause'|'stop'|'playNext'|'playPrevious'|'fastForward'|'rewind',
**系统能力:** SystemCapability.Multimedia.AVSession.Core
**系统接口:** 该接口为系统接口
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
......@@ -1887,6 +1930,8 @@ on(type: 'seek', callback: (time: number) => void): void
**系统能力:** SystemCapability.Multimedia.AVSession.Core
**系统接口:** 该接口为系统接口
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
......@@ -1918,6 +1963,8 @@ on(type: 'setSpeed', callback: (speed: number) => void): void
**系统能力:** SystemCapability.Multimedia.AVSession.Core
**系统接口:** 该接口为系统接口
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
......@@ -1949,6 +1996,8 @@ on(type: 'setLoopMode', callback: (mode: LoopMode) => void): void
**系统能力:** SystemCapability.Multimedia.AVSession.Core
**系统接口:** 该接口为系统接口
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
......@@ -1980,6 +2029,8 @@ on(type: 'toggleFavorite', callback: (assetId: string) => void): void
**系统能力:** SystemCapability.Multimedia.AVSession.Core
**系统接口:** 该接口为系统接口
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
......@@ -2044,6 +2095,8 @@ on(type: 'handleKeyEvent', callback: (event: KeyEvent) => void): void
**系统能力:** SystemCapability.Multimedia.AVSession.Core
**系统接口:** 该接口为系统接口
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
......@@ -2075,6 +2128,8 @@ on(type: 'outputDeviceChange', callback: (device: OutputDeviceInfo) => void): vo
**系统能力:** SystemCapability.Multimedia.AVSession.Core
**系统接口:** 该接口为系统接口
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
......@@ -2139,6 +2194,8 @@ off(type: 'play' | 'pause' | 'stop' | 'playNext' | 'playPrevious' | 'fastForward
**系统能力:** SystemCapability.Multimedia.AVSession.Core
**系统接口:** 该接口为系统接口
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
......@@ -2174,6 +2231,8 @@ off(type: 'seek', callback?: (time: number) => void): void
**系统能力:** SystemCapability.Multimedia.AVSession.Core
**系统接口:** 该接口为系统接口
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
......@@ -2203,6 +2262,8 @@ off(type: 'setSpeed', callback?: (speed: number) => void): void
**系统能力:** SystemCapability.Multimedia.AVSession.Core
**系统接口:** 该接口为系统接口
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
......@@ -2232,6 +2293,8 @@ off(type: 'setLoopMode', callback?: (mode: LoopMode) => void): void
**系统能力:** SystemCapability.Multimedia.AVSession.Core
**系统接口:** 该接口为系统接口
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
......@@ -2261,6 +2324,8 @@ off(type: 'toggleFavorite', callback?: (assetId: string) => void): void
**系统能力:** SystemCapability.Multimedia.AVSession.Core
**系统接口:** 该接口为系统接口
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
......@@ -2321,6 +2386,8 @@ off(type: 'handleKeyEvent', callback?: (event: KeyEvent) => void): void
**系统能力:** SystemCapability.Multimedia.AVSession.Core
**系统接口:** 该接口为系统接口
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
......@@ -2350,6 +2417,8 @@ off(type: 'outputDeviceChange', callback?: (device: OutputDeviceInfo) => void):
**系统能力:** SystemCapability.Multimedia.AVSession.Core
**系统接口:** 该接口为系统接口
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
......@@ -2436,6 +2505,8 @@ getAVPlaybackState(): Promise\<AVPlaybackState>
**系统能力:** SystemCapability.Multimedia.AVSession.Core
**系统接口:** 该接口为系统接口
**返回值:**
| 类型 | 说明 |
......@@ -2468,6 +2539,8 @@ getAVPlaybackState(callback: AsyncCallback\<AVPlaybackState>): void
**系统能力:** SystemCapability.Multimedia.AVSession.Core
**系统接口:** 该接口为系统接口
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
......@@ -2721,6 +2794,8 @@ getAVMetadata(): Promise\<AVMetadata>
**系统能力:** SystemCapability.Multimedia.AVSession.Core
**系统接口:** 该接口为系统接口
**返回值:**
| 类型 | 说明 |
......@@ -2753,6 +2828,8 @@ getAVMetadata(callback: AsyncCallback\<AVMetadata>): void
**系统能力:** SystemCapability.Multimedia.AVSession.Core
**系统接口:** 该接口为系统接口
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
......@@ -2787,6 +2864,8 @@ getOutputDevice(): Promise\<OutputDeviceInfo>
**系统能力:** SystemCapability.Multimedia.AVSession.Core
**系统接口:** 该接口为系统接口
**返回值:**
| 类型 | 说明 |
......@@ -2818,6 +2897,8 @@ getOutputDevice(callback: AsyncCallback\<OutputDeviceInfo>): void
**系统能力:** SystemCapability.Multimedia.AVSession.Core
**系统接口:** 该接口为系统接口
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
......@@ -2852,6 +2933,8 @@ sendAVKeyEvent(event: KeyEvent): Promise\<void>
**系统能力:** SystemCapability.Multimedia.AVSession.Core
**系统接口:** 该接口为系统接口
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
......@@ -2896,6 +2979,8 @@ sendAVKeyEvent(event: KeyEvent, callback: AsyncCallback\<void>): void
**系统能力:** SystemCapability.Multimedia.AVSession.Core
**系统接口:** 该接口为系统接口
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
......@@ -2937,6 +3022,8 @@ getLaunchAbility(): Promise\<WantAgent>
**系统能力:** SystemCapability.Multimedia.AVSession.Core
**系统接口:** 该接口为系统接口
**返回值:**
| 类型 | 说明 |
......@@ -2972,6 +3059,8 @@ getLaunchAbility(callback: AsyncCallback\<WantAgent>): void
**系统能力:** SystemCapability.Multimedia.AVSession.Core
**系统接口:** 该接口为系统接口
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
......@@ -3009,6 +3098,8 @@ getRealPlaybackPositionSync(): number
**系统能力:** SystemCapability.Multimedia.AVSession.Core
**系统接口:** 该接口为系统接口
**返回值:**
| 类型 | 说明 |
......@@ -3037,6 +3128,8 @@ isActive(): Promise\<boolean>
**系统能力:** SystemCapability.Multimedia.AVSession.Core
**系统接口:** 该接口为系统接口
**返回值:**
| 类型 | 说明 |
......@@ -3070,6 +3163,8 @@ isActive(callback: AsyncCallback\<boolean>): void
**系统能力:** SystemCapability.Multimedia.AVSession.Core
**系统接口:** 该接口为系统接口
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
......@@ -3105,6 +3200,8 @@ destroy(): Promise\<void>
**系统能力:** SystemCapability.Multimedia.AVSession.Core
**系统接口:** 该接口为系统接口
**返回值:**
| 类型 | 说明 |
......@@ -3137,6 +3234,8 @@ destroy(callback: AsyncCallback\<void>): void
**系统能力:** SystemCapability.Multimedia.AVSession.Core
**系统接口:** 该接口为系统接口
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
......@@ -3171,6 +3270,8 @@ getValidCommands(): Promise\<Array\<AVControlCommandType>>
**系统能力:** SystemCapability.Multimedia.AVSession.Core
**系统接口:** 该接口为系统接口
**返回值:**
| 类型 | 说明 |
......@@ -3204,6 +3305,8 @@ getValidCommands(callback: AsyncCallback\<Array\<AVControlCommandType>>): void
**系统能力:** SystemCapability.Multimedia.AVSession.Core
**系统接口:** 该接口为系统接口
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
......@@ -3239,6 +3342,8 @@ sendControlCommand(command: AVControlCommand): Promise\<void>
**系统能力:** SystemCapability.Multimedia.AVSession.Core
**系统接口:** 该接口为系统接口
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
......@@ -3292,6 +3397,8 @@ sendControlCommand(command: AVControlCommand, callback: AsyncCallback\<void>): v
**系统能力:** SystemCapability.Multimedia.AVSession.Core
**系统接口:** 该接口为系统接口
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
......@@ -3429,6 +3536,8 @@ on(type: 'metadataChange', filter: Array\<keyof AVMetadata> | 'all', callback: (
**系统能力:** SystemCapability.Multimedia.AVSession.Core
**系统接口:** 该接口为系统接口
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
......@@ -3466,6 +3575,8 @@ on(type: 'playbackStateChange', filter: Array\<keyof AVPlaybackState> | 'all', c
**系统能力:** SystemCapability.Multimedia.AVSession.Core
**系统接口:** 该接口为系统接口
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
......@@ -3602,6 +3713,8 @@ on(type: 'sessionDestroy', callback: () => void)
**系统能力:** SystemCapability.Multimedia.AVSession.Core
**系统接口:** 该接口为系统接口
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
......@@ -3633,6 +3746,8 @@ on(type: 'activeStateChange', callback: (isActive: boolean) => void)
**系统能力:** SystemCapability.Multimedia.AVSession.Core
**系统接口:** 该接口为系统接口
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
......@@ -3664,6 +3779,8 @@ on(type: 'validCommandChange', callback: (commands: Array\<AVControlCommandType>
**系统能力:** SystemCapability.Multimedia.AVSession.Core
**系统接口:** 该接口为系统接口
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
......@@ -3696,6 +3813,8 @@ on(type: 'outputDeviceChange', callback: (device: OutputDeviceInfo) => void): vo
**系统能力:** SystemCapability.Multimedia.AVSession.Core
**系统接口:** 该接口为系统接口
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
......@@ -3727,6 +3846,8 @@ off(type: 'metadataChange', callback?: (data: AVMetadata) => void)
**系统能力:** SystemCapability.Multimedia.AVSession.Core
**系统接口:** 该接口为系统接口
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
......@@ -3755,6 +3876,8 @@ off(type: 'playbackStateChange', callback?: (state: AVPlaybackState) => void)
**系统能力:** SystemCapability.Multimedia.AVSession.Core
**系统接口:** 该接口为系统接口
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
......@@ -3873,6 +3996,8 @@ off(type: 'sessionDestroy', callback?: () => void)
**系统能力:** SystemCapability.Multimedia.AVSession.Core
**系统接口:** 该接口为系统接口
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
......@@ -3901,6 +4026,8 @@ off(type: 'activeStateChange', callback?: (isActive: boolean) => void)
**系统能力:** SystemCapability.Multimedia.AVSession.Core
**系统接口:** 该接口为系统接口
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
......@@ -3929,6 +4056,8 @@ off(type: 'validCommandChange', callback?: (commands: Array\<AVControlCommandTyp
**系统能力:** SystemCapability.Multimedia.AVSession.Core
**系统接口:** 该接口为系统接口
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
......@@ -3957,6 +4086,8 @@ off(type: 'outputDeviceChange', callback?: (device: OutputDeviceInfo) => void):
**系统能力:** SystemCapability.Multimedia.AVSession.Core
**系统接口:** 该接口为系统接口
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
......@@ -3998,6 +4129,8 @@ controller.off('outputDeviceChange');
**系统能力:** SystemCapability.Multimedia.AVSession.Core
**系统接口:** 该接口为系统接口。
| 名称 | 类型 | 说明 |
| ----- | ------ | ---- |
| audio | string | 音频 |
......@@ -4027,6 +4160,8 @@ controller.off('outputDeviceChange');
**系统能力:** SystemCapability.Multimedia.AVSession.Core
**系统接口:** 该接口为系统接口
| 名称 | 类型 | 说明 |
| -------------- | ------ | ------------ |
| play | string | 播放 |
......@@ -4047,6 +4182,8 @@ controller.off('outputDeviceChange');
**系统能力:** SystemCapability.Multimedia.AVSession.Core
**系统接口:** 该接口为系统接口
| 名称 | 类型 | 必填 | 说明 |
| --------- | ------------------------------------------------- | ---- | -------------- |
| command | [AVControlCommandType](#avcontrolcommandtype) | 是 | 命令 |
......@@ -4058,6 +4195,8 @@ controller.off('outputDeviceChange');
**系统能力:** SystemCapability.Multimedia.AVSession.Core
**系统接口:** 该接口为系统接口
| 名称 | 类型 | 必填 | 说明 |
| --------------- |-------------------------| ---- |---------------------------------------------------------------------|
| assetId | string | 是 | 媒体ID。 |
......@@ -4110,6 +4249,8 @@ controller.off('outputDeviceChange');
**系统能力:** SystemCapability.Multimedia.AVSession.Core
**系统接口:** 该接口为系统接口
| 名称 | 类型 | 必填 | 说明 |
| ------------ | ------------------------------------- | ---- | ------- |
| state | [PlaybackState](#playbackstate) | 否 | 播放状态 |
......@@ -4125,6 +4266,8 @@ controller.off('outputDeviceChange');
**系统能力:** SystemCapability.Multimedia.AVSession.Core
**系统接口:** 该接口为系统接口
| 名称 | 类型 | 必填 | 说明 |
| ----------- | ------ | ---- | ------------------ |
| elapsedTime | number | 是 | 已用时间,单位毫秒(ms)。 |
......@@ -4136,6 +4279,8 @@ controller.off('outputDeviceChange');
**系统能力:** SystemCapability.Multimedia.AVSession.Core
**系统接口:** 该接口为系统接口
| 名称 | 类型 | 必填 | 说明 |
| ---------- | -------------- | ---- | ---------------------- |
| isRemote | boolean | 是 | 设备是否连接。 |
......@@ -4148,6 +4293,8 @@ controller.off('outputDeviceChange');
**系统能力:** SystemCapability.Multimedia.AVSession.Core
**系统接口:** 该接口为系统接口
| 名称 | 值 | 说明 |
| --------------------------- | ---- | ----------- |
| PLAYBACK_STATE_INITIAL | 0 | 初始状态 |
......@@ -4165,6 +4312,8 @@ controller.off('outputDeviceChange');
**系统能力:** SystemCapability.Multimedia.AVSession.Core
**系统接口:** 该接口为系统接口
| 名称 | 值 | 说明 |
| ------------------ | ---- | -------- |
| LOOP_MODE_SEQUENCE | 0 | 顺序播放 |
......@@ -4178,6 +4327,8 @@ controller.off('outputDeviceChange');
**系统能力:** SystemCapability.Multimedia.AVSession.Core
**系统接口:** 该接口为系统接口
| 名称 | 值 | 说明 |
| ------------------------------ | ------- | ------------------------------- |
| ERR_CODE_SERVICE_EXCEPTION | 6600101 | Session service exception. |
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册