SlideShare a Scribd company logo
WebRTC and Web Audio API
BY MATTEO AVALLE
Co-Founder & CTO Fluentify.com
OUTLINE
• Introduction
• WebRTC
– MediaStream
– RTCPeerConnection & RTCDataChannel
– ICE, STUN, TURN
– Browser support
• Alternatives
• “Abusing” MediaStreams
• Web Audio APIs
• Conclusions
WebRTC and Web Audio API
MATTEO AVALLE
Introduction
• How do we usually interact with websites?
– Mouse & Keyboard
– Plugin-based webcam & mic
– External apps
• Can we do better?
– Voice recognition
– Image processing
– Audio/Video chat integrated in webpages
WebRTC and Web Audio API
MATTEO AVALLE
WebRTC
• A JavaScript API set
– Audio/Video stream capture
– P2P Communication API
– Real time stream encoding/decoding
• Low level • Modular
WebRTC and Web Audio API
MATTEO AVALLE
WebRTC
• The three APIs:
– MediaStream
• Gets data from Webcam, Microphone, etc.
– RTCDataChannel
• Creates generic P2P connections
– RTCPeerConnection
• Handle complex procedures like:
– Audio/Video calls
– Encryption
– Bandwidth management
WebRTC and Web Audio API
MATTEO AVALLE
MediaStream
• Available in Chrome, Opera, Firefox, Edge
• Used to “connect” an audio/video stream to:
– A <video> / <canvas> tag
– A WebRTC stream
– ...
• Extremely simple
WebRTC and Web Audio API
MATTEO AVALLE
MediaStream: the Mirror Example
WebRTC and Web Audio API
MATTEO AVALLE
WebRTC and Web Audio API
MATTEO AVALLE
Note: examples are just
meant to be examples
RTCPeerConnection, RTCDataChannel
• Available in Chrome, Opera, Firefox
• They handle:
– P2P connection creation
– Data encoding/encrypion
– Data buffering
WebRTC and Web Audio API
MATTEO AVALLE
RTCPeerConnection, RTCDataChannel
WebRTC and Web Audio API
MATTEO AVALLE
Issues of P2P
• How do I know how many other guys are present?
• Who they are? (i.e. What are their IP addresses?)
• What if they are behind a NAT router (like 99% of home
users)?
• What if they are behind a firewall?
• What should I do if the connection drops/is bad?
WebRTC and Web Audio API
MATTEO AVALLE
ICE, STUN, TURN
• ICE/STUN are:
– “HACKS” to bypass the firewalls
– They use a server to create the initial connection
– The rest of the communication is P2P
• TURN:
– The last resort for too-protected networks
– All the traffic passes through a server
– No more P2P, but the most reliable
WebRTC and Web Audio API
MATTEO AVALLE
Browser compatibility
• Chrome, Opera and Firefox have all the APIs, but:
– They require different prefixes
– Certain behaviors are still different
• What about the other browsers?
WebRTC and Web Audio API
MATTEO AVALLE
WebRTC and Web Audio API
MATTEO AVALLE
HELP! THIS IS GETTING SO
COMPLICATED!
What can we do?
• Start on a journey to become a WebRTC master
• Use third-party libraries
– OpenTok
– EasyRTC
– PeerJS
– XirSys *
– simplewebrtc.com
– Hangouts APIs *
WebRTC and Web Audio API
MATTEO AVALLE
OpenTok
P2P? Relayed? You choose, they provide the servers
• DASH “for free” (in terms of coding)
• IE plugin available
• Real-Time performance monitor
• 100% customizable Javascript library
• BUT: it’s kinda expensive, both for small- scale and
large-scale applications
WebRTC and Web Audio API
MATTEO AVALLE
WebRTC and Web Audio API
MATTEO AVALLE
Creating video-chat
websites with WebRTC
alone is hard.
BUT THEN...
ARE WEBRTC APIS STILL USEFUL
FOR US TO KNOW?
“Abusing” WebRTC APIs
• We can redirect our Media Streams elsewhere
– <video>/<canvas> tags
– Filters (CSS/canvas)
– Background Javascript Workers
• We have a GPU-accelerated videoP codec encoder/
decoder
• We can develop P2P applications
WebRTC and Web Audio API
MATTEO AVALLE
“Abusing” WebRTC APIs:
the Filtered Mirror Example
WebRTC and Web Audio API
MATTEO AVALLE
Web Audio APIs
• An efficient API to manipulate audio streams
• Most common “slow” functions are hardcoded in the
browser (e.g. FFTransform), you just use them
• “Processing blocks” coding style
WebRTC and Web Audio API
MATTEO AVALLE
Web Audio APIs
WebRTC and Web Audio API
MATTEO AVALLE
Audio Capture
OutputJavascript filter
Output the
filtered stream
Web Audio APIs: Mp3 Volume bar Example
WebRTC and Web Audio API
MATTEO AVALLE
Conclusions
• WebRTC APIs are tremendously powerful
• Maybe too low level to create skype rivals “easily”
• We can do much more than just video chat
WebRTC and Web Audio API
MATTEO AVALLE
What would YOU do with these?
THANK YOU
www.fluentify.com/torinojs.zip
WebRTC and Web Audio API
BY MATTEO AVALLE
Co-Founder & CTO Fluentify.com

