|
|
|
|
|
by taspeotis
3810 days ago
|
|
Devil's advocate: Detecting the features available in the browser is potentially two requests: the server sends HTML/JS to the client, the client makes a decision, and then requests more data that's compatible with its feature set. If the server can do feature detection by user agent sniffing, it's potentially one request. The client has to do this for every browser session, too, since browsers are frequently upgraded and the features change week-to-week. |
|
That's not really true though. The code that's going to load the video will be downloaded and then the code will request the video. So those two requests happen no matter what. Cache the feature detection so it's slightly faster after the first time.
> The client has to do this for every browser session, too, since browsers are frequently upgraded and the features change week-to-week.
Browsers are unlikely to lose the ability to use whatever codec you think is best so I think this is a safe assumption. Bonus points if you can detect its failure and re-run the feature detection in case something odd like that would happen.