SlideShare a Scribd company logo
1 of 36
Download to read offline
JS Audio/Video Streaming
WebRTC API 101 explained
ale_polidori
alepolidori
webrtc.org
Our Purpose
● What’s WebRTC
● How it works
● 3 Javascript APIs
● Video Conference App
● Resources
��
WebRTC
Web Real-Time Communication
WebRTC
Web Real-Time Communication
to the WEB
open-source
protocols,
JS Web APIs,
web Browsers,
mobile app
WebRTC
JS Web APIs
Peer-2-Peer
real-time communications
How WebRTC
Works
How WebRTC
Works
1 2
● 1-2 offer request to start a call
How WebRTC
Works
1 2
● 1-2 offer request to start a call
● 3-4 answer to the offer
3
4
How WebRTC
Works
1 2
● 1-2 offer request to start a call
● 3-4 answer to the offer
● 5 peer-to-peer communications
3
4
5
How WebRTC
Works
● 1-2 offer request to start a call
● 3-4 answer to the offer
● 5 peer-to-peer communications
1 2
● 1-2 Offer request to start a call
● 3-4 Answer to the offer
● 5 peer-to-peer communications
3
4
5
Signaling
Signaling Server
WebRTC Javascript APIs
3 APIs
● getUserMedia
● RTCPeerConnection
● RTCDataChannel
3 APIs
● getUserMedia
Security
Permissions
HTTPS encryption
Let’s try getUserMedia
3 APIs
● getUserMedia
● RTCPeerConnection
● RTCDataChannel
1 2
● 1-2 Offer request to start a call
● 3-4 Answer to the offer
● 5 peer-to-peer communications
3
4
5
Signaling
Signaling Server
Signaling Server
1. new RTCPeerConnection
2. get & share Network Info
(ICE candidate)
3. get & share local/remote description
(SDP)
1. new RTCPeerConnection
2. get & share Network Info
(ICE candidate)
3. get & share local/remote description
(SDP)
Demo Time
Protocols Recap
● HTTPS
● RTP, SRTP: media exchange
● SDP: media description
● ICE: peer-to-peer connectivity
● WebSocket: custom signaling (alternative: SIP)
trends.google.com
Resources
● CityJS Talk: github.com/alepolidori/cityjs-athens-2023
● Samples: https://webrtc.github.io/samples/
● DOCs
○ https://developer.mozilla.org/en-US/docs/Web/API/WebRTC_API
● Get support
○ https://groups.google.com/forum/#!forum/discuss-webrtc
● Standard W3C & IETF
○ https://www.w3.org/TR/webrtc/
● Debug
○ chrome://webrtc-internals
Thanks!
ale_polidori
alepolidori
CityJS Athens 2023

More Related Content

Similar to JS Audio/Video Streaming: WebRTC APIs 101 explained

Design and Evolution of APIs in Microservice Architecture
Design and Evolution of APIs in Microservice ArchitectureDesign and Evolution of APIs in Microservice Architecture
Design and Evolution of APIs in Microservice ArchitectureLohika_Odessa_TechTalks
 
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...Amir Zmora
 
WebRTC for Telco: Informa's WebRTC Global Summit Preconference
WebRTC for Telco: Informa's WebRTC Global Summit PreconferenceWebRTC for Telco: Informa's WebRTC Global Summit Preconference
WebRTC for Telco: Informa's WebRTC Global Summit PreconferenceTsahi Levent-levi
 
ReproNow—Save Time Reproducing and Triaging Security Bugs
ReproNow—Save Time Reproducing and Triaging Security BugsReproNow—Save Time Reproducing and Triaging Security Bugs
ReproNow—Save Time Reproducing and Triaging Security BugsPriyanka Aash
 
Twilio Signal 2016 WebRTC Reborn
Twilio Signal 2016 WebRTC RebornTwilio Signal 2016 WebRTC Reborn
Twilio Signal 2016 WebRTC RebornTwilio Inc
 
WebRTC Reborn SignalConf 2016
WebRTC Reborn SignalConf 2016WebRTC Reborn SignalConf 2016
WebRTC Reborn SignalConf 2016Dan Jenkins
 
FinagleCon_2015_Pinterest
FinagleCon_2015_PinterestFinagleCon_2015_Pinterest
FinagleCon_2015_PinterestYongsheng Wu
 
