Closed sambhavsharma closed 1 year ago
Hi, it is a bit hard to check the issue from this message only. If it is possible can you upload part of your code which could reproduce the issue?
Hi, it is a bit hard to check the issue from this message only. If it is possible can you upload part of your code which could reproduce the issue?
Hi, updated the issue with some code.
same issue here, updates?
any update on this?
In 4.x sdk createMicrophoneAudioTrack returns Promise Object. And if you could use createMicrophoneAndCameraTracks APIs to publish then at the same time.
AgoraRTC.createMicrophoneAndCameraTracks({microphoneId: microphoneId}, {cameraId: cameraId})
.then((tracks) => {
this.mLocalAudioTrack = tracks[0]
this.mLocalVideoTrack = tracks[1]
this._client.publish([this.mLocalAudioTrack, this.mLocalVideoTrack])
resolve()
})
.catch(e => {
reject(e)
})
And for sure, you could create camera and microphone tracks relatively like:
// create local audio and video tracks
localTracks.audioTrack = await AgoraRTC.createMicrophoneAudioTrack();
localTracks.videoTrack = await AgoraRTC.createCameraVideoTrack();
// play local video track
localTracks.videoTrack.play("local-player");
// publish local tracks to channel
await client.publish(Object.values(localTracks));
I followed the steps as mentioned in the docs. I was earlier using agora v3.6.0 and everything was working fine. I want to upgrade to Agora v4 which isn't backward compatible, but looked easy enough to implement.
I am receiving the following error after I publish my local tracks.
-- Code
` import AgoraRTC from 'agora-rtc-sdk-ng'; const AgoraClient = AgoraRTC.createClient({ mode: 'rtc', codec: "h264" });
`