I've built a multimedia slider with images and html5 video using slick slider-- a fiddle can be viewed here-- and I'm trying to find a way to automatically pause any videos that might be playing that are not active in the slider, i.e. those that are out of view. Thus, if a viewer clicks a video to play, then progresses through the slider, that video will in turn pause, so no two videos can be playing at the same time.
Slick slider appends a class of .slick-active to all slides currently in view, so I'm thinking I need to isolate (via jQuery perhaps) all slides containing video that do not have the .slick-active class applied, and ensure that video playback is stopped?
I found a helpful SO thread here, that describes the use of getElementsByClassName to select video content in a slider that is not active, however I cannot employ this same method as slick slider only adds classes to those frames currently in view.
How might I use jQuery to select the appropriate slides and stop any active playback? Thanks in advance for any assistance here.