Skip to content

Commit

Permalink
bg videos remain muted on mobile, otherwise broken when navigating wi…
Browse files Browse the repository at this point in the history
…th swipe gestures
  • Loading branch information
hakimel committed Jun 16, 2020
1 parent 2fccb77 commit 9ff27cf
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 4 deletions.
2 changes: 1 addition & 1 deletion dist/reveal.esm.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/reveal.js

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions examples/media.html
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ <h2>Video</h2>
<video src="http://clips.vorwaerts-gmbh.de/big_buck_bunny.mp4" data-autoplay></video>
</section>

<section data-background-video="http://clips.vorwaerts-gmbh.de/big_buck_bunny.mp4" data-background-video-muted>
<section data-background-video="http://clips.vorwaerts-gmbh.de/big_buck_bunny.mp4">
<h2>Background Video</h2>
</section>

Expand Down Expand Up @@ -68,7 +68,7 @@ <h2>Audio with controls</h2>

<script src="../dist/reveal.js"></script>
<script>
Reveal.initialize();
Reveal.initialize({hash: true});
</script>

</body>
Expand Down
5 changes: 5 additions & 0 deletions js/controllers/slidecontent.js
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,12 @@ export default class SlideContent {
}

// Enable inline playback in mobile Safari
//
// Mute is required for video to play when using
// swipe gestures to navigate since they don't
// count as direct user actions :'(
if( isMobile ) {
video.muted = true;
video.setAttribute( 'playsinline', '' );
}

Expand Down

0 comments on commit 9ff27cf

Please sign in to comment.