Always try to update end time after new media info

This commit is contained in:
Rafał Dzięgiel
2021-04-09 13:53:43 +02:00
parent 1bf46a2f12
commit 8fb6b971fe
2 changed files with 9 additions and 6 deletions

View File

@@ -162,7 +162,7 @@ class ClapperRevealerTop extends CustomRevealer
/* Make sure that next timeout is always run after clock changes, /* Make sure that next timeout is always run after clock changes,
* by delaying it for additional few milliseconds */ * by delaying it for additional few milliseconds */
const nextUpdate = 60002 - parseInt(currTime.get_seconds() * 1000); const nextUpdate = 60004 - parseInt(currTime.get_seconds() * 1000);
debug(`updated current time: ${now}, ends at: ${end}`); debug(`updated current time: ${now}, ends at: ${end}`);
return nextUpdate; return nextUpdate;

View File

@@ -203,6 +203,9 @@ class ClapperWidget extends Gtk.Grid
this.isSeekable = mediaInfo.is_seekable(); this.isSeekable = mediaInfo.is_seekable();
this.controls.setLiveMode(isLive, this.isSeekable); this.controls.setLiveMode(isLive, this.isSeekable);
/* Update remaining end time if visible */
this.updateTime();
if(this.player.needsTocUpdate) { if(this.player.needsTocUpdate) {
if(!isLive) if(!isLive)
this.updateChapters(mediaInfo.get_toc()); this.updateChapters(mediaInfo.get_toc());
@@ -324,11 +327,11 @@ class ClapperWidget extends Gtk.Grid
updateTime() updateTime()
{ {
const revealerTop = this.revealerTop;
if( if(
!revealerTop.visible !this.revealerTop.visible
|| !revealerTop.revealerGrid.visible || !this.revealerTop.revealerGrid.visible
|| !this.isFullscreenMode
|| this.isMobileMonitor
) )
return null; return null;
@@ -458,7 +461,7 @@ class ClapperWidget extends Gtk.Grid
} }
const isNotStopped = (state !== GstClapper.ClapperState.STOPPED); const isNotStopped = (state !== GstClapper.ClapperState.STOPPED);
this.revealerTop.endTime.set_visible(isNotStopped); this.revealerTop.endTime.visible = isNotStopped;
} }
_onPlayerDurationChanged(player, duration) _onPlayerDurationChanged(player, duration)