1
0
mirror of https://github.com/videojs/video.js.git synced 2024-12-02 09:11:54 +02:00

fix: silence play promise in the play toggle. (#7189)

Fixes #6998
This commit is contained in:
Gary Katsevman 2021-04-16 14:06:19 -04:00 committed by GitHub
parent a7cbb2a948
commit 2c6e4397bb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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.
@ -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();
}