Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

Cushty's avatar

Video pause if another plays possible with AlpineJS?

Hi I have a blade file and it's pulling in all of the videos uploaded from the database , the only issue I have is I need a way to pause a video if another plays. I am currently using AlpineJS for some interactivity just wanted to know:

  1. Is it possible to achieve this using Alpine
  2. Is using the HTML5 video player sufficient or should I use a JS Video library instead?

Thanks

0 likes
1 reply
martinbean's avatar

Is it possible to achieve this using Alpine

@cushty Anything is possible if you write the code for it.

Is using the HTML5 video player sufficient or should I use a JS Video library instead?

Depends what type of videos you’re trying to play. A HTML5 <video> tag will work for things like MP4 files, but for HLS playlists you’ll want to use something like Video.js for maximum compatibility (as it’ll polyfill browsers that don’t natively support playing HLS playlists).

As for pausing when playing another video, this sounds like you’re going to have multiple videos on a single page, which is going to use a huge amount of data, and make your page slow to load if it has to download megabytes or even gigabytes of data to render.

Please or to participate in this conversation.