Fix for web remote volume buttons being stuck when a Roku stick is used with Roku TV

This commit is contained in:
Brahim Hadriche committed 2025-03-17 11:59:25 -04:00
1 parent 59e378cc9c
commit f7b8aa6c29
2 files changed
+27 -4

No files matched your search

@@ -5,6 +5,7 @@
export let key: string;
export let icon;
export let small: boolean = false;
export let singlePressEvent: boolean = false;
let button;
@@ -37,11 +38,18 @@
let isDown = false;
function pressKeyDown() {
isDown = true;
ExternalControlProtocol.pressKeyDown(key);
if (singlePressEvent) {
ExternalControlProtocol.pressKey(key);
} else {
ExternalControlProtocol.pressKeyDown(key);
}
}
function pressKeyUp() {
isDown = false;
if (singlePressEvent) {
return;
}
ExternalControlProtocol.pressKeyUp(key);
}
@@ -153,9 +153,24 @@ And set it to "Enabled".`;
<RemoteButton key={BUTTONS.fwd} icon={FastForwardIcon} small />
</div>
<div class="flex space-x-2 m-1">
<RemoteButton key={BUTTONS.volumeMute} icon={VolumeMuteIcon} small />
<RemoteButton key={BUTTONS.volumeDown} icon={VolumeDownIcon} small />
<RemoteButton key={BUTTONS.volumeUp} icon={VolumeUpIcon} small />
<RemoteButton
key={BUTTONS.volumeMute}
icon={VolumeMuteIcon}
small
singlePressEvent
/>
<RemoteButton
key={BUTTONS.volumeDown}
icon={VolumeDownIcon}
small
singlePressEvent
/>
<RemoteButton
key={BUTTONS.volumeUp}
icon={VolumeUpIcon}
small
singlePressEvent
/>
</div>
<button
on:click={showRemoteNotWorkingDialog}