timechanged renamed

This commit is contained in:
nklhrstv 2022-08-22 13:00:13 +03:00
parent 3710d10e29
commit 0101c015dd
2 changed files with 5 additions and 5 deletions

View file

@ -25,7 +25,7 @@ const Player = ({ urlParams, queryParams }) => {
queryParams.has('maxAudioChannels') ? parseInt(queryParams.get('maxAudioChannels'), 10) : null
];
}, [queryParams]);
const [player, timeUpdate, pushToLibrary, ended] = usePlayer(urlParams);
const [player, timeChanged, pushToLibrary, ended] = usePlayer(urlParams);
const [settings, updateSettings] = useSettings();
const streamingServer = useStreamingServer();
const routeFocused = useRouteFocused();
@ -299,7 +299,7 @@ const Player = ({ urlParams, queryParams }) => {
if (videoState.time !== null && !isNaN(videoState.time) &&
videoState.duration !== null && !isNaN(videoState.duration) &&
videoState.manifest !== null && typeof videoState.manifest.name === 'string') {
timeUpdate(videoState.time, videoState.duration, videoState.manifest.name);
timeChanged(videoState.time, videoState.duration, videoState.manifest.name);
}
}, [videoState.time, videoState.duration, videoState.manifest]);
React.useEffect(() => {

View file

@ -86,11 +86,11 @@ const usePlayer = (urlParams) => {
};
}
}, [urlParams]);
const timeUpdate = React.useCallback((time, duration, device) => {
const timeChanged = React.useCallback((time, duration, device) => {
core.transport.dispatch({
action: 'Player',
args: {
action: 'TimeUpdate',
action: 'TimeChanged',
args: { time, duration, device }
}
}, 'player');
@ -112,7 +112,7 @@ const usePlayer = (urlParams) => {
}, 'player');
}, []);
const player = useModelState({ model: 'player', action, map });
return [player, timeUpdate, pushToLibrary, ended];
return [player, timeChanged, pushToLibrary, ended];
};
module.exports = usePlayer;