More Related Content

What's hot

Extreme Web Performance for Mobile Devices
Extreme Web Performance for Mobile Devices Extreme Web Performance for Mobile Devices
Extreme Web Performance for Mobile Devices
Maximiliano Firtman
 
Consuming ASP.NET Web API with WebSockets
Consuming ASP.NET Web API with WebSocketsConsuming ASP.NET Web API with WebSockets
Consuming ASP.NET Web API with WebSockets
Maayan Glikser
 
Building modern web sites with ASP .Net Web API, WebSockets and RSignal
Building modern web sites with ASP .Net Web API, WebSockets and RSignalBuilding modern web sites with ASP .Net Web API, WebSockets and RSignal
Building modern web sites with ASP .Net Web API, WebSockets and RSignal
Alessandro Pilotti
 
Working with Git
Working with GitWorking with Git
Working with Git
Tony Hillerson
 
WEB SOCKET 應用
WEB SOCKET 應用WEB SOCKET 應用
WEB SOCKET 應用Jerromy Lee
 
JavaOne: Welcome alexa, your personal assistant [con1700]
JavaOne: Welcome alexa, your personal assistant [con1700]JavaOne: Welcome alexa, your personal assistant [con1700]
JavaOne: Welcome alexa, your personal assistant [con1700]
Johan Janssen
 
IPv6 at Home -2014
IPv6 at Home -2014IPv6 at Home -2014
IPv6 at Home -2014
Nathalie Kunneke-Trenaman
 
Ignite template f11fritzandmichelle
Ignite template f11fritzandmichelleIgnite template f11fritzandmichelle
Ignite template f11fritzandmichellefritzloewy
 
Ansible Meetup NYC 060215
Ansible Meetup NYC 060215Ansible Meetup NYC 060215
Ansible Meetup NYC 060215
jedelman99
 
The Software Developers Guide to Prototyping Wearable Devices
The Software Developers Guide to Prototyping Wearable DevicesThe Software Developers Guide to Prototyping Wearable Devices
The Software Developers Guide to Prototyping Wearable Devices
TechWell
 

What's hot (10)

Extreme Web Performance for Mobile Devices
Extreme Web Performance for Mobile Devices Extreme Web Performance for Mobile Devices
Extreme Web Performance for Mobile Devices
 
Consuming ASP.NET Web API with WebSockets
Consuming ASP.NET Web API with WebSocketsConsuming ASP.NET Web API with WebSockets
Consuming ASP.NET Web API with WebSockets
 
Building modern web sites with ASP .Net Web API, WebSockets and RSignal
Building modern web sites with ASP .Net Web API, WebSockets and RSignalBuilding modern web sites with ASP .Net Web API, WebSockets and RSignal
Building modern web sites with ASP .Net Web API, WebSockets and RSignal
 
Working with Git
Working with GitWorking with Git
Working with Git
 
WEB SOCKET 應用
WEB SOCKET 應用WEB SOCKET 應用
WEB SOCKET 應用
 
JavaOne: Welcome alexa, your personal assistant [con1700]
JavaOne: Welcome alexa, your personal assistant [con1700]JavaOne: Welcome alexa, your personal assistant [con1700]
JavaOne: Welcome alexa, your personal assistant [con1700]
 
IPv6 at Home -2014
IPv6 at Home -2014IPv6 at Home -2014
IPv6 at Home -2014
 
Ignite template f11fritzandmichelle
Ignite template f11fritzandmichelleIgnite template f11fritzandmichelle
Ignite template f11fritzandmichelle
 
Ansible Meetup NYC 060215
Ansible Meetup NYC 060215Ansible Meetup NYC 060215
Ansible Meetup NYC 060215
 
The Software Developers Guide to Prototyping Wearable Devices
The Software Developers Guide to Prototyping Wearable DevicesThe Software Developers Guide to Prototyping Wearable Devices
The Software Developers Guide to Prototyping Wearable Devices
 

Viewers also liked

Enterprise resource planning solutions for wholesale distributors
Enterprise resource planning solutions for wholesale distributorsEnterprise resource planning solutions for wholesale distributors
Enterprise resource planning solutions for wholesale distributors
Guy Blissett
 
