Skip to content

Commit

Permalink
fix: silence play promise error (#4247)
Browse files Browse the repository at this point in the history
  • Loading branch information
gkatsev authored Mar 30, 2017
1 parent 9274457 commit 0908d91
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/js/player.js
Original file line number Diff line number Diff line change
Expand Up @@ -1612,7 +1612,12 @@ class Player extends Component {
play() {
if (this.changingSrc_) {
this.ready(function() {
this.techCall_('play');
const retval = this.techGet_('play');

// silence errors (unhandled promise from play)
if (retval !== undefined && typeof retval.then === 'function') {
retval.then(null, (e) => {});
}
});

// Only calls the tech's play if we already have a src loaded
Expand Down

0 comments on commit 0908d91

Please sign in to comment.