rewind item on video ended

This commit is contained in:
nklhrstv 2020-03-22 08:47:42 +02:00
parent d343cb6a07
commit 0578556fa3

View file

@ -62,8 +62,17 @@ const Player = ({ urlParams }) => {
setVideoState({ [propName]: propValue });
}, []);
const onEnded = React.useCallback(() => {
// console.log('ended');
}, []);
core.dispatch({ action: 'Unload' }, 'Player');
if (player.lib_item !== null) {
core.dispatch({
action: 'Ctx',
args: {
action: 'RewindLibraryItem',
args: player.lib_item._id
}
});
}
}, [player.lib_item && player.lib_item._id]);
const onError = React.useCallback(() => {
// console.error(error);
}, []);