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 759d35fcee934925e33ed2a7409bb8bd2a263a3b..15fd3d4d861a707b78633691221962be75215b65 100755 --- a/zh-cn/application-dev/reference/apis/js-apis-avsession.md +++ b/zh-cn/application-dev/reference/apis/js-apis-avsession.md @@ -54,10 +54,9 @@ import featureAbility from '@ohos.ability.featureAbility'; let session; let tag = "createNewSession"; -let type = "audio"; let context = featureAbility.getContext(); -await avSession.createAVSession(context, tag, type).then((avSession) => { +await avSession.createAVSession(context, tag, "audio").then((avSession) => { session = avSession; console.info(`CreateAVSession : SUCCESS : sessionId = ${session.sessionId}`); }).catch((err) => { @@ -96,10 +95,9 @@ import featureAbility from '@ohos.ability.featureAbility'; let session; let tag = "createNewSession"; -let type = "audio"; let context = featureAbility.getContext(); -avSession.createAVSession(context, tag, type, function (err, avSession) { +avSession.createAVSession(context, tag, "audio", function (err, avSession) { if (err) { console.info(`CreateAVSession BusinessError: code: ${err.code}, message: ${err.message}`); } else {