Skip to content

Commit

Permalink
Fix(UI): Update Play icon after seeking from end (shaka-project#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 committed Jul 10, 2021
1 parent e9dc36d commit 8b418bb
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 8b418bb

Please sign in to comment.