aggiunto schermo nero durante il play audio in playlist

This commit is contained in:
David Frassi
2026-06-18 10:01:34 +02:00
parent b0bb5735c8
commit 6ed90ffff1
10 changed files with 407 additions and 19 deletions
+17 -4
View File
@@ -33,12 +33,15 @@ export class PlayerPage implements OnInit, AfterViewInit, OnDestroy {
if (target && (target.tagName === 'INPUT' || target.tagName === 'TEXTAREA' || target.isContentEditable)) {
return;
}
if (event.key === 'ArrowUp') {
if (event.key === 'ArrowUp' || event.key === 'MediaTrackPrevious') {
this.prevSong();
event.preventDefault();
} else if (event.key === 'ArrowDown') {
} else if (event.key === 'ArrowDown' || event.key === 'MediaTrackNext') {
this.nextSong();
event.preventDefault();
} else if (event.key === 'MediaPlayPause') {
this.toggleAudio();
event.preventDefault();
}
}
@@ -322,11 +325,12 @@ export class PlayerPage implements OnInit, AfterViewInit, OnDestroy {
}
}, { allowSignalWrites: true });
// Fullscreen control in landscape mode
// Fullscreen control in landscape mode or when black screen is active
effect(() => {
const isLandscape = this.isLandscapeActive();
const isBlack = this.isBlackScreen();
if (isLandscape) {
if (isLandscape || isBlack) {
this.enterFullscreen();
} else {
this.exitFullscreen();
@@ -1279,4 +1283,13 @@ export class PlayerPage implements OnInit, AfterViewInit, OnDestroy {
this.stopCameraNavigation();
this.channel.close();
}
formatSeconds(seconds: number | undefined | null): string {
if (seconds === undefined || seconds === null || isNaN(seconds)) {
return '0:00';
}
const mins = Math.floor(seconds / 60);
const secs = Math.floor(seconds % 60);
return `${mins}:${secs < 10 ? '0' : ''}${secs}`;
}
}