Comment by nayuki
1 year ago
Unrelated to the video content, the technical delivery of the video is stunningly good. There is no buffering time, and clicking at random points in time on the seek bar gives me a result in about 100 ms. The minimal UI is extremely fast - and because seek happens onmousedown, oftentimes the video is already ready by the time I do onmouseup on the physical button. This is important to me because I like to skip around videos to skim the content to look for anything interesting.
Meanwhile, YouTube is incredibly sluggish on my computer, with visible incremental rendering of the page UI, and seeking in a video easily takes 500~1000 ms. It's an embarrassment that the leading video platform, belonging to a multi-billion-dollar company, has a worse user experience than a simple video file with only the web browser's built-in UI controls.
I just want to emphasize parent's point: this is a simple video file with web browser controls. And it's an excellent user experience! You don't need youtube hosting! You don't need javascript! Here is all the code necessary:
> You don't need YouTube hosting
It looks like he’s using DigitalOcean’s CDN though. This isn’t an mov file thrown on an Apache vhost. And it’s probably not gone viral.
HTTP range requests [1] are enabled out-of-the-box on both Apache and NGINX for static content. If you slap a fMP4 [2] onto a vhost it will work. No CDN needed.
Going viral is a seperate technical challenge, but probably not needed in almost every use case.
[1]: https://http.dev/range-request
[2]: https://cloudinary.com/glossary/fragmented-mp4
> Unrelated to the video content, the technical delivery of the video is stunningly good.
To save readers a "View Source", this is the typical progressive file download user experience with CDNs that support byte-range requests.
That said, I appreciate thumbnails while scrubbing, and critically need playback speed multipliers. And key controls to skip ten or twenty seconds. Plenty of room for browsers to improve.
> playback speed multipliers
This is a built-in browser feature. For Chrome, it's in the lower right "..." menu. In Firefox, it's in the right-click menu. I use this feature heavily because I can handle most talking at 1.5× to 2.0×.
And if you use browser devtools, you can do custom speeds outside the range [0.25, 2.0]. Assuming that `temp` is the <video> element, simply execute the JavaScript code like: `temp.playbackRate = 3.0;` ( https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/... , https://developer.mozilla.org/en-US/docs/Web/API/HTMLMediaEl... )
I even do this on YouTube (where `temp = $("video")`) to occasionally do 2.5× or 3.0× speed, which are not available in YouTube's official menu.
> key controls to skip ten or twenty seconds
I think the browser default is to skip 5 seconds at a time, so I'd just have to tap the keyboard twice to skip 10 seconds. I know that on YouTube, arrow keys are 5 seconds whereas J/L are 10 seconds, and I use both features. I can live with tapping the keyboard more in exchange for a server that delivers the video with lower latency.
> I use this feature heavily because I can handle most talking at 1.5× to 2.0×
a little of topic, but after years of doing exactly this, I'm having a very hard time handling talking at 1.0x. Normal speed feels like watching in unbearably slow motion.
1 reply →
Out of all of those features, Firefox only seems to lack thumbnails while scrubbing (and those are very expensive to calculate on the fly, which is why Youtube serves up tiny JPEGs when you scroll).
It’s not that surprising that a massive page would have to compromise quality for scalability (to decrease server load and storage) compared to a smaller page with less visitors.
Most of the perceptual latency on YouTube derives from the massive front-end application, not inherent latency in the backend offering adaptive quality codecs for each video.
> It's an embarrassment that the leading video platform, belonging to a multi-billion-dollar company, has a worse user experience than a simple video file with only the web browser's built-in UI controls.
You're surprised because you view Youtube as a video platform. It was that once but now it's an advertising platform that happens to show videos.
Luckily for now you can pay for YT premium. It makes the experience so much better. no checking for ads every-time you skip.
More I-frames.
Not necessarily more, but importantly the cadence is fixed at one GOP per second — a good (and not-unusual) choice for progressive download delivery.