Embedding Video on a Website
Jump to Section:
⏱️ Estimated Reading Time: ~6 min read
HTML Lesson 8: Embedding Video on a Website
Lesson Objective: How to embed video and audio in HTML and file formats
Insert audio
Audio file formats:
- mp3 and mp4
- wav
- ogg
To embed an audio player, use the following code:
audio controls> <source src="song.ogg" type="audio/ogg"> <source src="song.mp3" type="audio/mpeg"> Your browser does not support the audio element. </audio>
In the Google Chrome browser, the player will look like this:

<audio> Player tag attributes :| Attribute | Meaning | Description |
|---|---|---|
| autoplay | autoplay | Specifies that the audio should start playing as soon as it is ready. |
| controls | controls | Specifies that playback controls should be displayed. |
| loop | loop | Specifies that the audio should restart when it finishes. |
| preload | auto metadata none | Determines whether the audio should be loaded when the page loads. |
| src | URL | Specifies the address of the audio to play. |
Other options for embedding audio on your website
<a href="filename.mp3">Click</a>
HTML
<audio src="04.wav" autoplay loop id="bg-audio"></audio>
<script>
const audio = document.getElementById('bg-audio');
let loopCount = 0;
audio.addEventListener('ended', () => {
loopCount++;
if (loopCount < 5) {
audio.play();
}
});
</script>*only for formats: wav, mp3, aiff, wma
HTML
<audio controls width="180" height="150">
<source src="filename.wav" type="audio/wav">
Your browser does not support the audio element.
</audio>Embed video
Video file format:
- MP4
- WebM
- Ogg
HTML
<video width="320" height="240" controls poster="logo.png">
<source src="movie.mp4" type="video/mp4">
<source src="movie.ogg" type="video/ogg">
Your browser does not support the video tag.
</video>Result in browser:

