A photo, chart, or recording can explain an idea faster than a paragraph, but only if people can actually use it.
What You Need to Know
A third-party video player may load scripts and tracking resources before someone watches anything. Consider loading it only when needed and provide a title and readable description.
Try the Example
Take a look at the example. We’ll explain the important lines right below it.
<article>
<h1>Our science demonstration</h1>
<p>Watch the experiment when you are ready.</p>
<iframe src="/embeds/experiment-video.html" title="Science experiment video"
loading="lazy" referrerpolicy="no-referrer" width="640" height="360"></iframe>
<h2>What happens</h2>
<p>The balloon expands as the air inside warms.</p>
</article>
Let’s Read the Code
- <h1>: A top-level heading explains what the page is about.
- <iframe>: An iframe embeds a separate document with its own URL and security context.
- src: Src identifies a resource path for images, frames, or media.
- loading: Loading can ask the browser to defer a resource that is off screen.
What the example shows: A video embed can load lazily while the surrounding article provides a readable summary of the lesson.
What Happens in the Browser?
The paths shown here refer to files in your own example project. Put real images and recordings in those locations before expecting them to load.
Remember the boundary. Embedded content may be a separate document, sometimes provided by another company. Give it a readable title or alternative, and check what permissions and information its request may expose.
Your Turn
Replace the media filename with your own local recording and check playback, controls, and fallback content.
Common Beginner Mistakes
- Forgetting that captions are stored in a separate timed-text file, not generated by the video tag.
- For third-party video services, embedding may create tracking or privacy implications when the frame loads.
Key Takeaways
- A third-party video player may load scripts and tracking resources before someone watches anything.
- <h1>: A top-level heading explains what the page is about.
- If the resource cannot load, users still need enough text to understand what was meant to be there.