1
0
Fork 0
mirror of https://github.com/muerwre/vault-frontend.git synced 2025-04-25 12:56:41 +07:00
vault-frontend/src/redux/player/actions.ts
2020-04-19 11:55:27 +07:00

48 lines
1 KiB
TypeScript

import { IPlayerState } from './reducer';
import { PLAYER_ACTIONS } from './constants';
export const playerSet = (player: Partial<IPlayerState>) => ({
type: PLAYER_ACTIONS.SET,
player,
});
export const playerSetFile = (file: IPlayerState['file']) => ({
type: PLAYER_ACTIONS.SET_FILE,
file,
});
export const playerSetFileAndPlay = (file: IPlayerState['file']) => ({
type: PLAYER_ACTIONS.SET_FILE_AND_PLAY,
file,
});
export const playerSetStatus = (status: IPlayerState['status']) => ({
type: PLAYER_ACTIONS.SET_STATUS,
status,
});
export const playerPlay = () => ({
type: PLAYER_ACTIONS.PLAY,
});
export const playerPause = () => ({
type: PLAYER_ACTIONS.PAUSE,
});
export const playerStop = () => ({
type: PLAYER_ACTIONS.STOP,
});
export const playerStopped = () => ({
type: PLAYER_ACTIONS.STOPPED,
});
export const playerSeek = (seek: number) => ({
type: PLAYER_ACTIONS.SEEK,
seek,
});
export const playerGetYoutubeInfo = (url: string) => ({
type: PLAYER_ACTIONS.GET_YOUTUBE_INFO,
url,
});