Wholesale distribution outlook 2012 net suite
Wholesale distribution outlook 2012 net suiteWholesale distribution outlook 2012 net suite
Wholesale distribution outlook 2012 net suiteGuy Blissett
 
Ph.D Annual Report III
Ph.D Annual Report IIIPh.D Annual Report III
Ph.D Annual Report III
Matteo Avalle
 
Facing the forces of change survey results segmented by customer type_novemb...
Facing the forces of change  survey results segmented by customer type_novemb...Facing the forces of change  survey results segmented by customer type_novemb...
Facing the forces of change survey results segmented by customer type_novemb...Guy Blissett
 
Model roll
Model rollModel roll
Model rollmifaya
 
Facing the forces of change survey results segmented by total sales_october ...
Facing the forces of change  survey results segmented by total sales_october ...Facing the forces of change  survey results segmented by total sales_october ...
Facing the forces of change survey results segmented by total sales_october ...
Guy Blissett
 
Module11and12
Module11and12Module11and12
Module11and12
Patricia Hoffman
 
Craig Hudson's HIPAA Training Outline
Craig Hudson's HIPAA Training OutlineCraig Hudson's HIPAA Training Outline
Craig Hudson's HIPAA Training Outline
Craig Hudson
 
Knowmads: Tecnología
Knowmads: TecnologíaKnowmads: Tecnología
Knowmads: Tecnología
Alicia Juarez Rodriguez
 
Ph.D Annual report II
Ph.D Annual report IIPh.D Annual report II
Ph.D Annual report IIMatteo Avalle
 
Asian Economy
Asian EconomyAsian Economy
Asian Economy
CharlotteVereecke
 
Economic situation of China and Japan
Economic situation of China and JapanEconomic situation of China and Japan
Economic situation of China and Japan
CharlotteVereecke
 
Fragile X presentation
Fragile X presentationFragile X presentation
Fragile X presentationKelsey Sokol
 
Desamortización2016
Desamortización2016Desamortización2016
Desamortización2016
tonicontreras
 
Ud8. población española
Ud8. población españolaUd8. población española
Ud8. población española
tonicontreras
 
Grandesdecubrimientos geográficos1
Grandesdecubrimientos geográficos1Grandesdecubrimientos geográficos1
Grandesdecubrimientos geográficos1tonicontreras
 

Viewers also liked (18)

Enterprise resource planning solutions for wholesale distributors
Enterprise resource planning solutions for wholesale distributorsEnterprise resource planning solutions for wholesale distributors
Enterprise resource planning solutions for wholesale distributors
 
Wholesale distribution outlook 2012 net suite
Wholesale distribution outlook 2012 net suiteWholesale distribution outlook 2012 net suite
Wholesale distribution outlook 2012 net suite
 
Ph.D Annual Report III
Ph.D Annual Report IIIPh.D Annual Report III
Ph.D Annual Report III
 
Facing the forces of change survey results segmented by customer type_novemb...
Facing the forces of change  survey results segmented by customer type_novemb...Facing the forces of change  survey results segmented by customer type_novemb...
Facing the forces of change survey results segmented by customer type_novemb...
 
Happy Birthday Anna
Happy Birthday AnnaHappy Birthday Anna
Happy Birthday Anna
 
Model roll
Model rollModel roll
Model roll
 
Facing the forces of change survey results segmented by total sales_october ...
Facing the forces of change  survey results segmented by total sales_october ...Facing the forces of change  survey results segmented by total sales_october ...
Facing the forces of change survey results segmented by total sales_october ...
 
Module11and12
Module11and12Module11and12
Module11and12
 
Craig Hudson's HIPAA Training Outline
Craig Hudson's HIPAA Training OutlineCraig Hudson's HIPAA Training Outline
Craig Hudson's HIPAA Training Outline
 
Knowmads: Tecnología
Knowmads: TecnologíaKnowmads: Tecnología
Knowmads: Tecnología
 
Ph.D Annual report II
Ph.D Annual report IIPh.D Annual report II
Ph.D Annual report II
 
Asian Economy
Asian EconomyAsian Economy
Asian Economy
 
Work Portfolio
Work PortfolioWork Portfolio
Work Portfolio
 
Economic situation of China and Japan
Economic situation of China and JapanEconomic situation of China and Japan
Economic situation of China and Japan
 
Fragile X presentation
Fragile X presentationFragile X presentation
Fragile X presentation
 
Desamortización2016
Desamortización2016Desamortización2016
Desamortización2016
 
Ud8. población española
Ud8. población españolaUd8. población española
Ud8. población española
 
Grandesdecubrimientos geográficos1
Grandesdecubrimientos geográficos1Grandesdecubrimientos geográficos1
Grandesdecubrimientos geográficos1
 

