Problem Running Screen Sharing Example

darndt

New Member
I am trying to run the screen-sharing demo locally on a Mac. For some reason, when I click the "connect" button, it doesn't do anything. But when running your demo, from your site, it does work. In the browser debugger, I see this:

screen-sharing.js:32 Uncaught TypeError: Cannot read properties of undefined (reading 'sendMessage')
at screen-sharing.js:32
Which is here in screen-sharing.js:

} else if (Browser.isChrome() && !Browser.isAndroid() && !Browser.isiOS()) {
interval = setInterval(function() {
chrome.runtime.sendMessage(extensionId, {type: "isInstalled"}, function (response) {
if (chrome.runtime.lastError) { //WCS-2369 - cacth runtime.lastError
(inIframe()) ? $("#installFromMarket").show() : $("#installExtensionButton").show();
clearInterval(interval);
onExtensionAvailable();
$('#woChromeExtension').prop('checked', true);
$('#woChromeExtension').prop('disabled', true);
extensionNotInstalled = true;
} else {
$("#extension").hide();
clearInterval(interval);
onExtensionAvailable();
}
});
Why might this be?

I am simply running the HTML from a command line on Mac (file://) - is there some reason this has to be running under a web server in order to work?

Thanks,

-da
 

Max

Administrator
Staff member
Good day.
I am simply running the HTML from a command line on Mac (file://) - is there some reason this has to be running under a web server in order to work?
Screen Sharing example uses a much of dependencies which should be placed by relative paths. This is the reason to deploy Web SDK bundle on webserver and open via HTTPS (or HTTP only if the server is on the same host and can be opened by localhost address)
You can also try a minimal example from this article (download the example here). This example depends only on flashphoner.js script which is downloaded from our site, so it should work when opening locally.
 

darndt

New Member
Got it. I slammed the entire set of examples under our server and linked in a launch page for the ones I want to run. All is good with this now. Thx.
 
Top