Skip to content

Commit

Permalink
fix: silence play promise in the play toggle. (#7189)
Browse files Browse the repository at this point in the history
Fixes #6998
  • Loading branch information
gkatsev authored Apr 16, 2021
1 parent a7cbb2a commit 2c6e439
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/js/control-bar/play-toggle.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
*/
import Button from '../button.js';
import Component from '../component.js';
import {silencePromise} from '../utils/promise';

/**
* Button to toggle between play and pause.
Expand Down Expand Up @@ -57,7 +58,7 @@ class PlayToggle extends Button {
*/
handleClick(event) {
if (this.player_.paused()) {
this.player_.play();
silencePromise(this.player_.play());
} else {
this.player_.pause();
}
Expand Down

0 comments on commit 2c6e439

Please sign in to comment.