Skip to content
This repository was archived by the owner on Jul 13, 2024. It is now read-only.
 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

OpenTok-User-Diagnostic

A library for getting a user's network, software, and hardware diagnostics. This library provides the same data used on the TokBox user diagnostic page (http://tokbox.com/user-diagnostic). Using it you will be able to get data like the following:

{
    "cat_software": {
        "flash_version": {
            "Flash Version": {
                "reason": "v11.5",
                "result": "Pass"
            }
        },
        "local_shared_object": {
            "Local Shared Object": {
                "reason": "Can write to local storage",
                "result": "Pass"
            }
        },
        "user_agent": {
            "User Agent": {
                "reason": "Chrome 23",
                "result": "Pass"
            }
        },
        "operating_system": {
            "Operating System": {
                "reason": "Mac OS 10.7.5",
                "result": "Pass"
            }
        }
    },
    "cat_hardware": {
        "camera_count": {
            "count": {
                "reason": "Detected 1 camera",
                "result": "Pass"
            }
        },
        "microphone_count": {
            "Count": {
                "reason": "Detected 2 microphones",
                "result": "Pass"
            }
        }
    },
    "cat_network": {
        "uri_access": {
            "http://static.opentok.com": {
                "reason": "Connected Successfully",
                "result": "Pass"
            },
            "http://hlg.tokbox.com": {
                "reason": "Connected Successfully",
                "result": "Pass"
            },
            "http://api.opentok.com": {
                "reason": "Connected Successfully",
                "result": "Pass"
            }
        },
        "port_access": {
            "1935": {
                "reason": "Connection established",
                "result": "Pass"
            }
        }
    }
}

Installation

Include TB.diagnostic.min.js on your page:

<script type="text/javascript" src="TB.diagnostic.min.js"></script>

Usage

The library exposes one method TB.runTests(callback). Use it like this:

TB.runTests(function(data) {
  // Do something with data...
  alert("finished running the test!")

  console.log(data);
  
  if (data.cat_network.port_access["1935"].result == "Fail") {
    alert("Port 1935 is closed!");
  }
  
  if (data.cat_hardware.camera_count.count.result == "Fail") {
    alert("No webcams were found");
  }
})

The call to TB.runTests can take about 10-20 seconds to run.

About

A library for getting a user's network, software, and hardware diagnostics

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages