Skip to content

Commit

Permalink
fix: Allow createAudioTrack failed when initialize (#16)
Browse files Browse the repository at this point in the history
Co-authored-by: gxz <guoxianzhe@agora.io>
  • Loading branch information
littleGnAl and guoxianzhe authored Oct 19, 2023
1 parent bbab630 commit 1588b7f
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 5 deletions.
2 changes: 1 addition & 1 deletion packages/fake/rtc/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "iris-web-rtc-fake",
"version": "0.1.2-dev.1",
"version": "0.1.2-dev.2",
"description": "wait",
"main": "./index.ts",
"scripts": {
Expand Down
2 changes: 1 addition & 1 deletion packages/rtc/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "iris-web-rtc",
"version": "0.1.2-dev.1",
"version": "0.1.2-dev.2",
"description": "wait",
"main": "./src/index.ts",
"scripts": {
Expand Down
10 changes: 7 additions & 3 deletions packages/rtc/src/impl/IAgoraRtcEngineImpl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -87,9 +87,13 @@ export class IRtcEngineImpl implements IRtcEngineExtensions {
);
}
//音频模块默认是开启的,所以默认创建音频轨道
await this._engine.implHelper.createAudioTrack(
IrisAudioSourceType.kAudioSourceTypeMicrophonePrimary
);
try {
await this._engine.implHelper.createAudioTrack(
IrisAudioSourceType.kAudioSourceTypeMicrophonePrimary
);
} catch (e) {
AgoraConsole.warn(`createAudioTrack error: ${e}`);
}

let result = this._engine.globalState.AgoraRTC.checkSystemRequirements();
return this._engine.returnResult(result);
Expand Down

0 comments on commit 1588b7f

Please sign in to comment.