Flash - displaying alternative content on ios...
Flash - displaying alternative content on ios...
Out of context: Reply #5
- Started
- Last post
- 10 Responses
- monolith0
You can always sniff it like this:
by using userAgent (not really best way):
var is_iOS = ( navigator.userAgent.match(/(iPad... ? true : false );
or you can do it like this (better way):
var is_iOS = false,
_platform = navigator.platform;if( _platform === 'iPad' || _platform === 'iPhone' || _platform === 'iPod' ){
is_iOS = true;
// redirect or call non-flash stuff here
}and you can check for version like this:
var iOSversion = false,
_window = window,
_platform = navigator.platform;if( _platform === 'iPad' || _platform === 'iPhone' || _platform === 'iPod' ){
!!_window.history && !!_window.history.pushState ? iOSversion = '4+' : iOSversion = '4-';
!!_window.matchMedia ? iOSversion = '5+' : '';
}