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.
- Modify the following
manifest.json
fields:name
,author
anddescription
- Change the allowed domains in
content_scripts.matches
array
- Replace
icon.png
with your own image
var 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
- Getting
SCREEN_EXTENSION_NOT_INSTALLED
orSCREEN_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 inmatches
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.