-
-
Notifications
You must be signed in to change notification settings - Fork 18
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
WebRTC Transport Layer #4
Comments
Digging into this, it seems like |
Copying this from @ErnWong since its important: (1) pass in an existing webrtc connection (created using wasm_bindgen/web_sys), or I like (1) as well, because it seems silly to write our own layer of indirection that just forwards to the actual WebRTC interface. (1) gives more control, probably there's quite a lot of flexibility on what the signalling server is, so you could even just use email as your signalling server for testing purposes. On your end, you'd create a new webrtc connection, get it to generate an "offer" that contains some "ICE candidates" (the information needed to establish a connection), email this offer to your friend, get your friend to email you back the "answer" that contains their "ICE candidates", and then if things are successful, you'd be connected You might want to look at RtcDataChannel (https://rustwasm.github.io/wasm-bindgen/api/web_sys/struct.RtcDataChannel.html), and find a way to create a bevy_transport::Peer out of the data channel. The send_with_u8_array and set_onmessage functions would be useful. (https://rustwasm.github.io/wasm-bindgen/api/web_sys/struct.RtcDataChannel.html#method.set_onmessage) |
Note: Ernest was mistaken when he said that we should convert it into a bevy_transport::Peer. In actuality, we want to convert it into the backroll_transport Peer data type. |
if you wonder about signaling method to establish webrtc p2p connection, I can say that one of good choices (in my opinion) is using RealtimeDB from Firebase (or some similar service). On public service like firebase two peers exchange negotiation informations and then can establist p2p connection directly. In my case it's work very well. I use webrtc-rs im my robotic project and I can establish connection over the public internet in that way. I use datachannels and videostreams to controll robot using camera stream video in realtime |
Adding this here just for posterity, since I already know that this is in the plans. This would be pretty easy to test though, since bevy and other rust game frameworks already support the web, with a few being web-only in fact. Having a game with rollback on the web besides Tough Love Arena would be really cool.
The text was updated successfully, but these errors were encountered: