Environment Detector
Realeyesit.EnvironmentDetector API
Realeyesit.EnvironmentDetector
namespace exposes one method detect()
. This method returns a Promise
object that resolves with EnvironmentDetectionResult object.
This is the type definition for the EnvironmentDetectionResult:
/**
* @typedef {{
* browser: {
* name: string,
* version: string,
* },
* platform: {
* type: string,
* },
* os: {
* name: string,
* version: string,
* },
* flash: ?{
* version: string,
* },
* webcams: Array.<string>,
* capabilities: Array.<string>,
* }} EnvironmentDetectionResult
*/
- browser.name is a string like "Chrome" or "Firefox"
- browser.version is a version string like "53.0"
- platform.type is one of "tablet", "mobile" or "desktop"
- os.name is a string like "windows" or "macos"
- os.version is a version string like "10.11"
- flash.version is a version string "<major>.<minor>.<patch>.<build>" format
- webcams is an array of strings, for example ["USB Camera", "iSight"]
- capabilities is an array of strings
Here is the list of capabilities we can detect:
{
FLASH: 'flash',
GET_USER_MEDIA: 'navigator.getUserMedia',
MEDIA_RECORDER: 'MediaRecorder',
WEBCAM: 'webcam',
DOCUMENT_ALL: 'document.all',
DOCUMENT_QUERY_SELECTOR: 'document.querySelector',
HTTP: 'http',
HTTPS: 'https',
}
detect()
can receive an optional options
object with the following type definition:
/**
* @typedef {{
* flash: {
* path: string,
* testTimeout: number,
* containerId: string,
* minFlashVersion: string,
* }
* }} EnvironmentDetectionOptions
*/
Example usage
Realeyesit.EnvironmentDetector.detect()
.then(function (result) {
});
License
Copyright 2016 Realeyes OU.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.