Skip to content

Commit

Permalink
@misteroneill fixed iphone useragent detection. closes #3077
Browse files Browse the repository at this point in the history
  • Loading branch information
misteroneill authored and gkatsev committed Feb 4, 2016
1 parent 5245335 commit 341c9c7
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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))

--------------------

Expand Down
6 changes: 5 additions & 1 deletion src/js/utils/browser.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down

0 comments on commit 341c9c7

Please sign in to comment.