From e0760ff74af1cb152b176de285840573ed730462 Mon Sep 17 00:00:00 2001 From: Daniel Supernault Date: Wed, 26 Sep 2018 22:08:06 -0600 Subject: [PATCH] Update timeline.js --- resources/assets/js/timeline.js | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/resources/assets/js/timeline.js b/resources/assets/js/timeline.js index bae14058..40352406 100644 --- a/resources/assets/js/timeline.js +++ b/resources/assets/js/timeline.js @@ -3,7 +3,12 @@ $(document).ready(function() { $('.container.timeline-container').removeClass('d-none'); let elem = document.querySelector('.timeline-feed'); pixelfed.fetchLikes(); - + $('video').on('play', function() { + activated = this; + $('video').each(function() { + if(this != activated) this.pause(); + }); + }); let infScroll = new InfiniteScroll( elem, { path: '.pagination__next', append: '.timeline-feed', @@ -19,6 +24,12 @@ $(document).ready(function() { $(this).addClass('d-none'); } }); + $('video').on('play', function() { + activated = this; + $('video').each(function() { + if(this != activated) this.pause(); + }); + }); });