Files
upstream-mirror 1d2bfcac0c
Some checks failed
Prosody Plugin Tests / test (push) Failing after 10m11s
Close stale issues and PRs / stale (push) Failing after 1s
snapshot of https://github.com/jitsi/jitsi-meet.git @ fd1749dd28f4138aa80234fc7f311b19aaffa0e7 (2026-09-15)
2026-09-15 15:56:32 +05:00

53 lines
1.6 KiB
TypeScript

import ReducerRegistry from '../base/redux/ReducerRegistry';
import { SET_PIP_ACTIVE, SET_PIP_WINDOW } from './actionTypes';
/**
* The default state for the pip feature.
*/
const DEFAULT_STATE = {
isPiPActive: false,
pipWindow: null
};
export interface IPipState {
isPiPActive: boolean;
/**
* The Document PiP window this feature opened and initialized (stylesheets copied, #pip-root
* container created), or null when none is open. This differs from
* window.documentPictureInPicture.window, which is the browser's view of any Document PiP
* window open for the page regardless of who opened it. Kept in Redux so that every change
* to the reference is observable by React.
*
* The ts-ignore mirrors web-hid's HIDDevice: the pip feature is excluded from the native
* TypeScript config, which has no DOM lib defining Window, but this interface still reaches
* the native check through IReduxState. Types are erased at build time, so the suppression
* only affects the type check and nothing on native ever reads this field.
*/
// @ts-ignore
pipWindow: Window | null;
}
/**
* Reduces the Redux actions of the pip feature.
*/
ReducerRegistry.register<IPipState>('features/pip', (state = DEFAULT_STATE, action): IPipState => {
switch (action.type) {
case SET_PIP_ACTIVE:
return {
...state,
isPiPActive: action.isPiPActive
};
case SET_PIP_WINDOW:
return {
...state,
pipWindow: action.pipWindow
};
default:
return state;
}
});