[MUSIC PLAYING]
DAG-INGE AAS: Two years ago, we had a problem.
SVEIN WILLASSEN: We were a small team
of developers based in Norway.
DAG-INGE AAS: And we wanted to be
able to communicate with friends and family
in other parts of the world.
SVEIN WILLASSEN: But getting everyone
to install the same video chat application
was just too painful.
DAG-INGE AAS: So we decided to build our own solution.
With three students in just two weeks,
we made the Appear In web app-- messaging and video
chat, no plug-ins, no installation required.
SVEIN WILLASSEN: We used WebRTC, a set of open source APIs
for real time communications.
DAG-INGE AAS: Only one problem, as our web app got popular,
we soon discovered that WebRTC was not
supported across all browsers.
Some of our friends wanted native apps
for their phones and tablets.
So after all that wonderful webbiness,
we realized that in the real world
we'd have to build native apps.
But it turned out that wasn't a problem.
WebRTC has great support for native iOS and Android apps.
I'm Dag-Inge.
SVEIN WILLASSEN: And I'm Svein.
If you're a web developer like me, hold onto your hat.
By the end of this video, you'll have
resources to get started with WebRTC on iOS and Android.
DAG-INGE AAS: As we'll show you, the APIs for iOS and Android
parallel those for the web.
WebRTC is an open standard and secure peer-to-peer
communication of audio, video or data.
In the past, a lot of real time communication
ran by a centralized service.
That was inefficient and expensive.
WebRTC enables apps to communicate directly
from device-to-device, peer-to-peer without going
via a third party server.
SVEIN WILLASSEN: This means communication with WebRTC
comes at very little cost to you as a developer.
Since WebRTC is built on peer-to-peer communication,
most of the data cost is left to the network.
DAG-INGE AAS: So WebRTC works peer-to-peer.
But they can't simply shout into the internet,
I want to exchange streaming data with my friend's computer.
WebRTC apps need to negotiate a connection.
In order to set up a call, WebRTC apps
first need to exchange connectivity and media
metadata, stuff like network addresses and audio and video
capabilities.
This process is called signaling.
SVEIN WILLASSEN: For signaling, you
can use any two-way messaging system.
We chose WebSocket with Socket.IO.
Once a call is set up, media flows directly between peers.
DAG-INGE AAS: Having built a signaling mechanism,
the next step in your WebRTC app is get video
from the camera and audio from the microphone.
SVEIN WILLASSEN: On the web, we used
to the navigator.getUserMedia method to access streams
from the camera and microphone.
DAG-INGE AAS: The equivalent on Android
is VideoCapturer to fetch audio and video streams
and VideoRenderer to display video.
VideoCapturer is a neat wrap around a camera
API allowing WebRTC to create the mediastream.
On iOS, RTCVideoCapturer and RTCVideoRenderer
do the same job.
SVEIN WILLASSEN: Once we get media streams from the camera
and mic, we need to set up a network connection to transmit
the streams to other users.
To do this on the web, we have RTCPeerConnection,
the JavaScript API for audio and video communication.
This is the core of WebRTC.
The peer connection API does a lot signal processing,
codec handling, peer-to-peer communication, security,
bandwidth management, and so on.
DAG-INGE AAS: On Android, the equivalent API
is PeerConnection and on iOS it's RTCPeerConnection.
WebRTC opens up communications to all of us,
open technology, free for developers, free for end users.
SVEIN WILLASSEN: WebRTC enabled us with a team of only eight
to build a competitor for mainstream video chat
application.
DAG-INGE AAS: But WebRTC enables a lot more
than just video chats.
Along with high performance audio and video,
WebRTC's peer-to-peer architecture
enables fast file sharing and data communication.
Peer-to-peer means less network ops resulting in lower latency.
We've seen WebRTC apps for music collaboration, file sharing,
health services, robots and even gaming.
To learn more, check out the resources at g.co/webrtc.
You'll find detailed guides, sample code, demos for Android
and iOS WebRTC developments.
BOTH: Goodbye.
NON-ENGLISH SPEECH]