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

fix(gDM) handle NotReadableError #2613

Merged
merged 1 commit into from
Jan 13, 2025
Merged
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion JitsiTrackError.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ TRACK_ERROR_TO_MESSAGE_MAP[JitsiTrackErrors.NOT_FOUND]
TRACK_ERROR_TO_MESSAGE_MAP[JitsiTrackErrors.CONSTRAINT_FAILED]
= 'Constraint could not be satisfied: ';
TRACK_ERROR_TO_MESSAGE_MAP[JitsiTrackErrors.TIMEOUT]
= 'Could not start media source. Timeout occured!';
= 'Could not start media source. Timeout occurred!';
TRACK_ERROR_TO_MESSAGE_MAP[JitsiTrackErrors.TRACK_IS_DISPOSED]
= 'Track has been already disposed';
TRACK_ERROR_TO_MESSAGE_MAP[JitsiTrackErrors.TRACK_NO_STREAM_FOUND]
Expand Down
15 changes: 11 additions & 4 deletions modules/RTC/ScreenObtainer.js
Original file line number Diff line number Diff line change
Expand Up @@ -286,18 +286,25 @@ const ScreenObtainer = {
})
.catch(error => {
const errorDetails = {
errorName: error && error.name,
errorMsg: error && error.message,
errorStack: error && error.stack
errorName: error?.name,
errorMsg: error?.message,
errorStack: error?.stack
};

logger.error('getDisplayMedia error', JSON.stringify(constraints), JSON.stringify(errorDetails));

if (errorDetails.errorMsg && errorDetails.errorMsg.indexOf('denied by system') !== -1) {
if (errorDetails.errorMsg?.indexOf('denied by system') !== -1) {
// On Chrome this is the only thing different between error returned when user cancels
// and when no permission was given on the OS level.
errorCallback(new JitsiTrackError(JitsiTrackErrors.PERMISSION_DENIED));

return;
} else if (errorDetails.errorMsg === 'NotReadableError') {
// This can happen under some weird conditions:
// - https://issues.chromium.org/issues/369103607
// - https://issues.chromium.org/issues/353555347
errorCallback(new JitsiTrackError(JitsiTrackErrors.SCREENSHARING_GENERIC_ERROR));

return;
}

Expand Down
2 changes: 1 addition & 1 deletion modules/proxyconnection/ProxyConnectionPC.js
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,7 @@ export default class ProxyConnectionPC {
* Invoked when a connection related issue has been encountered.
*
* @param {string} errorType - The constant indicating the type of the error
* that occured.
* that occurred.
* @param {string} details - Optional additional data about the error.
* @private
* @returns {void}
Expand Down
2 changes: 1 addition & 1 deletion modules/proxyconnection/ProxyConnectionService.js
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ export default class ProxyConnectionService {
* attempted or started, and to which an iq with error details should be
* sent.
* @param {string} errorType - The constant indicating the type of the error
* that occured.
* that occurred.
* @param {string} details - Optional additional data about the error.
* @private
* @returns {void}
Expand Down
Loading