Protected Learning Content

AICPE Gurukul content is created for learning purposes. Printing, copying and unauthorized reuse are restricted.

AICPE Learning Hub HTML with CSS
Chapter 10
Audio, Video & Embeds
Chapter 10 | Multimedia Content

Audio, Video & Embeds

Modern websites use audio, video, YouTube videos, maps and other embedded content. In this chapter, you will learn how to add multimedia content using HTML.

audio

Add sound, podcast, voice note or learning audio.

video

Add video lessons, demo clips and course previews.

source

Provide multiple file formats for better browser support.

iframe

Embed YouTube videos, maps and external pages.

Learning Objectives

After This Chapter, You Will Understand

This chapter teaches how to add multimedia and embedded content in webpages.

Audio

Add audio files with controls, source and supported formats.

Video

Add video with controls, poster, autoplay, muted and loop.

Iframe

Embed external content like YouTube and Google Maps.

Responsive Media

Understand the need for mobile-friendly embeds.

HTML Audio

Adding Audio with audio Tag

The audio tag is used to add sound files such as voice notes, lessons and music.

1 Basic Audio Syntax

The <audio> tag is used to embed audio files. The controls attribute shows play, pause and volume controls.

<audio controls>
    <source src="lesson.mp3" type="audio/mpeg">
    Your browser does not support audio.
</audio>
Use Case: Audio can be used for language learning, pronunciation, recorded explanation and meditation lessons.

Audio Player Preview

Sample Audio Player with Controls
Common Formats: MP3, WAV, OGG
HTML Video

Adding Video with video Tag

The video tag is used for lessons, demos, testimonials, product previews and training content.

Video Player Preview

This visual represents a video player area. Real video files will show play controls when uploaded.

2 Basic Video Syntax

The <video> tag embeds video content. The poster attribute shows an image before the video starts.

<video controls width="500" poster="cover.jpg">
    <source src="training.mp4" type="video/mp4">
    Your browser does not support video.
</video>
Attribute Use Example
controls Shows play, pause and volume controls <video controls>
autoplay Starts video automatically <video autoplay>
muted Mutes the video sound <video muted>
loop Plays video repeatedly <video loop>
poster Shows image before video starts <video poster="cover.jpg">
Note: Autoplay may not work in many browsers unless the video is muted. Use autoplay carefully.
Iframe Embeds

Embedding External Content

The iframe tag is used to display another webpage or external content inside your webpage.

YouTube Video

Use iframe to embed a YouTube video lesson or demo.

<iframe src="youtube-embed-url"></iframe>

Google Map

Use iframe to show institute location on a contact page.

<iframe src="google-map-url"></iframe>

External Page

Use iframe carefully to show permitted external content.

<iframe title="External Content"></iframe>
Professional Tip: Always add a meaningful title attribute to iframe for accessibility.
Responsive Embed

Making iframe Responsive

Videos and maps should adjust properly on mobile screens.

3 Responsive Wrapper

A responsive iframe wrapper keeps video and map embeds in proper ratio on different screen sizes. The common video ratio is 16:9.

<div class="video-wrapper">
    <iframe src="embed-url" title="Video Lesson"></iframe>
</div>

Responsive Preview Area


Responsive 16:9 Embed Area
CSS Concept: We will later use CSS to make iframe videos fully responsive using width, height, position and aspect ratio.
Try It Yourself

Create a Media Learning Page

Edit the code and click Run Code to see the output.

HTML Code Edit and run
Output Preview Browser result
Practice Task: Add one Google Map iframe section and add a meaningful title attribute to every iframe.
Common Mistakes

Mistakes Students Should Avoid

Media files and embeds need correct paths, attributes and responsible usage.

Wrong Habits

  • Forgetting controls attribute in audio/video
  • Using wrong media file path
  • Uploading very large video files without compression
  • Using autoplay unnecessarily
  • Adding iframe without title attribute

Correct Habits

  • Use controls for user-friendly playback
  • Use correct file format and path
  • Use poster image for videos
  • Use title attribute in iframe
  • Make embeds responsive for mobile users
Remember: Do not embed content without permission. Use trusted sources and keep page speed in mind.
Quick Quiz

Test Your Understanding

Select the correct answers and check your score.

1. Which tag is used to add audio?

The audio tag is used to add audio files in HTML.

2. Which attribute shows play and pause buttons?

The controls attribute shows playback controls.

3. Which tag is used to add video?

The video tag is used to embed video files.

4. Which tag is used to embed YouTube videos or Google Maps?

The iframe tag is used to embed external content like YouTube and maps.

5. Which video attribute shows an image before video starts?

The poster attribute shows an image before the video starts.
Quick Revision

Remember These Points

Revise these before moving to Chapter 11.

audio

The audio tag is used to add sound files to webpages.

video

The video tag is used to add video files to webpages.

source

The source tag provides media file path and type.

controls

The controls attribute shows play, pause and volume controls.

poster

The poster attribute shows an image before video starts.

iframe

The iframe tag embeds external content like YouTube and maps.