WebRTC: Leveraging New Features October 15, 2019 Website: - - PowerPoint PPT Presentation

webrtc leveraging new features
SMART_READER_LITE
LIVE PREVIEW

WebRTC: Leveraging New Features October 15, 2019 Website: - - PowerPoint PPT Presentation

WebRTC, Mobility, Cloud, IOT and More... IIT REAL-TIME COMMUNICATIONS Conference & Expo Oct 14-16, 2019 Chicago WebRTC: Leveraging New Features October 15, 2019 Website: https://webrtc.internaut.com/iit-2019/ Bernard Aboba


slide-1
SLIDE 1

WebRTC: Leveraging New Features

October 15, 2019

WebRTC, Mobility, Cloud, IOT and More...

IIT REAL-TIME COMMUNICATIONS

Conference & Expo Oct 14-16, 2019 Chicago

Bernard Aboba

Principal Architect at Microsoft

https://webrtc.internaut.com/iit-2019/ Website:

slide-2
SLIDE 2

Goals for Today

  • To introduce you to shipping features of WebRTC standards:
  • WebRTC 1.0 Candidate Recommendation
  • Screen Capture
  • Content-Hints
slide-3
SLIDE 3

WebRTC Standards

Shipping

WebRTC 1.0: Recycled at Candidate Recommendation (in all browsers) WebRTC-Stats: Recycling (soon) at Candidate Recommendation (in all browsers) Media Capture and Streams: Recycled at Candidate Recommendation (in all browsers) Screen Capture: Working Draft (in all browsers) Audio Output Devices: Candidate Recommendation (in Chrome and Edge Beta) Media Capture from DOM Elements: Working Draft (in Chrome and Edge Beta) MediaStream Recording: Working Draft (in Chrome and Edge Beta) Content Hints: Editor’s draft (in Chrome and Edge Beta)

Completed Origin Trial (Chrome and Edge Beta)

P2P QUIC: Editor’s draft in ORTC CG P2P QUIC Origin Trial Announcement

Not yet implemented

DSCP Control API: Editor’s draft WebTransport: Editor’s draft in WICG WebRTC-SVC: Editor’s draft WebRTC-NV Use Cases: Working Draft

slide-4
SLIDE 4

The Evolution of WebRTC

Since its conception in 2011, the WebRTC API has gone through three major iterations: 1. addStream and removeStream (widely implemented legacy API)

  • (widely varying) SDP only, no realtime object model
  • no longer included in the WebRTC specification

2. addTrack and removeTrack (implemented)

  • Both “Plan B” (Chrome, Edge) and “Unified Plan” SDP (Firefox)
  • Support for RtpSender/RtpReceiver objects

3. addTransceiver (Favored WebRTC 1.0 Candidate Recommendation API)

  • Required: “Unified Plan” SDP
  • Additional object model support
  • Advanced features: simulcast, direction, etc.

Blog by Jan-Ivar Bruaroey of Mozilla:

https://blog.mozilla.org/webrtc/the-evolution-of-webrtc/

slide-5
SLIDE 5

Why is there an object model in WebRTC 1.0?

  • Need a way to tweak parameters on individual tracks sent over the wire
  • Bitrate
  • Framerate
  • Direction (sendonly/recvonly etc.)
  • Existing control surfaces insufficient
  • createOffer params - not per-track
  • AddStream params - not modifiable post-add
  • MediaStreamTrack constraints - affects raw media, not encoding

PeerConnection PeerConnection JavaScript Application (Sender) JavaScript Application (Receiver)

Track

Track

Internet

Track

Track SDP SDP

Tracks handle raw media No per-track API surface

slide-6
SLIDE 6

The Evolution of WebRTC (cont’d)

Since its conception in 2011, the WebRTC API has gone through three major iterations: 1. addStream and removeStream (widely implemented legacy API)

  • (widely varying) SDP only, no realtime object model
  • no longer included in the WebRTC specification

