requested changes

This commit is contained in:
Arthurk12 2023-03-10 14:25:24 -03:00
parent 8f8bfc8903
commit 33c9abd874
4 changed files with 21 additions and 7 deletions

View File

@ -103,7 +103,7 @@ const intlMessages = defineMessages({
},
unshareCameraAsContent: {
id: 'app.actionsBar.actionsDropdown.unshareCameraAsContent',
description: 'Label for unshar camera as content',
description: 'Label for unshare camera as content',
},
});

View File

@ -151,7 +151,7 @@ const screenshareHasStarted = (isPresenter) => {
}
};
const shareScreen = async (isPresenter, onFail, options) => {
const shareScreen = async (isPresenter, onFail, options = {}) => {
// stop external video share if running
const meeting = Meetings.findOne({ meetingId: Auth.meetingID });
@ -161,7 +161,7 @@ const shareScreen = async (isPresenter, onFail, options) => {
try {
let stream;
if (!options) {
if (options.stream == null) {
stream = await BridgeService.getScreenStream();
} else {
stream = options.stream;

View File

@ -4,6 +4,8 @@ import Service from './service';
import VideoPreview from './component';
import VideoService from '../video-provider/service';
import ScreenShareService from '/imports/ui/components/screenshare/service';
import logger from '/imports/startup/client/logger';
import { SCREENSHARING_ERRORS } from '/imports/api/screenshare/client/bridge/errors';
const VideoPreviewContainer = (props) => <VideoPreview {...props} />;
@ -16,9 +18,22 @@ export default withTracker(({ setIsOpen, callbackToClose }) => ({
startSharingCameraAsContent: (deviceId) => {
callbackToClose();
setIsOpen(false);
ScreenShareService.shareScreen(true,
(error) => console.log(error),
{ stream: Service.getStream(deviceId)._mediaStream });
const handleFailure = (error) => {
const {
errorCode = SCREENSHARING_ERRORS.UNKNOWN_ERROR.errorCode,
errorMessage = error.message,
} = error;
logger.error({
logCode: 'camera_as_content_failed',
extraInfo: { errorCode, errorMessage },
}, `Sharing camera as content failed: ${errorMessage} (code=${errorCode})`);
ScreenShareService.screenshareHasEnded();
};
ScreenShareService.shareScreen(
true, handleFailure, { stream: Service.getStream(deviceId)._mediaStream }
);
},
stopSharing: (deviceId) => {
callbackToClose();

View File

@ -399,7 +399,6 @@ public:
constraints:
width: 1920
height: 1080
frameRate: 30
enableScreensharing: true
enableVideo: true
enableVideoMenu: true