3 ms·
I host very small videos (screen captures of a CLI output, for example, and yes, I know ASCII cinema exists) on some of my web sites, and never had any major is
by Ayesh 4y ago
I host very small videos (screen captures of a CLI output, for example, and yes, I know ASCII cinema exists) on some of my web sites, and never had any major issues with them. I manually encode the video into webm and av1, and then serve the files via a CDN. I did not want to get into the complexity of serving adaptive and different bit-rates because the videos were just small ones. Handbrake can do a good job.
I'd just go with a video tag, containing the webm/av1/mp4 URLs, a poster image, and optionally subtitle tracks.
The first and most important thing is that you need to make sure your web server can serve ranged requests. Most web servers that serve static content should do fine, such as Apache and Nginx. If you have your own web server, make sure they respect Range headers and respond with the requested chunks. Most CDNs do, but servers provided by runtimes don't, such as the PHP built-in server. This is important for the browser to properly preload and seek videos embed.
I find third party video players unnecessary and added bloat. Several years ago, sure, that was when we had to fiddle with Flash players and all browser compatibility shenanigans. A standard HTML5 video player works great, it even hooks into Android media controls, bluetooth play/pause buttons, and picture-in-picture. Though I have not tried, none of the custom players can properly add subtitles/closed-captions to videos and make them work in Picture-in-Picture, apart from the standardized CC tracks. IIRC, Firefox had to bend over backwards and add custom workarounds to get Netflix CC to work in PiP. If it comes to that you need to use a custom player for consistency, I can highly vouch for Media Element JS.
- dylan604 4y ago>If you have your own web server, make sure they respect Range headers and respond with the requested chunks. This is a pro on the HLS/DASH type of content. Even if the server doesn't respect ranges, this is still covered by the segment based encoding of HLS/DASH. Instead of asking the server to give a specified portion of a file, the playlists just requests a specific segment.