SlideShare a Scribd company logo
1 of 24
WebRTC Standards & Implementation
Q&A
Amir Zmora
TheNewDialTone
Dan Burnett
StandardsPlay
Guest Speaker – Jan-Ivar Bruaroey
• Senior Software Engineer on the WebRTC team at Mozilla .
• Works on both the Media capture and PeerConnection APIs in the Firefox platform
• Contributor to adapter.js open source and W3C specs
Watch video recording of this session
http://ccst.io/e/webrtcstandards16
Session sponsored by
WebRTC.ventures is a custom design and development shop dedicated to building WebRTC based applications
for web and mobile. We have built end-to-end broadcast solutions for events and entertainment clients,
telehealth solutions for multiple clients, live support tools, as well as communication tools for a variety of other
applications. WebRTC.ventures is a recognized development partner of TokBox and has also built native
WebRTC solutions
We use CrowdCast….It’s WebRTC
About Us
• Amir Zmora • Dan Burnett
Save The Date: July 10th
Register Now: http://ccst.io/e/webrtcstandards17
Next Session
The Browser ~ Standards Gap
Frits Ahlefeldt
The evolution of WebRTC 1.0.
Follow along at
https://blog.mozilla.org/webrtc
https://blog.mozilla.org/webrtc/the-evolution-of-webrtc/
Why now?
The WebRTC spec is nearing completion, going to Candidate
Recommendation real soon. With Google planning to finish 1.0 in
Chrome by the end of the year, it seems a good time to recap what this
means, as far as changes to what folks are doing today.
Wait for Unified Plan; Prepare for JS API.
Under the hood, the biggest remaining obstacle to advanced wire
interop, is that, unlike Firefox, Chrome hasn’t implement the spec’s
“Unified Plan” for multiple audio and video tracks yet. Be sad or happy,
but this blog isn’t about bridging that gap through SDP mangling. At
this point, it’s probably better to wait for Google to address this.
But web developers need to prepare, because the JavaScript API will
be different. This may be a surprise to those who haven’t followed the
spec. A good start is to look at what Firefox is already doing. But
there’s more. I don’t mean superficial things like promises, which all
browsers support now. Instead, expect a change in the media model.
The API gap: How the RTCPeerConnection API pivoted
twice
The RTCPeerConnection API has endured three design iterations on this topic over
the years. As a result, each browser today implements a snapshot from a different
point in the timeline of an evolving spec.
The three main stages in the design were:
• addStream and removeStream (Chrome today)
• addTrack, removeTrack, and sender.replaceTrack (Firefox today)
• addTransceiver and early media (No-one today)
Stage 1: addStream and removeStream
(async = )({ >
stream = await navigator.mediaDevices.getUserMedia({video: true, audio: true });
stream.removeTrack(videoTrack = stream.getVideoTracks()[ 0)];
pc1.addStream(stream );
})();
checkbox.onclick = )( ={ >
pc1.removeStream(stream );
if (checkbox.checked ){
stream.addTrack(videoTrack );
} else{
stream.removeTrack(videoTrack );
}
pc1.addStream(stream );
}
pc2.onaddstream = e ={ >
e.stream.onaddtrack = e ={ >
video.srcObject = video.srcObject;
e.track.onended = e => video.srcObject = video.srcObject;
}
video.srcObject = e.stream;
}
Stage 2: addTrack, removeTrack, and replaceTrack
(async = )({ >
stream = await navigator.mediaDevices.getUserMedia({video: true, audio: true });
videoTrack = stream.getVideoTracks()[ 0];
pc1.addTrack(stream.getAudioTracks()[0], stream );
})();
checkbox.onclick = )( ={ >
if (checkbox.checked ){
videoSender = pc1.addTrack(videoTrack, stream );
} else{
pc1.removeTrack(videoSender );
}
}
pc2.ontrack = e ={ >
video.srcObject = e.streams[ 0];
e.track.onended = e => video.srcObject = video.srcObject;
}
Stage 2: addTrack, removeTrack, and replaceTrack
This model adds quite a bit of control. But this abstraction still doesn’t cover the following realities well:
• ICE allocates bi-directional media ports, yet no way to know which sender & receiver go together.
• No clear re-use model for ports that wouldn’t risk sending the wrong media to a receiver at times.
• Kludgy {offerToReceiveVideo: 3} offer-options way to allocate additional m-lines (ports.)
• Using stream ids to correlate local & remote streams can collide with ids from other participants.
Stage 3: addTransceiver and early media
Solves the remaining 4 problems, plus one more: With call-setup time being critical more often than not,
some users want to send media early, before negotiation has even completed.
First, the main difference with this model is it naturally groups a sender and a receiver together into a
transceiver. The second, less obvious, difference is that this triumvirate is always created together.
This differs quite substantially from all implementations today where remote tracks are created by
setRemoteDescription.
Stage 3: addTransceiver and early media
(async = )({ >
stream = await navigator.mediaDevices.getUserMedia({video: true, audio: true });
videoTrack = stream.getVideoTracks()[ 0];
pc1.addTransceiver(stream.getAudioTracks()[0], {direction: "sendonly "});
videoTransceiver = pc1.addTransceiver("video", {direction: "inactive "});
})();
checkbox.onclick = async = )({ >
if (checkbox.checked ){
videoTransceiver.sender.setDirection("sendonly )";
await videoTransceiver.sender.replaceTrack(videoTrack );
} else{
videoTransceiver.sender.setDirection("inactive )";
await videoTransceiver.sender.replaceTrack(null );
}
}
pc2.ontrack = e ={ >
video.srcObject = e.streams[ 0];
e.track.onended = e => video.srcObject = video.srcObject;
}
Correlate by transceiver.mid instead of stream/track.id.
let videos = {[camStream.id]: videoA, [blankStream.id]: videoB;}
pc2.ontrack = ({streams: [stream ]}= ){ >
let video = videos[stream.id ];
if (!video.srcObject) video.srcObject = stream;
}
let videos = {[camTransceiver.mid]: videoA, [blankTransceiver.mid]: videoB;}
pc2.ontrack = ({transceiver, streams: [stream ]}= ){ >
let video = videos[transceiver.mid ];
if (!video.srcObject) video.srcObject = stream;
}
Conclusion
This blog covers only a piece of the API. There are lots of other
changes not covered here, in the API and on the wire. A lot of effort
has gone into this spec, and hopefully knowing the evolution of at least
one part of it might help with appreciating all it does. Looking forward
to seeing it all implemented soon!
Save The Date: July 10th
Register Now: http://ccst.io/e/webrtcstandards17
Next Session
Session sponsored by
Thanks to our guest speaker: Jan-Ivar Bruaroey
WebRTC Standards & Implementation
Q&A
Amir Zmora
TheNewDialTone
Dan Burnett
StandardsPlay

More Related Content

What's hot

What's hot (8)

Building great mobile apps: Somethings you might want to know
Building great mobile apps: Somethings you might want to knowBuilding great mobile apps: Somethings you might want to know
Building great mobile apps: Somethings you might want to know
 
Gerrit JavaScript Plugins
Gerrit JavaScript PluginsGerrit JavaScript Plugins
Gerrit JavaScript Plugins
 
Gradle in 45min
Gradle in 45minGradle in 45min
Gradle in 45min
 
DIY: Computer Vision with GWT.
DIY: Computer Vision with GWT.DIY: Computer Vision with GWT.
DIY: Computer Vision with GWT.
 
GDG Devfest 2019 - Build go kit microservices at kubernetes with ease
GDG Devfest 2019 - Build go kit microservices at kubernetes with easeGDG Devfest 2019 - Build go kit microservices at kubernetes with ease
GDG Devfest 2019 - Build go kit microservices at kubernetes with ease
 
Ddev workshop t3dd18
Ddev workshop t3dd18Ddev workshop t3dd18
Ddev workshop t3dd18
 
PuppetConf 2016: Running Puppet Software in Docker Containers – Gareth Rushgr...
PuppetConf 2016: Running Puppet Software in Docker Containers – Gareth Rushgr...PuppetConf 2016: Running Puppet Software in Docker Containers – Gareth Rushgr...
PuppetConf 2016: Running Puppet Software in Docker Containers – Gareth Rushgr...
 
Gradle in 45min - JBCN2-16 version
Gradle in 45min - JBCN2-16 versionGradle in 45min - JBCN2-16 version
Gradle in 45min - JBCN2-16 version
 

Similar to WebRTC Standards & Implementation Q&A - All about browser interoperability

DIY- computer vision with GWT
DIY- computer vision with GWTDIY- computer vision with GWT
DIY- computer vision with GWT
Francesca Tosi
 

Similar to WebRTC Standards & Implementation Q&A - All about browser interoperability (20)

WebRTC Standards & Implementation Q&A - getDisplayMedia 1.0
WebRTC Standards & Implementation Q&A - getDisplayMedia 1.0WebRTC Standards & Implementation Q&A - getDisplayMedia 1.0
WebRTC Standards & Implementation Q&A - getDisplayMedia 1.0
 
WebRTC ... GWT & in-browser computation
WebRTC ... GWT & in-browser computationWebRTC ... GWT & in-browser computation
WebRTC ... GWT & in-browser computation
 
Using Groovy to empower WebRTC Network Systems
Using Groovy to empower WebRTC Network SystemsUsing Groovy to empower WebRTC Network Systems
Using Groovy to empower WebRTC Network Systems
 
WebRTC Webinar & Q&A - W3C WebRTC JS API Test Platform & Updates from W3C Lis...
WebRTC Webinar & Q&A - W3C WebRTC JS API Test Platform & Updates from W3C Lis...WebRTC Webinar & Q&A - W3C WebRTC JS API Test Platform & Updates from W3C Lis...
WebRTC Webinar & Q&A - W3C WebRTC JS API Test Platform & Updates from W3C Lis...
 
Web rtc, Media stream, Peer connection, Setting up STUN and TURN on Linux and...
Web rtc, Media stream, Peer connection, Setting up STUN and TURN on Linux and...Web rtc, Media stream, Peer connection, Setting up STUN and TURN on Linux and...
Web rtc, Media stream, Peer connection, Setting up STUN and TURN on Linux and...
 
No drama here - E2E-testing django with playwright
No drama here - E2E-testing django with playwrightNo drama here - E2E-testing django with playwright
No drama here - E2E-testing django with playwright
 
Introduction to WebRTC
Introduction to WebRTCIntroduction to WebRTC
Introduction to WebRTC
 
WebRTC Live Q&A and Screen Capture session 3
WebRTC Live Q&A and Screen Capture session 3WebRTC Live Q&A and Screen Capture session 3
WebRTC Live Q&A and Screen Capture session 3
 
JooinK - DevFest Piemonte 2013
JooinK - DevFest Piemonte 2013JooinK - DevFest Piemonte 2013
JooinK - DevFest Piemonte 2013
 
WebRTC: A front-end perspective
WebRTC: A front-end perspectiveWebRTC: A front-end perspective
WebRTC: A front-end perspective
 
[workshop] The Revolutionary WebRTC
[workshop] The Revolutionary WebRTC[workshop] The Revolutionary WebRTC
[workshop] The Revolutionary WebRTC
 
[1C2]webrtc 개발, 현재와 미래
[1C2]webrtc 개발, 현재와 미래[1C2]webrtc 개발, 현재와 미래
[1C2]webrtc 개발, 현재와 미래
 
Power ai image-pipeline
Power ai image-pipelinePower ai image-pipeline
Power ai image-pipeline
 
WebRTC Webinar & Q&A - Sumilcast Standards & Implementation
WebRTC Webinar & Q&A - Sumilcast Standards & ImplementationWebRTC Webinar & Q&A - Sumilcast Standards & Implementation
WebRTC Webinar & Q&A - Sumilcast Standards & Implementation
 
DIY- computer vision with GWT
DIY- computer vision with GWTDIY- computer vision with GWT
DIY- computer vision with GWT
 
Introduction to WebRTC
Introduction to WebRTCIntroduction to WebRTC
Introduction to WebRTC
 
WebRTC 101 - How to get started building your first WebRTC application
WebRTC 101 - How to get started building your first WebRTC applicationWebRTC 101 - How to get started building your first WebRTC application
WebRTC 101 - How to get started building your first WebRTC application
 
Reactive Programming with Rx
 Reactive Programming with Rx Reactive Programming with Rx
Reactive Programming with Rx
 
Production Experience: Some Insights from Using Vercel and Next.js for Over 3...
Production Experience: Some Insights from Using Vercel and Next.js for Over 3...Production Experience: Some Insights from Using Vercel and Next.js for Over 3...
Production Experience: Some Insights from Using Vercel and Next.js for Over 3...
 
The unconventional devices for the Android video streaming
The unconventional devices for the Android video streamingThe unconventional devices for the Android video streaming
The unconventional devices for the Android video streaming
 

More from Amir Zmora

More from Amir Zmora (20)

FlexiWAN Webinar - The Role of Open Source in Your SD-WAN Strategy
FlexiWAN Webinar - The Role of Open Source in Your SD-WAN StrategyFlexiWAN Webinar - The Role of Open Source in Your SD-WAN Strategy
FlexiWAN Webinar - The Role of Open Source in Your SD-WAN Strategy
 
WebRTC Standards & Implementation Q&A - All You Wanted to Know About W3C TPAC...
WebRTC Standards & Implementation Q&A - All You Wanted to Know About W3C TPAC...WebRTC Standards & Implementation Q&A - All You Wanted to Know About W3C TPAC...
WebRTC Standards & Implementation Q&A - All You Wanted to Know About W3C TPAC...
 
WebRTC Standards & Implementation Q&A - IP address privacy revisited
WebRTC Standards & Implementation Q&A - IP address privacy revisitedWebRTC Standards & Implementation Q&A - IP address privacy revisited
WebRTC Standards & Implementation Q&A - IP address privacy revisited
 
WebRTC Standards & Implementation Q&A - WebRTC NV planning face-to-face meeting
WebRTC Standards & Implementation Q&A - WebRTC NV planning face-to-face meetingWebRTC Standards & Implementation Q&A - WebRTC NV planning face-to-face meeting
WebRTC Standards & Implementation Q&A - WebRTC NV planning face-to-face meeting
 
WebRTC Standards & Implementation Q&A - Implications of WebRTC 1.0 changes an...
WebRTC Standards & Implementation Q&A - Implications of WebRTC 1.0 changes an...WebRTC Standards & Implementation Q&A - Implications of WebRTC 1.0 changes an...
WebRTC Standards & Implementation Q&A - Implications of WebRTC 1.0 changes an...
 
WebRTC Standards & Implementation Q&A - Testing WebRTC 1.0
WebRTC Standards & Implementation Q&A - Testing WebRTC 1.0WebRTC Standards & Implementation Q&A - Testing WebRTC 1.0
WebRTC Standards & Implementation Q&A - Testing WebRTC 1.0
 
WebRTC Standards & Implementation Q&A - The Future is Now2!
WebRTC Standards & Implementation Q&A - The Future is Now2!WebRTC Standards & Implementation Q&A - The Future is Now2!
WebRTC Standards & Implementation Q&A - The Future is Now2!
 
WebRTC Standards & Implementation Q&A - The Future is Now!
WebRTC Standards & Implementation Q&A - The Future is Now!WebRTC Standards & Implementation Q&A - The Future is Now!
WebRTC Standards & Implementation Q&A - The Future is Now!
 
WebRTC Standards & Implementation Q&A - WebRTC Standards Feature Complete 
No...
WebRTC Standards & Implementation Q&A - WebRTC Standards Feature Complete 
No...WebRTC Standards & Implementation Q&A - WebRTC Standards Feature Complete 
No...
WebRTC Standards & Implementation Q&A - WebRTC Standards Feature Complete 
No...
 
WebRTC Standards & Implementation Q&A - WebRTC Constrains
WebRTC Standards & Implementation Q&A - WebRTC ConstrainsWebRTC Standards & Implementation Q&A - WebRTC Constrains
WebRTC Standards & Implementation Q&A - WebRTC Constrains
 
WebRTC Standards & Implementation Q&A - The Internals of WebRTC Browsers Impl...
WebRTC Standards & Implementation Q&A - The Internals of WebRTC Browsers Impl...WebRTC Standards & Implementation Q&A - The Internals of WebRTC Browsers Impl...
WebRTC Standards & Implementation Q&A - The Internals of WebRTC Browsers Impl...
 
WebRTC Standards & Implementation Q&A - Legacy API Support Changes
WebRTC Standards & Implementation Q&A - Legacy API Support ChangesWebRTC Standards & Implementation Q&A - Legacy API Support Changes
WebRTC Standards & Implementation Q&A - Legacy API Support Changes
 
WebRTC Webinar & Q&A - Standards Update
WebRTC Webinar & Q&A - Standards UpdateWebRTC Webinar & Q&A - Standards Update
WebRTC Webinar & Q&A - Standards Update
 
WebRTC Webinar & Q&A - All About Microsoft & WebRTC Hosting Guest Speaker Ja...
WebRTC Webinar & Q&A -  All About Microsoft & WebRTC Hosting Guest Speaker Ja...WebRTC Webinar & Q&A -  All About Microsoft & WebRTC Hosting Guest Speaker Ja...
WebRTC Webinar & Q&A - All About Microsoft & WebRTC Hosting Guest Speaker Ja...
 
Web rtc standards live session #13 - The Browser-Standards Gap
Web rtc standards live session #13 - The Browser-Standards GapWeb rtc standards live session #13 - The Browser-Standards Gap
Web rtc standards live session #13 - The Browser-Standards Gap
 
WebRTC Webinar & Q&A - Sending DTMF in WebRTC the standard way
WebRTC Webinar & Q&A -  Sending DTMF in WebRTC the standard wayWebRTC Webinar & Q&A -  Sending DTMF in WebRTC the standard way
WebRTC Webinar & Q&A - Sending DTMF in WebRTC the standard way
 
WebRTC Webinar & Q&A - W3C WebRTC W3C MediaStream Recording
WebRTC Webinar & Q&A - W3C WebRTC W3C MediaStream RecordingWebRTC Webinar & Q&A - W3C WebRTC W3C MediaStream Recording
WebRTC Webinar & Q&A - W3C WebRTC W3C MediaStream Recording
 
WebRTC Webinar & Q&A - Debugging Networking Issues in WebRTC
WebRTC Webinar & Q&A - Debugging Networking Issues in WebRTCWebRTC Webinar & Q&A - Debugging Networking Issues in WebRTC
WebRTC Webinar & Q&A - Debugging Networking Issues in WebRTC
 
WebRTC Webinar and Q&A - IP Address Privacy and Microsoft Edge Interoperability
WebRTC Webinar and Q&A - IP Address Privacy and Microsoft Edge InteroperabilityWebRTC Webinar and Q&A - IP Address Privacy and Microsoft Edge Interoperability
WebRTC Webinar and Q&A - IP Address Privacy and Microsoft Edge Interoperability
 
WebRTC Live Q&A Session #5 - JavaScript Promises and WebRTC Interoperability ...
WebRTC Live Q&A Session #5 - JavaScript Promises and WebRTC Interoperability ...WebRTC Live Q&A Session #5 - JavaScript Promises and WebRTC Interoperability ...
WebRTC Live Q&A Session #5 - JavaScript Promises and WebRTC Interoperability ...
 

Recently uploaded

Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Victor Rentea
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
WSO2
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 

Recently uploaded (20)

ChatGPT and Beyond - Elevating DevOps Productivity
ChatGPT and Beyond - Elevating DevOps ProductivityChatGPT and Beyond - Elevating DevOps Productivity
ChatGPT and Beyond - Elevating DevOps Productivity
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
 
JavaScript Usage Statistics 2024 - The Ultimate Guide
JavaScript Usage Statistics 2024 - The Ultimate GuideJavaScript Usage Statistics 2024 - The Ultimate Guide
JavaScript Usage Statistics 2024 - The Ultimate Guide
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistan
 
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
 
Vector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptxVector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptx
 
Stronger Together: Developing an Organizational Strategy for Accessible Desig...
Stronger Together: Developing an Organizational Strategy for Accessible Desig...Stronger Together: Developing an Organizational Strategy for Accessible Desig...
Stronger Together: Developing an Organizational Strategy for Accessible Desig...
 
Quantum Leap in Next-Generation Computing
Quantum Leap in Next-Generation ComputingQuantum Leap in Next-Generation Computing
Quantum Leap in Next-Generation Computing
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
 
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
 
JohnPollard-hybrid-app-RailsConf2024.pptx
JohnPollard-hybrid-app-RailsConf2024.pptxJohnPollard-hybrid-app-RailsConf2024.pptx
JohnPollard-hybrid-app-RailsConf2024.pptx
 
Six Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal OntologySix Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal Ontology
 
Introduction to use of FHIR Documents in ABDM
Introduction to use of FHIR Documents in ABDMIntroduction to use of FHIR Documents in ABDM
Introduction to use of FHIR Documents in ABDM
 
API Governance and Monetization - The evolution of API governance
API Governance and Monetization -  The evolution of API governanceAPI Governance and Monetization -  The evolution of API governance
API Governance and Monetization - The evolution of API governance
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Design and Development of a Provenance Capture Platform for Data Science
Design and Development of a Provenance Capture Platform for Data ScienceDesign and Development of a Provenance Capture Platform for Data Science
Design and Development of a Provenance Capture Platform for Data Science
 

WebRTC Standards & Implementation Q&A - All about browser interoperability

  • 1. WebRTC Standards & Implementation Q&A Amir Zmora TheNewDialTone Dan Burnett StandardsPlay
  • 2. Guest Speaker – Jan-Ivar Bruaroey • Senior Software Engineer on the WebRTC team at Mozilla . • Works on both the Media capture and PeerConnection APIs in the Firefox platform • Contributor to adapter.js open source and W3C specs
  • 3. Watch video recording of this session http://ccst.io/e/webrtcstandards16
  • 4. Session sponsored by WebRTC.ventures is a custom design and development shop dedicated to building WebRTC based applications for web and mobile. We have built end-to-end broadcast solutions for events and entertainment clients, telehealth solutions for multiple clients, live support tools, as well as communication tools for a variety of other applications. WebRTC.ventures is a recognized development partner of TokBox and has also built native WebRTC solutions
  • 6. About Us • Amir Zmora • Dan Burnett
  • 7. Save The Date: July 10th Register Now: http://ccst.io/e/webrtcstandards17 Next Session
  • 8. The Browser ~ Standards Gap Frits Ahlefeldt
  • 9. The evolution of WebRTC 1.0. Follow along at https://blog.mozilla.org/webrtc https://blog.mozilla.org/webrtc/the-evolution-of-webrtc/
  • 10. Why now? The WebRTC spec is nearing completion, going to Candidate Recommendation real soon. With Google planning to finish 1.0 in Chrome by the end of the year, it seems a good time to recap what this means, as far as changes to what folks are doing today.
  • 11. Wait for Unified Plan; Prepare for JS API. Under the hood, the biggest remaining obstacle to advanced wire interop, is that, unlike Firefox, Chrome hasn’t implement the spec’s “Unified Plan” for multiple audio and video tracks yet. Be sad or happy, but this blog isn’t about bridging that gap through SDP mangling. At this point, it’s probably better to wait for Google to address this. But web developers need to prepare, because the JavaScript API will be different. This may be a surprise to those who haven’t followed the spec. A good start is to look at what Firefox is already doing. But there’s more. I don’t mean superficial things like promises, which all browsers support now. Instead, expect a change in the media model.
  • 12. The API gap: How the RTCPeerConnection API pivoted twice The RTCPeerConnection API has endured three design iterations on this topic over the years. As a result, each browser today implements a snapshot from a different point in the timeline of an evolving spec. The three main stages in the design were: • addStream and removeStream (Chrome today) • addTrack, removeTrack, and sender.replaceTrack (Firefox today) • addTransceiver and early media (No-one today)
  • 13. Stage 1: addStream and removeStream (async = )({ > stream = await navigator.mediaDevices.getUserMedia({video: true, audio: true }); stream.removeTrack(videoTrack = stream.getVideoTracks()[ 0)]; pc1.addStream(stream ); })(); checkbox.onclick = )( ={ > pc1.removeStream(stream ); if (checkbox.checked ){ stream.addTrack(videoTrack ); } else{ stream.removeTrack(videoTrack ); } pc1.addStream(stream ); } pc2.onaddstream = e ={ > e.stream.onaddtrack = e ={ > video.srcObject = video.srcObject; e.track.onended = e => video.srcObject = video.srcObject; } video.srcObject = e.stream; }
  • 14. Stage 2: addTrack, removeTrack, and replaceTrack (async = )({ > stream = await navigator.mediaDevices.getUserMedia({video: true, audio: true }); videoTrack = stream.getVideoTracks()[ 0]; pc1.addTrack(stream.getAudioTracks()[0], stream ); })(); checkbox.onclick = )( ={ > if (checkbox.checked ){ videoSender = pc1.addTrack(videoTrack, stream ); } else{ pc1.removeTrack(videoSender ); } } pc2.ontrack = e ={ > video.srcObject = e.streams[ 0]; e.track.onended = e => video.srcObject = video.srcObject; }
  • 15. Stage 2: addTrack, removeTrack, and replaceTrack This model adds quite a bit of control. But this abstraction still doesn’t cover the following realities well: • ICE allocates bi-directional media ports, yet no way to know which sender & receiver go together. • No clear re-use model for ports that wouldn’t risk sending the wrong media to a receiver at times. • Kludgy {offerToReceiveVideo: 3} offer-options way to allocate additional m-lines (ports.) • Using stream ids to correlate local & remote streams can collide with ids from other participants.
  • 16. Stage 3: addTransceiver and early media Solves the remaining 4 problems, plus one more: With call-setup time being critical more often than not, some users want to send media early, before negotiation has even completed. First, the main difference with this model is it naturally groups a sender and a receiver together into a transceiver. The second, less obvious, difference is that this triumvirate is always created together. This differs quite substantially from all implementations today where remote tracks are created by setRemoteDescription.
  • 17. Stage 3: addTransceiver and early media (async = )({ > stream = await navigator.mediaDevices.getUserMedia({video: true, audio: true }); videoTrack = stream.getVideoTracks()[ 0]; pc1.addTransceiver(stream.getAudioTracks()[0], {direction: "sendonly "}); videoTransceiver = pc1.addTransceiver("video", {direction: "inactive "}); })(); checkbox.onclick = async = )({ > if (checkbox.checked ){ videoTransceiver.sender.setDirection("sendonly )"; await videoTransceiver.sender.replaceTrack(videoTrack ); } else{ videoTransceiver.sender.setDirection("inactive )"; await videoTransceiver.sender.replaceTrack(null ); } } pc2.ontrack = e ={ > video.srcObject = e.streams[ 0]; e.track.onended = e => video.srcObject = video.srcObject; }
  • 18. Correlate by transceiver.mid instead of stream/track.id. let videos = {[camStream.id]: videoA, [blankStream.id]: videoB;} pc2.ontrack = ({streams: [stream ]}= ){ > let video = videos[stream.id ]; if (!video.srcObject) video.srcObject = stream; } let videos = {[camTransceiver.mid]: videoA, [blankTransceiver.mid]: videoB;} pc2.ontrack = ({transceiver, streams: [stream ]}= ){ > let video = videos[transceiver.mid ]; if (!video.srcObject) video.srcObject = stream; }
  • 19. Conclusion This blog covers only a piece of the API. There are lots of other changes not covered here, in the API and on the wire. A lot of effort has gone into this spec, and hopefully knowing the evolution of at least one part of it might help with appreciating all it does. Looking forward to seeing it all implemented soon!
  • 20.
  • 21. Save The Date: July 10th Register Now: http://ccst.io/e/webrtcstandards17 Next Session
  • 23. Thanks to our guest speaker: Jan-Ivar Bruaroey
  • 24. WebRTC Standards & Implementation Q&A Amir Zmora TheNewDialTone Dan Burnett StandardsPlay