WebRTC is not supported in Chrome and Edge

Hi I've implemented a video call using WebRTC / Agora.io.

It was working well until last week I get this message.

It doesn't support now in Chrome and Edge. But is still working on Mozilla Firefox.

Anyone also encounter this issue? There's no error in the console logs and network tab.

enter image description here

Upvotes: 4

Views: 3747

Answers (1)

Hermes
Hermes

Reputation: 2898

For anyone experiencing this issue after upgrading their Agora v3.x SDK, it only happens when using old (v3.x) versions of the Agora SDK and is caused by a updates to Chrome. We sent out emails to our developer community explaining the issue.

To resolve the issue we recommend updating your SDK version to the 4.x (latest is v4.21). As mentioned in one of the comments this will require some updates to your code, but contrary to the comment the updates are minimal.

Updating is not a massive rewrite of your architecture, the updates are minor syntax changes in the implementation. For example:

  • When creating a client, you no longer have to init the client before joining:
// v3.x
const client = AgoraRTC.createClient({ mode: "live", codec: "vp9" });
client.init("APPID", () => {
  client.join("Token", "Channel", null, (uid) => { ... }, (e) => { ... });
});

// v4.x
const client = AgoraRTC.createClient({ mode: "live", codec: "vp9" });
try {
  const uid = await client.join("APPID", "Channel", "Token", uid);
  console.log("join success");
} catch (e) { console.log("join failed", e) }
  • Similarly for local streams you don't need to init before you create them
// v3.x
const localStream = AgoraRTC.createStream({ audio: true, video: true });
localStream.init(() => {
  console.log("init stream success");
  localStream.play("DOM_ELEMENT_ID", { muted: true });
}, (e) => {
  console.log("init local stream failed", e);
});

// v4.x
const localAudio = await AgoraRTC.createMicrophoneAudioTrack();
const localVideo = await AgoraRTC.createCameraVideoTrack();
console.log("create local audio/video track success");
localVideo.play("DOM_ELEMENT_ID");

For the full list of changes when upgrading from v3.x to v4.x check out the Agora Guide: https://docs.agora.io/en/video-calling/develop/migration-guide?platform=web

Upvotes: 0

Related Questions