Skip to content

Commit 54266b3

Browse files
committed
fix(UI): Sync volume and mute values when loading a new content or casting (#8487)
1 parent 2627947 commit 54266b3

File tree

2 files changed

+18
-0
lines changed

2 files changed

+18
-0
lines changed

ui/mute_button.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,16 @@ shaka.ui.MuteButton = class extends shaka.ui.Element {
9191
this.updateIcon_();
9292
});
9393

94+
this.eventManager.listen(this.player, 'loading', () => {
95+
this.updateLocalizedStrings_();
96+
this.updateIcon_();
97+
});
98+
99+
this.eventManager.listen(this.controls, 'caststatuschanged', () => {
100+
this.updateLocalizedStrings_();
101+
this.updateIcon_();
102+
});
103+
94104
this.eventManager.listen(this.adManager,
95105
shaka.ads.Utils.AD_VOLUME_CHANGED, () => {
96106
this.updateLocalizedStrings_();

ui/volume_bar.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,14 @@ shaka.ui.VolumeBar = class extends shaka.ui.RangeElement {
4040
'volumechange',
4141
() => this.onPresentationVolumeChange_());
4242

43+
this.eventManager.listen(this.player,
44+
'loading',
45+
() => this.onPresentationVolumeChange_());
46+
47+
this.eventManager.listen(this.controls,
48+
'caststatuschanged',
49+
() => this.onPresentationVolumeChange_());
50+
4351
this.eventManager.listen(this.adManager,
4452
shaka.ads.Utils.AD_VOLUME_CHANGED,
4553
() => this.onAdVolumeChange_());

0 commit comments

Comments
 (0)