SlideShare a Scribd company logo
1 of 27
Confidential ©2021 RingCentral
November 18, 2021
async function call_ringout() {
try {
var resp = await
platform.post('/restapi/v1.0/account/~/ex
'from': { 'phoneNumber': RINGCENTRA
'to': { 'phoneNumber': RECIPIENT },
'playPrompt': false
})
var jsonObj = await resp.json()
console.log("Call placed. Call status
jsonObj.status.callStatus)
} catch (e) {
console.log(e.message)
}
}
Best practices in Electron-based
desktop development for WebRTC
Arnaud Budkiewicz
Sr Director of Video Engineering, W3C Member
@ArnaudBud
2 ©2021 RingCentral
ON MOBILE
40
An average person
has 40 apps
installed on his
phone.
18
Out of that 40
apps, 89% of the
time is split
between 18 apps.
People love apps!
3 ©2021 RingCentral
ON DESKTOP
App Stores
even if both Apple
and Microsoft
have their store to
extend users'
appetite for apps,
Businesses
the behavior is
different from
mobile, and
businesses want
full control on
what users install
on their devices.
People love apps!
4 ©2021 RingCentral
WebRTC runs in browsers,
but what if you want to build a desktop app?
PWAs (Progressive Web
Applications)
is a quick and easy way to distribute
your Web app on the Windows Store,
get it “installed” on a PC or a Mac
But the most popular way remains
Electron
5 ©2021 RingCentral
Who are the major apps that are
using Electron?
● Microsoft Visual Studio Code
is a reference
● for RTC applications?
○ Slack
○ Facebook Messenger
○ WhatsApp
○ Skype
○ Microsoft Teams
○ Jitsi powered by 8x8
○ Streamlabs OBS
○ Discord
○ …
○ And RingCentral of course
6 ©2021 RingCentral
The “simplest” way to build from a Web App
a desktop app for Windows, Mac, and linux.
myElectronApp =
f(Electron, myWebApp, myNativeModules)
So what is Electron?
Electron = Chromium (WebRTC) + nodeJS
myDependencyTree is:
● myElectronApp
○ myWebApp
○ myNativeModules
○ Electron
■ Chromium
● WebRTC
What can go
wrong with
Electron?
8 ©2021 RingCentral
myWebApp has ONE MORE browser to support: myElectronApp
● Triggers different UX (screen sharing), different portion of code
(myNativeModules), different features
● always older than the latest Chrome or Edge,
● not 100% exactly Chrome
● must be integrated and tested with myNativeModules
myNativeModules expose another API to myWebApp
● but have different implementations Windows, Mac
● and hardware specificities (GPUs)
● usually work with only one given major version of Electron
● to be tested multiple times, as a component, with an integration test app, end-to-
end with multiple versions of myWebApp
What can go wrong with Electron?
9 ©2021 RingCentral
Upgrades!
● Pain points
○ Both myWebApp and myElectronApp can be upgraded separately
○ But they have different methods of deployment (app server upgrade vs IT
package)
○ myElectronApp usually requires a restart, to reload the native modules, and
expose the new API
● So there is a solid upgrade experience to build, to not disrupt the user, but
guiding him through the upgrade
What can go wrong with Electron?
10 ©2021 RingCentral
Dependencies
● S**** happens and this is a complex onion to debug
● Depending on where is your bug you may need to talk to different groups
● Electron
○ GitHub to report the issue
○ Slack and Discord to socialize/discuss it
○ only 3 versions of Electron are supported
● Chromium
○ Electron can cherry pick a few minor releases of the same version of Chromium
○ only 3 versions of Electron are supported
● WebRTC
○ The hardest one as you need to touch all the layers
○ Depending on various factors, your fix maybe back ported, maybe not
○ Understand which minor version(s) of Chromium will contain your fix
○ Push the Electron community to take the minor Chromium release
What can go wrong with Electron?
11 ©2021 RingCentral
Understanding the entire release cycle
Electron Cadence Changed
● 12-week → 8-week release cadence
● Every other Chrome version (even numbers)
● Starting with E15 (M94) on September 21
● Increase in supported Electron versions from
3 → 4 until May’22 (E19)
Why?
● Chromium has moved to a release every 4
weeks, starting with M94 (Sept 21).
● Microsoft Store requires Chromium-based
apps to be no older than 2 major versions.
This policy includes Electron apps.
● More frequent releases = smaller releases
Quicker to get Chrome fixes/feature
12 ©2021 RingCentral
Understanding the entire release cycle
Upcoming Release Plan
Supported Versions Plan
13 ©2021 RingCentral
Bug tracking exemple
WebRTC
For instance, you need this bug fixed:
14 ©2021 RingCentral
How to identify the release train of a commit in
WebRTC/Chromium/Electron/myElectronApp?
WebRTC
1. Find the patch submission:
1. Get the commithash
○ in the patch submission (f288f5b2d41d6810428f6ec9bc646ace8a9edeca)
https://webrtc.googlesource.com/src/+/f288f5b2d41d6810428f6ec9bc646ace8a9edec
a
○ or in the Issue tracker if they have been linked together, you'll find a
comment from bugdroid
https://bugs.chromium.org/p/webrtc/issues/detail?id=11957#c4
15 ©2021 RingCentral
How to identify the release train of a commit in
WebRTC/Chromium/Electron/myElectronApp?
WebRTC
3. Enter it into cdash:
https://chromiumdash.appspot.com
And Voila!
16 ©2021 RingCentral
How to identify the release train of a commit in
WebRTC/Chromium/Electron/myElectronApp?
WebRTC
4. Sometimes there is a backport in the current stable release, like here:
4. Repeating the same steps will give you the minor release in cdash:
17 ©2021 RingCentral
How to identify the release train of a commit in
WebRTC/Chromium/Electron/myElectronApp?
Electron
Now, where this commit landed in Electron?
A quick look at major release notes will tell you which version to look at. In the
current example, E11.
Here you can find the release notes of all the minor releases of E11:
https://www.electronjs.org/releases/stable?version=11
In that case, Electron 11.0.0 already contained the fix we are looking for
https://www.electronjs.org/releases/stable?version=11&page=6 shows Chromium
87.0.4280.47
Sometimes Electron also cherry-pick some Chromium patches, mostly security:
https://www.electronjs.org/releases/stable?version=11&page=2#11.4.8
Best Practices
19 ©2021 RingCentral
Test, Test, Test!
● Test all your upgrades, combinations, your backward compatibility
● Test your performance, your media quality, during dev, regression, in production
● Test Electron Betas
Best practices in Electron-based desktop development for WebRTC
Upgrade
● Upgrade as fast as you can on the latest Electron stable version
Custom
● Go with a Custom Electron strategy ONLY if you have the resources, dev and QA
20 ©2021 RingCentral
Contribute back!
python tools/bisect-builds.py -a mac
-g M85 -b M86 --use-local-cache --verify-
range
1
2
3
https://webrtccourse.com
Best practices in Electron-based desktop development for WebRTC
Report issues
How to submit a WebRTC bug >>
● Bisect-builds.py
Where to report:
● github.com -- for Electron
● crbug.com -- for Chromium.
● bugs.webrtc.org -- for WebRTC native code.
21 ©2021 RingCentral
Contribute back!
Best practices in Electron-based desktop development for WebRTC
Test experimental features
Example: RED
RTP Payload for Redundant Audio Data
● Extensive lab testing
● Internal User feedback
Source: RingCentral
Need to go
further?
23 ©2021 RingCentral
Build your custom Electron
RC Electron features
● External capturer
Allows another team to develop screen capturer
without rebuilding electron
● Preload script in worker context
Allows to run native modules as audioworklet
● API to direct access to video frame payload
Allows to run native modules to apply video
effect/filters in breakout box
● API to create audio dumps for audio issues
investigation
RCV Web Client “Custom“ WebRTC
MediaStream
RTCPeerConnection
getUserMedia
MediaStream
Promise
Shared Screen
Capturing Library
24 ©2021 RingCentral
Architecture Overview Comparaison
Teams 2.0 Moves Away from Electron to Embrace Edge WebView2
25 ©2021 RingCentral
Architecture Overview Comparaison Electron WebView2
Build Dependency Chromium Edge
Source Available on GitHub Yes No
Shares Edge/Chrome DLLs No Yes (as of Edge 90)
Shared Runtime Between Applications No Optional
Application APIs Yes No
Node.js Yes No
Sandbox Optional Always
Requires an Application Framework No Yes
Supported Platforms Mac, Win, Linux Win (Mac/Linux planned)
Process Sharing Between Apps Never Optional
Framework Updates Managed By Application WebView2
26 ©2021 RingCentral
Questions?
@ArnaudBud
developers.ringcentral.com
Confidential
Thank you.
Thank you.
@ringcentraldevs
developers.ringcentral.com
Friday, January 01, 2021
async function call_ringout() {
try {
var resp = await
platform.post('/restapi/v1.0/account/~/ex
'from': { 'phoneNumber': RINGCENTRA
'to': { 'phoneNumber': RECIPIENT },
'playPrompt': false
})
var jsonObj = await resp.json()
console.log("Call placed. Call status
jsonObj.status.callStatus)
} catch (e) {
console.log(e.message)
}
}

More Related Content

Similar to KrankGeek November 2021 - Best practices in Electron-based desktop development for WebRTC.pptx

A Browser for the Automotive: Introduction to WebKit for Wayland (Automotive ...
A Browser for the Automotive: Introduction to WebKit for Wayland (Automotive ...A Browser for the Automotive: Introduction to WebKit for Wayland (Automotive ...
A Browser for the Automotive: Introduction to WebKit for Wayland (Automotive ...Igalia
 
A simplest-way-to-reconstruct-.net-framework
A simplest-way-to-reconstruct-.net-frameworkA simplest-way-to-reconstruct-.net-framework
A simplest-way-to-reconstruct-.net-frameworksonia merchant
 
A simplest way to reconstruct .Net Framework - CRB Tech
A simplest way to reconstruct .Net Framework - CRB TechA simplest way to reconstruct .Net Framework - CRB Tech
A simplest way to reconstruct .Net Framework - CRB TechPooja Gaikwad
 
Why is .Net Technology Recognised for Software Development?
Why is .Net Technology Recognised for Software Development?Why is .Net Technology Recognised for Software Development?
Why is .Net Technology Recognised for Software Development?LOGINPHP360
 
Why is .Net Technology Recognised for Software Development?
Why is .Net Technology Recognised for Software Development?Why is .Net Technology Recognised for Software Development?
Why is .Net Technology Recognised for Software Development?LOGINPHP360
 
React and Web Performance
React and Web PerformanceReact and Web Performance
React and Web PerformanceLars Roettig
 
Angular (v2 and up) - Morning to understand - Linagora
Angular (v2 and up) - Morning to understand - LinagoraAngular (v2 and up) - Morning to understand - Linagora
Angular (v2 and up) - Morning to understand - LinagoraLINAGORA
 
Scaling Prometheus Metrics in Kubernetes with Telegraf | Chris Goller | Influ...
Scaling Prometheus Metrics in Kubernetes with Telegraf | Chris Goller | Influ...Scaling Prometheus Metrics in Kubernetes with Telegraf | Chris Goller | Influ...
Scaling Prometheus Metrics in Kubernetes with Telegraf | Chris Goller | Influ...InfluxData
 
Powering your next IoT application with MQTT - JavaOne 2014 tutorial
Powering your next IoT application with MQTT - JavaOne 2014 tutorialPowering your next IoT application with MQTT - JavaOne 2014 tutorial
Powering your next IoT application with MQTT - JavaOne 2014 tutorialBenjamin Cabé
 
What should you know about Net Core?
What should you know about Net Core?What should you know about Net Core?
What should you know about Net Core?Damir Dobric
 
Web componenet using angular element
Web componenet using angular elementWeb componenet using angular element
Web componenet using angular elementHimanshu Tamrakar
 
MeeGo 1.2 Harmattan - Development & Community Processes
MeeGo 1.2 Harmattan - Development & Community ProcessesMeeGo 1.2 Harmattan - Development & Community Processes
MeeGo 1.2 Harmattan - Development & Community ProcessesUwe Kaminski
 
GDG Devfest 2016 session on Android N
GDG Devfest 2016 session on Android NGDG Devfest 2016 session on Android N
GDG Devfest 2016 session on Android NImam Raza
 
Krank Geek April 2021 - Screensharing made easier
Krank Geek April 2021 -  Screensharing made easierKrank Geek April 2021 -  Screensharing made easier
Krank Geek April 2021 - Screensharing made easierArnaud BUDKIEWICZ
 
Iot world 2018 presentation
Iot world 2018 presentationIot world 2018 presentation
Iot world 2018 presentationNicola La Gloria
 

Similar to KrankGeek November 2021 - Best practices in Electron-based desktop development for WebRTC.pptx (20)

A Browser for the Automotive: Introduction to WebKit for Wayland (Automotive ...
A Browser for the Automotive: Introduction to WebKit for Wayland (Automotive ...A Browser for the Automotive: Introduction to WebKit for Wayland (Automotive ...
A Browser for the Automotive: Introduction to WebKit for Wayland (Automotive ...
 
A simplest-way-to-reconstruct-.net-framework
A simplest-way-to-reconstruct-.net-frameworkA simplest-way-to-reconstruct-.net-framework
A simplest-way-to-reconstruct-.net-framework
 
A simplest way to reconstruct .Net Framework - CRB Tech
A simplest way to reconstruct .Net Framework - CRB TechA simplest way to reconstruct .Net Framework - CRB Tech
A simplest way to reconstruct .Net Framework - CRB Tech
 
Why is .Net Technology Recognised for Software Development?
Why is .Net Technology Recognised for Software Development?Why is .Net Technology Recognised for Software Development?
Why is .Net Technology Recognised for Software Development?
 
Why is .Net Technology Recognised for Software Development?
Why is .Net Technology Recognised for Software Development?Why is .Net Technology Recognised for Software Development?
Why is .Net Technology Recognised for Software Development?
 
Eclipse summit-2010
Eclipse summit-2010Eclipse summit-2010
Eclipse summit-2010
 
React and Web Performance
React and Web PerformanceReact and Web Performance
React and Web Performance
 
Angular (v2 and up) - Morning to understand - Linagora
Angular (v2 and up) - Morning to understand - LinagoraAngular (v2 and up) - Morning to understand - Linagora
Angular (v2 and up) - Morning to understand - Linagora
 
Scaling Prometheus Metrics in Kubernetes with Telegraf | Chris Goller | Influ...
Scaling Prometheus Metrics in Kubernetes with Telegraf | Chris Goller | Influ...Scaling Prometheus Metrics in Kubernetes with Telegraf | Chris Goller | Influ...
Scaling Prometheus Metrics in Kubernetes with Telegraf | Chris Goller | Influ...
 
Powering your next IoT application with MQTT - JavaOne 2014 tutorial
Powering your next IoT application with MQTT - JavaOne 2014 tutorialPowering your next IoT application with MQTT - JavaOne 2014 tutorial
Powering your next IoT application with MQTT - JavaOne 2014 tutorial
 
Where should I run my code? Serverless, Containers, Virtual Machines and more
Where should I run my code? Serverless, Containers, Virtual Machines and moreWhere should I run my code? Serverless, Containers, Virtual Machines and more
Where should I run my code? Serverless, Containers, Virtual Machines and more
 
What should you know about Net Core?
What should you know about Net Core?What should you know about Net Core?
What should you know about Net Core?
 
Bof4162 kovalsky
Bof4162 kovalskyBof4162 kovalsky
Bof4162 kovalsky
 
Web componenet using angular element
Web componenet using angular elementWeb componenet using angular element
Web componenet using angular element
 
Basic Widget Development
Basic Widget DevelopmentBasic Widget Development
Basic Widget Development
 
MeeGo 1.2 Harmattan - Development & Community Processes
MeeGo 1.2 Harmattan - Development & Community ProcessesMeeGo 1.2 Harmattan - Development & Community Processes
MeeGo 1.2 Harmattan - Development & Community Processes
 
GDG Devfest 2016 session on Android N
GDG Devfest 2016 session on Android NGDG Devfest 2016 session on Android N
GDG Devfest 2016 session on Android N
 
Discover Meteor
Discover MeteorDiscover Meteor
Discover Meteor
 
Krank Geek April 2021 - Screensharing made easier
Krank Geek April 2021 -  Screensharing made easierKrank Geek April 2021 -  Screensharing made easier
Krank Geek April 2021 - Screensharing made easier
 
Iot world 2018 presentation
Iot world 2018 presentationIot world 2018 presentation
Iot world 2018 presentation
 

Recently uploaded

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
 
VICTOR MAESTRE RAMIREZ - Planetary Defender on NASA's Double Asteroid Redirec...
VICTOR MAESTRE RAMIREZ - Planetary Defender on NASA's Double Asteroid Redirec...VICTOR MAESTRE RAMIREZ - Planetary Defender on NASA's Double Asteroid Redirec...
VICTOR MAESTRE RAMIREZ - Planetary Defender on NASA's Double Asteroid Redirec...VICTOR MAESTRE RAMIREZ
 
Oxy acetylene welding presentation note.
Oxy acetylene welding presentation note.Oxy acetylene welding presentation note.
Oxy acetylene welding presentation note.eptoze12
 
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
 
ZXCTN 5804 / ZTE PTN / ZTE POTN / ZTE 5804 PTN / ZTE POTN 5804 ( 100/200 GE Z...
ZXCTN 5804 / ZTE PTN / ZTE POTN / ZTE 5804 PTN / ZTE POTN 5804 ( 100/200 GE Z...ZXCTN 5804 / ZTE PTN / ZTE POTN / ZTE 5804 PTN / ZTE POTN 5804 ( 100/200 GE Z...
ZXCTN 5804 / ZTE PTN / ZTE POTN / ZTE 5804 PTN / ZTE POTN 5804 ( 100/200 GE Z...ZTE
 
Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024hassan khalil
 
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
 
chaitra-1.pptx fake news detection using machine learning
chaitra-1.pptx  fake news detection using machine learningchaitra-1.pptx  fake news detection using machine learning
chaitra-1.pptx fake news detection using machine learningmisbanausheenparvam
 
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝soniya singh
 
Biology for Computer Engineers Course Handout.pptx
Biology for Computer Engineers Course Handout.pptxBiology for Computer Engineers Course Handout.pptx
Biology for Computer Engineers Course Handout.pptxDeepakSakkari2
 
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...Soham Mondal
 
Artificial-Intelligence-in-Electronics (K).pptx
Artificial-Intelligence-in-Electronics (K).pptxArtificial-Intelligence-in-Electronics (K).pptx
Artificial-Intelligence-in-Electronics (K).pptxbritheesh05
 
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escortsranjana rawat
 
Internship report on mechanical engineering
Internship report on mechanical engineeringInternship report on mechanical engineering
Internship report on mechanical engineeringmalavadedarshan25
 
Introduction to Microprocesso programming and interfacing.pptx
Introduction to Microprocesso programming and interfacing.pptxIntroduction to Microprocesso programming and interfacing.pptx
Introduction to Microprocesso programming and interfacing.pptxvipinkmenon1
 
microprocessor 8085 and its interfacing
microprocessor 8085  and its interfacingmicroprocessor 8085  and its interfacing
microprocessor 8085 and its interfacingjaychoudhary37
 
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escortsranjana rawat
 
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...ranjana rawat
 

Recently uploaded (20)

Call Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCR
Call Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCRCall Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCR
Call Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCR
 
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
 
★ CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR
★ CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR★ CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR
★ CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR
 
VICTOR MAESTRE RAMIREZ - Planetary Defender on NASA's Double Asteroid Redirec...
VICTOR MAESTRE RAMIREZ - Planetary Defender on NASA's Double Asteroid Redirec...VICTOR MAESTRE RAMIREZ - Planetary Defender on NASA's Double Asteroid Redirec...
VICTOR MAESTRE RAMIREZ - Planetary Defender on NASA's Double Asteroid Redirec...
 
Oxy acetylene welding presentation note.
Oxy acetylene welding presentation note.Oxy acetylene welding presentation note.
Oxy acetylene welding presentation note.
 
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
 
ZXCTN 5804 / ZTE PTN / ZTE POTN / ZTE 5804 PTN / ZTE POTN 5804 ( 100/200 GE Z...
ZXCTN 5804 / ZTE PTN / ZTE POTN / ZTE 5804 PTN / ZTE POTN 5804 ( 100/200 GE Z...ZXCTN 5804 / ZTE PTN / ZTE POTN / ZTE 5804 PTN / ZTE POTN 5804 ( 100/200 GE Z...
ZXCTN 5804 / ZTE PTN / ZTE POTN / ZTE 5804 PTN / ZTE POTN 5804 ( 100/200 GE Z...
 
Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024
 
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
 
chaitra-1.pptx fake news detection using machine learning
chaitra-1.pptx  fake news detection using machine learningchaitra-1.pptx  fake news detection using machine learning
chaitra-1.pptx fake news detection using machine learning
 
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝
 
Biology for Computer Engineers Course Handout.pptx
Biology for Computer Engineers Course Handout.pptxBiology for Computer Engineers Course Handout.pptx
Biology for Computer Engineers Course Handout.pptx
 
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
 
Artificial-Intelligence-in-Electronics (K).pptx
Artificial-Intelligence-in-Electronics (K).pptxArtificial-Intelligence-in-Electronics (K).pptx
Artificial-Intelligence-in-Electronics (K).pptx
 
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
 
Internship report on mechanical engineering
Internship report on mechanical engineeringInternship report on mechanical engineering
Internship report on mechanical engineering
 
Introduction to Microprocesso programming and interfacing.pptx
Introduction to Microprocesso programming and interfacing.pptxIntroduction to Microprocesso programming and interfacing.pptx
Introduction to Microprocesso programming and interfacing.pptx
 
microprocessor 8085 and its interfacing
microprocessor 8085  and its interfacingmicroprocessor 8085  and its interfacing
microprocessor 8085 and its interfacing
 
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
 
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
 

KrankGeek November 2021 - Best practices in Electron-based desktop development for WebRTC.pptx

  • 1. Confidential ©2021 RingCentral November 18, 2021 async function call_ringout() { try { var resp = await platform.post('/restapi/v1.0/account/~/ex 'from': { 'phoneNumber': RINGCENTRA 'to': { 'phoneNumber': RECIPIENT }, 'playPrompt': false }) var jsonObj = await resp.json() console.log("Call placed. Call status jsonObj.status.callStatus) } catch (e) { console.log(e.message) } } Best practices in Electron-based desktop development for WebRTC Arnaud Budkiewicz Sr Director of Video Engineering, W3C Member @ArnaudBud
  • 2. 2 ©2021 RingCentral ON MOBILE 40 An average person has 40 apps installed on his phone. 18 Out of that 40 apps, 89% of the time is split between 18 apps. People love apps!
  • 3. 3 ©2021 RingCentral ON DESKTOP App Stores even if both Apple and Microsoft have their store to extend users' appetite for apps, Businesses the behavior is different from mobile, and businesses want full control on what users install on their devices. People love apps!
  • 4. 4 ©2021 RingCentral WebRTC runs in browsers, but what if you want to build a desktop app? PWAs (Progressive Web Applications) is a quick and easy way to distribute your Web app on the Windows Store, get it “installed” on a PC or a Mac But the most popular way remains Electron
  • 5. 5 ©2021 RingCentral Who are the major apps that are using Electron? ● Microsoft Visual Studio Code is a reference ● for RTC applications? ○ Slack ○ Facebook Messenger ○ WhatsApp ○ Skype ○ Microsoft Teams ○ Jitsi powered by 8x8 ○ Streamlabs OBS ○ Discord ○ … ○ And RingCentral of course
  • 6. 6 ©2021 RingCentral The “simplest” way to build from a Web App a desktop app for Windows, Mac, and linux. myElectronApp = f(Electron, myWebApp, myNativeModules) So what is Electron? Electron = Chromium (WebRTC) + nodeJS myDependencyTree is: ● myElectronApp ○ myWebApp ○ myNativeModules ○ Electron ■ Chromium ● WebRTC
  • 7. What can go wrong with Electron?
  • 8. 8 ©2021 RingCentral myWebApp has ONE MORE browser to support: myElectronApp ● Triggers different UX (screen sharing), different portion of code (myNativeModules), different features ● always older than the latest Chrome or Edge, ● not 100% exactly Chrome ● must be integrated and tested with myNativeModules myNativeModules expose another API to myWebApp ● but have different implementations Windows, Mac ● and hardware specificities (GPUs) ● usually work with only one given major version of Electron ● to be tested multiple times, as a component, with an integration test app, end-to- end with multiple versions of myWebApp What can go wrong with Electron?
  • 9. 9 ©2021 RingCentral Upgrades! ● Pain points ○ Both myWebApp and myElectronApp can be upgraded separately ○ But they have different methods of deployment (app server upgrade vs IT package) ○ myElectronApp usually requires a restart, to reload the native modules, and expose the new API ● So there is a solid upgrade experience to build, to not disrupt the user, but guiding him through the upgrade What can go wrong with Electron?
  • 10. 10 ©2021 RingCentral Dependencies ● S**** happens and this is a complex onion to debug ● Depending on where is your bug you may need to talk to different groups ● Electron ○ GitHub to report the issue ○ Slack and Discord to socialize/discuss it ○ only 3 versions of Electron are supported ● Chromium ○ Electron can cherry pick a few minor releases of the same version of Chromium ○ only 3 versions of Electron are supported ● WebRTC ○ The hardest one as you need to touch all the layers ○ Depending on various factors, your fix maybe back ported, maybe not ○ Understand which minor version(s) of Chromium will contain your fix ○ Push the Electron community to take the minor Chromium release What can go wrong with Electron?
  • 11. 11 ©2021 RingCentral Understanding the entire release cycle Electron Cadence Changed ● 12-week → 8-week release cadence ● Every other Chrome version (even numbers) ● Starting with E15 (M94) on September 21 ● Increase in supported Electron versions from 3 → 4 until May’22 (E19) Why? ● Chromium has moved to a release every 4 weeks, starting with M94 (Sept 21). ● Microsoft Store requires Chromium-based apps to be no older than 2 major versions. This policy includes Electron apps. ● More frequent releases = smaller releases Quicker to get Chrome fixes/feature
  • 12. 12 ©2021 RingCentral Understanding the entire release cycle Upcoming Release Plan Supported Versions Plan
  • 13. 13 ©2021 RingCentral Bug tracking exemple WebRTC For instance, you need this bug fixed:
  • 14. 14 ©2021 RingCentral How to identify the release train of a commit in WebRTC/Chromium/Electron/myElectronApp? WebRTC 1. Find the patch submission: 1. Get the commithash ○ in the patch submission (f288f5b2d41d6810428f6ec9bc646ace8a9edeca) https://webrtc.googlesource.com/src/+/f288f5b2d41d6810428f6ec9bc646ace8a9edec a ○ or in the Issue tracker if they have been linked together, you'll find a comment from bugdroid https://bugs.chromium.org/p/webrtc/issues/detail?id=11957#c4
  • 15. 15 ©2021 RingCentral How to identify the release train of a commit in WebRTC/Chromium/Electron/myElectronApp? WebRTC 3. Enter it into cdash: https://chromiumdash.appspot.com And Voila!
  • 16. 16 ©2021 RingCentral How to identify the release train of a commit in WebRTC/Chromium/Electron/myElectronApp? WebRTC 4. Sometimes there is a backport in the current stable release, like here: 4. Repeating the same steps will give you the minor release in cdash:
  • 17. 17 ©2021 RingCentral How to identify the release train of a commit in WebRTC/Chromium/Electron/myElectronApp? Electron Now, where this commit landed in Electron? A quick look at major release notes will tell you which version to look at. In the current example, E11. Here you can find the release notes of all the minor releases of E11: https://www.electronjs.org/releases/stable?version=11 In that case, Electron 11.0.0 already contained the fix we are looking for https://www.electronjs.org/releases/stable?version=11&page=6 shows Chromium 87.0.4280.47 Sometimes Electron also cherry-pick some Chromium patches, mostly security: https://www.electronjs.org/releases/stable?version=11&page=2#11.4.8
  • 19. 19 ©2021 RingCentral Test, Test, Test! ● Test all your upgrades, combinations, your backward compatibility ● Test your performance, your media quality, during dev, regression, in production ● Test Electron Betas Best practices in Electron-based desktop development for WebRTC Upgrade ● Upgrade as fast as you can on the latest Electron stable version Custom ● Go with a Custom Electron strategy ONLY if you have the resources, dev and QA
  • 20. 20 ©2021 RingCentral Contribute back! python tools/bisect-builds.py -a mac -g M85 -b M86 --use-local-cache --verify- range 1 2 3 https://webrtccourse.com Best practices in Electron-based desktop development for WebRTC Report issues How to submit a WebRTC bug >> ● Bisect-builds.py Where to report: ● github.com -- for Electron ● crbug.com -- for Chromium. ● bugs.webrtc.org -- for WebRTC native code.
  • 21. 21 ©2021 RingCentral Contribute back! Best practices in Electron-based desktop development for WebRTC Test experimental features Example: RED RTP Payload for Redundant Audio Data ● Extensive lab testing ● Internal User feedback Source: RingCentral
  • 23. 23 ©2021 RingCentral Build your custom Electron RC Electron features ● External capturer Allows another team to develop screen capturer without rebuilding electron ● Preload script in worker context Allows to run native modules as audioworklet ● API to direct access to video frame payload Allows to run native modules to apply video effect/filters in breakout box ● API to create audio dumps for audio issues investigation RCV Web Client “Custom“ WebRTC MediaStream RTCPeerConnection getUserMedia MediaStream Promise Shared Screen Capturing Library
  • 24. 24 ©2021 RingCentral Architecture Overview Comparaison Teams 2.0 Moves Away from Electron to Embrace Edge WebView2
  • 25. 25 ©2021 RingCentral Architecture Overview Comparaison Electron WebView2 Build Dependency Chromium Edge Source Available on GitHub Yes No Shares Edge/Chrome DLLs No Yes (as of Edge 90) Shared Runtime Between Applications No Optional Application APIs Yes No Node.js Yes No Sandbox Optional Always Requires an Application Framework No Yes Supported Platforms Mac, Win, Linux Win (Mac/Linux planned) Process Sharing Between Apps Never Optional Framework Updates Managed By Application WebView2
  • 27. Confidential Thank you. Thank you. @ringcentraldevs developers.ringcentral.com Friday, January 01, 2021 async function call_ringout() { try { var resp = await platform.post('/restapi/v1.0/account/~/ex 'from': { 'phoneNumber': RINGCENTRA 'to': { 'phoneNumber': RECIPIENT }, 'playPrompt': false }) var jsonObj = await resp.json() console.log("Call placed. Call status jsonObj.status.callStatus) } catch (e) { console.log(e.message) } }

Editor's Notes

  1. Hi! My name is Arnaud Budkiewicz I am Senior Director of Engineering at RingCentral, and W3C Member. Along the way, I’ve built 5 different products and platforms based on WebRTC. Today, I am going to talk about my experience delivering an Electron-based desktop application that heavily use WebRTC. <NEXT SLIDE>
  2. People love apps! On MOBILE, an average person has 40 apps installed on his phone. But in most cases, really use 18 of them on daily basis. <NEXT SLIDE>
  3. On Desktop, even if both Apple and Microsoft have their App Store to extend users appetite for apps The behavior is different And Businesses want full control on what their users install on their devices. <NEXT SLIDE>
  4. WebRTC runs in browsers, but what if you want to build a desktop app, out of your web application? 2 options are available PWA as in Progressive Web Applications, a quick and easy way to distribute your existing web app on the stores, and get installed on a PC or a Mac But the most popular one remains Electron <NEXT SLIDE>
  5. You are in good company with Electron Microsoft Visual Studio Code is a reference But for RTC Applications, you will find Slack, Messenger, Whatsapp, Teams, Discord And of course, RingCentral <NEXT SLIDE>
  6. So what is Electron? The “simplest” way to build from a Web App a desktop app for Windows, Mac, and linux. <CLICK> Electron = Chromium (WebRTC) + nodeJS <CLICK> So your Electron App is a function of Electron, the version you pick, your WebApp, and eventually, your Native Modules <CLICK> Your dependency tree is your electron app, as a container for your Web app, coming with your native and electron modules, and a specific version of Chromium and within, WebRTC. <NEXT SLIDE>
  7. What can go wrong with Electron? <NEXT SLIDE>
  8. Your Web App has ONE MORE browser to support: your Electron App In the case of OUR desktop client, it Triggers a different screen sharing implementation, different portion of code, different features This browser is always older than the latest Chrome or Edge, But is not not 100% exactly Chrome And must be integrated and tested with your Native Modules Your Native Modules expose one API to your Web App but have different implementations Windows, Mac and hardware specificities, like GPUs Your Native Modules usually work with only one given major version of Electron So it has to be tested multiple times, as a component, with an integration test app, end-to-end with multiple versions of your Web App <NEXT SLIDE>
  9. Another pain point is the Upgrades. Both your Web App and your Electron Container can be upgraded separately But they have different methods of deployment An app server upgrade for one, the distribution of an IT package for the other. An upgrade of Your Electron App will probably require a restart, to reload the native modules, and expose the new API So there is a solid upgrade experience to build, to not disrupt the user, but guiding him through the upgrade process. <NEXT SLIDE>
  10. Another pain point is the dependency management. When things go wrong, this is a complex onion to debug, and you may need to talk to different open source communities. For Electron you ll need to report on github, and use slack and discord to socialize and discuss it. Abre in mind that the community support only 3 versions. Chromium its own bug tracker, and Electron can cherry pick a few minor releases of the same version of Chromium If you are facing a WebRTC issue, that’s the hardest one, you need to touch all the layers, and discuss with the 3 communities. <NEXT SLIDE>
  11. So it’s very important to understand the entire release cycle. And Chromium has just moved to a release every 4 weeks, so Electron has change its cadence from 12 to 8 weeks now Picking every even number of Chromium. Fortunately, Electron increased the supported Electron versions from 3 to 4, until May’22 (E19) More frequent releases means smaller releases and you will get Chrome fixes and feature quicker. <NEXT SLIDE>
  12. As an exemple, Electron 16 has been released 2 days ago It comes with Chromium 96 And the supported version are 13 to 16 Again, in May 2022, the Electron community will support only 17, 18 and 19. <NEXT SLIDE>
  13. Now, let me give you a real example of bug tracking we experienced. VP8 is an excellent codec for video, but for screen sharing, in the context of business meetings, when people mostly share presentations, and expect the remote participants to see a crisp image, our research proves that H264 provides a better quality than VP8. Among others, this issue was in our way to use H264 for screen sharing. <NEXT SLIDE>
  14. Now, How to identify the release train of the fix in WebRTC, then Chromium, and Electron? First, you need to find the patch submission. Get the commithash from the patch submission, or in the issue tracker if they have been linked together, you will find a comment from bugdroid. <NEXT SLIDE>
  15. Enter the commithash into cdash and voila <NEXT SLIDE>
  16. Sometimes there is a backport in the current stable release, like in this exemple. Just Repeating the same steps will give you the minor release in cdash. <NEXT SLIDE>
  17. Now, where this commit landed in Electron? A quick look at major release notes will tell you which version to look at. In the current example, E11. Then you can find the release notes of all the minor releases of E11. In that case, Electron 11.0.0 already contained the fix we are looking for. Sometimes Electron also cherry-pick some Chromium patches, mostly related to security. <NEXT SLIDE>
  18. Now that you master Webrtc bug tracking in Electron, let’s talk best practices. <NEXT SLIDE>
  19. Test, Test, Test! Test all your upgrades, combinations, your backward compatibility Test your performance, your media quality, during dev, regression, in production Test Electron Beta versions Upgrade as fast as you can on the latest Electron stable version Go with a Custom Electron strategy ONLY if you have the resources, dev and QA <NEXT SLIDE>
  20. Contribute back! You don’t want to maintain your own build for too long, so report issues early, use tools like this very handy bisect python script that let developers find the exact version of Chromium that introduced the bug they are facing. For more information, I recommend this video on WebRTC-Course. <NEXT SLIDE>
  21. Also, contribute by Testing experimental features One example from RingCentral: RED, an IETF RFC that describes an audio packet duplication mechanism to fight against packet loss. Jitsi supported Philipp Hencke’s contribution, we performed Extensive lab testing, and shared our Internal User feedback. RED is now GA in Chrome 96 <NEXT SLIDE>
  22. What if you need to go further, pushed on the cutting edge by users who want more and more AI based features <NEXT SLIDE>
  23. You may consider building your custom Electron like we do. It allows RingCentral to have our own desktop capturer, run native modules as audioworklets, Expose a new API to run native modules to apply video effect and filters in the WebRTC breakout box And finally, create audio dumps to help us investigating audio issues. <NEXT SLIDE>
  24. All these AI-based features come with a very high price on the CPU and Memory footprint, so you may consider a similar solution as Microsoft Teams announced recently, mixing native code with javascript code using a new feature from Windows 10: WebView 2 <NEXT SLIDE>
  25. Under the hood, WebView 2 is an instance of Microsoft Edge, based on Chromium, that has the exact same release cadence. This new approach is interesting, if like us your application is a mix of real-time communication features, and asynchronous communications. You may have an alternative that allows you to have the best for each of these worlds, well, on Windows only for now. <NEXT SLIDE>
  26. I am now ready to answer any question you may have. <NEXT SLIDE>