videojs / video.js

Video.js - open source HTML5 video player
https://videojs.com
Other
38.05k stars 7.45k forks source link

Add an "Unsupported Browser" modal dialog for unsupported browsers #2045

Open tinwatchman opened 9 years ago

tinwatchman commented 9 years ago

So here's a fun one for you... so you know how you guys are parsing the user agent string to determine whether or not a browser is IE8? The problem is that -- on _INTRA_net sites, as in on an internal network -- IE8 by default goes into Compatibility Mode. Which means its user string actually looks like this:

ie8compatmodeuseragent

Meaning the user string check fails -- meaning the code generates a whole bunch of errors afterwards, since the script doesn't know it's running in IE8. I would suggest either relying on feature detection for this, or otherwise (for a quick fix) update line 408 (or thereabouts) in lib.js from this:

var IS_IE8 = (/MSIE\s8\.0/).test(USER_AGENT);

to this:

var IS_IE8 = (/MSIE\s(7|8)\.0/).test(USER_AGENT);

If only to spare some poor idiot out there the same path I've been dealing with all afternoon here.

heff commented 9 years ago

That's interesting. I'm pretty positive we don't support compatibility mode, so we should probably detect this case specifically and show an error.

Sent from mobile

EZWrighter commented 9 years ago

I would agree with Tinwatchman, that the detection should at least be sane. I have used the Tim Downs answer from stackoverflow and I think it's pretty bulletproof: http://stackoverflow.com/questions/10964966/detect-ie-version-prior-to-v9-in-javascript

gkatsev commented 8 years ago

Would anyone want to a PR for "Unsupported Browser" Modal dialog for vjs 5?

gkatsev commented 8 years ago

Updating the title to "Unsupported Browser" modal.