Created
May 9, 2014 01:33
-
-
Save karlcow/3b4c3d0f1ac6e296332a to your computer and use it in GitHub Desktop.
and everything else which is not… something in this category, go to hell ;)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| deviceCanPlayFlash: function(){ | |
| //TODO - for now, return false for IPhone and IPad | |
| try | |
| { | |
| if( | |
| (navigator.userAgent.match(/iPhone/i)) | |
| || (navigator.userAgent.match(/iPod/i)) | |
| || (navigator.userAgent.match(/iPad/i)) | |
| || (navigator.userAgent.match(/android/i)) | |
| || (navigator.userAgent.match(/Windows Phone/i)) | |
| ) | |
| { | |
| return false; | |
| } | |
| // Assume "Linux x86_64" is a desktop request site from Android device, try to detect instead | |
| else if (navigator.userAgent.match(/Linux x86_64/i)) | |
| { | |
| if("ActiveXObject" in window) { | |
| try{ | |
| return !!(new ActiveXObject("ShockwaveFlash.ShockwaveFlash")); | |
| } catch(e) { | |
| return false; | |
| } | |
| } else { | |
| try{ | |
| return !!navigator.mimeTypes['application/x-shockwave-flash']; | |
| } catch(e) { | |
| return false; | |
| } | |
| } | |
| return false; | |
| } | |
| } | |
| catch(e){} | |
| return true; | |
| }, | |
| deviceCanPlayMP4: function(){ | |
| //TODO - for now return true | |
| return true; | |
| }, |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment