fix(spot) make Spot TV detection more resilient

Setting the UA string in Electron doesn't propagate the change to the
iframe where the meeting is loaded (🤦).

Thus make it more resilient by trying different things:

- A freshly introduced "iAmSpot" config option, similar to Jibri
- The app ID is present in the UA string, so we can test for that
- As a last-ditch effort, check if the display name is the default
  "Meeting Room"
This commit is contained in:
Saúl Ibarra Corretgé
2025-05-16 12:42:59 +02:00
committed by Saúl Ibarra Corretgé
parent 82f2060ebf
commit 4735911b6c
5 changed files with 13 additions and 4 deletions

View File

@@ -442,6 +442,7 @@ export interface IConfig {
};
iAmRecorder?: boolean;
iAmSipGateway?: boolean;
iAmSpot?: boolean;
ignoreStartMuted?: boolean;
inviteAppName?: string | null;
inviteServiceCallFlowsUrl?: string;

View File

@@ -170,6 +170,7 @@ export default [
'hideLobbyButton',
'iAmRecorder',
'iAmSipGateway',
'iAmSpot',
'ignoreStartMuted',
'inviteAppName',
'liveStreaming.enabled',

View File

@@ -1,9 +1,16 @@
import { IReduxState } from '../../app/types';
/**
* Checks if Jitsi Meet is running on Spot TV.
*
* @param {IReduxState} state - The redux state.
* @returns {boolean} Whether or not Jitsi Meet is running on Spot TV.
*/
export function isSpotTV(): boolean {
return navigator.userAgent.includes('SpotElectron/');
export function isSpotTV(state: IReduxState): boolean {
const { defaultLocalDisplayName, iAmSpot } = state['features/base/config'] || {};
return iAmSpot
|| navigator.userAgent.includes('JitsiSpot/') // Jitsi Spot app
|| navigator.userAgent.includes('8x8MeetingRooms/') // 8x8 Meeting Rooms app
|| defaultLocalDisplayName === 'Meeting Room';
}

View File

@@ -383,7 +383,7 @@ function _mapStateToProps(state: IReduxState) {
_customBackgroundColor: backgroundColor,
_customBackgroundImageUrl: backgroundImageUrl,
_displayScreenSharingPlaceholder:
Boolean(isLocalScreenshareOnLargeVideo && !seeWhatIsBeingShared && !isSpotTV()),
Boolean(isLocalScreenshareOnLargeVideo && !seeWhatIsBeingShared && !isSpotTV(state)),
_hideSelfView: getHideSelfView(state),
_isChatOpen: isChatOpen,
_isDisplayNameVisible: isDisplayNameVisible(state),

View File

@@ -450,7 +450,7 @@ export function shouldRequireRecordingConsent(recorderSession: any, state: IRedu
return false;
}
if (isSpotTV()) {
if (isSpotTV(state)) {
return false;
}