Capabilities API - Know more about your users
Created By Abdul - 0 Comments Published by Monday, October 22, 2007 at 9:03 AM .Often, we develop applications which need to know about client-machine's capabilities in order to provide optimal experience. For example, we might need to know following in different scenarios:-
- What is client's screen-resolution?
- What is client's Operating-System (OS)?
- What is Adobe Flash runtime (Flash Player or AIR) version?
- What is system-language (English or German etc) of the machine?
- What is player type (Standalone or browser-plugin)?
- Does client have audio/video support?
- Does client support accessibility aids (screen-readers etc)?
- Does client support SSL/TLS transport?
- Is client allowed to use Microphone/Webcam (in restricted/administrated environments - corporates/institutes etc)?
Adobe Flash runtimes (Flash Player and AIR) provide Capabilities API to know all these (above and more) about client-machine. You can use various static properties to determine various capabilities of client machine.
For example:-
//To know horizontal-screen-resolution
var screenResolutionX:Number = Capabilities.screenResolutionX;
//To know vertical screen-resolution
var screenResolutionY:Number = Capabilities.screenResolutionY;
//To know operating-system - returns "Window", "Linux" or "MacOS".
//Wherecould be different versions (2000 or XP etc) of MS-Windows.
var operatingSystem:String = Capabilities.os;
Check out the Capabilities API to learn all about it.
Labels: api, capabilities