bigbluebutton-Github/bigbluebutton-html5/imports/ui/services/bbb-webrtc-sfu/broker-base-errors.js
prlanzarin 83e26b7f63 fix(screenshare): race condition - local stream ends while broker stars
There could be a race condition where the local getDisplayMedia stream ends
(eg via Chrome`s stop sharing toast) while the broker hasn't finished starting.
That would lead to a scenario where the broker wouldn't emit an end event,
causing screen sharing to be flagged as started with a blank/invalid stream.
2022-05-09 18:00:30 +00:00

38 lines
1.1 KiB
JavaScript

const SFU_CLIENT_SIDE_ERRORS = {
// 13xx errors are client-side bbb-webrtc-sfu's base broker errors
1301: "WEBSOCKET_DISCONNECTED",
1302: "WEBSOCKET_CONNECTION_FAILED",
1305: "PEER_NEGOTIATION_FAILED",
1307: "ICE_STATE_FAILED",
1310: "ENDED_WHILE_STARTING",
};
const SFU_SERVER_SIDE_ERRORS = {
// 2xxx codes are server-side bbb-webrtc-sfu errors
2000: "MEDIA_SERVER_CONNECTION_ERROR",
2001: "MEDIA_SERVER_OFFLINE",
2002: "MEDIA_SERVER_NO_RESOURCES",
2003: "MEDIA_SERVER_REQUEST_TIMEOUT",
2004: "MEDIA_SERVER_GENERIC_ERROR",
2020: "ICE_ADD_CANDIDATE_FAILED",
2021: "ICE_GATHERING_FAILED",
2022: "ICE_STATE_FAILED",
2200: "MEDIA_GENERIC_ERROR",
2201: "MEDIA_NOT_FOUND",
2202: "MEDIA_INVALID_SDP",
2203: "MEDIA_NO_AVAILABLE_CODEC",
2208: "MEDIA_GENERIC_PROCESS_ERROR",
2209: "MEDIA_ADAPTER_OBJECT_NOT_FOUND",
2210: "MEDIA_CONNECT_ERROR",
2211: "MEDIA_NOT_FLOWING",
2300: "SFU_INVALID_REQUEST",
};
const SFU_BROKER_ERRORS = { ...SFU_SERVER_SIDE_ERRORS, ...SFU_CLIENT_SIDE_ERRORS };
export {
SFU_CLIENT_SIDE_ERRORS,
SFU_SERVER_SIDE_ERRORS,
SFU_BROKER_ERRORS,
};