Stabilize screen audio playback/reduce race conditions
Some checks are pending
build-docker / Build Image (push) Waiting to run
Some checks are pending
build-docker / Build Image (push) Waiting to run
This commit is contained in:
parent
0afd3f14a0
commit
b0d9c95bf1
3 changed files with 87 additions and 18 deletions
|
|
@ -6,6 +6,7 @@ import { safeJson } from './utils/fetch.mjs';
|
|||
import { getPoint, getOpenMeteoForecast, aggregateWeatherForecastData } from './utils/weather.mjs';
|
||||
import { debugFlag } from './utils/debug.mjs';
|
||||
import settings from './settings.mjs';
|
||||
import { stopScreenAudio } from './media.mjs';
|
||||
|
||||
document.addEventListener('DOMContentLoaded', () => {
|
||||
init();
|
||||
|
|
@ -386,17 +387,13 @@ const handleNavButton = (button) => {
|
|||
case 'next':
|
||||
setPlaying(false);
|
||||
// Stop screen audio immediately when navigating
|
||||
import('./media.mjs').then((media) => {
|
||||
media.stopScreenAudio();
|
||||
});
|
||||
stopScreenAudio();
|
||||
navTo(msg.command.nextFrame);
|
||||
break;
|
||||
case 'previous':
|
||||
setPlaying(false);
|
||||
// Stop screen audio immediately when navigating
|
||||
import('./media.mjs').then((media) => {
|
||||
media.stopScreenAudio();
|
||||
});
|
||||
stopScreenAudio();
|
||||
navTo(msg.command.previousFrame);
|
||||
break;
|
||||
case 'menu':
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue