HTML_Multimedia_Examples
HTML_Multimedia_Examples
What is Multimedia?
Multimedia is any content you can see or hear—like sound, music, videos, pictures, or animations.
Browser Support
Modern browsers support many multimedia formats. Older browsers only supported text.
Multimedia Formats
Multimedia files come in various formats like .mp4, .mp3, .ogg, .webm, .wav, etc. Browsers support only some formats
directly.
Animation Examples
GIF:
Output:
Displays an animated GIF named "animation.gif" with a width of 300 pixels.
CSS Animation: Output:
Shows a red box that moves left to right continuously across 100px.
Tip:
Use multiple sources for audio/video to ensure it works in all browsers.
HTML Video
HTML <video> element is used to embed video files on a webpage.
Autoplay Example:
Automatically play a video when the page loads.
Output:
Video starts playing automatically when the page loads
without sound (muted). No play button is required initially.
Output:
Displays a video with play/pause controls and two buttons.
Clicking Play starts the video, clicking Pause stops it.
HTML Audio
The <audio> tag is used to play sound files in a webpage.
How It Works:
controls: adds play, pause, and volume controls.
<source>: supports multiple audio formats for browser compatibility.
Text between <audio> tags shows if the browser doesn’t support audio.
Browser Support:
All major browsers (Chrome, Firefox, Safari, Edge, Opera) support the <audio> element.
MP3 audio/mpeg
WAV audio/wav
OGG audio/ogg
HTML Plug-ins
Plug-ins extend browser functionality (e.g., run Java applets, display Flash, play media).
Note: Most plug-ins (Java, Flash, ActiveX) are no longer supported by modern browsers.
Warning !
Most browsers no longer support Java Applets and Plug-ins. ActiveX controls are no longer supported in any browsers.
The support for Shockwave Flash has also been turned off in modern browsers.
The <object> Element
Embeds external files like images, PDFs, or HTML within a page.
Output:
Displays the content of snippet.html inside a 100% wide, 500px tall container. If snippet.html is a valid HTML file, its
content (like text, images, or formatting) is shown embedded on the page.
Output:
Shows the image audi1.jpeg inside the object container. If the image exists, it will be rendered just like a normal image
tag.
Output:
Displays the image audi1.jpeg directly in the page using the embed tag. Functions similar to an <img> element.
Note that the <embed> element does not have a closing tag. It can not contain alternative text.
Output:
Displays the contents of snippet.html inside a 100% wide, 500px tall embedded frame. HTML content from the file
appears as part of the current page layout.
Example
Output:
Video loops endlessly after finishing.