1
0
Fork 0
mirror of https://github.com/jellyfin/jellyfin-web synced 2025-03-30 19:56:21 +00:00

Don't change volume if it is physically controlled

This commit is contained in:
Dmitry Lyzo 2024-06-25 22:56:50 +03:00
parent 21ced03987
commit bc8b83be5e
3 changed files with 19 additions and 6 deletions

View file

@ -263,7 +263,10 @@ class HtmlAudioPlayer {
document.body.appendChild(elem);
}
elem.volume = htmlMediaHelper.getSavedVolume();
// TODO: Move volume control to PlaybackManager. Player should just be a wrapper that translates commands into API calls.
if (!appHost.supports('physicalvolumecontrol')) {
elem.volume = htmlMediaHelper.getSavedVolume();
}
self._mediaElement = elem;

View file

@ -1584,7 +1584,11 @@ export class HtmlVideoPlayer {
playerDlg.innerHTML = html;
const videoElement = playerDlg.querySelector('video');
videoElement.volume = getSavedVolume();
// TODO: Move volume control to PlaybackManager. Player should just be a wrapper that translates commands into API calls.
if (!appHost.supports('physicalvolumecontrol')) {
videoElement.volume = getSavedVolume();
}
videoElement.addEventListener('timeupdate', this.onTimeUpdate);
videoElement.addEventListener('ended', this.onEnded);
videoElement.addEventListener('volumechange', this.onVolumeChange);