mirror of
https://gitcode.com/GitHub_Trending/ji/jitsi-meet.git
synced 2025-12-30 11:22:31 +00:00
Implements Picture-in-Picture functionality for the Electron wrapper to maintain video engagement when users are not actively focused on the conference window. This feature addresses the need to keep users visually connected to the conference even when multitasking. Key features: - Automatic PiP mode activation and deactivation based on user interaction - Displays large video participant's stream or renders their avatar on canvas when video unavailable - Provides audio/video mute controls via MediaSession API directly in PiP window - Adds API events (_pip-requested) for Electron wrapper integration Implementation includes new pip feature module with Redux architecture, canvas-based avatar rendering with custom backgrounds support, and integration with existing mute/unmute logic. Depends on jitsi-meet-electron-sdk#479 for proper user gesture handling in Electron.
49 lines
1.5 KiB
TypeScript
49 lines
1.5 KiB
TypeScript
import { setUserFilmstripWidth } from '../../filmstrip/actions.web';
|
|
import MiddlewareRegistry from '../redux/MiddlewareRegistry';
|
|
import { updateSettings } from '../settings/actions';
|
|
|
|
import { SET_CONFIG } from './actionTypes';
|
|
import './middleware.any';
|
|
|
|
/**
|
|
* The middleware of the feature {@code base/config}.
|
|
*
|
|
* @param {Store} store - The redux store.
|
|
* @private
|
|
* @returns {Function}
|
|
*/
|
|
MiddlewareRegistry.register(store => next => action => {
|
|
const result = next(action);
|
|
|
|
switch (action.type) {
|
|
case SET_CONFIG: {
|
|
const { initialWidth, stageFilmstripParticipants } = action.config.filmstrip || {};
|
|
const { dispatch, getState } = store;
|
|
const state = getState();
|
|
|
|
if (stageFilmstripParticipants !== undefined) {
|
|
dispatch(updateSettings({
|
|
maxStageParticipants: stageFilmstripParticipants
|
|
}));
|
|
}
|
|
|
|
if (initialWidth) {
|
|
dispatch(setUserFilmstripWidth(initialWidth));
|
|
}
|
|
|
|
// FIXME On Web we rely on the global 'config' variable which gets altered
|
|
// multiple times, before it makes it to the reducer. At some point it may
|
|
// not be the global variable which is being modified anymore due to
|
|
// different merge methods being used along the way. The global variable
|
|
// must be synchronized with the final state resolved by the reducer.
|
|
if (typeof window.config !== 'undefined') {
|
|
window.config = state['features/base/config'];
|
|
}
|
|
|
|
break;
|
|
}
|
|
}
|
|
|
|
return result;
|
|
});
|