Skip to content

Commit

Permalink
Merge pull request #44 from BluPoint-io/hotfix/0.6.20
Browse files Browse the repository at this point in the history
Promise is added for videoElements
  • Loading branch information
serkanbektas authored Mar 10, 2021
2 parents 92fd4b0 + 0935a71 commit b4d8276
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions src/player/player.js
Original file line number Diff line number Diff line change
Expand Up @@ -861,7 +861,7 @@ class Player {
Logger.addLog('Player', 'info', 'Video is playing...');
}
} else if (this.videoElement) {
this.videoElement.play();
this.playing = this.videoElement.play();
} else if (this.objectPlayer) {
this.objectPlayer.play(1);
}
Expand Down Expand Up @@ -898,7 +898,16 @@ class Player {
webapis.avplay.pause();
}
} else if (this.videoElement) {
this.videoElement.pause();

if (!this.playing) {
return this.videoElement.pause();
}

this.playing.then(() => {
this.videoElement.pause();
}).catch(error => {
Logger.addLog('Player', 'error', 'Pause', error);
});
} else if (this.objectPlayer) {
this.objectPlayer.play(0);
}
Expand Down

0 comments on commit b4d8276

Please sign in to comment.