1 of 41

15

2 of 41

WebRTC for Android, iOS and Web

+Justin Uberti @juberti

+Sam Dutton @sw12

3 of 41

4 of 41

int main(char** argv, int argc) {

// TODO(webrtc-team): Build the world's� best communications platform

return 0;

}

5 of 41

Any application

Audio, video, and data

Open source, open protocols

6 of 41

High quality

Peer-to-peer

End-to-end security

7 of 41

Chrome commented on this revision

LGTM! When can we have it?

8 of 41

Photo source: Eric Fischer

WebRTC

Photo source: Eric Fischer

9 of 41

10 of 41

11 of 41

12 of 41

AndroidiOSWebRTC

13 of 41

1.5 billion+

WebRTC browsers

14 of 41

3 billion+

WebRTC app downloads

15 of 41

✓ Web�

✓ Android�

✓ iOS

16 of 41

Audio track

Video track

17 of 41

MediaStream

Audio track

Video track

getUserMedia()

18 of 41

Get a media stream

Web: getUserMedia

navigator.getUserMedia(constraints, onStream);�function onStream(localStream) {� // do something with stream�}

19 of 41

Get a media stream

Android: org.webrtc.VideoCapturer

VideoCapturer c = VideoCapturer.create(device);

PeerConnectionFactory factory = new PeerConnectionFactory();�MediaStream localStream = factory.createLocalMediaStream(streamName);

VideoSource s = factory.createVideoSource(c, constraints);�VideoTrack t = factory.createVideoTrack(trackName, s);�localStream.addTrack(t);

20 of 41

Get a media stream

iOS: RTCVideoCapturer

RTCVideoCapturer* c = [capturerWithDeviceName device];

RTCMediaStream* localStream = [factory mediaStreamWithLabel:streamName];

RTCVideoSource* s = [[factory videoSourceWithCapturer:c ...];

RTCVideoTrack* t = [[RTCVideoTrack alloc] source:s ...];

[localStream addVideoTrack:t];

21 of 41

Peer connection

Peer connection

MediaStream

Audio�+

Video

Audio�+

Video

22 of 41

Stream between peers

Web: RTCPeerConnection

pc = new RTCPeerConnection(config);

pc.onaddstream = onRemoteStream;�pc.addStream(localStream);

pc.createOffer(onCreateSuccess);�function onCreateSuccess(offer) { sendMessage(offer); }

23 of 41

Stream between peers

Android: org.webrtc.PeerConnection

PeerConnection pc = � factory.createPeerConnection(iceServers, constraints, observer);

pc.addStream(localStream);

pc.createOffer(this, offerConstraints);�public void onCreateSuccess(� final SessionDescription offer) { sendMessage(offer); }

24 of 41

Stream between peers

iOS: RTCPeerConnection

RTCPeerConnection* pc = [factory peerConnectionWithICEServers:iceServers� constraints:constraints delegate:self];

[pc addStream:localStream];

[pc createOfferWithDelegate:self constraints:offerConstraints];�- (void)peerConnection:(RTCPeerConnection *)peerConnection� didCreateSessionDescription:(RTCSessionDescription *)offer� error:(NSError *)error { sendMessage(offer); }

25 of 41

Peer connection

Render

Peer connection

MediaStream

MediaStream

Audio�+

Video

Audio�+

Video

26 of 41

Display a media stream

Web: <video>

function onRemoteStream(remoteStream) {� videoElement.src = window.URL.createObjectURL(remoteStream);}

27 of 41

Display a media stream

Android: org.webrtc.VideoRenderer

public void onAddStream(final MediaStream stream) {� VideoTrack track = stream.getVideoTracks(0);

YuvImageRenderer renderer = remoteRenderer;

track.addRenderer(new VideoRenderer(renderer));�}

28 of 41

Display a media stream

iOS: RTCEAGLVideoView

- (void)peerConnection:(RTCPeerConnection *)peerConnection� addedStream:(RTCMediaStream *)stream {

RTCVideoTrack* track = stream.videoTracks[0];

RTCEAGLVideoView* view = _remoteVideoView;

[track addRenderer:view]; �}

29 of 41

30 of 41

AppRTC

31 of 41

High performance media

Fast call setup

Easy to understand and extend

32 of 41

33 of 41

github.com/webrtc��webrtc.org

34 of 41

35 of 41

WebSocket + GCE

Smart signaling

36 of 41

37 of 41

Tailbone

Coturn server + GCE

38 of 41

500 ms

39 of 41

40 of 41

Thank You!

+Justin Uberti @juberti

+Sam Dutton @sw12

41 of 41

15