From 341c9c7700db5d6348abf6ad06ddeb53bd24bd7c Mon Sep 17 00:00:00 2001 From: "Pat O'Neill" Date: Thu, 4 Feb 2016 12:32:33 -0500 Subject: [PATCH] @misteroneill fixed iphone useragent detection. closes #3077 --- CHANGELOG.md | 1 + src/js/utils/browser.js | 6 +++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 867f3f5673..726431f246 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,7 @@ CHANGELOG * @mister-ben updated Umuted to Unmute in lang files ([view](https://github.com/videojs/video.js/pull/3053)) * @hartman updated fullscreen and time controls for more consistent widths ([view](https://github.com/videojs/video.js/pull/2893)) * @hartman Set a min-width for the progress slider of 4em ([view](https://github.com/videojs/video.js/pull/2902)) +* @misteroneill fixed iphone useragent detection ([view](https://github.com/videojs/video.js/pull/3077)) -------------------- diff --git a/src/js/utils/browser.js b/src/js/utils/browser.js index 545776191c..72145c157c 100644 --- a/src/js/utils/browser.js +++ b/src/js/utils/browser.js @@ -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;