mirror of
https://gitlab.com/futo-org/fcast.git
synced 2025-07-20 15:07:00 +00:00
Fixed video position and duration not showing after switching from livestream
This commit is contained in:
parent
72f782d1ea
commit
795393e69a
1 changed files with 5 additions and 0 deletions
|
@ -111,6 +111,9 @@ window.electronAPI.onPlay((_event, value: PlayMessage) => {
|
||||||
const currentPlaybackRate = player ? player.getPlaybackRate() : null;
|
const currentPlaybackRate = player ? player.getPlaybackRate() : null;
|
||||||
|
|
||||||
playerPrevTime = 0;
|
playerPrevTime = 0;
|
||||||
|
lastPlayerUpdateGenerationTime = 0;
|
||||||
|
isLive = false;
|
||||||
|
isLivePosition = false;
|
||||||
|
|
||||||
if (player) {
|
if (player) {
|
||||||
if (player.getSource() === value.url) {
|
if (player.getSource() === value.url) {
|
||||||
|
@ -327,6 +330,8 @@ function playerCtrlStateUpdate(event: PlayerControlEvent) {
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
playerCtrlLiveBadge.setAttribute("style", "display: none");
|
playerCtrlLiveBadge.setAttribute("style", "display: none");
|
||||||
|
playerCtrlPosition.setAttribute("style", "display: block");
|
||||||
|
playerCtrlDuration.setAttribute("style", "display: block");
|
||||||
playerCtrlPosition.textContent = formatDuration(player.getCurrentTime());
|
playerCtrlPosition.textContent = formatDuration(player.getCurrentTime());
|
||||||
playerCtrlDuration.innerHTML = `/  ${formatDuration(player.getDuration())}`;
|
playerCtrlDuration.innerHTML = `/  ${formatDuration(player.getDuration())}`;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue