A WebRTC data channel establishment with QR codes used for signaling channel.
npx https-localhost
npx serve .
to find it)On iOS, the Camera app is capable of scanning QR codes by default and you can
also pin a control to the Control Centre called Scan QR Code which opens it.
On Android, the Camera app scans QR codes if the Google Lens Suggestion option
is enabled in the Camera app settings.
Even though I am able to successfully establish the connection.
On top of the data channel peer connection. Send only diffs instead of the full
data with each change and on the other end patch the existing content with the
change. Also probably add version number and ensure the current messags one is
one larger than the last one so we didn’t miss messages. If it is the same we
have a conflict and need to present resolution UI.
In the codes so that they are easier to scan on both ends.
In case of connecting two laptops/phones or not having a QR scanner on the phone. This will
just need to add another bit of data to the code - if it is another offer or an
answer and based on it switch the flows. (Because by default both would show an
offer and the one which notices each other first should display an answer for
the other to then notice.)
(maybe using a service worker? maybe there is a JS API for this?) and/or how to
reconnect a peer connection that got interrupted by the lock (can reuse the same
SDP?).