DEPRECATION NOTICE: This extension is no longer needed for screen share with OpenVidu
This Chrome extension allows web applications to capture desktop windows. It is meant to be used in combination with openvidu-browser and is easily customizable.
manifest.json
fields:
name
, author
and description
content_scripts.matches
arrayicon.png
with your own imagevar OV = new OpenVidu();
OV.setAdvancedConfiguration( { screenShareChromeExtension: "https://chrome.google.com/webstore/detail/YOUR_EXTENSION_NAME/YOUR_EXTENSION_ID" } );
var publisher = OV.initPublisher(
document.getElementById('myTargetElement'),
{ videoSource: "screen" }
);
First of all, add to array content_scripts.matches
in manifest.json
the developing URL you are using (for example: "matches": ["https://*.openvidu.io/*", "http://localhost:4200/"]
)
Then go to chrome://extensions
in Google Chrome. Click Load Unpacked
and select the extension's folder.
When setting property videoSource
in your app, just do it like this:
var OV = new OpenVidu();
OV.setAdvancedConfiguration( { screenShareChromeExtension: "https://chrome.google.com/webstore/detail/not_relevant/DEVELOPING_EXTENSION_ID_CHROME_PROVIDED" } );
var publisher = OV.initPublisher(
document.getElementById('myTargetElement'),
{ videoSource: "screen" }
);
You're good to go now!
https://developer.chrome.com/webstore/publish
SCREEN_EXTENSION_NOT_INSTALLED
or SCREEN_EXTENSION_DISABLED
errors even though the extension is already added: this usually means that you are trying to use your extension from a URL not included in matches
array of your manifest.json file. Be sure to add any URL where you plan to serve an application using your extension (this includes localhost domains when developing!).Acknowledgements to Muaz Khan, whose open-source project Chrome-Extensions helped implementing OpenVidu/openvidu-screen-sharing-chrome-extension repository.