jeremyckahn / chitchatter

Secure peer-to-peer chat that is serverless, decentralized, and ephemeral
https://chitchatter.im/
GNU General Public License v2.0
1.58k stars 208 forks source link

[feature] Allow a video file source not just camera. #287

Open Zibri opened 6 months ago

Zibri commented 6 months ago

Instead of file sharing (which does not work well),

Put another icon at the top, next to the webcam icon... clicking the icon will let the user select a file (webm).

To do that you can use captureStream().

See here: https://webrtc.github.io/samples/src/content/capture/video-video/

In short:

const srcVideo = document.getElementById('srcVideo'); srcStream = srcVideo.captureStream()

also, I don't know if you are already using it, but webrtc can be used to send video ONE to many: https://muazkhan.com:9001/demos/Scalable-Broadcast.html

which would be the best both for webcam both for video files :D

jeremyckahn commented 6 months ago

Hi @Zibri, this could be an interesting addition to Chitchatter. I don't think I'll have the time to implement this myself, but I'm open to accepting a Pull Request that implements it.

I'm noticing that https://webrtc.github.io/samples/src/content/capture/video-video/ doesn't work in Firefox (though it does work in Chromium). If Chitchatter is going to support this kind of functionality, it will need to work in all browsers.