2. addTrack and removeTrack (implemented)

  • Both “Plan B” (Chrome, Edge) and “Unified Plan” SDP (Firefox)
  • Support for RtpSender/RtpReceiver objects

3. addTransceiver (Favored WebRTC 1.0 Candidate Recommendation API)

  • Required: “Unified Plan” SDP
  • Additional object model support
  • Advanced features: simulcast, direction, etc.

Blog by Jan-Ivar Bruaroey of Mozilla:

https://blog.mozilla.org/webrtc/the-evolution-of-webrtc/

slide-7
SLIDE 7

The Evolution of WebRTC (cont’d)

Since its conception in 2011, the WebRTC API has gone through three major iterations: 1. addStream and removeStream (widely implemented legacy API)

  • (widely varying) SDP only, no realtime object model
  • no longer included in the WebRTC specification

2. addTrack and removeTrack (implemented)

  • Both “Plan B” (Chrome, Edge) and “Unified Plan” SDP (Firefox)
  • Support for RtpSender/RtpReceiver objects

3. addTransceiver (Favored WebRTC 1.0 Candidate Recommendation API)

  • Required: “Unified Plan” SDP
  • Additional object model support
  • Advanced features: simulcast, direction, etc.

Blog by Jan-Ivar Bruaroey of Mozilla:

https://blog.mozilla.org/webrtc/the-evolution-of-webrtc/

slide-8
SLIDE 8

addTransceiver Concepts

  • Implemented first in Firefox 59, now available in Chrome (simulcast support in M73+)
  • addTransceiver() creates a RTCRtpTransceiver object with associated

RTCRtpSender/RTCRtpReceiver objects.

– Allows RTCRtpSender to be initialized with sendEncodings, establishing the “simulcast envelope” (number of streams, order of encodings). – setParameters() cannot change “simulcast envelope” though it can set individual streams to active/inactive.

  • RTCRtpTransceiver has an m-line identifier (mid) attribute that identifies the

transceiver uniquely on both the local and remote peer.

– Track.id rarely correlates due to RTCRtpSender/RTCRtpReceiver model. – Implies that each m-line corresponds to one and only one RTCRtpReceiver/Sender pair. Only true in “Unified Plan” SDP.

Blog by Jan-Ivar Bruaroey of Mozilla: –https://blog.mozilla.org/webrtc/rtcrtptransceiver-explored/

slide-9
SLIDE 9

WebRTC 1.0 CR: Now in Chrome, Edge Beta, Firefox and Safari

  • WebRTC 1.0 CR + “Unified Plan” is now the default in all

browsers.

– Chrome Announcements: – https://groups.google.com/forum/#!topic/discuss-webrtc/P9qHa0inKtY – https://groups.google.com/forum/#!topic/discuss-webrtc/aPRI0-l7lvY – Chrome Rollout began in late January 2019:

https://chromiumdash.appspot.com/schedule

  • Transition guide:

– https://docs.google.com/document/d/1-ZfikoUtoJa9k-GZG1daN0BU3IjIanQ_JSsc

HxQesvU/

slide-10
SLIDE 10

What You Need to Know

  • To retain Plan B behavior in Chrome:

