WebRTC in Safari 11 and iOS 11

OpenWebRTC in WebKit Upstream Complete

Dark Light

webRTC finally found its way in the safari mac and iOS port of webkit. While it had been in the GTK port for quite some time, based on openWebRTC, the Safari port reused all the bindings and most of the webcore work done by the webrtc-in-webkit project, but used the library from webrtc.org (a.k.a. libwebrtc) for the lower layers. It is great news for the webrtc ecosystem, as now most of the major browsers support WebRTC. That was the number one concern according to several surveys.

Some additional work was needed to incorporate libwebrtc in webkit. Those interested in a review of all the commits one by one, and to track the port of the commits upstream to webrtc.org can look at this document maintained by Dr Alex has he was, and still is helping the project go through. 

First, libwebrtc uses its own configuration and compilation tools (depot_tools, GN, Ninja) which are not only different from those used by the linux port of webkit (cmake) and these used by the safari port (Xcode). The apple engineers first exported the configuration file from GN to a JSON format (using a GN option) and translated that into a CMake files to generate the Xcode project file to reach very quickly a compilable version. Then, the work to start compiling webrtc within the webkit system could start, which required changing a lot of compilation flags, and adding within libwebrtc the same kind of flag to differentiate when libwebrtc is compiled as a standalone library, within chrome and within FireFox. Now a “webkit” flag has been introduced. That took most of January 2017.

Most of February was spent stabilising libwebrtc builds, adding iOS builds, and adding builds options not supported in webrtc.org like support for dynamic libraries and dynamic loading. By the end of February 2017, most of the build were stable, and the C++ webcore classes could start being connected to the libwebrtc C++ classes. The JS APIs and the C++ to JS bindings where already existing and reused from the webrtc-in-webkit project. Both capturers and renderers for MacOS and iOS needed to be created from scratch. By the end of february, the first production builds were tested.

The first half of march was spend adding as many tests as possible, including importing the W3C tests, and enabling the network portion (STUN, TURN, Sockets, ..). By mid-march 2017, fully functional alpha stage was reached, and the ironing of the remaining bugs started. Decision was made at that time to move to a track only design, closer to current stage of the specifications. From there on the focus was on polishing the implementation, and eventually, when everything reached beta quality toward the end of may, add the stats for each objects (yeah … you want to keep the stats for last …..).

Today webrtc is out there for everybody to use. It is not a full implementation (do not ask about VP8), but it’s already very close. While there will be no major release for a year, the safari tech previews go out almost every 2 weeks, and of course, webkit nightly can also be used for the most adventurous.

Youenn Fablet, the main engineer behind the libwertc-in-webkit implementation spoke publicly about their design, and called for feedback during the SF webrtc meet up at Mozilla HQ on June 27th, 2017. The video is accessible at this link. We thanks him again for the recognition of the hard work that was done within this project, mainly by Adam B. from Ericsson Research and Igalia in terms of coding. 

The project is still active, and there should be more news next week, in August 2017, and then in October 2017 as the webrtc webkit developers from all ports (Linux, Safari, Samsung, …) will get together at the (on-invitation only) web engine Hackfest.

Have fun with webrtc!

Leave a Reply

Your email address will not be published. Required fields are marked *

Related Posts

WebKitGTK+ and Chrome WebRTC Interop

The process to upstream an RTCPeerConnection implementation, based on OpenWebRTC, to WebKit is under way. We are starting…

Bringing WebRTC to WebKit

For years now, the WebRTC developers and users community has been asking for support for WebRTC on more…

Upstream of RTCPeerConnection started

RTCPeerConnection is the main object in WebRTC for sending media and data peer-to-peer. The API is constantly evolving…

Mid-April Updates!

This blog post is long overdue. As WebRTC Expo is about to begin in Miami, I thought it…