Video Coding

Home❯Coding Introduction❯'Accordion' reduces screen real estate

A Video "Accordion" that greatly reduces the space taken up by inactive videos

We explained on another page how to put several videos on a page, but only have one playing at a time. It's certainly an improvement on a simpler arrangement that allows any number of the videos to play simultaneously, but it has disadvantages when you want to show a lot of videos.

So we designed another scheme inspired by the way that audio pages such as Bandcamp provide access to a bunch of audio tracks:

Bandcamp audio selector  

A video version of this is a bit more complex because when a visitor hits a "Play" button, they expect not just a soundtrack, there should be a video as well. So we made it so that a panel containing the video drops down.

 
A feature of this system that sets it appart from others, is that loading in of each video is delayed until just before playing starts instead of having to wait for them all to load. It also saves screen real estate, although it sacrifices the "thumbnail" of each video that the user can see before playing.

The main code for this page:is further down but here's some notes on how it works:
(Note: The JSFiddle version of our code below, needs you to press the Youtube "Play" arrow to get it started. We haven't found out why that happens but when our code runs directly on our site, the extra "Play" is not needed)

Last modified: 27 February 2026, 11:25am