diff --git a/zh-cn/application-dev/reference/apis/js-apis-avsession.md b/zh-cn/application-dev/reference/apis/js-apis-avsession.md index 552b10b89e557e4c0152281a125f38c062638310..f51ca39a5a07a4d3c88fcfeec08664ee33e81fee 100755 --- a/zh-cn/application-dev/reference/apis/js-apis-avsession.md +++ b/zh-cn/application-dev/reference/apis/js-apis-avsession.md @@ -26,6 +26,8 @@ createAVSession(context: Context, tag: string, type: AVSessionType): Promise\ void): void **系统能力:** SystemCapability.Multimedia.AVSession.Core +**系统接口:** 该接口为系统接口 + **参数:** | 参数名 | 类型 | 必填 | 说明 | @@ -533,6 +539,8 @@ off(type: 'sessionServiceDie', callback?: () => void): void **系统能力:** SystemCapability.Multimedia.AVSession.Core +**系统接口:** 该接口为系统接口 + **参数:** | 参数名 | 类型 | 必填 | 说明 | @@ -765,6 +773,8 @@ avSession.sendSystemControlCommand(avcommand, function (err) { **系统能力:** SystemCapability.Multimedia.AVSession.Core +**系统接口:** 该接口为系统接口 + | 名称 | 类型 | 可读 | 可写 | 说明 | | :-------- | :----- | :--- | :--- | :---------------------------- | @@ -784,6 +794,8 @@ setAVMetadata(data: AVMetadata): Promise\ **系统能力:** SystemCapability.Multimedia.AVSession.Core +**系统接口:** 该接口为系统接口 + **参数:** | 参数名 | 类型 | 必填 | 说明 | @@ -838,6 +850,8 @@ setAVMetadata(data: AVMetadata, callback: AsyncCallback\): void **系统能力:** SystemCapability.Multimedia.AVSession.Core +**系统接口:** 该接口为系统接口 + **参数:** | 参数名 | 类型 | 必填 | 说明 | @@ -889,6 +903,8 @@ setAVPlaybackState(state: AVPlaybackState): Promise\ **系统能力:** SystemCapability.Multimedia.AVSession.Core +**系统接口:** 该接口为系统接口 + **参数:** | 参数名 | 类型 | 必填 | 说明 | @@ -935,6 +951,8 @@ setAVPlaybackState(state: AVPlaybackState, callback: AsyncCallback\): void **系统能力:** SystemCapability.Multimedia.AVSession.Core +**系统接口:** 该接口为系统接口 + **参数:** | 参数名 | 类型 | 必填 | 说明 | @@ -978,6 +996,8 @@ setLaunchAbility(ability: WantAgent): Promise\ **系统能力:** SystemCapability.Multimedia.AVSession.Core +**系统接口:** 该接口为系统接口 + **参数:** | 参数名 | 类型 | 必填 | 说明 | @@ -1048,6 +1068,8 @@ setLaunchAbility(ability: WantAgent, callback: AsyncCallback\): void **系统能力:** SystemCapability.Multimedia.AVSession.Core +**系统接口:** 该接口为系统接口 + **参数:** | 参数名 | 类型 | 必填 | 说明 | @@ -1198,6 +1220,8 @@ getController(): Promise\ **系统能力:** SystemCapability.Multimedia.AVSession.Core +**系统接口:** 该接口为系统接口 + **返回值:** | 类型 | 说明 | @@ -1232,6 +1256,8 @@ getController(callback: AsyncCallback\): void **系统能力:** SystemCapability.Multimedia.AVSession.Core +**系统接口:** 该接口为系统接口 + **参数:** | 参数名 | 类型 | 必填 | 说明 | @@ -1268,6 +1294,8 @@ getOutputDevice(): Promise\ **系统能力:** SystemCapability.Multimedia.AVSession.Core +**系统接口:** 该接口为系统接口 + **返回值:** | 类型 | 说明 | @@ -1300,6 +1328,8 @@ getOutputDevice(callback: AsyncCallback\): void **系统能力:** SystemCapability.Multimedia.AVSession.Core +**系统接口:** 该接口为系统接口 + **参数:** | 参数名 | 类型 | 必填 | 说明 | @@ -1334,6 +1364,8 @@ activate(): Promise\ **系统能力:** SystemCapability.Multimedia.AVSession.Core +**系统接口:** 该接口为系统接口 + **返回值:** | 类型 | 说明 | @@ -1366,6 +1398,8 @@ activate(callback: AsyncCallback\): void **系统能力:** SystemCapability.Multimedia.AVSession.Core +**系统接口:** 该接口为系统接口 + **参数:** | 参数名 | 类型 | 必填 | 说明 | @@ -1400,6 +1434,8 @@ deactivate(): Promise\ **系统能力:** SystemCapability.Multimedia.AVSession.Core +**系统接口:** 该接口为系统接口 + **返回值:** | 类型 | 说明 | @@ -1434,6 +1470,8 @@ deactivate(callback: AsyncCallback\): void **系统能力:** SystemCapability.Multimedia.AVSession.Core +**系统接口:** 该接口为系统接口 + **参数:** | 参数名 | 类型 | 必填 | 说明 | @@ -1468,6 +1506,8 @@ destroy(): Promise\ **系统能力:** SystemCapability.Multimedia.AVSession.Core +**系统接口:** 该接口为系统接口 + **返回值:** | 类型 | 说明 | @@ -1498,9 +1538,10 @@ destroy(callback: AsyncCallback\): void 销毁当前会话,使当前会话完全失效。结果通过callback异步回调方式返回。 - **系统能力:** SystemCapability.Multimedia.AVSession.Core +**系统接口:** 该接口为系统接口 + **参数:** | 参数名 | 类型 | 必填 | 说明 | @@ -1535,6 +1576,8 @@ on(type: 'play'|'pause'|'stop'|'playNext'|'playPrevious'|'fastForward'|'rewind', **系统能力:** SystemCapability.Multimedia.AVSession.Core +**系统接口:** 该接口为系统接口 + **参数:** | 参数名 | 类型 | 必填 | 说明 | @@ -1584,6 +1627,8 @@ on(type: 'seek', callback: (time: number) => void): void **系统能力:** SystemCapability.Multimedia.AVSession.Core +**系统接口:** 该接口为系统接口 + **参数:** | 参数名 | 类型 | 必填 | 说明 | @@ -1615,6 +1660,8 @@ on(type: 'setSpeed', callback: (speed: number) => void): void **系统能力:** SystemCapability.Multimedia.AVSession.Core +**系统接口:** 该接口为系统接口 + **参数:** | 参数名 | 类型 | 必填 | 说明 | @@ -1646,6 +1693,8 @@ on(type: 'setLoopMode', callback: (mode: LoopMode) => void): void **系统能力:** SystemCapability.Multimedia.AVSession.Core +**系统接口:** 该接口为系统接口 + **参数:** | 参数名 | 类型 | 必填 | 说明 | @@ -1677,6 +1726,8 @@ on(type: 'toggleFavorite', callback: (assetId: string) => void): void **系统能力:** SystemCapability.Multimedia.AVSession.Core +**系统接口:** 该接口为系统接口 + **参数:** | 参数名 | 类型 | 必填 | 说明 | @@ -1708,6 +1759,8 @@ on(type: 'handleKeyEvent', callback: (event: KeyEvent) => void): void **系统能力:** SystemCapability.Multimedia.AVSession.Core +**系统接口:** 该接口为系统接口 + **参数:** | 参数名 | 类型 | 必填 | 说明 | @@ -1739,6 +1792,8 @@ on(type: 'outputDeviceChange', callback: (device: OutputDeviceInfo) => void): vo **系统能力:** SystemCapability.Multimedia.AVSession.Core +**系统接口:** 该接口为系统接口 + **参数:** | 参数名 | 类型 | 必填 | 说明 | @@ -1770,6 +1825,8 @@ off(type: 'play' | 'pause' | 'stop' | 'playNext' | 'playPrevious' | 'fastForward **系统能力:** SystemCapability.Multimedia.AVSession.Core +**系统接口:** 该接口为系统接口 + **参数:** | 参数名 | 类型 | 必填 | 说明 | @@ -1805,6 +1862,8 @@ off(type: 'seek', callback?: (time: number) => void): void **系统能力:** SystemCapability.Multimedia.AVSession.Core +**系统接口:** 该接口为系统接口 + **参数:** | 参数名 | 类型 | 必填 | 说明 | @@ -1834,6 +1893,8 @@ off(type: 'setSpeed', callback?: (speed: number) => void): void **系统能力:** SystemCapability.Multimedia.AVSession.Core +**系统接口:** 该接口为系统接口 + **参数:** | 参数名 | 类型 | 必填 | 说明 | @@ -1863,6 +1924,8 @@ off(type: 'setLoopMode', callback?: (mode: LoopMode) => void): void **系统能力:** SystemCapability.Multimedia.AVSession.Core +**系统接口:** 该接口为系统接口 + **参数:** | 参数名 | 类型 | 必填 | 说明 | @@ -1892,6 +1955,8 @@ off(type: 'toggleFavorite', callback?: (assetId: string) => void): void **系统能力:** SystemCapability.Multimedia.AVSession.Core +**系统接口:** 该接口为系统接口 + **参数:** | 参数名 | 类型 | 必填 | 说明 | @@ -1921,6 +1986,8 @@ off(type: 'handleKeyEvent', callback?: (event: KeyEvent) => void): void **系统能力:** SystemCapability.Multimedia.AVSession.Core +**系统接口:** 该接口为系统接口 + **参数:** | 参数名 | 类型 | 必填 | 说明 | @@ -1950,6 +2017,8 @@ off(type: 'outputDeviceChange', callback?: (device: OutputDeviceInfo) => void): **系统能力:** SystemCapability.Multimedia.AVSession.Core +**系统接口:** 该接口为系统接口 + **参数:** | 参数名 | 类型 | 必填 | 说明 | @@ -1981,6 +2050,7 @@ session.off('outputDeviceChange'); **系统能力:** SystemCapability.Multimedia.AVSession.Core +**系统接口:** 该接口为系统接口 | 名称 | 类型 | 可读 | 可写 | 说明 | | :-------- | :----- | :--- | :--- | :-------------------------------------- | @@ -2005,6 +2075,8 @@ getAVPlaybackState(): Promise\ **系统能力:** SystemCapability.Multimedia.AVSession.Core +**系统接口:** 该接口为系统接口 + **返回值:** | 类型 | 说明 | @@ -2037,6 +2109,8 @@ getAVPlaybackState(callback: AsyncCallback\): void **系统能力:** SystemCapability.Multimedia.AVSession.Core +**系统接口:** 该接口为系统接口 + **参数:** | 参数名 | 类型 | 必填 | 说明 | @@ -2071,6 +2145,8 @@ getAVMetadata(): Promise\ **系统能力:** SystemCapability.Multimedia.AVSession.Core +**系统接口:** 该接口为系统接口 + **返回值:** | 类型 | 说明 | @@ -2103,6 +2179,8 @@ getAVMetadata(callback: AsyncCallback\): void **系统能力:** SystemCapability.Multimedia.AVSession.Core +**系统接口:** 该接口为系统接口 + **参数:** | 参数名 | 类型 | 必填 | 说明 | @@ -2137,6 +2215,8 @@ getOutputDevice(): Promise\ **系统能力:** SystemCapability.Multimedia.AVSession.Core +**系统接口:** 该接口为系统接口 + **返回值:** | 类型 | 说明 | @@ -2168,6 +2248,8 @@ getOutputDevice(callback: AsyncCallback\): void **系统能力:** SystemCapability.Multimedia.AVSession.Core +**系统接口:** 该接口为系统接口 + **参数:** | 参数名 | 类型 | 必填 | 说明 | @@ -2202,6 +2284,8 @@ sendAVKeyEvent(event: KeyEvent): Promise\ **系统能力:** SystemCapability.Multimedia.AVSession.Core +**系统接口:** 该接口为系统接口 + **参数:** | 参数名 | 类型 | 必填 | 说明 | @@ -2246,6 +2330,8 @@ sendAVKeyEvent(event: KeyEvent, callback: AsyncCallback\): void **系统能力:** SystemCapability.Multimedia.AVSession.Core +**系统接口:** 该接口为系统接口 + **参数:** | 参数名 | 类型 | 必填 | 说明 | @@ -2287,6 +2373,8 @@ getLaunchAbility(): Promise\ **系统能力:** SystemCapability.Multimedia.AVSession.Core +**系统接口:** 该接口为系统接口 + **返回值:** | 类型 | 说明 | @@ -2322,6 +2410,8 @@ getLaunchAbility(callback: AsyncCallback\): void **系统能力:** SystemCapability.Multimedia.AVSession.Core +**系统接口:** 该接口为系统接口 + **参数:** | 参数名 | 类型 | 必填 | 说明 | @@ -2359,6 +2449,8 @@ getRealPlaybackPositionSync(): number **系统能力:** SystemCapability.Multimedia.AVSession.Core +**系统接口:** 该接口为系统接口 + **返回值:** | 类型 | 说明 | @@ -2387,6 +2479,8 @@ isActive(): Promise\ **系统能力:** SystemCapability.Multimedia.AVSession.Core +**系统接口:** 该接口为系统接口 + **返回值:** | 类型 | 说明 | @@ -2420,6 +2514,8 @@ isActive(callback: AsyncCallback\): void **系统能力:** SystemCapability.Multimedia.AVSession.Core +**系统接口:** 该接口为系统接口 + **参数:** | 参数名 | 类型 | 必填 | 说明 | @@ -2455,6 +2551,8 @@ destroy(): Promise\ **系统能力:** SystemCapability.Multimedia.AVSession.Core +**系统接口:** 该接口为系统接口 + **返回值:** | 类型 | 说明 | @@ -2487,6 +2585,8 @@ destroy(callback: AsyncCallback\): void **系统能力:** SystemCapability.Multimedia.AVSession.Core +**系统接口:** 该接口为系统接口 + **参数:** | 参数名 | 类型 | 必填 | 说明 | @@ -2521,6 +2621,8 @@ getValidCommands(): Promise\> **系统能力:** SystemCapability.Multimedia.AVSession.Core +**系统接口:** 该接口为系统接口 + **返回值:** | 类型 | 说明 | @@ -2554,6 +2656,8 @@ getValidCommands(callback: AsyncCallback\>): void **系统能力:** SystemCapability.Multimedia.AVSession.Core +**系统接口:** 该接口为系统接口 + **参数:** | 参数名 | 类型 | 必填 | 说明 | @@ -2589,6 +2693,8 @@ sendControlCommand(command: AVControlCommand): Promise\ **系统能力:** SystemCapability.Multimedia.AVSession.Core +**系统接口:** 该接口为系统接口 + **参数:** | 参数名 | 类型 | 必填 | 说明 | @@ -2642,6 +2748,8 @@ sendControlCommand(command: AVControlCommand, callback: AsyncCallback\): v **系统能力:** SystemCapability.Multimedia.AVSession.Core +**系统接口:** 该接口为系统接口 + **参数:** | 参数名 | 类型 | 必填 | 说明 | @@ -2692,6 +2800,8 @@ on(type: 'metadataChange', filter: Array\ | 'all', callback: ( **系统能力:** SystemCapability.Multimedia.AVSession.Core +**系统接口:** 该接口为系统接口 + **参数:** | 参数名 | 类型 | 必填 | 说明 | @@ -2729,6 +2839,8 @@ on(type: 'playbackStateChange', filter: Array\ | 'all', c **系统能力:** SystemCapability.Multimedia.AVSession.Core +**系统接口:** 该接口为系统接口 + **参数:** | 参数名 | 类型 | 必填 | 说明 | @@ -2799,6 +2911,8 @@ on(type: 'sessionDestroy', callback: () => void) **系统能力:** SystemCapability.Multimedia.AVSession.Core +**系统接口:** 该接口为系统接口 + **参数:** | 参数名 | 类型 | 必填 | 说明 | @@ -2830,6 +2944,8 @@ on(type: 'activeStateChange', callback: (isActive: boolean) => void) **系统能力:** SystemCapability.Multimedia.AVSession.Core +**系统接口:** 该接口为系统接口 + **参数:** | 参数名 | 类型 | 必填 | 说明 | @@ -2861,6 +2977,8 @@ on(type: 'validCommandChange', callback: (commands: Array\ **系统能力:** SystemCapability.Multimedia.AVSession.Core +**系统接口:** 该接口为系统接口 + **参数:** | 参数名 | 类型 | 必填 | 说明 | @@ -2893,6 +3011,8 @@ on(type: 'outputDeviceChange', callback: (device: OutputDeviceInfo) => void): vo **系统能力:** SystemCapability.Multimedia.AVSession.Core +**系统接口:** 该接口为系统接口 + **参数:** | 参数名 | 类型 | 必填 | 说明 | @@ -2924,6 +3044,8 @@ off(type: 'metadataChange', callback?: (data: AVMetadata) => void) **系统能力:** SystemCapability.Multimedia.AVSession.Core +**系统接口:** 该接口为系统接口 + **参数:** | 参数名 | 类型 | 必填 | 说明 | @@ -2952,6 +3074,8 @@ off(type: 'playbackStateChange', callback?: (state: AVPlaybackState) => void) **系统能力:** SystemCapability.Multimedia.AVSession.Core +**系统接口:** 该接口为系统接口 + **参数:** | 参数名 | 类型 | 必填 | 说明 | @@ -3010,6 +3134,8 @@ off(type: 'sessionDestroy', callback?: () => void) **系统能力:** SystemCapability.Multimedia.AVSession.Core +**系统接口:** 该接口为系统接口 + **参数:** | 参数名 | 类型 | 必填 | 说明 | @@ -3038,6 +3164,8 @@ off(type: 'activeStateChange', callback?: (isActive: boolean) => void) **系统能力:** SystemCapability.Multimedia.AVSession.Core +**系统接口:** 该接口为系统接口 + **参数:** | 参数名 | 类型 | 必填 | 说明 | @@ -3066,6 +3194,8 @@ off(type: 'validCommandChange', callback?: (commands: Array\ void): **系统能力:** SystemCapability.Multimedia.AVSession.Core +**系统接口:** 该接口为系统接口 + **参数:** | 参数名 | 类型 | 必填 | 说明 | @@ -3135,6 +3267,8 @@ controller.off('outputDeviceChange'); **系统能力:** SystemCapability.Multimedia.AVSession.Core +**系统接口:** 该接口为系统接口。 + | 名称 | 类型 | 说明 | | ----- | ------ | ---- | | audio | string | 音频 | @@ -3164,6 +3298,8 @@ controller.off('outputDeviceChange'); **系统能力:** SystemCapability.Multimedia.AVSession.Core +**系统接口:** 该接口为系统接口 + | 名称 | 类型 | 说明 | | -------------- | ------ | ------------ | | play | string | 播放 | @@ -3184,6 +3320,8 @@ controller.off('outputDeviceChange'); **系统能力:** SystemCapability.Multimedia.AVSession.Core +**系统接口:** 该接口为系统接口 + | 名称 | 类型 | 必填 | 说明 | | --------- | ------------------------------------------------- | ---- | -------------- | | command | [AVControlCommandType](#avcontrolcommandtype) | 是 | 命令 | @@ -3195,6 +3333,8 @@ controller.off('outputDeviceChange'); **系统能力:** SystemCapability.Multimedia.AVSession.Core +**系统接口:** 该接口为系统接口 + | 名称 | 类型 | 必填 | 说明 | | --------------- |-------------------------| ---- |---------------------------------------------------------------------| | assetId | string | 是 | 媒体ID。 | @@ -3219,6 +3359,8 @@ controller.off('outputDeviceChange'); **系统能力:** SystemCapability.Multimedia.AVSession.Core +**系统接口:** 该接口为系统接口 + | 名称 | 类型 | 必填 | 说明 | | ------------ | ------------------------------------- | ---- | ------- | | state | [PlaybackState](#playbackstate) | 否 | 播放状态 | @@ -3234,6 +3376,8 @@ controller.off('outputDeviceChange'); **系统能力:** SystemCapability.Multimedia.AVSession.Core +**系统接口:** 该接口为系统接口 + | 名称 | 类型 | 必填 | 说明 | | ----------- | ------ | ---- | ------------------ | | elapsedTime | number | 是 | 已用时间,单位毫秒(ms)。 | @@ -3245,6 +3389,8 @@ controller.off('outputDeviceChange'); **系统能力:** SystemCapability.Multimedia.AVSession.Core +**系统接口:** 该接口为系统接口 + | 名称 | 类型 | 必填 | 说明 | | ---------- | -------------- | ---- | ---------------------- | | isRemote | boolean | 是 | 设备是否连接。 | @@ -3257,6 +3403,8 @@ controller.off('outputDeviceChange'); **系统能力:** SystemCapability.Multimedia.AVSession.Core +**系统接口:** 该接口为系统接口 + | 名称 | 值 | 说明 | | --------------------------- | ---- | ----------- | | PLAYBACK_STATE_INITIAL | 0 | 初始状态 | @@ -3274,6 +3422,8 @@ controller.off('outputDeviceChange'); **系统能力:** SystemCapability.Multimedia.AVSession.Core +**系统接口:** 该接口为系统接口 + | 名称 | 值 | 说明 | | ------------------ | ---- | -------- | | LOOP_MODE_SEQUENCE | 0 | 顺序播放 | @@ -3287,6 +3437,8 @@ controller.off('outputDeviceChange'); **系统能力:** SystemCapability.Multimedia.AVSession.Core +**系统接口:** 该接口为系统接口 + | 名称 | 值 | 说明 | | ------------------------------ | ------- | ------------------------------- | | ERR_CODE_SERVICE_EXCEPTION | 6600101 | Session service exception. |