1
0
Fork 0
mirror of https://github.com/muerwre/vault-frontend.git synced 2025-04-25 12:56:41 +07:00

player seeking

This commit is contained in:
Fedor Katurov 2019-10-13 19:09:44 +07:00
parent 69ff9a7652
commit f445882a61
7 changed files with 48 additions and 12 deletions

View file

@ -1,6 +1,6 @@
import { takeLatest } from 'redux-saga/effects';
import { PLAYER_ACTIONS } from './constants';
import { playerSetFile } from './actions';
import { playerSetFile, playerSeek } from './actions';
import { Player } from '~/utils/player';
import { getURL } from '~/utils/dom';
@ -17,8 +17,14 @@ function pauseSaga() {
Player.pause();
}
function seekSaga({ seek }: ReturnType<typeof playerSeek>) {
Player.jumpToPercent(seek * 100);
console.log(seek * 100);
}
export default function* playerSaga() {
yield takeLatest(PLAYER_ACTIONS.SET_FILE, setFileSaga);
yield takeLatest(PLAYER_ACTIONS.PAUSE, pauseSaga);
yield takeLatest(PLAYER_ACTIONS.PLAY, playSaga);
yield takeLatest(PLAYER_ACTIONS.SEEK, seekSaga);
}