-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' of git@github.com:away3d/gloop-a-hoop.git
Conflicts: development/flash/lib-swc/preload.swf
- Loading branch information
Showing
6 changed files
with
84 additions
and
5 deletions.
There are no files selected for viewing
Binary file not shown.
Binary file not shown.
This file contains 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
This file contains 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
This file contains 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
41 changes: 41 additions & 0 deletions
41
development/flash/src/com/away3d/gloop/utils/PlatformUtil.as
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
package com.away3d.gloop.utils | ||
{ | ||
import flash.external.ExternalInterface; | ||
import flash.system.Capabilities; | ||
|
||
public class PlatformUtil | ||
{ | ||
public static function isRunningOnMobile():Boolean { | ||
var playerType:String = Capabilities.playerType; | ||
return playerType != "DirectX" && playerType != "PlugIn"; | ||
} | ||
|
||
public static function isRunningOnSafari():Boolean { | ||
var browser:String = checkBrowser(); | ||
return browser == "Safari"; | ||
} | ||
|
||
public static function checkBrowser():String { | ||
var browser:String; | ||
var strUserAgent:String = String( ExternalInterface.call( "function() {return navigator.userAgent;}" ) ).toLowerCase(); | ||
if( strUserAgent.indexOf( "firefox" ) != -1 ) { | ||
browser = "Firefox"; | ||
} | ||
else if( strUserAgent.indexOf( "msie" ) != -1 ) { | ||
browser = "Internet Explorer"; | ||
} | ||
else if( strUserAgent.indexOf( "safari" ) != -1 ) { | ||
browser = "Safari"; | ||
} | ||
else if( strUserAgent.indexOf( "chrome" ) != -1 ) { | ||
browser = "Google Chrome"; | ||
} | ||
else if( strUserAgent.indexOf( "opera" ) != -1 ) { | ||
browser = "Opera"; | ||
} else { | ||
browser = "none"; | ||
} | ||
return browser | ||
} | ||
} | ||
} |