What you need to know about litigation before hiring a lawyer
This PDF goes over a ton of great tips for things you should do and think about before hiring an attorney. It's free and we really think it will help you out in any of your legal endeavors.
function playPauseVideo() {
let videos = document.querySelectorAll("video");
videos.forEach((video) => {
// We can only control playback without insteraction if video is mute
video.muted = true;
// Play is a promise so we need to check we have it
let playPromise = video.play();
if (playPromise !== undefined) {
playPromise.then((_) => {
let observer = new IntersectionObserver(
(entries) => {
entries.forEach((entry) => {
if (
entry.intersectionRatio !== 1 &&
!video.paused
) {
video.pause();
} else if (video.paused) {
video.play();
}
});
},
{ threshold: 0.2 }
);
observer.observe(video);
});
}
});
}
// And you would kick this off where appropriate with:
playPauseVideo();