6 ms·
Show HN: I built a simple web app for streaming videos
- anxiostial 6y agoSo the idea is that you select a file, create a room and then share the URL with anyone you want to join and then the video is streamed to everyone connected. All communication between occupants is peer to peer, the room creator has the video controls and any action is relayed to all peers. I built this thing in my spare time because it seemed like a fun idea to be able to stream a video file between a group of friends and it is very much a first pass, things will be broken, features missing, etc. I do plan on expanding it further when I have more spare time but please do comment with any feedback, roast it if you like.
- samtimalsina 6y agoSounds like a cool idea, wish there was a demo room without uploading a file. Can you talk a little bit about how the video is handled on the server? What steps do you take to keep the file secure and protect the privacy of the users?
- anxiostial 6y agothe server does not actually ever receive any part of the video, it is peer to peer (webrtc).
- anxiostial 6y agoand regarding a public room, just uncheck the private boolean when creating a room, it will then show up for everyone at: https://peer-flix.herokuapp.com/ https://peer-flix.herokuapp.com/. although public rooms are kinda pointless right now because once you close your browser the room is basically dead and is not being cleaned up atm.
- Minor49er 6y agoYou should keep the public rooms up, but show a viewer counter and duration of how long the room has been alive. That way, if someone comes onto the page, they can see if a room has been actively streaming to an audience, which would be less likely to disconnect, versus a room that someone created on a whim that they don't intend on keeping around
- anxiostial 6y agoYea I would like to and maybe I will revisit the idea, but the inappropriate content issue has me concerned, so until I have some kind of solution for that I think its more responsible to disable it.
- Minor49er 6y agoYou'd probably just have to have people create accounts, verify that they aren't bots through email and captcha, then wait for them to achieve a certain amount of cred before allowing them to have a public channel. And include a flagging system, of course. And add moderators. So yeah, not exactly a short list of things!
- iconjack 6y agoThis is a cool idea. I did give it a spin and found that the fidelity between viewers was not all that true. For example, if I pause the video (as the room creator), the video gets paused for other viewers as expected, but not in the same place. In other words, not all viewers are in sync.
- anxiostial 6y agoyea so there is a "drift threshold" of 2 seconds, and my thinking for this is that instead of having the frames jump around many times when we go out of sync it would be preferable to allow for some difference between peers to reduce the number of times we need to sync up.
- TheSmiddy 6y agoDuring pause you can use that time to drag the forward people (including host) back to the oldest guest so people can "manually sync" if they ever choose to.
- ignoramous 6y agohttps://www.comeover.io/ https://www.comeover.io/ is similar I take, but only that it is built on top of webtorrent instead.
- anxiostial 6y agowell so is this haha, yea functionally its basically the same app right now, but like I said though I do want to expand it a lot, this was very much a POC for me.
- ignoramous 6y agoExcited to see what you build. Is there a way to subscribe to your product updates?
- anxiostial 6y agono but maybe I will add a way to subscribe to a mailing list of some sort, might be a good idea, did not really expect this much reception haha.
- crtasm 6y agoOP doesn't embed googlesyndication+googletagmanager, so that's a plus for me.
- anxiostial 6y agoand I never will, promise!
- aero-glide 6y agoVery useful. Better than using screen-sharing in MS Teams (which has really choppy fps)
- m-p-3 6y agoSame in Jitsi Meet. One workaround I found for the video choppiness (at the expense of image quality) is to present the video file as a virtual webcam using OBS Studio. https://github.com/Fenrirthviti/obs-virtual-cam/releases https://github.com/Fenrirthviti/obs-virtual-cam/releases
- soylentcola 6y agoNot sure if this is the case on all platforms, but didn't OBS just add virtual camera in the most recent version (instead of via plugin)? I noticed it the other day after an update, but not sure if it's only on the Windows version.
- m-p-3 6y agoMaybe, if they did that's great!
- FR10 6y agoGood job, it works pretty well. I see you are using WebRTC and WebTorrent, so I assume that this scales well, do you have any stats you can share?
- anxiostial 6y agoI deployed it a few hours ago so sorry no haha but yea it is almost entirely peer to peer so it should. I don't really have any kind of analytics in place anyways.
- ShamelessC 6y agoWhat's your experience been like with WebRTC? I've been playing games and watching shows with Jitsi and Discord with friends. The lower latency is fantastic. I've been looking for a self hosted (or p2p) solution for streaming to a large audience e.g. Twitch but with WebRTC instead of HLS/DASH/rtmp. Are you aware of anything like that?
- dugvuivnhuihnvu 6y agoYour Question: > I've been looking for a self hosted (or p2p) solution for streaming to a large audience e.g. Twitch but with WebRTC instead of HLS/DASH/rtmp. Are you aware of anything like that? My Answer: You have PeerTube, which you can self-host. > PeerTube is software that you install on a web server. It allows you to create a video hosting website, so you can create your "homemade YouTube". The difference to YouTube is that it's not intended to create a huge platform centralizing videos from the whole world on a single server farm (which is horribly expensive). On the contrary, PeerTube's concept is to create a network of multiple small interconnected video hosting providers. - From PeerTube's FAQ(verbatim except for a few minor grammar errors) > PeerTube has 3 main adventages: 1) An open code (transparency) under a free/libre license (ethic, respect and community-driven development); 2) A federation of interconnected hosting providers (so more video choices wherever you go to see them); 3) Peer-to-peer broadcasting – and therefore viewing – (so no slowing down when a video becomes viral). - From PeerTube's FAQ: What are the main advantages of PeerTube? On the specifics of the live streaming features, albeit vague: https://joinpeertube.org/roadmap https://joinpeertube.org/roadmap Apparently Framasoft(the organization behind PeerTube) is planning to implement the live streaming feature once they hit $60,000 USD in funding. However, keep in mind that this is a new feature that hasn't come out yet, and if and when it comes out the first time, it will be a work-in-progress. They are currently below funding goals for step 4 of the roadmap, aka the live streaming feature. Donations may or may not be tax deductible, depending on the jurisdiction in which you live. What is PeerTube: > PeerTube is software that you install on a web server. It allows you to create a video hosting website, so you can create your "homemade YouTube". The difference to YouTube is that it's not intended to create a huge platform centralizing videos from the whole world on a single server farm (which is horribly expensive). On the contrary, PeerTube's concept is to create a network of multiple small interconnected video hosting providers. - From PeerTube's FAQ(verbatim except for a few minor grammar errors) A more descriptive explanation of PeerTube here: https://en.wikipedia.org/wiki/PeerTube https://en.wikipedia.org/wiki/PeerTube FAQ: https://joinpeertube.org/faq https://joinpeertube.org/faq Documentation: https://docs.joinpeertube.org/ https://docs.joinpeertube.org/ ____________ Framasoft is the parent organization of Peertube. It maintains the source code for PeerTube and several other projects. It's also based in France(important if you want to send tax-deductible donations to Framasoft). Website on the parent organization: https://framasoft.org/en/association/ https://framasoft.org/en/association/ > The Framasoft association is a 1901 not-for-profit association whose character of general interest authorizes a tax deduction. Which shows its willingness to stay an association on a human scale (less than forty members, less than ten permanent staff) ___________ Sorry for the crappy formatting, I wasn't sure how to format the information optimally.
- cvhashim 6y agoI love the idea. I have a ton of questions. How would you prevent someone from sharing explicit, harmful or illegal content? Or is this an “anything goes” sort of platform? Is there chat functionality with room participants? Also I wonder if a similar sort of platform exists for Live events/Sports? Sort of like watching a live sporting event (NBA, champions league) with friends in a chat room?
- anxiostial 6y agoThere is nothing preventing bad content atm, and I may look into this, but with it being largely client side (peer to peer) I have a feeling that will be tricky and obviously anyone knowing what they are doing could get around the safeguards. There is no chat functionality but yea that is very high on my list of todos. Not sure, I have never come across anything like that but I feel like its something people would like, especially considering most people have been locked in doors more often than usual lately.
- summitsummit 6y agois this uses torrents, does that mean there's a possibility i might get a notice for uploading illegal content if i watch like a marvel movie i uploaded with just a couple of my friends?
- anxiostial 6y agoits pretty unlikely since these aren't public torrents, but either way please don't do that.
- amelius 6y ago> but either way please don't do that. And would it be ok if I had bought the DVD?
- bootcampwhere 6y agoNo you idiot, that's not how any of this works.
- WrtCdEvrydy 6y agoYeah, this is fancy.
- anxiostial 6y agothanks.
- adictator 6y agoIf you could not use WebTorrent, how would you have built this?
- anxiostial 6y agoIt would have certainly been a lot of work to do that custom, but I would have used webrtc for that as well. I certainly would not have implemented a torrent client myself, which is something that is nice to have as a library, because adding support for creating a room with a magnet uri instead of a local file would be trivial now.
- sebmellen 6y agoDo you have a lot of experience working with WebRTC/WebTorrents? I would appreciate if you'd reach out via my company email (listed in my profile). I can't find any contact information for you on your page.
- deleted 6y ago[deleted]
- valboa 6y agoThis! I think we are needing something similar to podcasts for video, that will remove the incumbent players (youtube) from being the sole owners of the video content and instead they are one of many distributors.
- holler 6y agocurious what you mean by that? can’t you already either use existing video or download your videos? what about IG, tiktok, etc? feels like short-form video is pretty ubiquitous these days
- pawsed 6y agoThis is pretty fancy, I looked around and it's straight forward too. Do you think you'll explore the idea of sync viewing and chats so on so forth?
- anxiostial 6y agoThanks, so what do you mean by sync viewing? right now everyone is synced to the room creator, which is the only user with controls, and obviously it is super simple / restricted but works for a POC. Yes, very much, chat is probably the next big feature I would tackle.
- sufyanadam 6y agoThis is great. Nice work! I built something really similar about 3 years ago, a few months before my 4th child was born. Then I lost interest lol. Super barebones POC https://justwatchwith.me/ https://justwatchwith.me/ The idea was that you could stream videos directly from your machine and watch in sync with remote friends and family, controlling the playback with a pause button. I didn't maintain it for a while after I built the POC because not many of my friends / family were very interested at the time. If I only had more time to improve it..... they probably would've appreciated it more under current circumstances if I continued to work on it lol
- anxiostial 6y agocool, and yea I am not sure if people would want something like this at all, it just seemed like a fun idea to me.
- arxv33 6y agoCan you detail the technology stack a little more? Like how you are using webrtc and webtorrent?
- codethief 6y agoHmm videos don't seem to be working in Firefox. The loading animation with the blue bricks goes on and on and on… The only thing I see on the JS console is "asm.js type error: initializer of exported object literal must be name of function" but I suppose this is not it?
- anxiostial 6y agoyea so I should have clarified, when a room creator closes the tab, the room is basically dead, anyone who enters will never connect or see anything. This basically makes public rooms completely useless so I may remove them for now (possibly forever).
- NiceWayToDoIT 6y agoI tried joining this one https://peer-flix.herokuapp.com/3ef2c597-f30b-49ac-bdcc-bac742f8f2f2/ https://peer-flix.herokuapp.com/3ef2c597-f30b-49ac-bdcc-bac7... but nothing is happening just 2 blue boxes spinning ?
- anxiostial 6y ago[copied from another answer] yea so I should have clarified, when a room creator closes the tab, the room is basically dead, anyone who enters will never connect or see anything. This basically makes public rooms completely useless so I may remove them for now (possibly forever).
- nixgeek 6y agoRan into no support for mobile devices? Out of interest, what’s the technical challenge governing what seems to be an allowlist of screen resolutions you support? “Apologies, unfortunately this application does not support your screen resolution (yet).“
- anxiostial 6y agoI believe it is largely time related, I did not want a broken UI and prefer adaptive UIs, I will look into adding mobile support at some point.
- deleted 6y ago[deleted]
- ghostbrainalpha 6y agoHow long after sharing this with hacker news did it take for one of us to name their public room "penis"?
- anxiostial 6y agoit was within the first hour
- solrflow 6y agoOpen source?
- anxiostial 6y agono but probably will be, mostly not making it public right now because it isn't a pretty project to look at atm.