Skip to content

Commit

Permalink
Fix(UI): Update Play icon after seeking from end (#3515)
Browse files Browse the repository at this point in the history
We change the "play" button icon to become "rewind" when the video ends.
However, previously we did not update the icon again when seeking.
This would lead to the icon still looking like a "rewind" button if
the user seeks back from the end of the video.
This fixes that, by making the button listen to "seeking" events.
  • Loading branch information
Álvaro Velad Galván authored and joeyparrish committed Jul 12, 2021
1 parent 568b6f3 commit 1d3a1ad
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions ui/play_button.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,11 @@ shaka.ui.PlayButton = class extends shaka.ui.Element {
this.updateIcon();
});

this.eventManager.listen(this.video, 'seeking', () => {
this.updateAriaLabel();
this.updateIcon();
});

this.eventManager.listen(this.adManager, AdManager.AD_PAUSED, () => {
this.updateAriaLabel();
this.updateIcon();
Expand Down

0 comments on commit 1d3a1ad

Please sign in to comment.