-
Notifications
You must be signed in to change notification settings - Fork 1
/
example.html
80 lines (73 loc) · 3.05 KB
/
example.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
<html>
<head>
<script src="https://code.jquery.com/jquery-3.7.1.slim.min.js" integrity="sha256-kmHvs0B+OpCW5GVHUNjv9rOmY0IvSIRcf7zGUDTDQM8=" crossorigin="anonymous"></script>
<script type="text/javascript" src="/static/js/browsercheck.js"></script>
<script type="text/javascript">
var plivocheck;
$(document).ready(function() {
console.log("Browsercheck in progress ...");
plivocheck = new window.PlivoCheck();
var version = "Browsercheck version " + plivocheck.version();
console.log(version);
var checkWebSocket = plivocheck.checkWebSocket();
var checkFlash = plivocheck.checkFlash();
var getFlashVer = plivocheck.getFlashVer();
var info = plivocheck.checkBrowser();
var browser = 'Browser Version : ' + info[0] + ' ' + info[1];
var checkOS = plivocheck.checkOS();
var checkMic = plivocheck.checkMic();
var checkWebRTC = plivocheck.checkWebRTC();
var checkMediaDevices = plivocheck.checkMediaDevices();
console.log("checkWebSocket: " + checkWebSocket);
console.log("checkFlash: " + checkFlash);
console.log("getFlashVer: " + getFlashVer);
console.log("checkBrowser: " + browser);
console.log("checkOS: " + checkOS);
console.log("checkMic: " + checkMic);
console.log("checkWebRTC: " + checkWebRTC);
$('#browsercheckVersion').text(version);
$('#checkWebSocket').text(checkWebSocket);
$('#checkFlash').text(checkFlash);
$('#getFlashVer').text(getFlashVer);
$('#checkBrowser').text(browser);
$('#checkOS').text(checkOS);
$('#checkMic').text(checkMic);
$('#checkWebRTC').text(checkWebRTC);
$('#checkMediaDevices').text(checkMediaDevices);
plivocheck.listMediaDevices().then((devices) => {
for (var i = 0; i !== devices.length; ++i) {
var device = devices[i];
console.log(device);
if (device.kind == 'audioinput') {
var name = "Microphone: " + device.label;
console.log("Detected device: " + name);
$('#listMediaDevices').append('<li>' + name + '</li>');
} else if (device.kin == 'audioouput') {
var name = "Speaker: " + device.label;
console.log("Detected device: " + name);
$('#listMediaDevices').append('<li>' + name + '</li>');
} else {
console.log("Skipping detected device: " + name);
}
}
})
.catch((error) => {
console.log("Error listing media devices: " + error);
$('#listMediaDevices').append('<li>' + error + '</li>');
});
console.log("Browsercheck completed");
});
</script>
</head>
<body>
<div>version:</div><div id="browsercheckVersion"></div><br/>
<div>checkWebSocket:</div><div id="checkWebSocket"></div><br/>
<div>checkFlash:</div><div id="checkFlash"></div><br/>
<div>getFlashVer:</div><div id="getFlashVer"></div><br/>
<div>checkBrowser:</div><div id="checkBrowser"></div><br/>
<div>checkOS:</div><div id="checkOS"></div><br/>
<div>checkMic:</div><div id="checkMic"></div><br/>
<div>checkWebRTC:</div><div id="checkWebRTC"></div><br/>
<div>checkMediaDevices:</div><div id="checkMediaDevices"></div><br/>
<div>listMediaDevices:</div><div id="listMediaDevices"></div><br/>
</body>