1
0
mirror of https://github.com/videojs/video.js.git synced 2025-07-15 01:34:23 +02:00

@gkatsev added null checks around navigator.userAgent. closes #3502

This commit is contained in:
Gary Katsevman
2016-08-05 14:38:42 -04:00
parent 1ff9f381a2
commit f947ed7791
3 changed files with 4 additions and 2 deletions

View File

@ -4,7 +4,7 @@
import document from 'global/document';
import window from 'global/window';
const USER_AGENT = window.navigator.userAgent;
const USER_AGENT = window.navigator && window.navigator.userAgent || "";
const webkitVersionMap = (/AppleWebKit\/([\d.]+)/i).exec(USER_AGENT);
const appleWebkitVersion = webkitVersionMap ? parseFloat(webkitVersionMap.pop()) : null;
@ -30,6 +30,7 @@ export const IOS_VERSION = (function() {
if (match && match[1]) {
return match[1];
}
return null;
}());
export const IS_ANDROID = (/Android/i).test(USER_AGENT);