Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Docs
提交
bb34fe84
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看板
提交
bb34fe84
编写于
7月 31, 2023
作者:
J
jiaoyanlin3
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Modification of avsession sample code issues
Signed-off-by:
N
jiaoyanlin3
<
jiaoyanlin3@huawei.com
>
上级
f041beee
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
88 addition
and
64 deletion
+88
-64
zh-cn/application-dev/reference/apis/js-apis-avsession.md
zh-cn/application-dev/reference/apis/js-apis-avsession.md
+88
-64
未找到文件。
zh-cn/application-dev/reference/apis/js-apis-avsession.md
浏览文件 @
bb34fe84
...
...
@@ -56,10 +56,12 @@ import featureAbility from '@ohos.ability.featureAbility';
let
currentAVSession
;
let
tag
=
"
createNewSession
"
;
let
context
=
featureAbility
.
getContext
();
let
sessionId
;
//供后续函数入参使用
a
wait
a
vSession
.
createAVSession
(
context
,
tag
,
"
audio
"
).
then
((
data
)
=>
{
avSession
.
createAVSession
(
context
,
tag
,
"
audio
"
).
then
((
data
)
=>
{
currentAVSession
=
data
;
console
.
info
(
`CreateAVSession : SUCCESS : sessionId =
${
currentAVSession
.
sessionId
}
`
);
sessionId
=
currentAVSession
.
sessionId
;
console
.
info
(
`CreateAVSession : SUCCESS : sessionId =
${
sessionId
}
`
);
}).
catch
((
err
)
=>
{
console
.
info
(
`CreateAVSession BusinessError: code:
${
err
.
code
}
, message:
${
err
.
message
}
`
);
});
...
...
@@ -98,13 +100,15 @@ import featureAbility from '@ohos.ability.featureAbility';
let
currentAVSession
;
let
tag
=
"
createNewSession
"
;
let
context
=
featureAbility
.
getContext
();
let
sessionId
;
//供后续函数入参使用
avSession
.
createAVSession
(
context
,
tag
,
"
audio
"
,
function
(
err
,
data
)
{
if
(
err
)
{
console
.
info
(
`CreateAVSession BusinessError: code:
${
err
.
code
}
, message:
${
err
.
message
}
`
);
}
else
{
currentAVSession
=
data
;
console
.
info
(
`CreateAVSession : SUCCESS : sessionId =
${
session
.
sessionId
}
`
);
sessionId
=
currentAVSession
.
sessionId
;
console
.
info
(
`CreateAVSession : SUCCESS : sessionId =
${
sessionId
}
`
);
}
});
```
...
...
@@ -325,7 +329,7 @@ createController(sessionId: string): Promise\<AVSessionController>
```
js
let
currentAVcontroller
;
a
wait
a
vSession
.
createController
(
currentAVSession
.
sessionId
).
then
((
avcontroller
)
=>
{
avSession
.
createController
(
currentAVSession
.
sessionId
).
then
((
avcontroller
)
=>
{
currentAVcontroller
=
avcontroller
;
console
.
info
(
`CreateController : SUCCESS :
${
currentAVcontroller
.
sessionId
}
`
);
}).
catch
((
err
)
=>
{
...
...
@@ -1376,8 +1380,13 @@ startCasting(session: SessionToken, device: OutputDeviceInfo, callback: AsyncCal
```js
let myToken = {
sessionId:
currentAVSession.sessionId;
sessionId:
sessionId,
}
let castDevice;
avSession.on('deviceAvailable', (device) => {
castDevice = device;
console.info(`on deviceAvailable : ${device} `);
});
avSession.startCasting(myToken, castDevice, function (err) {
if (err) {
console.error(`startCasting BusinessError: code: ${err.code}, message: ${err.message}`);
...
...
@@ -1424,8 +1433,13 @@ startCasting(session: SessionToken, device: OutputDeviceInfo): Promise\<void>
```js
let myToken = {
sessionId:
currentAVSession.sessionId;
sessionId:
sessionId,
}
let castDevice;
avSession.on('deviceAvailable', (device) => {
castDevice = device;
console.info(`on deviceAvailable : ${device} `);
});
avSession.startCasting(myToken, castDevice).then(() => {
console.info(`startCasting successfully`);
}).catch((err) => {
...
...
@@ -1461,8 +1475,13 @@ stopCasting(session: SessionToken, callback: AsyncCallback\<void>): void
```js
let myToken = {
sessionId:
currentAVSession.sessionId;
sessionId:
sessionId,
}
let castDevice;
avSession.on('deviceAvailable', (device) => {
castDevice = device;
console.info(`on deviceAvailable : ${device} `);
});
avSession.stopCasting(myToken, castDevice, function (err) {
if (err) {
console.error(`stopCasting BusinessError: code: ${err.code}, message: ${err.message}`);
...
...
@@ -1505,8 +1524,13 @@ stopCasting(session: SessionToken): Promise\<void>
```js
let myToken = {
sessionId:
currentAVSession.sessionId;
sessionId:
sessionId,
}
let castDevice;
avSession.on('deviceAvailable', (device) => {
castDevice = device;
console.info(`on deviceAvailable : ${device} `);
});
avSession.stopCasting(myToken).then(() => {
console.info(`stopCasting successfully`);
}).catch((err) => {
...
...
@@ -1914,7 +1938,7 @@ let eventName = "dynamic_lyric";
let args = {
lyric : "This is lyric"
}
await
currentAVSession.dispatchSessionEvent(eventName, args).catch((err) => {
currentAVSession.dispatchSessionEvent(eventName, args).catch((err) => {
console.info(`dispatchSessionEvent BusinessError: code: ${err.code}, message: ${err.message}`);
})
```
...
...
@@ -1953,7 +1977,7 @@ let eventName = "dynamic_lyric";
let args = {
lyric : "This is lyric"
}
await
currentAVSession.dispatchSessionEvent(eventName, args, (err) => {
currentAVSession.dispatchSessionEvent(eventName, args, (err) => {
if(err) {
console.error(`dispatchSessionEvent BusinessError: code: ${err.code}, message: ${err.message}`);
}
...
...
@@ -2211,7 +2235,7 @@ setExtras(extras: {[key: string]: Object}): Promise\<void>
let extras = {
extras : "This is custom media packet"
}
await
currentAVSession.setExtras(extras).catch((err) => {
currentAVSession.setExtras(extras).catch((err) => {
console.info(`setExtras BusinessError: code: ${err.code}, message: ${err.message}`);
})
```
...
...
@@ -2248,7 +2272,7 @@ setExtras(extras: {[key: string]: Object}, callback: AsyncCallback\<void>): void
let extras = {
extras : "This is custom media packet"
}
await
currentAVSession.setExtras(extras, (err) => {
currentAVSession.setExtras(extras, (err) => {
if(err) {
console.error(`setExtras BusinessError: code: ${err.code}, message: ${err.message}`);
}
...
...
@@ -4795,7 +4819,7 @@ aVCastController.off('error')
**示例:**
```js
let AVSessionController;
a
wait a
vSession.createController(currentAVSession.sessionId).then((controller) => {
avSession.createController(currentAVSession.sessionId).then((controller) => {
AVSessionController = controller;
}).catch((err) => {
console.error(`CreateController BusinessError: code: ${err.code}, message: ${err.message}`);
...
...
@@ -4828,7 +4852,7 @@ getAVPlaybackState(callback: AsyncCallback\<AVPlaybackState>): void
**示例:**
```js
AVS
essionController.getAVPlaybackState(function (err, state) {
avs
essionController.getAVPlaybackState(function (err, state) {
if (err) {
console.error(`getAVPlaybackState BusinessError: code: ${err.code}, message: ${err.message}`);
} else {
...
...
@@ -4863,7 +4887,7 @@ getAVPlaybackState(): Promise\<AVPlaybackState>;
**示例:**
```js
AVS
essionController.getAVPlaybackState().then((state) => {
avs
essionController.getAVPlaybackState().then((state) => {
console.info(`getAVPlaybackState : SUCCESS :`);
}).catch((err) => {
console.error(`getAVPlaybackState BusinessError: code: ${err.code}, message: ${err.message}`);
...
...
@@ -4895,7 +4919,7 @@ getAVMetadata(): Promise\<AVMetadata>
**示例:**
```js
AVS
essionController.getAVMetadata().then((metadata) => {
avs
essionController.getAVMetadata().then((metadata) => {
console.info(`GetAVMetadata : SUCCESS : assetId : ${metadata.assetId}`);
}).catch((err) => {
console.error(`GetAVMetadata BusinessError: code: ${err.code}, message: ${err.message}`);
...
...
@@ -4927,7 +4951,7 @@ getAVMetadata(callback: AsyncCallback\<AVMetadata>): void
**示例:**
```js
AVS
essionController.getAVMetadata(function (err, metadata) {
avs
essionController.getAVMetadata(function (err, metadata) {
if (err) {
console.error(`GetAVMetadata BusinessError: code: ${err.code}, message: ${err.message}`);
} else {
...
...
@@ -4961,7 +4985,7 @@ getAVQueueTitle(): Promise\<string>
**示例:**
```js
AVS
essionController.getAVQueueTitle().then((title) => {
avs
essionController.getAVQueueTitle().then((title) => {
console.info(`GetAVQueueTitle : SUCCESS : title : ${title}`);
}).catch((err) => {
console.error(`GetAVQueueTitle BusinessError: code: ${err.code}, message: ${err.message}`);
...
...
@@ -4993,7 +5017,7 @@ getAVQueueTitle(callback: AsyncCallback\<string>): void
**示例:**
```js
AVS
essionController.getAVQueueTitle(function (err, title) {
avs
essionController.getAVQueueTitle(function (err, title) {
if (err) {
console.error(`GetAVQueueTitle BusinessError: code: ${err.code}, message: ${err.message}`);
} else {
...
...
@@ -5027,7 +5051,7 @@ getAVQueueItems(): Promise\<Array\<AVQueueItem>>
**示例:**
```js
AVS
essionController.getAVQueueItems().then((items) => {
avs
essionController.getAVQueueItems().then((items) => {
console.info(`GetAVQueueItems : SUCCESS : length : ${items.length}`);
}).catch((err) => {
console.error(`GetAVQueueItems BusinessError: code: ${err.code}, message: ${err.message}`);
...
...
@@ -5059,7 +5083,7 @@ getAVQueueItems(callback: AsyncCallback\<Array\<AVQueueItem>>): void
**示例:**
```js
AVS
essionController.getAVQueueItems(function (err, items) {
avs
essionController.getAVQueueItems(function (err, items) {
if (err) {
console.error(`GetAVQueueItems BusinessError: code: ${err.code}, message: ${err.message}`);
} else {
...
...
@@ -5101,7 +5125,7 @@ skipToQueueItem(itemId: number): Promise\<void>
```js
let queueItemId = 0;
AVS
essionController.skipToQueueItem(queueItemId).then(() => {
avs
essionController.skipToQueueItem(queueItemId).then(() => {
console.info(`SkipToQueueItem successfully`);
}).catch((err) => {
console.error(`SkipToQueueItem BusinessError: code: ${err.code}, message: ${err.message}`);
...
...
@@ -5136,7 +5160,7 @@ skipToQueueItem(itemId: number, callback: AsyncCallback\<void>): void
```js
let queueItemId = 0;
AVS
essionController.skipToQueueItem(queueItemId, function (err) {
avs
essionController.skipToQueueItem(queueItemId, function (err) {
if (err) {
console.error(`SkipToQueueItem BusinessError: code: ${err.code}, message: ${err.message}`);
} else {
...
...
@@ -5170,7 +5194,7 @@ getOutputDevice(): Promise\<OutputDeviceInfo>
**示例:**
```js
AVS
essionController.getOutputDevice().then((deviceInfo) => {
avs
essionController.getOutputDevice().then((deviceInfo) => {
console.info(`GetOutputDevice : SUCCESS : isRemote : ${deviceInfo.isRemote}`);
}).catch((err) => {
console.error(`GetOutputDevice BusinessError: code: ${err.code}, message: ${err.message}`);
...
...
@@ -5202,7 +5226,7 @@ getOutputDevice(callback: AsyncCallback\<OutputDeviceInfo>): void
**示例:**
```js
AVS
essionController.getOutputDevice(function (err, deviceInfo) {
avs
essionController.getOutputDevice(function (err, deviceInfo) {
if (err) {
console.error(`GetOutputDevice BusinessError: code: ${err.code}, message: ${err.message}`);
} else {
...
...
@@ -5248,7 +5272,7 @@ sendAVKeyEvent(event: KeyEvent): Promise\<void>
let keyItem = {code:0x49, pressedTime:2, deviceId:0};
let event = {action:2, key:keyItem, keys:[keyItem]};
AVS
essionController.sendAVKeyEvent(event).then(() => {
avs
essionController.sendAVKeyEvent(event).then(() => {
console.info(`SendAVKeyEvent Successfully`);
}).catch((err) => {
console.error(`SendAVKeyEvent BusinessError: code: ${err.code}, message: ${err.message}`);
...
...
@@ -5287,7 +5311,7 @@ sendAVKeyEvent(event: KeyEvent, callback: AsyncCallback\<void>): void
let keyItem = {code:0x49, pressedTime:2, deviceId:0};
let event = {action:2, key:keyItem, keys:[keyItem]};
AVS
essionController.sendAVKeyEvent(event, function (err) {
avs
essionController.sendAVKeyEvent(event, function (err) {
if (err) {
console.error(`SendAVKeyEvent BusinessError: code: ${err.code}, message: ${err.message}`);
} else {
...
...
@@ -5322,7 +5346,7 @@ getLaunchAbility(): Promise\<WantAgent>
**示例:**
```js
AVS
essionController.getLaunchAbility().then((agent) => {
avs
essionController.getLaunchAbility().then((agent) => {
console.info(`GetLaunchAbility : SUCCESS : wantAgent : ${agent}`);
}).catch((err) => {
console.error(`GetLaunchAbility BusinessError: code: ${err.code}, message: ${err.message}`);
...
...
@@ -5355,7 +5379,7 @@ getLaunchAbility(callback: AsyncCallback\<WantAgent>): void
**示例:**
```js
AVS
essionController.getLaunchAbility(function (err, agent) {
avs
essionController.getLaunchAbility(function (err, agent) {
if (err) {
console.error(`GetLaunchAbility BusinessError: code: ${err.code}, message: ${err.message}`);
} else {
...
...
@@ -5389,7 +5413,7 @@ getRealPlaybackPositionSync(): number
**示例:**
```js
let time =
AVS
essionController.getRealPlaybackPositionSync();
let time =
avs
essionController.getRealPlaybackPositionSync();
```
### isActive<sup>10+</sup>
...
...
@@ -5418,7 +5442,7 @@ isActive(): Promise\<boolean>
**示例:**
```js
AVS
essionController.isActive().then((isActive) => {
avs
essionController.isActive().then((isActive) => {
console.info(`IsActive : SUCCESS : isactive : ${isActive}`);
}).catch((err) => {
console.error(`IsActive BusinessError: code: ${err.code}, message: ${err.message}`);
...
...
@@ -5451,7 +5475,7 @@ isActive(callback: AsyncCallback\<boolean>): void
**示例:**
```js
AVS
essionController.isActive(function (err, isActive) {
avs
essionController.isActive(function (err, isActive) {
if (err) {
console.error(`IsActive BusinessError: code: ${err.code}, message: ${err.message}`);
} else {
...
...
@@ -5485,7 +5509,7 @@ destroy(): Promise\<void>
**示例:**
```js
AVS
essionController.destroy().then(() => {
avs
essionController.destroy().then(() => {
console.info(`Destroy : SUCCESS `);
}).catch((err) => {
console.error(`Destroy BusinessError: code: ${err.code}, message: ${err.message}`);
...
...
@@ -5517,7 +5541,7 @@ destroy(callback: AsyncCallback\<void>): void
**示例:**
```js
AVS
essionController.destroy(function (err) {
avs
essionController.destroy(function (err) {
if (err) {
console.error(`Destroy BusinessError: code: ${err.code}, message: ${err.message}`);
} else {
...
...
@@ -5552,7 +5576,7 @@ getValidCommands(): Promise\<Array\<AVControlCommandType>>
**示例:**
```js
AVS
essionController.getValidCommands.then((validCommands) => {
avs
essionController.getValidCommands.then((validCommands) => {
console.info(`GetValidCommands : SUCCESS : size : ${validCommands.length}`);
}).catch((err) => {
console.error(`GetValidCommands BusinessError: code: ${err.code}, message: ${err.message}`);
...
...
@@ -5585,7 +5609,7 @@ getValidCommands(callback: AsyncCallback\<Array\<AVControlCommandType>>): void
**示例:**
```js
AVS
essionController.getValidCommands(function (err, validCommands) {
avs
essionController.getValidCommands(function (err, validCommands) {
if (err) {
console.error(`GetValidCommands BusinessError: code: ${err.code}, message: ${err.message}`);
} else {
...
...
@@ -5644,7 +5668,7 @@ let avCommand = {command:'play'};
// let avCommand = {command:'setSpeed', parameter:2.6};
// let avCommand = {command:'setLoopMode', parameter:avSession.LoopMode.LOOP_MODE_SINGLE};
// let avCommand = {command:'toggleFavorite', parameter:"false"};
AVS
essionController.sendControlCommand(avCommand).then(() => {
avs
essionController.sendControlCommand(avCommand).then(() => {
console.info(`SendControlCommand successfully`);
}).catch((err) => {
console.error(`SendControlCommand BusinessError: code: ${err.code}, message: ${err.message}`);
...
...
@@ -5696,7 +5720,7 @@ let avCommand = {command:'play'};
// let avCommand = {command:'setSpeed', parameter:2.6};
// let avCommand = {command:'setLoopMode', parameter:avSession.LoopMode.LOOP_MODE_SINGLE};
// let avCommand = {command:'toggleFavorite', parameter:"false"};
AVS
essionController.sendControlCommand(avCommand, function (err) {
avs
essionController.sendControlCommand(avCommand, function (err) {
if (err) {
console.info(`SendControlCommand BusinessError: code: ${err.code}, message: ${err.message}`);
} else {
...
...
@@ -5748,7 +5772,7 @@ let commandName = "my_command";
let args = {
command : "This is my command"
}
a
wait AVS
essionController.sendCommonCommand(commandName, args).catch((err) => {
a
vs
essionController.sendCommonCommand(commandName, args).catch((err) => {
console.info(`SendCommonCommand BusinessError: code: ${err.code}, message: ${err.message}`);
})
```
...
...
@@ -5791,7 +5815,7 @@ let commandName = "my_command";
let args = {
command : "This is my command"
}
AVS
essionController.sendCommonCommand(commandName, args, (err) => {
avs
essionController.sendCommonCommand(commandName, args, (err) => {
if(err) {
console.info(`SendCommonCommand BusinessError: code: ${err.code}, message: ${err.message}`);
}
...
...
@@ -5825,7 +5849,7 @@ getExtras(): Promise\<{[key: string]: Object}>
**示例:**
```js
let extras = await
AVS
essionController.getExtras().catch((err) => {
let extras = await
avs
essionController.getExtras().catch((err) => {
console.info(`getExtras BusinessError: code: ${err.code}, message: ${err.message}`);
});
```
...
...
@@ -5857,7 +5881,7 @@ getExtras(callback: AsyncCallback\<{[key: string]: Object}>): void
**示例:**
```js
AVS
essionController.getExtras(function (err, extras) {
avs
essionController.getExtras(function (err, extras) {
if (err) {
console.error(`getExtras BusinessError: code: ${err.code}, message: ${err.message}`);
} else {
...
...
@@ -5893,12 +5917,12 @@ on(type: 'metadataChange', filter: Array\<keyof AVMetadata> | 'all', callback: (
**示例:**
```js
AVS
essionController.on('metadataChange', 'all', (metadata) => {
avs
essionController.on('metadataChange', 'all', (metadata) => {
console.info(`on metadataChange assetId : ${metadata.assetId}`);
});
let metaFilter = ['assetId', 'title', 'description'];
AVS
essionController.on('metadataChange', metaFilter, (metadata) => {
avs
essionController.on('metadataChange', metaFilter, (metadata) => {
console.info(`on metadataChange assetId : ${metadata.assetId}`);
});
```
...
...
@@ -5929,7 +5953,7 @@ off(type: 'metadataChange', callback?: (data: AVMetadata) => void)
**示例:**
```js
AVS
essionController.off('metadataChange');
avs
essionController.off('metadataChange');
```
### on('playbackStateChange')<sup>10+</sup>
...
...
@@ -5959,12 +5983,12 @@ on(type: 'playbackStateChange', filter: Array\<keyof AVPlaybackState> | 'all', c
**示例:**
```js
AVS
essionController.on('playbackStateChange', 'all', (playbackState) => {
avs
essionController.on('playbackStateChange', 'all', (playbackState) => {
console.info(`on playbackStateChange state : ${playbackState.state}`);
});
let playbackFilter = ['state', 'speed', 'loopMode'];
AVS
essionController.on('playbackStateChange', playbackFilter, (playbackState) => {
avs
essionController.on('playbackStateChange', playbackFilter, (playbackState) => {
console.info(`on playbackStateChange state : ${playbackState.state}`);
});
```
...
...
@@ -5995,7 +6019,7 @@ off(type: 'playbackStateChange', callback?: (state: AVPlaybackState) => void)
**示例:**
```js
AVS
essionController.off('playbackStateChange');
avs
essionController.off('playbackStateChange');
```
### on('sessionDestroy')<sup>10+</sup>
...
...
@@ -6024,7 +6048,7 @@ on(type: 'sessionDestroy', callback: () => void)
**示例:**
```js
AVS
essionController.on('sessionDestroy', () => {
avs
essionController.on('sessionDestroy', () => {
console.info(`on sessionDestroy : SUCCESS `);
});
```
...
...
@@ -6055,7 +6079,7 @@ off(type: 'sessionDestroy', callback?: () => void)
**示例:**
```js
AVS
essionController.off('sessionDestroy');
avs
essionController.off('sessionDestroy');
```
### on('activeStateChange')<sup>10+</sup>
...
...
@@ -6084,7 +6108,7 @@ on(type: 'activeStateChange', callback: (isActive: boolean) => void)
**示例:**
```js
AVS
essionController.on('activeStateChange', (isActive) => {
avs
essionController.on('activeStateChange', (isActive) => {
console.info(`on activeStateChange : SUCCESS : isActive ${isActive}`);
});
```
...
...
@@ -6115,7 +6139,7 @@ off(type: 'activeStateChange', callback?: (isActive: boolean) => void)
**示例:**
```js
AVS
essionController.off('activeStateChange');
avs
essionController.off('activeStateChange');
```
### on('validCommandChange')<sup>10+</sup>
...
...
@@ -6144,7 +6168,7 @@ on(type: 'validCommandChange', callback: (commands: Array\<AVControlCommandType>
**示例:**
```js
AVS
essionController.on('validCommandChange', (validCommands) => {
avs
essionController.on('validCommandChange', (validCommands) => {
console.info(`validCommandChange : SUCCESS : size : ${validCommands.size}`);
console.info(`validCommandChange : SUCCESS : validCommands : ${validCommands.values()}`);
});
...
...
@@ -6176,7 +6200,7 @@ off(type: 'validCommandChange', callback?: (commands: Array\<AVControlCommandTyp
**示例:**
```js
AVS
essionController.off('validCommandChange');
avs
essionController.off('validCommandChange');
```
### on('outputDeviceChange')<sup>10+</sup>
...
...
@@ -6205,7 +6229,7 @@ on(type: 'outputDeviceChange', callback: (state: ConnectionState, device: Output
**示例:**
```js
AVS
essionController.on('outputDeviceChange', (state, device) => {
avs
essionController.on('outputDeviceChange', (state, device) => {
console.info(`on outputDeviceChange state: ${state}, device : ${device}`);
});
```
...
...
@@ -6236,7 +6260,7 @@ off(type: 'outputDeviceChange', callback?: (state: ConnectionState, device: Outp
**示例:**
```js
AVS
essionController.off('outputDeviceChange');
avs
essionController.off('outputDeviceChange');
```
### on('sessionEvent')<sup>10+</sup>
...
...
@@ -6266,7 +6290,7 @@ on(type: 'sessionEvent', callback: (sessionEvent: string, args: {[key:string]: O
**示例:**
```js
AVS
essionController.on('sessionEvent', (sessionEvent, args) => {
avs
essionController.on('sessionEvent', (sessionEvent, args) => {
console.info(`OnSessionEvent, sessionEvent is ${sessionEvent}, args: ${JSON.stringify(args)}`);
});
```
...
...
@@ -6297,7 +6321,7 @@ off(type: 'sessionEvent', callback?: (sessionEvent: string, args: {[key:string]:
**示例:**
```js
AVS
essionController.off('sessionEvent');
avs
essionController.off('sessionEvent');
```
### on('queueItemsChange')<sup>10+</sup>
...
...
@@ -6326,7 +6350,7 @@ on(type: 'queueItemsChange', callback: (items: Array<[AVQueueItem](#avqueueitem1
**示例:**
```js
AVS
essionController.on('queueItemsChange', (items) => {
avs
essionController.on('queueItemsChange', (items) => {
console.info(`OnQueueItemsChange, items length is ${items.length}`);
});
```
...
...
@@ -6357,7 +6381,7 @@ off(type: 'queueItemsChange', callback?: (items: Array<[AVQueueItem](#avqueueite
**示例:**
```js
AVS
essionController.off('queueItemsChange');
avs
essionController.off('queueItemsChange');
```
### on('queueTitleChange')<sup>10+</sup>
...
...
@@ -6386,7 +6410,7 @@ on(type: 'queueTitleChange', callback: (title: string) => void): void
**示例:**
```js
AVS
essionController.on('queueTitleChange', (title) => {
avs
essionController.on('queueTitleChange', (title) => {
console.info(`queueTitleChange, title is ${title}`);
});
```
...
...
@@ -6417,7 +6441,7 @@ off(type: 'queueTitleChange', callback?: (title: string) => void): void
**示例:**
```js
AVS
essionController.off('queueTitleChange');
avs
essionController.off('queueTitleChange');
```
### on('extrasChange')<sup>10+</sup>
...
...
@@ -6446,7 +6470,7 @@ on(type: 'extrasChange', callback: (extras: {[key:string]: Object}) => void): vo
**示例:**
```js
AVS
essionController.on('extrasChange', (extras) => {
avs
essionController.on('extrasChange', (extras) => {
console.info(`Caught extrasChange event,the new extra is: ${JSON.stringify(extras)}`);
});
```
...
...
@@ -6477,7 +6501,7 @@ off(type: 'extrasChange', callback?: (extras: {[key:string]: Object}) => void):
**示例:**
```js
AVS
essionController.off('extrasChange');
avs
essionController.off('extrasChange');
``
`
## AVControlCommandType<sup>10+</sup>
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录