mirror of
https://github.com/Stremio/stremio-web.git
synced 2026-03-11 21:27:05 +00:00
timechanged renamed
This commit is contained in:
parent
3710d10e29
commit
0101c015dd
2 changed files with 5 additions and 5 deletions
|
|
@ -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(() => {
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Reference in a new issue