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

@misteroneill fixed iphone useragent detection. closes #3077

This commit is contained in:
Pat O'Neill
2016-02-04 12:32:33 -05:00
committed by Gary Katsevman
parent 5245335147
commit 341c9c7700
2 changed files with 6 additions and 1 deletions

View File

@ -15,8 +15,12 @@ const appleWebkitVersion = webkitVersionMap ? parseFloat(webkitVersionMap.pop())
* @constant
* @private
*/
export const IS_IPHONE = (/iPhone/i).test(USER_AGENT);
export const IS_IPAD = (/iPad/i).test(USER_AGENT);
// The Facebook app's UIWebView identifies as both an iPhone and iPad, so
// to identify iPhones, we need to exclude iPads.
// http://artsy.github.io/blog/2012/10/18/the-perils-of-ios-user-agent-sniffing/
export const IS_IPHONE = (/iPhone/i).test(USER_AGENT) && !IS_IPAD;
export const IS_IPOD = (/iPod/i).test(USER_AGENT);
export const IS_IOS = IS_IPHONE || IS_IPAD || IS_IPOD;