<video> Player tag attributes :| Attribute | Meaning | Description |
|---|---|---|
| audio | muted | Specifies the default sound state. Currently, only “muted” is allowed. |
| autoplay | autoplay | If specified, the video will start playing as soon as it is ready. |
| controls | controls | If specified, control buttons will be shown, such as the play button. |
| height | pixels | Specifies the height of the video player. |
| loop | loop | If specified, the video will start playing again once it finishes. |
| poster | URL | Specifies the URL of an image representing the video. |
| preload | auto metadata none | If specified, the video will be loaded when the page loads and is ready to play. Ignored if “autoplay” is specified. |
| src | URL | URL address of the video to play |
| width | pixels | Specifies the width of the video player. |
Example:
<video src="04.avi" loop muted></video>
Another option for inserting video (without a player):
HTML
<a href="filename.avi">Click to watch</a>
<!-- Example:
<a href="ocean.qt">1 MB video clip</a> -->* for MPEG, AVI formats
Favicon
A favicon appears in the browser’s address bar before the page’s URL. You can also see the favicon in the page’s browser tab. Search engines display the favicon along with their search results.
- Files with the .ico extension,
- size 16×16 pixels
Service for conversion to ICO format: http://image.online-convert.com/
HTML
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<link rel="icon" href="favicon.ico" type="image/x-icon">
</head>
<body>
</body>
</html>HTML 5: Semantic Tags
- Semantic tags typically carry semantic meaning and have no external HTML formatting. However, they can and should be styled with CSS. These tags are important for code readability and influence search engine rankings.
- Let’s look at examples of semantic tags and their use:
HTML
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Heading</title>
</head>
<body>
<header>
<p>The header element contains information that appears as the site's title. This is usually a company logo and sometimes additional site navigation.</p>
<nav>
<p>nav (short for navigation) element - typically represents a horizontal menu for navigating to specific parts of a website.</p>
</nav>
</header>
<main>
<h1>Main page heading</h1>
<section>
<h2>Section 1</h2>
<article>
<h3>Article 1</h3>
</article>
<article>
<h3>Article 2</h3>
</article>
<article>
<h3>Article 3</h3>
</article>
</section>
<section>
<h2>Section 2</h2>
<article>
<h3>Article 4</h3>
</article>
<article>
<h3>Article 5</h3>
</article>
<article>
<h3>Article 6</h3>
</article>
<div>Regular div, block element</div>
</section>
<aside>
<p>ASIDE - some information related to the topic of the page.</p>
</aside>
</main>
<footer>
<p>© 2026 365education.org. All rights reserved.</p>
</footer>
</body>
</html>Assignment: Format sections of your completed essay or coursework on a web page using semantic tags. Chapters are tags
section, and subchapters are tags article. Don’t insert large sections of text; several paragraphs per subsection are sufficient. All semantic tags must be used.Explore More IT Terms
#
- Using an integrating factor
- Equations in total differentials
- Bernoulli's equation
- Linear differential equations of the first order
- 10 Mixed C++ Challenges to Test Your Skills
- 11 Tricky Non-Technical Questions to Ask in a Recruiting Interview
- 50 Terms Every Programmer Should Know
- 52 Java Thread Interview Questions
- 7 Levels of Using the Zip Function in Python
- 7 Python Code Bugs You Need to Fix
- 70+ Free Resources for Learning Programming
A
- A Comprehensive Guide to HTML and CSS
- A Comprehensive Guide to MODX CMS
- A computer science question tests your ability to work with IP addresses and network masks
- A Guide to SQL Query Formatting for Beginners
- A/B testing
- Abstract Data Type (ADT)
- AES Encryption Algorithm: How It Works and Where It's Used
- Agile
- Algorithm
- Algorithm Analysis
- Algorithm Complexity-Key Points
- Algorithm complexity: deep parsing O(log n)
- Algorithm vs. Program
- Algorithms and Data Structures in C#
- An overview of the C # programming language
- An overview of the Python programming language
- Anaconda Python
- Analysis of graphs and adjacency matrices question
- Android
- Android App Bundle
- Android SDK
- Angular
- Ansible
- Apache
- Apache Airflow
- Apache Kafka
- Apache Tomcat
- App Store
- AppCode
- Applications of microcontrollers: From simple circuits in electronics to complex systems
- Applications of the derivative
- Arduino: How to Program It: Basics for Beginners
- Array-based stack
- ArrayList
- ASCII
- ASP.NET
- Assembly Language Lessons
B
C
- C++ Lessons
- Cache
- Calculating Memory Capacity
- Character sets and encodings
- Characteristics of a good Algorithm
- Circular singly linked list
- Coding Tests with Answers
- Combinational Circuits Solved Questions
- Compiler
- Complexity of algorithms-Tutorial
- Computer Science Fundamentals Test with Answers (47 questions)
- Computer science tests with answers (More than 100 Questions)
- Constants
- Creating a Table in HTML
- Creating Forms in HTML
- Creating Lists
- Cybernetics and informatics
- Cycles
D
- Data Analytics: applications of data analysis in companies
- Data Engineer - Who is it, what does a data engineer do, and an overview of the profession
- Data modeling: what it is, types, and process steps.
- Data preprocessing: a complete guide for beginners and professionals.
- Data structure
- Data Structures and Algorithms (DSA)
- Data types vs. Data structures
- Database Tests with Answers
- Deep Learning
- Defining Aliases
- Defining Arrays
- Deque
- Detailed articles and tutorials on PHP
- Developing a Website from Scratch
- Differential Equations
- Differentiation of functions
- Digital data: understand the importance of this asset for businesses.
- Double integrals
- Doubly linked lists
- DSA Tutorial
E
F
G
H
- Handling errors and exceptions
- Heads or Tails? How Probability Theory Is Used in IT
- History of the development of computer science
- Homogeneous equations
- Homogeneous vs. non-homogeneous structures
- How to effectively organize your workflow
- How to Learn Java: Tips for Beginner Developers
- How to Learn PHP: A Beginner's Guide
- How to Use S3 Storage in Kubernetes with CSI
- HTML
- HTML and CSS: Definition, Application, and Operating Principles
- HTML and CSS. Layout from Scratch: What to Learn, Where to Learn, and How Long Will It Take?
- HTML Frame Structure
- HTML Link Formatting
- HTML Quizzes with Answers
I
- if..else construction
- Infinite sequences and series
- Information properties
- Inheritance in Java: A Complete Guide to Principles and Implementation
- Inserting an Image
- Integration of functions
- Interactive Python Tutorial – Learn Programming from Scratch
- Interpreter
- Interview Problem: Finding a Deleted Element in O(N)
- Interview Scare: The FizzBuzz Challenge
- Introduction to C++
- Introduction to Machine Learning
- Introduction to Networking | Network Fundamentals Part 1
- Introduction to Number Systems (Binary, Octal, Hexadecimal) | Math for CS Foundations #1
- IT Specialist Resume (CV)
J
K
L
M
- Machine Learning
- Machine Learning Basic Tool: NumPy
- Machine Learning Basic Tool: Pandas
- Machine Learning Mathematics
- Mathematics for programmers: what is really needed?
- MD5 encryption algorithm: What is it and why is it needed?
- Microcontroller and Microprocessor - what's the difference?
- ML Engineer: Who They Are, What They Do, How Much They Earn, and How to Become a Neural Network Specialist
- Monte Carlo Simulation: How It Works and What It's For
O
P
- PHP lessons
- Private DNS server and its configuration
- Program code
- Programmer's Dictionary
- Programming
- Programming with pseudocode
- Python Code Formatting Guide: PEP8
- Python for data analysis: how to do it and main libraries
- Python Lessons
- Python Superstar: 5 Ways to Use the * Operator
- Python vs. Julia: Should You Replace Python with Julia?
R
S
- SFML Graphics Library Tutorials
- Sorting Algorithms in Programming: Types, Descriptions, and Comparisons
- SQL commands: see what they are, what the main ones are + examples
- SQL Interview Questions and Tasks
- SQL Lessons
- SQL Stored Procedures
- SQL Syntactic Sugar: The COALESCE Function
- Stack
- Start in analytics: Python or R
- Static vs. dynamic data structures
- Statistical analysis: importance for decision making.
- String formatting in Python
- Structure of computer science
- Swift Lessons
- switch/match construct
- Syntax
T
- Terms in programming
- Text and paragraph formatting tags
- The Complete Guide to Bootstrap
- The Complete Guide to JavaScript
- The concept of information and its transmission
- The Future of Python: Key Trends and Insights from Global Researc
- The Infrastructure of Code: A Complete Guide to Repositories for Languages, Frameworks, and Compilers
- The pip package manager in Python
- The role of informatization in the development of society
- Transfers
- Tricky Java Questions Often Asked in Interviews
- Tutorials / Articles
- TypeScript: What It Is and Why Developers Need It
W
- What are databases, and why do they need DBMS and SQL?
- What do Linux distributions consist of?
- What is .NET and what is it used for?
- What is a data structure?
- What is a GPU in a computer, in simple terms?
- What is a quantum computer: 100,500 problems in one second
- What Is an Algorithm?
- What is Arduino: How it Works and the Platform's Capabilities
- What is Big Data? Introduction, Types, Characteristics, and Examples
- What is FizzBuzz Challenge?
- What is Golang and what is it used for?
- What is Haskell and what is it used for?
- What is Kotlin and what is it used for?
- What is Linux? The History of Linux
- What is machine learning, and how does it work?
- What is Power BI: everything about the data analytics software
- What is recursion, recursive and iterative process in programming?
- What is the C++ programming language?
- What is the OSI Model: A Complete Explanation of the Seven Layers and Their Role in Networking
- What's the difference between x86 and ARM processors?
- Where to start learning the C programming language?
- Which Linux distribution should you choose? A Linux distribution overview