Deploy with confidence
Deploy with confidenceDeploy with confidence
Deploy with confidenceTarcio Saraiva
 
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 InteroperabilityAmir Zmora
 
WebRTC, another Web?
WebRTC, another Web?WebRTC, another Web?
WebRTC, another Web?Hui Fan
 
WebRTC Reborn Over The Air
WebRTC Reborn Over The AirWebRTC Reborn Over The Air
WebRTC Reborn Over The AirDan Jenkins
 
StarkNet JS
StarkNet JSStarkNet JS
StarkNet JSNeven6
 
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 revisitedAmir Zmora
 
Managing the Customer Experience for Media – Web, Mobile, and Video
Managing the Customer Experience for Media – Web, Mobile, and VideoManaging the Customer Experience for Media – Web, Mobile, and Video
Managing the Customer Experience for Media – Web, Mobile, and VideoNew Relic
 
The Enterprise wants WebRTC -- and it needs Middleware to get it! (IIT RTC Co...
The Enterprise wants WebRTC -- and it needs Middleware to get it! (IIT RTC Co...The Enterprise wants WebRTC -- and it needs Middleware to get it! (IIT RTC Co...
The Enterprise wants WebRTC -- and it needs Middleware to get it! (IIT RTC Co...Brian Pulito
 

Similar to JS Audio/Video Streaming: WebRTC APIs 101 explained (20)

Design and Evolution of APIs in Microservice Architecture
Design and Evolution of APIs in Microservice ArchitectureDesign and Evolution of APIs in Microservice Architecture
Design and Evolution of APIs in Microservice Architecture
 
VozDigital DevFest 31/10/14
VozDigital DevFest 31/10/14VozDigital DevFest 31/10/14
VozDigital DevFest 31/10/14
 
DevCon 5 (December 2013) - WebRTC & WebSockets
DevCon 5 (December 2013) - WebRTC & WebSocketsDevCon 5 (December 2013) - WebRTC & WebSockets
DevCon 5 (December 2013) - WebRTC & WebSockets
 
The Future of SIP in WebRTC
The Future of SIP in WebRTCThe Future of SIP in WebRTC
The Future of SIP in WebRTC
 
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 for Telco: Informa's WebRTC Global Summit Preconference
WebRTC for Telco: Informa's WebRTC Global Summit PreconferenceWebRTC for Telco: Informa's WebRTC Global Summit Preconference
WebRTC for Telco: Informa's WebRTC Global Summit Preconference
 
WebRTC Seminar Report
WebRTC  Seminar ReportWebRTC  Seminar Report
WebRTC Seminar Report
 
Ws
WsWs
Ws
 
ReproNow—Save Time Reproducing and Triaging Security Bugs
ReproNow—Save Time Reproducing and Triaging Security BugsReproNow—Save Time Reproducing and Triaging Security Bugs
ReproNow—Save Time Reproducing and Triaging Security Bugs
 
Twilio Signal 2016 WebRTC Reborn
Twilio Signal 2016 WebRTC RebornTwilio Signal 2016 WebRTC Reborn
Twilio Signal 2016 WebRTC Reborn
 
WebRTC Reborn SignalConf 2016
WebRTC Reborn SignalConf 2016WebRTC Reborn SignalConf 2016
WebRTC Reborn SignalConf 2016
 
FinagleCon_2015_Pinterest
FinagleCon_2015_PinterestFinagleCon_2015_Pinterest
FinagleCon_2015_Pinterest
 
Deploy with confidence
Deploy with confidenceDeploy with confidence
Deploy with confidence
 
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, another Web?
WebRTC, another Web?WebRTC, another Web?
WebRTC, another Web?
 
WebRTC Reborn Over The Air
WebRTC Reborn Over The AirWebRTC Reborn Over The Air
WebRTC Reborn Over The Air
 
StarkNet JS
StarkNet JSStarkNet JS
StarkNet JS
 
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
 
Managing the Customer Experience for Media – Web, Mobile, and Video
Managing the Customer Experience for Media – Web, Mobile, and VideoManaging the Customer Experience for Media – Web, Mobile, and Video
Managing the Customer Experience for Media – Web, Mobile, and Video
 
The Enterprise wants WebRTC -- and it needs Middleware to get it! (IIT RTC Co...
The Enterprise wants WebRTC -- and it needs Middleware to get it! (IIT RTC Co...The Enterprise wants WebRTC -- and it needs Middleware to get it! (IIT RTC Co...
The Enterprise wants WebRTC -- and it needs Middleware to get it! (IIT RTC Co...
 

More from Alessandro Polidori

Presentation @ Node.js Global Summit 2020 - Online
Presentation @ Node.js Global Summit 2020 - OnlinePresentation @ Node.js Global Summit 2020 - Online
Presentation @ Node.js Global Summit 2020 - OnlineAlessandro Polidori
 
Presentation at ClueCon 2019 - Chicago, IL, USA 🇺🇸
Presentation at ClueCon 2019 - Chicago, IL, USA 🇺🇸Presentation at ClueCon 2019 - Chicago, IL, USA 🇺🇸
Presentation at ClueCon 2019 - Chicago, IL, USA 🇺🇸Alessandro Polidori
 
Presentation at JSConf.be 2019 - Alessandro Polidori
Presentation at JSConf.be 2019 - Alessandro PolidoriPresentation at JSConf.be 2019 - Alessandro Polidori
Presentation at JSConf.be 2019 - Alessandro PolidoriAlessandro Polidori
 
Asterisk WebRTC frontier: make client SIP Phone with sipML5 and Janus Gateway
Asterisk WebRTC frontier: make client SIP Phone with sipML5 and Janus GatewayAsterisk WebRTC frontier: make client SIP Phone with sipML5 and Janus Gateway
Asterisk WebRTC frontier: make client SIP Phone with sipML5 and Janus GatewayAlessandro Polidori
 
Asterisk WebRTC frontier: realize client SIP Phone with sipML5 and Janus Gateway
Asterisk WebRTC frontier: realize client SIP Phone with sipML5 and Janus GatewayAsterisk WebRTC frontier: realize client SIP Phone with sipML5 and Janus Gateway
Asterisk WebRTC frontier: realize client SIP Phone with sipML5 and Janus GatewayAlessandro Polidori
 
Alessandro polidori nextcloud conf 2018
Alessandro polidori   nextcloud conf 2018Alessandro polidori   nextcloud conf 2018
Alessandro polidori nextcloud conf 2018Alessandro Polidori
 
Telefono SIP WebRTC nel tuo browser: da sipML5 a Janus
Telefono SIP WebRTC nel tuo browser: da sipML5 a JanusTelefono SIP WebRTC nel tuo browser: da sipML5 a Janus
Telefono SIP WebRTC nel tuo browser: da sipML5 a JanusAlessandro Polidori
 

More from Alessandro Polidori (7)

Presentation @ Node.js Global Summit 2020 - Online
Presentation @ Node.js Global Summit 2020 - OnlinePresentation @ Node.js Global Summit 2020 - Online
Presentation @ Node.js Global Summit 2020 - Online
 
Presentation at ClueCon 2019 - Chicago, IL, USA 🇺🇸
Presentation at ClueCon 2019 - Chicago, IL, USA 🇺🇸Presentation at ClueCon 2019 - Chicago, IL, USA 🇺🇸
Presentation at ClueCon 2019 - Chicago, IL, USA 🇺🇸
 
Presentation at JSConf.be 2019 - Alessandro Polidori
Presentation at JSConf.be 2019 - Alessandro PolidoriPresentation at JSConf.be 2019 - Alessandro Polidori
Presentation at JSConf.be 2019 - Alessandro Polidori
 
Asterisk WebRTC frontier: make client SIP Phone with sipML5 and Janus Gateway
Asterisk WebRTC frontier: make client SIP Phone with sipML5 and Janus GatewayAsterisk WebRTC frontier: make client SIP Phone with sipML5 and Janus Gateway
Asterisk WebRTC frontier: make client SIP Phone with sipML5 and Janus Gateway
 
Asterisk WebRTC frontier: realize client SIP Phone with sipML5 and Janus Gateway
Asterisk WebRTC frontier: realize client SIP Phone with sipML5 and Janus GatewayAsterisk WebRTC frontier: realize client SIP Phone with sipML5 and Janus Gateway
Asterisk WebRTC frontier: realize client SIP Phone with sipML5 and Janus Gateway
 
Alessandro polidori nextcloud conf 2018
Alessandro polidori   nextcloud conf 2018Alessandro polidori   nextcloud conf 2018
Alessandro polidori nextcloud conf 2018
 
Telefono SIP WebRTC nel tuo browser: da sipML5 a Janus
Telefono SIP WebRTC nel tuo browser: da sipML5 a JanusTelefono SIP WebRTC nel tuo browser: da sipML5 a Janus
Telefono SIP WebRTC nel tuo browser: da sipML5 a Janus
 

Recently uploaded

DATA ANALYTICS PPT definition usage example
DATA ANALYTICS PPT definition usage exampleDATA ANALYTICS PPT definition usage example
DATA ANALYTICS PPT definition usage examplePragyanshuParadkar1
 
Effects of rheological properties on mixing
Effects of rheological properties on mixingEffects of rheological properties on mixing
Effects of rheological properties on mixingviprabot1
 
EduAI - E learning Platform integrated with AI
EduAI - E learning Platform integrated with AIEduAI - E learning Platform integrated with AI
EduAI - E learning Platform integrated with AIkoyaldeepu123
 
Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024hassan khalil
 
main PPT.pptx of girls hostel security using rfid
main PPT.pptx of girls hostel security using rfidmain PPT.pptx of girls hostel security using rfid
main PPT.pptx of girls hostel security using rfidNikhilNagaraju
 
Call Us ≽ 8377877756 ≼ Call Girls In Shastri Nagar (Delhi)
Call Us ≽ 8377877756 ≼ Call Girls In Shastri Nagar (Delhi)Call Us ≽ 8377877756 ≼ Call Girls In Shastri Nagar (Delhi)
Call Us ≽ 8377877756 ≼ Call Girls In Shastri Nagar (Delhi)dollysharma2066
 
Application of Residue Theorem to evaluate real integrations.pptx
Application of Residue Theorem to evaluate real integrations.pptxApplication of Residue Theorem to evaluate real integrations.pptx
Application of Residue Theorem to evaluate real integrations.pptx959SahilShah
 
CCS355 Neural Networks & Deep Learning Unit 1 PDF notes with Question bank .pdf
CCS355 Neural Networks & Deep Learning Unit 1 PDF notes with Question bank .pdfCCS355 Neural Networks & Deep Learning Unit 1 PDF notes with Question bank .pdf
CCS355 Neural Networks & Deep Learning Unit 1 PDF notes with Question bank .pdfAsst.prof M.Gokilavani
 
Gurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort service
Gurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort serviceGurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort service
Gurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort servicejennyeacort
 
An experimental study in using natural admixture as an alternative for chemic...
An experimental study in using natural admixture as an alternative for chemic...An experimental study in using natural admixture as an alternative for chemic...
An experimental study in using natural admixture as an alternative for chemic...Chandu841456
 
What are the advantages and disadvantages of membrane structures.pptx
What are the advantages and disadvantages of membrane structures.pptxWhat are the advantages and disadvantages of membrane structures.pptx
What are the advantages and disadvantages of membrane structures.pptxwendy cai
 
Call Girls Narol 7397865700 Independent Call Girls
Call Girls Narol 7397865700 Independent Call GirlsCall Girls Narol 7397865700 Independent Call Girls
Call Girls Narol 7397865700 Independent Call Girlsssuser7cb4ff
 
Heart Disease Prediction using machine learning.pptx
Heart Disease Prediction using machine learning.pptxHeart Disease Prediction using machine learning.pptx
Heart Disease Prediction using machine learning.pptxPoojaBan
 
HARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IVHARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IVRajaP95
 
pipeline in computer architecture design
pipeline in computer architecture  designpipeline in computer architecture  design
pipeline in computer architecture designssuser87fa0c1
 
Arduino_CSE ece ppt for working and principal of arduino.ppt
Arduino_CSE ece ppt for working and principal of arduino.pptArduino_CSE ece ppt for working and principal of arduino.ppt
Arduino_CSE ece ppt for working and principal of arduino.pptSAURABHKUMAR892774
 
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptxDecoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptxJoão Esperancinha
 
Introduction-To-Agricultural-Surveillance-Rover.pptx
Introduction-To-Agricultural-Surveillance-Rover.pptxIntroduction-To-Agricultural-Surveillance-Rover.pptx
Introduction-To-Agricultural-Surveillance-Rover.pptxk795866
 

Recently uploaded (20)

DATA ANALYTICS PPT definition usage example
DATA ANALYTICS PPT definition usage exampleDATA ANALYTICS PPT definition usage example
DATA ANALYTICS PPT definition usage example
 
Effects of rheological properties on mixing
Effects of rheological properties on mixingEffects of rheological properties on mixing
Effects of rheological properties on mixing
 
EduAI - E learning Platform integrated with AI
EduAI - E learning Platform integrated with AIEduAI - E learning Platform integrated with AI
EduAI - E learning Platform integrated with AI
 
Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024
 
main PPT.pptx of girls hostel security using rfid
main PPT.pptx of girls hostel security using rfidmain PPT.pptx of girls hostel security using rfid
main PPT.pptx of girls hostel security using rfid
 
Call Us ≽ 8377877756 ≼ Call Girls In Shastri Nagar (Delhi)
Call Us ≽ 8377877756 ≼ Call Girls In Shastri Nagar (Delhi)Call Us ≽ 8377877756 ≼ Call Girls In Shastri Nagar (Delhi)
Call Us ≽ 8377877756 ≼ Call Girls In Shastri Nagar (Delhi)
 
Exploring_Network_Security_with_JA3_by_Rakesh Seal.pptx
Exploring_Network_Security_with_JA3_by_Rakesh Seal.pptxExploring_Network_Security_with_JA3_by_Rakesh Seal.pptx
Exploring_Network_Security_with_JA3_by_Rakesh Seal.pptx
 
Application of Residue Theorem to evaluate real integrations.pptx
Application of Residue Theorem to evaluate real integrations.pptxApplication of Residue Theorem to evaluate real integrations.pptx
Application of Residue Theorem to evaluate real integrations.pptx
 
CCS355 Neural Networks & Deep Learning Unit 1 PDF notes with Question bank .pdf
CCS355 Neural Networks & Deep Learning Unit 1 PDF notes with Question bank .pdfCCS355 Neural Networks & Deep Learning Unit 1 PDF notes with Question bank .pdf
CCS355 Neural Networks & Deep Learning Unit 1 PDF notes with Question bank .pdf
 
Gurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort service
Gurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort serviceGurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort service
Gurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort service
 
An experimental study in using natural admixture as an alternative for chemic...
An experimental study in using natural admixture as an alternative for chemic...An experimental study in using natural admixture as an alternative for chemic...
An experimental study in using natural admixture as an alternative for chemic...
 
young call girls in Green Park🔝 9953056974 🔝 escort Service
young call girls in Green Park🔝 9953056974 🔝 escort Serviceyoung call girls in Green Park🔝 9953056974 🔝 escort Service
young call girls in Green Park🔝 9953056974 🔝 escort Service
 
What are the advantages and disadvantages of membrane structures.pptx
What are the advantages and disadvantages of membrane structures.pptxWhat are the advantages and disadvantages of membrane structures.pptx
What are the advantages and disadvantages of membrane structures.pptx
 
Call Girls Narol 7397865700 Independent Call Girls
Call Girls Narol 7397865700 Independent Call GirlsCall Girls Narol 7397865700 Independent Call Girls
Call Girls Narol 7397865700 Independent Call Girls
 
Heart Disease Prediction using machine learning.pptx
Heart Disease Prediction using machine learning.pptxHeart Disease Prediction using machine learning.pptx
Heart Disease Prediction using machine learning.pptx
 
HARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IVHARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IV
 
pipeline in computer architecture design
pipeline in computer architecture  designpipeline in computer architecture  design
pipeline in computer architecture design
 
Arduino_CSE ece ppt for working and principal of arduino.ppt
Arduino_CSE ece ppt for working and principal of arduino.pptArduino_CSE ece ppt for working and principal of arduino.ppt
Arduino_CSE ece ppt for working and principal of arduino.ppt
 
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptxDecoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
 
Introduction-To-Agricultural-Surveillance-Rover.pptx
Introduction-To-Agricultural-Surveillance-Rover.pptxIntroduction-To-Agricultural-Surveillance-Rover.pptx
Introduction-To-Agricultural-Surveillance-Rover.pptx
 

JS Audio/Video Streaming: WebRTC APIs 101 explained