Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Docs
提交
28a272fa
D
Docs
项目概览
OpenHarmony
/
Docs
大约 1 年 前同步成功
通知
159
Star
292
Fork
28
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
D
Docs
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
28a272fa
编写于
6月 16, 2023
作者:
H
houyu
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
pr_hy_doc2
Signed-off-by:
N
houyu
<
houyu21@h-partners.com
>
上级
54f28001
变更
1
显示空白变更内容
内联
并排
Showing
1 changed file
with
27 addition
and
3 deletion
+27
-3
zh-cn/application-dev/reference/apis/js-apis-avsession.md
zh-cn/application-dev/reference/apis/js-apis-avsession.md
+27
-3
未找到文件。
zh-cn/application-dev/reference/apis/js-apis-avsession.md
浏览文件 @
28a272fa
...
...
@@ -1096,6 +1096,10 @@ setAVQueueItems(items: Array\<AVQueueItem>): Promise\<void>
**示例:**
```
js
import
image
from
'
@ohos.multimedia.image
'
;
import
resourceManager
from
'
@ohos.resourceManager
'
;
let
value
:
Uint8Array
=
await
resourceManager
.
getRawFile
(
'
IMAGE_URI
'
);
let
imageSource
:
imageImageSource
=
image
.
createImageSource
(
value
.
buffer
);
let
imagePixel
:
image
.
PixelMap
=
await
imageSource
.
createPixelMap
({
desiredSize
:{
width
:
150
,
height
:
150
}});
let
queueItemDescription_1
=
{
...
...
@@ -1116,7 +1120,7 @@ let queueItemDescription_2 = {
title
:
'
music_name
'
,
subtitle
:
'
music_sub_name
'
,
description
:
'
music_description
'
,
icon
:
PIXELMAP_OBJECT
,
icon
:
imagePixel
,
iconUri
:
'
http://www.xxx.com
'
,
extras
:
{
'
extras
'
:
'
any
'
}
};
...
...
@@ -1158,6 +1162,10 @@ setAVQueueItems(items: Array\<AVQueueItem>, callback: AsyncCallback\<void>): voi
**示例:**
```
js
import
image
from
'
@ohos.multimedia.image
'
;
import
resourceManager
from
'
@ohos.resourceManager
'
;
let
value
:
Uint8Array
=
await
resourceManager
.
getRawFile
(
'
IMAGE_URI
'
);
let
imageSource
:
imageImageSource
=
image
.
createImageSource
(
value
.
buffer
);
let
imagePixel
:
image
.
PixelMap
=
await
imageSource
.
createPixelMap
({
desiredSize
:{
width
:
150
,
height
:
150
}});
let
queueItemDescription_1
=
{
...
...
@@ -1178,7 +1186,7 @@ let queueItemDescription_2 = {
title
:
'
music_name
'
,
subtitle
:
'
music_sub_name
'
,
description
:
'
music_description
'
,
icon
:
PIXELMAP_OBJECT
,
icon
:
imagePixel
,
iconUri
:
'
http://www.icon.uri.com
'
,
extras
:
{
'
extras
'
:
'
any
'
}
};
...
...
@@ -2197,7 +2205,7 @@ on(type: 'commonCommand', callback: (command: string, args: {[key: string]: Obje
| 错误码ID | 错误信息 |
| -------- | ------------------------------ |
| 6600101 | Session service exception. |
| 660010
3 | The session controller
does not exist. |
| 660010
2 | The session
does not exist. |
**示例:**
...
...
@@ -2467,6 +2475,7 @@ off(type: 'commonCommand', callback?: (command: string, args: {[key:string]: Obj
| 错误码ID | 错误信息 |
| -------- | ---------------- |
| 6600101 | Session service exception. |
| 6600102 | The session does not exist. |
**示例:**
...
...
@@ -2724,6 +2733,7 @@ skipToQueueItem(itemId: number): Promise\<void>
| -------- | ---------------------------------------- |
| 6600101 | Session service exception. |
| 6600102 | The session does not exist. |
| 6600103 | The session controller does not exist. |
**示例:**
...
...
@@ -2758,6 +2768,7 @@ skipToQueueItem(itemId: number, callback: AsyncCallback\<void>): void
| -------- | ---------------------------------------- |
| 6600101 | Session service exception. |
| 6600102 | The session does not exist. |
| 6600103 | The session controller does not exist. |
**示例:**
...
...
@@ -2925,6 +2936,8 @@ getExtras(): Promise\<{[key: string]: Object}>
| 6600101 | Session service exception. |
| 6600102 | The session does not exist. |
| 6600103 | The session controller does not exist. |
| 6600105 | Invalid session command. |
| 6600107 | Too many commands or events. |
**示例:**
```
js
...
...
@@ -2955,6 +2968,8 @@ getExtras(callback: AsyncCallback\<{[key: string]: Object}>): void
| 6600101 | Session service exception. |
| 6600102 | The session does not exist. |
| 6600103 | The session controller does not exist. |
| 6600105 | Invalid session command. |
| 6600107 | Too many commands or events. |
**示例:**
```
js
...
...
@@ -3919,6 +3934,7 @@ off(type: 'metadataChange', callback?: (data: AVMetadata) => void)
| 错误码ID | 错误信息 |
| -------- | ---------------- |
| 6600101 | Session service exception. |
| 6600103 | The session controller does not exist. |
**示例:**
...
...
@@ -3947,6 +3963,7 @@ off(type: 'playbackStateChange', callback?: (state: AVPlaybackState) => void)
| 错误码ID | 错误信息 |
| -------- | ---------------- |
| 6600101 | Session service exception. |
| 6600103 | The session controller does not exist. |
**示例:**
...
...
@@ -3975,6 +3992,7 @@ off(type: 'sessionEvent', callback?: (sessionEvent: string, args: {[key:string]:
| 错误码ID | 错误信息 |
| -------- | ---------------- |
| 6600101 | Session service exception. |
| 6600103 | The session controller does not exist. |
**示例:**
...
...
@@ -4003,6 +4021,7 @@ off(type: 'queueItemsChange', callback?: (items: Array<[AVQueueItem](#avqueueite
| 错误码ID | 错误信息 |
| -------- | ---------------- |
| 6600101 | Session service exception. |
| 6600103 | The session controller does not exist. |
**示例:**
...
...
@@ -4031,6 +4050,7 @@ off(type: 'queueTitleChange', callback?: (title: string) => void): void
| 错误码ID | 错误信息 |
| -------- | ---------------- |
| 6600101 | Session service exception. |
| 6600103 | The session controller does not exist. |
**示例:**
...
...
@@ -4089,6 +4109,7 @@ off(type: 'sessionDestroy', callback?: () => void)
| 错误码ID | 错误信息 |
| -------- | ---------------- |
| 6600101 | Session service exception. |
| 6600103 | The session controller does not exist. |
**示例:**
...
...
@@ -4117,6 +4138,7 @@ off(type: 'activeStateChange', callback?: (isActive: boolean) => void)
| 错误码ID | 错误信息 |
| -------- | ---------------- |
| 6600101 | Session service exception. |
| 6600103 | The session controller does not exist. |
**示例:**
...
...
@@ -4145,6 +4167,7 @@ off(type: 'validCommandChange', callback?: (commands: Array\<AVControlCommandTyp
| 错误码ID | 错误信息 |
| -------- | ---------------- |
| 6600101 | Session service exception. |
| 6600103 | The session controller does not exist. |
**示例:**
...
...
@@ -4173,6 +4196,7 @@ off(type: 'outputDeviceChange', callback?: (device: OutputDeviceInfo) => void):
| 错误码ID | 错误信息 |
| -------- | ---------------- |
| 6600101 | Session service exception. |
| 6600103 | The session controller does not exist. |
**示例:**
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录