I'm following this guide to detect when my video element comes in viewport then do "x", but keep getting the title error. Not sure if because Im using wordpress with gulp and piling.js
My page uses Piling and I have a video section, when I scroll to that "stack", I want the video to start play but it starts to play on page load.
// inside document.ready()
$('video').each(function(){
if ($(this).is(":in-viewport")) {
$(this)[0].play();
} else {
$(this)[0].pause();
}
})
Uncaught Error: Syntax error, unrecognized expression: unsupported pseudo: in-viewport
<div id='<ID-CHANGES-INSIDE-LOOP>' class='image-block'>
<video autoplay>
<source class='video' src='movie.mp4' type='video/mp4'>
</video>
</div>
Is using Piling making this difficult to work?
You should be using pagePiling.js callbacks or state classes.