Similar to Torino js

WHIP WebRTC Broadcasting @ FOSDEM 2022
WHIP WebRTC Broadcasting @ FOSDEM 2022WHIP WebRTC Broadcasting @ FOSDEM 2022
WHIP WebRTC Broadcasting @ FOSDEM 2022
Lorenzo Miniero
 
KazooCon 2014 - WebRTC
KazooCon 2014 - WebRTCKazooCon 2014 - WebRTC
KazooCon 2014 - WebRTC
2600Hz
 
WHIP and Janus @ IIT-RTC 2021
WHIP and Janus @ IIT-RTC 2021WHIP and Janus @ IIT-RTC 2021
WHIP and Janus @ IIT-RTC 2021
Lorenzo Miniero
 
Janus/SIP @ OpenSIPS 2019
Janus/SIP @ OpenSIPS 2019Janus/SIP @ OpenSIPS 2019
Janus/SIP @ OpenSIPS 2019
Lorenzo Miniero
 
WebRTC Broadcasting @ TADSummit 2023
WebRTC Broadcasting @ TADSummit 2023WebRTC Broadcasting @ TADSummit 2023
WebRTC Broadcasting @ TADSummit 2023
Lorenzo Miniero
 
Scaling WebRTC deployments with multicast @ IETF 110 MBONED
Scaling WebRTC deployments with multicast @ IETF 110 MBONEDScaling WebRTC deployments with multicast @ IETF 110 MBONED
Scaling WebRTC deployments with multicast @ IETF 110 MBONED
Lorenzo Miniero
 
2600hz WebRTC Meetup at WeWork, San Francisco, CA
2600hz WebRTC Meetup at WeWork, San Francisco, CA2600hz WebRTC Meetup at WeWork, San Francisco, CA
2600hz WebRTC Meetup at WeWork, San Francisco, CA
2600Hz
 
Upperside Webinar - WebRTC Standards Update
Upperside Webinar - WebRTC Standards UpdateUpperside Webinar - WebRTC Standards Update
Upperside Webinar - WebRTC Standards Update
UppersideConferences
 
Janus @ WebRTC Meetup Stockholm
Janus @ WebRTC Meetup StockholmJanus @ WebRTC Meetup Stockholm
Janus @ WebRTC Meetup Stockholm
Lorenzo Miniero
 
Kurento FIWARE
Kurento FIWAREKurento FIWARE
Kurento FIWARE
Ivan Gracia
 
Janus + Audio @ Open Source World
Janus + Audio @ Open Source WorldJanus + Audio @ Open Source World
Janus + Audio @ Open Source World
Lorenzo Miniero
 
Bridging_WebRTC_with_SIP_Alberto_WebRTCventures_Cluecon2023_NoVideo.pptx
Bridging_WebRTC_with_SIP_Alberto_WebRTCventures_Cluecon2023_NoVideo.pptxBridging_WebRTC_with_SIP_Alberto_WebRTCventures_Cluecon2023_NoVideo.pptx
Bridging_WebRTC_with_SIP_Alberto_WebRTCventures_Cluecon2023_NoVideo.pptx
Alberto González Trastoy
 
Twilio Signal 2016 WebRTC Reborn
Twilio Signal 2016 WebRTC RebornTwilio Signal 2016 WebRTC Reborn
Twilio Signal 2016 WebRTC Reborn
Twilio Inc
 
WebRTC Reborn SignalConf 2016
WebRTC Reborn SignalConf 2016WebRTC Reborn SignalConf 2016
WebRTC Reborn SignalConf 2016
Dan Jenkins
 
Upperside Webinar- WebRTC from the service provider prism-final
Upperside Webinar- WebRTC from the service provider prism-finalUpperside Webinar- WebRTC from the service provider prism-final
Upperside Webinar- WebRTC from the service provider prism-final
Amir Zmora
 
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
Amir Zmora
 
Baby Steps: A WebRTC Tutorial
Baby Steps: A WebRTC TutorialBaby Steps: A WebRTC Tutorial
Baby Steps: A WebRTC Tutorial
Tsahi Levent-levi
 
WebRTC Demystified
WebRTC DemystifiedWebRTC Demystified
WebRTC Demystified
Anant Narayanan
 
Html5 web sockets - Brad Drysdale - London Web 2011-10-20
Html5 web sockets - Brad Drysdale - London Web 2011-10-20Html5 web sockets - Brad Drysdale - London Web 2011-10-20
Html5 web sockets - Brad Drysdale - London Web 2011-10-20
Nathan O'Hanlon
 

Similar to Torino js (20)

WHIP WebRTC Broadcasting @ FOSDEM 2022
WHIP WebRTC Broadcasting @ FOSDEM 2022WHIP WebRTC Broadcasting @ FOSDEM 2022
WHIP WebRTC Broadcasting @ FOSDEM 2022
 
