@flashphoner/websdk 2.0.225 → 2.0.226
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/docTemplate/README.md
CHANGED
|
@@ -6,6 +6,8 @@ var remoteVideo;
|
|
|
6
6
|
var extensionId = "nlbaajplpmleofphigmgaifhoikjmbkg";
|
|
7
7
|
var extensionNotInstalled;
|
|
8
8
|
|
|
9
|
+
var askExtension = getUrlParam("askExtension") || false;
|
|
10
|
+
|
|
9
11
|
function init_page() {
|
|
10
12
|
//init api
|
|
11
13
|
try {
|
|
@@ -29,20 +31,22 @@ function init_page() {
|
|
|
29
31
|
|
|
30
32
|
} else if (Browser.isChrome() && !Browser.isAndroid() && !Browser.isiOS()) {
|
|
31
33
|
interval = setInterval(function() {
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
} else {
|
|
41
|
-
$("#extension").hide();
|
|
34
|
+
try {
|
|
35
|
+
chrome.runtime.sendMessage(extensionId, {type: "isInstalled"}, function (response) {
|
|
36
|
+
if (chrome.runtime.lastError) { //WCS-2369 - catch runtime.lastError
|
|
37
|
+
onExtensionNotFound();
|
|
38
|
+
} else {
|
|
39
|
+
$("#extension").hide();
|
|
40
|
+
onExtensionAvailable();
|
|
41
|
+
}
|
|
42
42
|
clearInterval(interval);
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
43
|
+
});
|
|
44
|
+
} catch (e) {
|
|
45
|
+
// Catch chrome.runtime.sendMessage undefined exception #WCS-3638
|
|
46
|
+
console.log("Can't detect screen sharing extension: "+e);
|
|
47
|
+
onExtensionNotFound();
|
|
48
|
+
clearInterval(interval);
|
|
49
|
+
}
|
|
46
50
|
}, 500);
|
|
47
51
|
} else if(isSafariMacOS()) {
|
|
48
52
|
$("#extension").hide();
|
|
@@ -84,6 +88,22 @@ function isSafariMacOS() {
|
|
|
84
88
|
return Browser.isSafari() && !Browser.isAndroid() && !Browser.isiOS();
|
|
85
89
|
}
|
|
86
90
|
|
|
91
|
+
function onExtensionNotFound() {
|
|
92
|
+
if (askExtension === true) {
|
|
93
|
+
if (inIframe()) {
|
|
94
|
+
$("#installFromMarket").show();
|
|
95
|
+
} else {
|
|
96
|
+
$("#installExtensionButton").show();
|
|
97
|
+
}
|
|
98
|
+
} else {
|
|
99
|
+
$("#extension").hide();
|
|
100
|
+
}
|
|
101
|
+
onExtensionAvailable();
|
|
102
|
+
$('#woChromeExtension').prop('checked', true);
|
|
103
|
+
$('#woChromeExtension').prop('disabled', true);
|
|
104
|
+
extensionNotInstalled = true;
|
|
105
|
+
}
|
|
106
|
+
|
|
87
107
|
function onExtensionAvailable() {
|
|
88
108
|
localVideo = document.getElementById("localVideo");
|
|
89
109
|
remoteVideo = document.getElementById("remoteVideo");
|