We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 5acbc8b commit 771dd59Copy full SHA for 771dd59
demo/index.html
@@ -14,6 +14,9 @@
14
.centered {
15
max-width: none;
16
}
17
+ demo-snippet {
18
+ width: fit-content;
19
+ }
20
</style>
21
</custom-style>
22
</head>
mp4-video-player.js
@@ -770,9 +770,15 @@ class MP4VideoPlayer extends PolymerElement {
770
* Play the video
771
*/
772
play() {
773
- this._getShadowElementById('video_player').play();
774
- this._setPlaying(true);
775
- this.focus();
+ const aPromise = this._getShadowElementById('video_player').play();
+ if (aPromise !== undefined) {
+ aPromise.then(() => {
776
+ this._setPlaying(true);
777
+ this.focus();
778
+ }).catch(() => {
779
+ console.log('Problem Playing Audio!');
780
+ });
781
782
783
784
/**
0 commit comments