2020-09-28 11:29:43 +00:00
|
|
|
// @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
|
2023-04-30 00:29:54 +00:00
|
|
|
* @returns {object}
|
2020-09-28 11:29:43 +00:00
|
|
|
*/
|
2021-06-10 14:08:31 +00:00
|
|
|
export const deployPictureInPicture = (statusId, accountId, playerType, props) => {
|
2023-04-26 19:30:41 +00:00
|
|
|
// @ts-expect-error
|
2021-06-10 14:08:31 +00:00
|
|
|
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,
|
|
|
|
});
|
|
|
|
}
|
|
|
|
};
|
|
|
|
};
|
2020-09-28 11:29:43 +00:00
|
|
|
|
|
|
|
/*
|
|
|
|
* @return {object}
|
|
|
|
*/
|
|
|
|
export const removePictureInPicture = () => ({
|
|
|
|
type: PICTURE_IN_PICTURE_REMOVE,
|
|
|
|
});
|