Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enabling GetDisplayMedia for screensharing #1468

Merged
merged 1 commit into from
Oct 3, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 11 additions & 2 deletions erizo_controller/erizoClient/src/utils/ConnectionHelpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,11 @@ const GetUserMedia = (config, callback = () => {}, error = () => {}) => {
navigator.mediaDevices.getUserMedia(userMediaConfig).then(cb).catch(errorCb);
};

const getDisplayMedia = (userMediaConfig, cb, errorCb) => {
navigator.mediaDevices.getDisplayMedia(userMediaConfig).then(cb).catch(errorCb);
};

const configureScreensharing = () => {
Logger.debug('Screen access requested');
switch (getBrowser()) {
case 'electron' :
Logger.debug('Screen sharing in Electron');
Expand Down Expand Up @@ -110,7 +113,13 @@ const GetUserMedia = (config, callback = () => {}, error = () => {}) => {
};

if (config.screen) {
configureScreensharing();
if (config.desktopStreamId || config.extensionId) {
Logger.debug('Screen access requested using GetUserMedia');
configureScreensharing();
} else {
Logger.debug('Screen access requested using GetDisplayMedia');
getDisplayMedia(config, callback, error);
}
} else if (typeof module !== 'undefined' && module.exports) {
Logger.error('Video/audio streams not supported in erizofc yet');
} else {
Expand Down