– new RTCPeerConnection({sdpSemantics:'plan-b’});

  • To explicitly ask for Unified Plan (now the default):

– new RTCPeerConnection({sdpSemantics:'unified-plan’});

  • Feature detection

– To check for addTransceiver support:

if(typeof(RTCRtpTransceiver) !== "undefined"){

  • utput('RTCRtpTransceiver supported\n’);

}

– Chrome specific: pc.getConfiguration() returns the value of sdpSemantics.

  • Read the Transition Guide!!
slide-11
SLIDE 11

WebRTC 1.0 Object Model

PeerConnection

RTPSender

PeerConnection JavaScript Application (Sender) JavaScript Application (Receiver)

Track

Track

RTPSender

DTLS Transport ICE Transport Internet

ICE Transport

DTLS Transport

RTP Receiver

RTP Receiver

Track

Track SDP SDP

RTPSender

DataChannel

RTPSender

SctpTransport

RTPSender

DataChannel

RTPSender

SctpTransport

slide-12
SLIDE 12

WebRTC 1.0 Object Model

  • RtpSender* (Section 5.2)
  • RtpReceiver (Section 5.3)
  • RtpTransceiver (Section 5.4)
  • DtlsTransport (Section 5.5)
  • IceTransport (Section 5.6)
  • SctpTransport (Section 6.1.1)
  • DataChannel (Section 6.2)
  • DTMFSender (Section 7.2)

* all objects are prefixed with “RTC”

Specification: https://w3c.github.io/webrtc-pc/

slide-13
SLIDE 13

WebRTC 1.0 specification additions

PeerConnection .getSenders() .getReceivers() .getTransceivers() .addTrack() .removeTrack() .addTransceiver() .sctp ... RtpSender .track .transport .getCapabilities() .getParameters() .setParameters(params) .replaceTrack(track) .setStreams() ... RtpReceiver .track .transport .getCapabilities() .getParameters() .getContributingSources() .getSynchronizationSources() .getStats() ... DtlsTransport .iceTransport .state .getRemoteCertificates() .onstatechange .onerror ... IceTransport .role .component .state .gatheringState .getLocalParameters(), .getRemoteParameters(), .getLocalCandidates() .getRemoteCandidates() .getSelectedCandidatePair() .onstatechange .ongatherinstatechange .onselectedcandidatepairchange ... SctpTransport .transport .state .maxMesageSize .maxChannels .onstatechange

RtpParameters

.headerExtensions .rtcp .codecs RtpSendParameters: RtpParameters .encodings .degradationPreference .priority RtpReceiveParameters: RtpParameters .encodings RtpCodingParameters .rid RtpEncodingParameters .rid .codecPayloadType .dtx .active .ptime .maxBitrate .maxFramerate .scaleResolutionDownBy IceParameters (read only) .usernameFragment .password

Source: https://w3c.github.io/webrtc-pc/

slide-14
SLIDE 14

What can you do with WebRTC 1.0 objects?

  • "Warm up" media path while the getting a track and ringing
  • Change the send codec (without SDP munging)
  • Change the camera source instantly (front to back)
  • Enable/disable sending of media instantly (without signalling)
  • Set a maximum bitrate or maximum framerate
  • Obtain detailed status of individual ICE and DTLS transports
  • Send simulcast
  • Receive simulcast (optional)
slide-15
SLIDE 15

WebRTC API Simulcast Examples

Source: https://w3c.github.io/webrtc-pc/#rtcrtpencodingspatialsim-example* Note: maxFramerate is not yet implemented in any browser.

slide-16
SLIDE 16

Demo: Simulcast Playground by Philipp Hancke

https://fippo.github.io/simulcast-playground/chrome

Note: Currently, simulcast is not yet interoperable between browsers. As a result, this demo only runs on Firefox and Chrome or Edge Preview “Plan B”. Chrome/Edge “Unified Plan” does not surface SSRCs when simulcast is enabled, unlike Firefox. A fix for Chrome to resolve this issue is specified here: https://tools.ietf.org/html/draft-alvestrand-mmusic-simulcast-ssrc

slide-17
SLIDE 17

Implementation Status

  • Web-platform-tests dashboard “does not contain useful metrics for

evaluation or comparison of web platform features”

  • Web confluence project:

○ Looks at properties and methods exposed by browsers: ○ https://web-confluence.appspot.com/#!/ ○ Caveat: no guarantee that a widely-supported API is interoperable in its details, or will remain part of the web platform. ○ Tool that extracts data from the confluence tracker: https://dontcallmedom.github.io/webrtc-impl-tracker/?webrtc

  • Overall status:

○ Fewer features with no implementations, compared with TPAC 2018. ○ All objects now supported in Chrome and Edge Preview

17

slide-18
SLIDE 18

WebRTC 1.0 Implementation Status

https://dontcallmedom.github.io/webrtc-impl-tracker/?webrtc

Features “with intent to implement”:

RTCRtpEncodingParameters.maxFramerate

Features “at risk”:

RTCPeerConnection.getDefaultIceServers(), RTCCertificate.getSupportedAlgorithms(), RTCRtpEncodingParameters.dtx RTCRtpEncodingParameters.ptime

slide-19
SLIDE 19

WebRTC 1.0 Implementation Status (cont’d)

slide-20
SLIDE 20

WebRTC 1.0 Implementation Status (cont’d)

slide-21
SLIDE 21

WebRTC 1.0 Implementation Status (cont’d)

slide-22
SLIDE 22

Coming Attractions: Recent Intent Statements

(from https://groups.google.com/a/chromium.org/forum/#!forum/blink-dev )

  • Intent to Implement: WebRTC Insertable Streams (10/1/19)
  • Intent to Implement: QuicTransport (10/4/19)
  • Intent to Ship: RTCRtpREceiver playoutDelayHint property (10/4/19)
  • Intent to Experiment: WebSocketStream (9/5/19)
  • Intent to Implement: Screen Enumeration (9/12/19)
  • PSA: Private IP Addresses exposed by WebRTC changing to mDNS hostnames (8/13/19)
  • Intent to Implement: WebRTC SVC extensions (7/21/19)
  • Intent to Implement & Ship: WebRTC Perfect Negotiation APIs (7/22/19)
  • Intent to Implement & Ship: RTCPeerConnection::onicecandidateerror (6/14/19)
  • Intent to Implement and Ship: RTCRtpTransceiver.stop() (4/8/19)
  • Intent to Implement and Ship: Simulcast with PeerConnection AddTransceiver API in WebRTC (3/27/19)
  • Intent to Implement and Ship: SctpTransport in WebRTC (2/25/19)
  • Intent to Implement: RTCError, RTCErrorEvent, RTCErrorEventInit (1/21/19)
  • Intent to Implement and Ship: RTCRtpEncodingParameters.scaleResolutionDownBy &

RTCRtpEncodingParameters.maxFramerate (1/18/19)

  • Intent to Ship: WebRTC RTCDtlsTransport object (1/11/19)
  • Intent to Implement and Ship: RTCRtpReceiver.getParameters() (11/27/18)
  • Intent to Implement and Ship: RTCPeerConnection.connectionState and
  • RTCPeerConnection.onconnectionstatechanged (11/22/18)
  • Intent to Implement and Ship: RTCRtpTransceiver.setCodecPreferences (10/2/18)
slide-23
SLIDE 23

The Evolution of Screen Sharing

Web-based screen sharing has evolved from a model based on whitelists and extensions, to standardized getDisplayMedia and content-hints APIs that “just work”. Supported in Edge, Chrome, Firefox, and Safari (preview). Specification: https://w3c.github.io/mediacapture-screen-share/ Blog: https://blogs.windows.com/msedgedev/2018/05/02/bringing-screen-capture-to-micros

  • ft-edge-media-capture-api/
slide-24
SLIDE 24

Screen Capture API

Supported browsers

slide-25
SLIDE 25

Example Usage

var constraints = { video: true }; function handleSuccess(stream) { video.srcObject = stream; } function handleError(error) { console.log('navigator.MediaDevices.getDisplayMedia error: ', error); } navigator.MediaDevices.getDisplayMedia(constraints). then(handleSuccess).catch(handleError);

slide-26
SLIDE 26

Demo

https://webrtc.internaut.com/iit-2019/screen-capture/

slide-27
SLIDE 27

Content Hints API

Goal: Enables optimized content handling. For example, when capturing the screen of an application, the “detail” hint can be provided (“motion” would be more appropriate for a video of a soccer game).

slide-28
SLIDE 28

Content Hints Audio Values

slide-29
SLIDE 29

Content Hints Video Values

slide-30
SLIDE 30

Demo

https://webrtc.github.io/samples/src/content/capture/video-contenthint/

slide-31
SLIDE 31

Thank you!