top | item 10878458

(no title)

timothya | 10 years ago

> The poor way in which YouTube does feature detection (via user agent string) is almost as appalling.

If you could provide a better alternative, I'm sure they'd be all ears.

discuss

order

BinaryIdiot|10 years ago

I'd have to look at the code but you can detect just about anything within the browser; do the check once regarding what features you want to use, store and do that. User agent string parsing is a hack that's typically easier to do hence why so many still rely on it.

Having said that I don't think they'd be all ears; their code isn't opened source and while I could try to debug through their minified code that hardly seems worth it for me to do.

taspeotis|10 years 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.

pas|10 years ago

Put there a little button that lets the user select the format/resolution/implementation.

jrowley|10 years ago

What percentage of YouTube users could define the word "format"?

BinaryIdiot|10 years ago

The less options you give the user up front the better; I don't think this would be a better option (though allowing advanced users to select this may not be the worst thing).