KazooCon 2014 - WebRTC
KazooCon 2014 - WebRTCKazooCon 2014 - WebRTC
KazooCon 2014 - WebRTC
 
WHIP and Janus @ IIT-RTC 2021
WHIP and Janus @ IIT-RTC 2021WHIP and Janus @ IIT-RTC 2021
WHIP and Janus @ IIT-RTC 2021
 
Janus/SIP @ OpenSIPS 2019
Janus/SIP @ OpenSIPS 2019Janus/SIP @ OpenSIPS 2019
Janus/SIP @ OpenSIPS 2019
 
WebRTC Broadcasting @ TADSummit 2023
WebRTC Broadcasting @ TADSummit 2023WebRTC Broadcasting @ TADSummit 2023
WebRTC Broadcasting @ TADSummit 2023
 
Scaling WebRTC deployments with multicast @ IETF 110 MBONED
Scaling WebRTC deployments with multicast @ IETF 110 MBONEDScaling WebRTC deployments with multicast @ IETF 110 MBONED
Scaling WebRTC deployments with multicast @ IETF 110 MBONED
 
2600hz WebRTC Meetup at WeWork, San Francisco, CA
2600hz WebRTC Meetup at WeWork, San Francisco, CA2600hz WebRTC Meetup at WeWork, San Francisco, CA
2600hz WebRTC Meetup at WeWork, San Francisco, CA
 
Upperside Webinar - WebRTC Standards Update
Upperside Webinar - WebRTC Standards UpdateUpperside Webinar - WebRTC Standards Update
Upperside Webinar - WebRTC Standards Update
 
Janus @ WebRTC Meetup Stockholm
Janus @ WebRTC Meetup StockholmJanus @ WebRTC Meetup Stockholm
Janus @ WebRTC Meetup Stockholm
 
Kurento FIWARE
Kurento FIWAREKurento FIWARE
Kurento FIWARE
 
Webrtc
WebrtcWebrtc
Webrtc
 
Janus + Audio @ Open Source World
Janus + Audio @ Open Source WorldJanus + Audio @ Open Source World
Janus + Audio @ Open Source World
 
Bridging_WebRTC_with_SIP_Alberto_WebRTCventures_Cluecon2023_NoVideo.pptx
Bridging_WebRTC_with_SIP_Alberto_WebRTCventures_Cluecon2023_NoVideo.pptxBridging_WebRTC_with_SIP_Alberto_WebRTCventures_Cluecon2023_NoVideo.pptx
Bridging_WebRTC_with_SIP_Alberto_WebRTCventures_Cluecon2023_NoVideo.pptx
 
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
 
Upperside Webinar- WebRTC from the service provider prism-final
Upperside Webinar- WebRTC from the service provider prism-finalUpperside Webinar- WebRTC from the service provider prism-final
Upperside Webinar- WebRTC from the service provider prism-final
 
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
 
Baby Steps: A WebRTC Tutorial
Baby Steps: A WebRTC TutorialBaby Steps: A WebRTC Tutorial
Baby Steps: A WebRTC Tutorial
 
WebRTC Demystified
WebRTC DemystifiedWebRTC Demystified
WebRTC Demystified
 
Html5 web sockets - Brad Drysdale - London Web 2011-10-20
Html5 web sockets - Brad Drysdale - London Web 2011-10-20Html5 web sockets - Brad Drysdale - London Web 2011-10-20
Html5 web sockets - Brad Drysdale - London Web 2011-10-20
 

Recently uploaded

Globus Connect Server Deep Dive - GlobusWorld 2024
Globus Connect Server Deep Dive - GlobusWorld 2024Globus Connect Server Deep Dive - GlobusWorld 2024
Globus Connect Server Deep Dive - GlobusWorld 2024
Globus
 
Need for Speed: Removing speed bumps from your Symfony projects ⚡️
Need for Speed: Removing speed bumps from your Symfony projects ⚡️Need for Speed: Removing speed bumps from your Symfony projects ⚡️
Need for Speed: Removing speed bumps from your Symfony projects ⚡️
Łukasz Chruściel
 
Large Language Models and the End of Programming
Large Language Models and the End of ProgrammingLarge Language Models and the End of Programming
Large Language Models and the End of Programming
Matt Welsh
 
Enterprise Software Development with No Code Solutions.pptx
Enterprise Software Development with No Code Solutions.pptxEnterprise Software Development with No Code Solutions.pptx
Enterprise Software Development with No Code Solutions.pptx
QuickwayInfoSystems3
 
