A support page has one video for assembly and another for cleaning. Each clip sits in its own expandable section. Assign the source when that section opens. Pause its playback when the section closes so people can move on to the next instruction.
Defer the source until the section opens
Give each details section its own HTML video. The section begins closed in this example. The address starts in data-src and is copied into src on open. A poster would be a separate image request.
<details class="faq-video"> <summary>Watch the assembly video</summary> <video controls preload="metadata" data-src="assembly.mp4"></video> </details>
Handle the change in open state
Put this script after the sections. The toggle event reports a state change. On the first open, the handler assigns the source for that section only. The viewer can start the video with its normal controls. On close, the handler calls pause() on that video.
for (const section of document.querySelectorAll(".faq-video")) { const video = section.querySelector("video") section.addEventListener("toggle", () => { if (section.open && !video.hasAttribute("src")) { video.src = video.dataset.src } if (!section.open) video.pause() }) }
In a local Chrome test, both closed sections began with no selected video source. Opening the first section requested its file. After playback started, closing the section paused the video. The second clip received its source only when its own section opened.
Try the sequence on the real support page
- Reload with the FAQ sections closed. Inspect which video files appear in the network panel.
- Play one clip, close its section, and open the other. Check that the first clip pauses and the second play control is reachable.
- For a hosted iframe player, use the provider’s documented controls where available. A direct watch link alongside the player gives readers another way to reach the video if playback fails.