1
0
mirror of https://github.com/videojs/video.js.git synced 2025-01-02 06:32:07 +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

@ -6,6 +6,7 @@ CHANGELOG
* @misteroneill added ghooks to run linter on git push ([view](https://github.com/videojs/video.js/pull/3459))
* @BrandonOCasey removed unused base-styles.js file ([view](https://github.com/videojs/video.js/pull/3486))
* @erikyuzwa, @gkatsev updated CSS build to inlcude the IE8-specific CSS from a separate file instead of it being inside of sass ([view](https://github.com/videojs/video.js/pull/3380)) ([view2](https://github.com/erikyuzwa/video.js/pull/1))
* @gkatsev added null checks around navigator.userAgent ([view](https://github.com/videojs/video.js/pull/3502))
--------------------

View File

@ -574,7 +574,7 @@ class Html5 extends Tech {
*/
supportsFullScreen() {
if (typeof this.el_.webkitEnterFullScreen === 'function') {
const userAgent = window.navigator.userAgent;
const userAgent = window.navigator && window.navigator.userAgent || "";
// Seems to be broken in Chromium/Chrome && Safari in Leopard
if ((/Android/).test(userAgent) || !(/Chrome|Mac OS X 10.5/).test(userAgent)) {

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);