Phoenix integration: WebRTC video component #164
-
Hey all -- really cool project here!
I was wondering if there were any plans to package the client-side setup into a built-in video component and hook. For instance, the Broadcaster app uses this custom hook and I wonder if an ex_webrtc_phoenix could be published that basically packages all that up so that someone could build a basic WebRTC integration while writing essentially no JavaScript.
While I admit to having not dug too deeply into the code, it looks like most of the assumed variables in the hook (like the ICE servers, WHEP endpoint, etc.) could be passed as attributes.
This would have the side-benefit of potentially making the Broadcaster app example a bit slicker as the JS would be abstracted away, and LiveView streams could even be used for the chat instead of channels + DOM mutation 🙂
Beta Was this translation helpful? Give feedback.
All reactions
Replies: 3 comments 7 replies
-
That's a cool idea (we thought of something similar at some point too, albeit its unrelated to the WebRTC implementation itself, so it landed in a drawer) - it might be worth tackling @mickel8
Beta Was this translation helpful? Give feedback.
All reactions
-
😄 1 -
❤️ 1
-
Yeah, I don't think it's something that belongs in ex_webrtc, but an ex_webrtc_phoenix would fit the bill!
Beta Was this translation helpful? Give feedback.
All reactions
-
👍 1
-
That would be awesome! Personally, I would love someone who knows LiveView better to implement this. I can help with explaining WebRTC. If not, I will try to create some PoC :)
Beta Was this translation helpful? Give feedback.
All reactions
-
I unfortunately don't have the bandwidth to commit to that, but if I find some time to play around, I'll drop a note here and share anything I come up with!
Beta Was this translation helpful? Give feedback.
All reactions
-
Sure! Even references or examples that we could take a look at would be helpful. Just to know where to start
Beta Was this translation helpful? Give feedback.
All reactions
-
Very generally, LiveToast is a small, really well-designed library that replaces the default Phoenix Flash system. It's a good example for how to package components and hooks for reuse.
Beta Was this translation helpful? Give feedback.
All reactions
-
Perfect! Thank you, that's all I need :)
Beta Was this translation helpful? Give feedback.
All reactions
-
Hi @zachallaun, JFYI, check out: https://github.com/elixir-webrtc/live_ex_webrtc
Beta Was this translation helpful? Give feedback.
All reactions
-
🎉 1
-
Awesome! I'll give this a try tomorrow!
Beta Was this translation helpful? Give feedback.
All reactions
-
See also this video: https://www.youtube.com/watch?v=jziOb2Edfzk&t=991s
Beta Was this translation helpful? Give feedback.