1
0
mirror of https://github.com/xuthus83/pigallery2.git synced 2025-01-14 14:43:17 +08:00

playback is paused on dropdown open and resumed on dropdown close to prevent autoclose when next image is loaded

This commit is contained in:
crypt-o-warrior 2022-12-17 02:04:48 +01:00
parent 75c26f8422
commit 243495147f
No known key found for this signature in database
GPG Key ID: 95194045885EFFFF
2 changed files with 3 additions and 5 deletions

View File

@ -198,6 +198,7 @@
title="auto play"></span>
<span class="oi btn-group highlight control-button"
dropdown
(isOpenChange)="$event ? pause() : play()"
[dropup]="true">
<div id="button-duration"
dropdownToggle
@ -213,7 +214,7 @@
aria-labelledby="button-duration">
<li *ngFor="let duration of playBackDurations"
role="menuitem"
(click)="play(duration)">
(click)="setPlayBackDuration(duration)">
<a class="dropdown-item"
[class]="selectedPlayBackDuration === duration ? 'active' : ''">
{{duration}}s

View File

@ -301,11 +301,8 @@ export class ControlsLightboxComponent implements OnDestroy, OnInit, OnChanges {
this.nextPhoto.emit();
};
public play(duration?: number): void {
public play(): void {
this.pause();
if (duration) {
this.setPlayBackDuration(duration);
}
this.timerSub = this.timer
.pipe(filter((t) => t % this.selectedPlayBackDuration === 0))
.subscribe(this.showNextMedia);