Rate this page:

Video calls in Safari (<12.1)

Although the latest versions of Safari support WebRTC, users still may experience some issues with video calls. By default, Safari uses only the H264 codec while other browsers use both H264 and VP8 popular codecs. To fix the issue, you can explicitly specify a video codec list conventionally called “scheme”.

The following issues may arise:

  1. The video is enabled for both parties but it glitches.
  2. Only the party that uses Chrome can see the video. If this party switches the video off:
    • the video is switched off for both users;
    • it is impossible to switch the video back on, and so on.

What you need

To follow this how-to guide, you will need:

  • Voximplant developer account. If you don’t have one, sign up here

  • A JS scenario. It will be created during this tutorial

1. JS scenario

If you log in as user1 and want to call user2, a JS scenario has to receive an incoming call from user1, call user2, and connect them. Note that we call the callUser method because we need to pass scheme as an argument to support video calls in Safari:

Call handling

Call handling

The connection is successfully established. Next, we need to enable switching the video on and off. To do this, we use the reInvite method together with the ReInviteReceived and ReInviteAccepted events:

Switching video on and off

Switching video on and off

You might have noticed a comment about the easyprocess method, which makes it possible to use fewer lines of code. Let’s reduce our code size:



That’s all the code we need to support video calls in Safari. The tutorial below demonstrates how you can finalize the sample application and test video calls.

To create a scenario, you need to create an application first. Go to Applications, click New application and name it videocalls.

Then switch to the Scenarios tab of the application and add the scenario with the code above. Name it video-call-handling.

2. Users and a rule

To use the application, you need to create two users. Switch to the Users tab, create two users named user1 and user2 and set passwords for them. The active checkbox should be selected.

Further, we should create a rule for our application. As you are still in the edit mode, go to the Routing tab in the application and click New rule in the upper right corner (or Create in the center of the screen).

You can name the rule Incoming call. Use the created JS scenario in the rule and leave the default call pattern ( .* ). Select video-call-handling in the Available Scenarios drop-down list to link it with the application. Finally, click Create rule.

You will see Incoming call in the rule list. Now you can test your solution.

3. How to use the demo

To make video calls, you need a web client. You can build it via Web SDK or use our video chat demo:

  1. Open your demo app on two different devices.
  2. Allow access to your microphone and camera.
  3. Sign in as user1 in one demo app.
  4. Sign in as user2 in the other demo app.
  5. Call user2 to start a video call.
  6. Try to switch the video stream on/off for each party. It should work perfectly!

The scheme is required

…for video calls. That’s the point! Don’t forget to use it in your development. We hope this article helped you save time by explaining what was wrong with the video.