mirror of
https://git.kescher.at/CatCatNya/catstodon.git
synced 2024-12-05 17:09:04 +01:00
51479f5c28
Port f22b4e556c
to glitch-soc
Signed-off-by: Claire <claire.github-309c@sitedethib.com>
46 lines
1.1 KiB
JavaScript
46 lines
1.1 KiB
JavaScript
// @ts-check
|
|
|
|
export const PICTURE_IN_PICTURE_DEPLOY = 'PICTURE_IN_PICTURE_DEPLOY';
|
|
export const PICTURE_IN_PICTURE_REMOVE = 'PICTURE_IN_PICTURE_REMOVE';
|
|
|
|
/**
|
|
* @typedef MediaProps
|
|
* @property {string} src
|
|
* @property {boolean} muted
|
|
* @property {number} volume
|
|
* @property {number} currentTime
|
|
* @property {string} poster
|
|
* @property {string} backgroundColor
|
|
* @property {string} foregroundColor
|
|
* @property {string} accentColor
|
|
*/
|
|
|
|
/**
|
|
* @param {string} statusId
|
|
* @param {string} accountId
|
|
* @param {string} playerType
|
|
* @param {MediaProps} props
|
|
* @returns {object}
|
|
*/
|
|
export const deployPictureInPicture = (statusId, accountId, playerType, props) => {
|
|
// @ts-expect-error
|
|
return (dispatch, getState) => {
|
|
// Do not open a player for a toot that does not exist
|
|
if (getState().hasIn(['statuses', statusId])) {
|
|
dispatch({
|
|
type: PICTURE_IN_PICTURE_DEPLOY,
|
|
statusId,
|
|
accountId,
|
|
playerType,
|
|
props,
|
|
});
|
|
}
|
|
};
|
|
};
|
|
|
|
/*
|
|
* @return {object}
|
|
*/
|
|
export const removePictureInPicture = () => ({
|
|
type: PICTURE_IN_PICTURE_REMOVE,
|
|
});
|