Text-Summarization-of-Breaking-News-Using-Fine-tuning-BART-Model.pptx
Text-Summarization-of-Breaking-News-Using-Fine-tuning-BART-Model.pptxText-Summarization-of-Breaking-News-Using-Fine-tuning-BART-Model.pptx
Text-Summarization-of-Breaking-News-Using-Fine-tuning-BART-Model.pptx
ShamsuddeenMuhammadA
 
Top Features to Include in Your Winzo Clone App for Business Growth (4).pptx
Top Features to Include in Your Winzo Clone App for Business Growth (4).pptxTop Features to Include in Your Winzo Clone App for Business Growth (4).pptx
Top Features to Include in Your Winzo Clone App for Business Growth (4).pptx
rickgrimesss22
 
Enterprise Resource Planning System in Telangana
Enterprise Resource Planning System in TelanganaEnterprise Resource Planning System in Telangana
Enterprise Resource Planning System in Telangana
NYGGS Automation Suite
 
AI Genie Review: World’s First Open AI WordPress Website Creator
AI Genie Review: World’s First Open AI WordPress Website CreatorAI Genie Review: World’s First Open AI WordPress Website Creator
AI Genie Review: World’s First Open AI WordPress Website Creator
Google
 
Orion Context Broker introduction 20240604
Orion Context Broker introduction 20240604Orion Context Broker introduction 20240604
Orion Context Broker introduction 20240604
Fermin Galan
 
Lecture 1 Introduction to games development
Lecture 1 Introduction to games developmentLecture 1 Introduction to games development
Lecture 1 Introduction to games development
abdulrafaychaudhry
 
Custom Healthcare Software for Managing Chronic Conditions and Remote Patient...
Custom Healthcare Software for Managing Chronic Conditions and Remote Patient...Custom Healthcare Software for Managing Chronic Conditions and Remote Patient...
Custom Healthcare Software for Managing Chronic Conditions and Remote Patient...
Mind IT Systems
 
Quarkus Hidden and Forbidden Extensions
Quarkus Hidden and Forbidden ExtensionsQuarkus Hidden and Forbidden Extensions
Quarkus Hidden and Forbidden Extensions
Max Andersen
 
Globus Compute Introduction - GlobusWorld 2024
Globus Compute Introduction - GlobusWorld 2024Globus Compute Introduction - GlobusWorld 2024
Globus Compute Introduction - GlobusWorld 2024
Globus
 
Navigating the Metaverse: A Journey into Virtual Evolution"
Navigating the Metaverse: A Journey into Virtual Evolution"Navigating the Metaverse: A Journey into Virtual Evolution"
Navigating the Metaverse: A Journey into Virtual Evolution"
Donna Lenk
 
openEuler Case Study - The Journey to Supply Chain Security
openEuler Case Study - The Journey to Supply Chain SecurityopenEuler Case Study - The Journey to Supply Chain Security
openEuler Case Study - The Journey to Supply Chain Security
Shane Coughlan
 
Globus Compute wth IRI Workflows - GlobusWorld 2024
Globus Compute wth IRI Workflows - GlobusWorld 2024Globus Compute wth IRI Workflows - GlobusWorld 2024
Globus Compute wth IRI Workflows - GlobusWorld 2024
Globus
 
Empowering Growth with Best Software Development Company in Noida - Deuglo
Empowering Growth with Best Software  Development Company in Noida - DeugloEmpowering Growth with Best Software  Development Company in Noida - Deuglo
Empowering Growth with Best Software Development Company in Noida - Deuglo
Deuglo Infosystem Pvt Ltd
 
OpenMetadata Community Meeting - 5th June 2024
OpenMetadata Community Meeting - 5th June 2024OpenMetadata Community Meeting - 5th June 2024
OpenMetadata Community Meeting - 5th June 2024
OpenMetadata
 
Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...
Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...
Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...
Globus
 
AI Fusion Buddy Review: Brand New, Groundbreaking Gemini-Powered AI App
AI Fusion Buddy Review: Brand New, Groundbreaking Gemini-Powered AI AppAI Fusion Buddy Review: Brand New, Groundbreaking Gemini-Powered AI App
AI Fusion Buddy Review: Brand New, Groundbreaking Gemini-Powered AI App
Google
 

Recently uploaded (20)

Globus Connect Server Deep Dive - GlobusWorld 2024
Globus Connect Server Deep Dive - GlobusWorld 2024Globus Connect Server Deep Dive - GlobusWorld 2024
Globus Connect Server Deep Dive - GlobusWorld 2024
 
Need for Speed: Removing speed bumps from your Symfony projects ⚡️
Need for Speed: Removing speed bumps from your Symfony projects ⚡️Need for Speed: Removing speed bumps from your Symfony projects ⚡️
Need for Speed: Removing speed bumps from your Symfony projects ⚡️
 
