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:
parent
69ff9a7652
commit
f445882a61
7 changed files with 48 additions and 12 deletions
|
@ -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);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue