periodically push changes in library from player

This commit is contained in:
nklhrstv 2020-03-23 14:08:50 +02:00
parent 38b7f71d86
commit 3e05fe2e31

View file

@ -220,6 +220,19 @@ const Player = ({ urlParams }) => {
}, 'player');
}
}, [videoState.time, videoState.duration]);
React.useEffect(() => {
const interval = setInterval(() => {
core.dispatch({
action: 'Player',
args: {
action: 'PushToLibrary'
}
}, 'player');
}, 30000);
return () => {
clearInterval(interval);
};
}, []);
React.useLayoutEffect(() => {
const onKeyDown = (event) => {
switch (event.code) {