Large Language Models and the End of Programming
Large Language Models and the End of ProgrammingLarge Language Models and the End of Programming
Large Language Models and the End of Programming
 
Enterprise Software Development with No Code Solutions.pptx
Enterprise Software Development with No Code Solutions.pptxEnterprise Software Development with No Code Solutions.pptx
Enterprise Software Development with No Code Solutions.pptx
 
Text-Summarization-of-Breaking-News-Using-Fine-tuning-BART-Model.pptx
Text-Summarization-of-Breaking-News-Using-Fine-tuning-BART-Model.pptxText-Summarization-of-Breaking-News-Using-Fine-tuning-BART-Model.pptx
Text-Summarization-of-Breaking-News-Using-Fine-tuning-BART-Model.pptx
 
Top Features to Include in Your Winzo Clone App for Business Growth (4).pptx
Top Features to Include in Your Winzo Clone App for Business Growth (4).pptxTop Features to Include in Your Winzo Clone App for Business Growth (4).pptx
Top Features to Include in Your Winzo Clone App for Business Growth (4).pptx
 
Enterprise Resource Planning System in Telangana
Enterprise Resource Planning System in TelanganaEnterprise Resource Planning System in Telangana
Enterprise Resource Planning System in Telangana
 
AI Genie Review: World’s First Open AI WordPress Website Creator
AI Genie Review: World’s First Open AI WordPress Website CreatorAI Genie Review: World’s First Open AI WordPress Website Creator
AI Genie Review: World’s First Open AI WordPress Website Creator
 
Orion Context Broker introduction 20240604
Orion Context Broker introduction 20240604Orion Context Broker introduction 20240604
Orion Context Broker introduction 20240604
 
Lecture 1 Introduction to games development
Lecture 1 Introduction to games developmentLecture 1 Introduction to games development
Lecture 1 Introduction to games development
 
Custom Healthcare Software for Managing Chronic Conditions and Remote Patient...
Custom Healthcare Software for Managing Chronic Conditions and Remote Patient...Custom Healthcare Software for Managing Chronic Conditions and Remote Patient...
Custom Healthcare Software for Managing Chronic Conditions and Remote Patient...
 
Quarkus Hidden and Forbidden Extensions
Quarkus Hidden and Forbidden ExtensionsQuarkus Hidden and Forbidden Extensions
Quarkus Hidden and Forbidden Extensions
 
Globus Compute Introduction - GlobusWorld 2024
Globus Compute Introduction - GlobusWorld 2024Globus Compute Introduction - GlobusWorld 2024
Globus Compute Introduction - GlobusWorld 2024
 
Navigating the Metaverse: A Journey into Virtual Evolution"
Navigating the Metaverse: A Journey into Virtual Evolution"Navigating the Metaverse: A Journey into Virtual Evolution"
Navigating the Metaverse: A Journey into Virtual Evolution"
 
openEuler Case Study - The Journey to Supply Chain Security
openEuler Case Study - The Journey to Supply Chain SecurityopenEuler Case Study - The Journey to Supply Chain Security
openEuler Case Study - The Journey to Supply Chain Security
 
Globus Compute wth IRI Workflows - GlobusWorld 2024
Globus Compute wth IRI Workflows - GlobusWorld 2024Globus Compute wth IRI Workflows - GlobusWorld 2024
Globus Compute wth IRI Workflows - GlobusWorld 2024
 
Empowering Growth with Best Software Development Company in Noida - Deuglo
Empowering Growth with Best Software  Development Company in Noida - DeugloEmpowering Growth with Best Software  Development Company in Noida - Deuglo
Empowering Growth with Best Software Development Company in Noida - Deuglo
 
OpenMetadata Community Meeting - 5th June 2024
OpenMetadata Community Meeting - 5th June 2024OpenMetadata Community Meeting - 5th June 2024
OpenMetadata Community Meeting - 5th June 2024
 
Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...
Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...
Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...
 
AI Fusion Buddy Review: Brand New, Groundbreaking Gemini-Powered AI App
AI Fusion Buddy Review: Brand New, Groundbreaking Gemini-Powered AI AppAI Fusion Buddy Review: Brand New, Groundbreaking Gemini-Powered AI App
AI Fusion Buddy Review: Brand New, Groundbreaking Gemini-Powered AI App
 

