-
Notifications
You must be signed in to change notification settings - Fork 420
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added Chrome screensharing extension.
- Loading branch information
Showing
5 changed files
with
65 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
This folder contains screensharing extensions for various browsers. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
# Screensharing utility for the Nextcloud video calls app | ||
|
||
Based on the getScreenMedia example from | ||
https://github.com/HenrikJoreteg/getScreenMedia/tree/master/chrome-extension-sample | ||
|
||
Make sure to replace `replace-with-your-hostname` with your actual hostname | ||
in `manifest.json` before installing the extension. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
/* global chrome */ | ||
|
||
(function() { | ||
|
||
/* background page, responsible for actually choosing media */ | ||
chrome.runtime.onMessageExternal.addListener(function (message, sender, callback) { | ||
switch(message.type) { | ||
case 'getScreen': | ||
chrome.desktopCapture.chooseDesktopMedia(message.options || ['screen', 'window'], | ||
sender.tab, function (streamid) { | ||
// communicate this string to the app so it can call getUserMedia with it | ||
message.type = 'gotScreen'; | ||
message.sourceId = streamid; | ||
callback(message); | ||
return false; | ||
}); | ||
return true; // retain callback for chooseDesktopMedia result | ||
case 'cancelGetScreen': | ||
chrome.desktopCapture.cancelChooseDesktopMedia(message.request); | ||
message.type = 'canceledGetScreen'; | ||
callback(message); | ||
return false; //dispose callback | ||
} | ||
}); | ||
|
||
})(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
/* global chrome */ | ||
|
||
(function() { | ||
|
||
sessionStorage.getScreenMediaJSExtensionId = chrome.runtime.id; | ||
|
||
})(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
{ | ||
"name": "Nextcloud Screensharing", | ||
"description": "Screensharing utility for the Nextcloud video calls app.", | ||
"version": "0.0.1", | ||
"manifest_version": 2, | ||
"minimum_chrome_version": "34", | ||
"icons": { | ||
}, | ||
"permissions": [ | ||
"desktopCapture" | ||
], | ||
"background": { | ||
"scripts": ["background.js"] | ||
}, | ||
"content_scripts": [ { | ||
"js": [ "content.js" ], | ||
"matches": [ "https://replace-with-your-hostname/*" ] | ||
}], | ||
"externally_connectable": { | ||
"matches": [ | ||
"https://replace-with-your-hostname/*" | ||
] | ||
} | ||
} |