Skip to content

Commit

Permalink
fix force play of the videogroup
Browse files Browse the repository at this point in the history
  • Loading branch information
stamat committed Feb 6, 2024
1 parent de8a0ae commit b57ff9f
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 7 deletions.
4 changes: 2 additions & 2 deletions src/lib/controls.js
Original file line number Diff line number Diff line change
Expand Up @@ -103,8 +103,8 @@ export class VideoBackgroundGroup {
onVideoReady(event) {
if (this.stack[this.current] !== event.detail.element) return;
this.setVideoBackgroundFactoryInstance(event);
// console.log('ready', event.detail.element, event.detail.currentState);
if (event.detail.currentState !== 'playing') event.detail.play();
const videoBackground = event.detail;
if (videoBackground.currentState !== 'playing' && videoBackground.isIntersecting) videoBackground.softPlay();
}

onVideoPause(event) {;
Expand Down
5 changes: 3 additions & 2 deletions youtube-background-experimental.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit b57ff9f

Please sign in to comment.