Torino js

  • 1. WebRTC and Web Audio API BY MATTEO AVALLE Co-Founder & CTO Fluentify.com
  • 2. OUTLINE • Introduction • WebRTC – MediaStream – RTCPeerConnection & RTCDataChannel – ICE, STUN, TURN – Browser support • Alternatives • “Abusing” MediaStreams • Web Audio APIs • Conclusions WebRTC and Web Audio API MATTEO AVALLE
  • 3. Introduction • How do we usually interact with websites? – Mouse & Keyboard – Plugin-based webcam & mic – External apps • Can we do better? – Voice recognition – Image processing – Audio/Video chat integrated in webpages WebRTC and Web Audio API MATTEO AVALLE
  • 4. WebRTC • A JavaScript API set – Audio/Video stream capture – P2P Communication API – Real time stream encoding/decoding • Low level • Modular WebRTC and Web Audio API MATTEO AVALLE
  • 5. WebRTC • The three APIs: – MediaStream • Gets data from Webcam, Microphone, etc. – RTCDataChannel • Creates generic P2P connections – RTCPeerConnection • Handle complex procedures like: – Audio/Video calls – Encryption – Bandwidth management WebRTC and Web Audio API MATTEO AVALLE
  • 6. MediaStream • Available in Chrome, Opera, Firefox, Edge • Used to “connect” an audio/video stream to: – A <video> / <canvas> tag – A WebRTC stream – ... • Extremely simple WebRTC and Web Audio API MATTEO AVALLE
  • 7. MediaStream: the Mirror Example WebRTC and Web Audio API MATTEO AVALLE
  • 8. WebRTC and Web Audio API MATTEO AVALLE Note: examples are just meant to be examples
  • 9. RTCPeerConnection, RTCDataChannel • Available in Chrome, Opera, Firefox • They handle: – P2P connection creation – Data encoding/encrypion – Data buffering WebRTC and Web Audio API MATTEO AVALLE
  • 10. RTCPeerConnection, RTCDataChannel WebRTC and Web Audio API MATTEO AVALLE
  • 11. Issues of P2P • How do I know how many other guys are present? • Who they are? (i.e. What are their IP addresses?) • What if they are behind a NAT router (like 99% of home users)? • What if they are behind a firewall? • What should I do if the connection drops/is bad? WebRTC and Web Audio API MATTEO AVALLE
  • 12. ICE, STUN, TURN • ICE/STUN are: – “HACKS” to bypass the firewalls – They use a server to create the initial connection – The rest of the communication is P2P • TURN: – The last resort for too-protected networks – All the traffic passes through a server – No more P2P, but the most reliable WebRTC and Web Audio API MATTEO AVALLE
  • 13. Browser compatibility • Chrome, Opera and Firefox have all the APIs, but: – They require different prefixes – Certain behaviors are still different • What about the other browsers? WebRTC and Web Audio API MATTEO AVALLE
  • 14. WebRTC and Web Audio API MATTEO AVALLE HELP! THIS IS GETTING SO COMPLICATED!
  • 15. What can we do? • Start on a journey to become a WebRTC master • Use third-party libraries – OpenTok – EasyRTC – PeerJS – XirSys * – simplewebrtc.com – Hangouts APIs * WebRTC and Web Audio API MATTEO AVALLE
  • 16. OpenTok P2P? Relayed? You choose, they provide the servers • DASH “for free” (in terms of coding) • IE plugin available • Real-Time performance monitor • 100% customizable Javascript library • BUT: it’s kinda expensive, both for small- scale and large-scale applications WebRTC and Web Audio API MATTEO AVALLE
  • 17. WebRTC and Web Audio API MATTEO AVALLE Creating video-chat websites with WebRTC alone is hard. BUT THEN... ARE WEBRTC APIS STILL USEFUL FOR US TO KNOW?
  • 18. “Abusing” WebRTC APIs • We can redirect our Media Streams elsewhere – <video>/<canvas> tags – Filters (CSS/canvas) – Background Javascript Workers • We have a GPU-accelerated videoP codec encoder/ decoder • We can develop P2P applications WebRTC and Web Audio API MATTEO AVALLE
  • 19. “Abusing” WebRTC APIs: the Filtered Mirror Example WebRTC and Web Audio API MATTEO AVALLE
  • 20. Web Audio APIs • An efficient API to manipulate audio streams • Most common “slow” functions are hardcoded in the browser (e.g. FFTransform), you just use them • “Processing blocks” coding style WebRTC and Web Audio API MATTEO AVALLE
  • 21. Web Audio APIs WebRTC and Web Audio API MATTEO AVALLE Audio Capture OutputJavascript filter Output the filtered stream
  • 22. Web Audio APIs: Mp3 Volume bar Example WebRTC and Web Audio API MATTEO AVALLE
  • 23. Conclusions • WebRTC APIs are tremendously powerful • Maybe too low level to create skype rivals “easily” • We can do much more than just video chat WebRTC and Web Audio API MATTEO AVALLE What would YOU do with these?
  • 24. THANK YOU www.fluentify.com/torinojs.zip WebRTC and Web Audio API BY MATTEO AVALLE Co-Founder & CTO Fluentify.com