How to detect the systems with no support for the WebPlayer in order to redirect them to other url?
Just wondering if the rough rule I am currenlly using:
screen.width + screen.height <= 1400
is good enough?
1 Answer
1Siema ![]()
I guess the best option is to reuse the code from official Unity Web Player page. The code looks like this:
<script type="text/javascript">
function onVersionDetected(status, version) {
var versionText = 'not installed';
switch(status) {
case "unsupported":
versionText = 'unsupported browser';
break;
case "installed":
versionText = version.plugin;
break;
}
$("#UnityVersionString").html("<div class='left mr10'>Unity Plugin version:</div><div class='left bd cw'> " + versionText + " </div>");
return;
}
function pollUnityVersion(){
var u = new UnityObject2({
enableGoogleAnalytics: false
});
u.detectUnity(onVersionDetected, true);
}
</script>
You just have to call pollUnityVersion and change code of onVersionDetected function to do what you want, based on status. Quickly scanning through UnityObject2.js source (this script has to be included in your page), there are 4 statuses available: installed, missing, broken and unsupported.
Fantastic. That's exactly what I need. I found further helpful and detailed hints here: http://docs.unity3d.com/Documentation/Manual/WorkingwithUnityObject.html
– tomekkie2