Open iwasrobbed opened 9 months ago
@iwasrobbed good callout! I think your intuition here is the right one for expected behavior. We'll try to get around to this ASAP, but we're also open to contributions if you'd like to knock it out. Sounds like you have a decent understanding of the codebase.
Issue
Currently, the volume level is only persisted if you manually drag the volume slider, but does not persist if you mute/unmute so this leads to an inconsistent state where the persisted volume level does not match the volume slider's value.
See https://github.com/muxinc/media-chrome/blob/daa4b406fdf8c875fe4dcbffe342ca9bab99733f/src/js/controller.js#L569-L598
Repro
media-chrome-pref-volume
in local storage changes to 0 eventually as well0
media-chrome-pref-volume
key in local storage and notice it's still0
Expected Behavior
Muting / unmuting should also update
media-chrome-pref-volume
in local storage, e.g. the volume slider changed value should always be persisted, regardless of which button (such as mute) is changing the volume.