5 ms·
Great question, it's actually not quite that simple. HTML5 was indeed supposed to bring trivial video to the browser, and it almost did. If you want a good vid
by GeneticGenesis 6y ago
Great question, it's actually not quite that simple. HTML5 was indeed supposed to bring trivial video to the browser, and it almost did.
If you want a good video streaming experience for all your viewers, you need something called Adaptive Bitrate (ABR). Some protocols that you may have heard of the implement ABR include HTTP Live Streaming (HLS) and MPEG Dynamic Adaptive streaming over HTTP (DASH).
ABR allows the stream to adapt to the bandwidth capabilities of the viewer. If you don't do this, some users will experience buffering, and some will have to sacrifice on quality.
Unfortunately most browsers don't support an ABR format natively, so you need to use Media Source Extensions, and a more complex player to support these protocols in a browser.
- pas 6y agoWhat's wrong with buffering? Just let the client download it in full, provide a progress bar, and then allow it to watch/enjoy. Obviously it's not going to be YouTube/Netflix-level anyhow.
- black_puppydog 6y agoWell, people do expect YT/NF level. And sadly we've trained everyone to expect that everything starts playing instantly. So if your income depends on people not rage-quitting your page, you'll have to provide something that satisfies their "needs", or more appropriately "desires".
- pas 6y agoI'm not saying people shouldn't do more for user experience, but the cost-benefit seems to be bimodal. Do the minimum, or pay YT/NF/Vimeo (or CF or AWS Streaming, or get ready to bankroll your own).
- chrisandchris 6y agoSo you would like to watch that 30min 4K video on slow 2G, which then will (probably) download for 3000 hours before you can watch... Or you will just get a lower resolution and you can start watching in an instant.
- aembleton 6y agoDoes Youtube work over 2G?
- chrisandchris 6y agoWork... Yes, you can watch a video fluently, but it takes (on Desktop, Firefox, with Throttling on "Good 2G") maybe ~2min to load the video page. However, you can start watching the video before the full page is even loaded.
- Santosh83 6y agoIt is by no means a clean or modern solution (I agree, go with Youtube etc or provide a transcoding js player), but about a couple decades ago many sites would simply link to several resolutions of a video, allowing the user to play either a low, medium or high res version as per their current data connection. So that is one option that sidesteps adaptive bitrate players as well as a large CDN.
- emilfihlman 6y agoSo you'd much rather watch absolute shit for 30minutes? Yeah that's a hard no.
- chrisandchris 6y agoI agree with you - partly. It's either "watch nothing" or "watch not in 4K". Not everybody in this world has such a good internet connection. There are still enough people that would be happy to even have internet...
- ogre_codes 6y agoAs has been pointed out above, having some kinds of video downrated to be streamable on 2G isn't much different from not having the content at all. While 4K is rarely required, pushing out coding tutorials at any resolution below 1080p is nearly worthless, and pushing it out at 480p is worthless (Unless it's a retro C64 BASIC tutorial in which case rock on).
- ElFitz 6y agoWell, I don't know about you, but sometimes I'm on a 3G network. Yes, I could wait to get home. But some people also have really terribly bad providers offering them very little bandwidth. So, by doing this, you make sure your content can reach more people. Which, to me, seems to be the whole point of making and putting it online in the first place
- pas 6y agoOf course, but there are instances of the opposite. I encounter both from time to time. For example I want to show someone a video while having a drink, usually it doesn't have to be crisp 4K 60fps, just play the god damn thing before we lose interest. Other times I want to watch a video, I'm in the middle of nowhere anyway, I have time and data in the monthly cap, just not enough bandwidth. User choice and smart defaults would go a long way.
- coffeefirst 6y agoYou can probably implement a dumb version of this where transcode a few different versions with ffmpeg (which is amazing, but takes some tinkering), use browser API's to guess the right one as a default, and give the user control if they'd like to switch. I'd still try HLS but this may be good enough for v1, depending on what you're building.