Chrome Addon Screen Share Implementation - imona/tutorial GitHub Wiki
Preparing HemenGorus ScreenSharing Addon
Visit and clone the repo
https://github.com/opentok/screensharing-extensions
****I already prepared for https://www.hemengorus.com ****
https://github.com/bahadirodevci/imonacloud-web/tree/master/HemenGorus%20ScreenSharing%20Chrome
**I already prepared for http://localhost:8081/ ****
https://github.com/bahadirodevci/imonacloud-web/tree/master/HemenGorus%20ScreenSharing%20Chrome%20Local
Edit the contents of the manifest.json file. Be sure to change the name and author settings, and ensure that matches is set to your own domains only
In this case, "https://www.hemengorus.com/", "http://localhost:8081/" etc..
- Website must be https
- For local test, change manifest.json file and drag folder to chrome://extensions/
- Check the developer mode to see the, app id, you will need it.
- Also enabling incognito mode, allows you to use screen sharing abilitiy in incognito
{
"name" : "HemenGorus Screen Sharing Local V2",
"author": "Imona Ltd.",
"version" : "2.0",
"manifest_version" : 2,
"minimum_chrome_version": "34",
"description" : "This extension is developed primary for https://hemengorus.com/. It doesn't do anything except capture content of your screen.",
"homepage_url": "http://localhost:8081/anasayfa",
"background": {
"scripts": ["background-script.js"],
"persistent": false
},
"externally_connectable": {
"matches": ["http://localhost:8081/*"]
},
"icons": {
"16": "logo16.png",
"48": "logo48.png",
"128": "logo128.png"
},
"permissions": [
"desktopCapture"
],
"web_accessible_resources": [
"icon.png"
]
}
Publish Addon
Zip folder and publish to google apps. If you changed the old one and update the addon, **Dont Forget to upgrade version number **
"version" : "2.1",
Put Chrome app addon id to global.js
Find your domain and put screenshare id
WebSite[domain] = [language_code, site_title, org_name, screen_share_id]
WebSite['hemengorus'] = ['tr', 'Hemen Görüş','doctororg','jbionicdfmcpnfidljeplhehblhhhohi'];
**For local testing put your screenshareid**
function getChromeScreenShareId(){
//for local testing put your screenshareid
var screenShareId = "adaecbhepbefgbapkeclcbdcnimpmmin";
if (isWebSiteKeyExists()) {
var key = getKey();
screenShareId = WebSite[key][3];
}
return screenShareId;
}
Register ScreenSharing Id
We put this line in video-conference-utils.
// For Google Chrome only, register your extension by ID.
// You can find it at chrome://extensions once the extension is installed.
OT.registerScreenSharingExtension('chrome', chromeExtensionId, 2);
Inline installation popup
In order to open google apps inline - installation popup, we also need to add "chrome-webstore-item" link in our page.
I put this line into requiredCSSFiles.jsp
<link rel="chrome-webstore-item" href="https://chrome.google.com/webstore/detail/jbionicdfmcpnfidljeplhehblhhhohi">