• Home
  • Courses
  • School
  • Programs
  • Problems
  • Contact Us
  • My account
  • Register

Have any question?

(+91) 98222 16647
info@simplycoding.in
RegisterLogin
Simply Coding
  • Home
  • Courses
  • School
  • Programs
  • Problems
  • Contact Us
  • My account
  • Register

Web Designing

HTML Audio and Video tags

  • Categories Web Designing, HTML, HTML
Audio and Video tag in HTML

Audio and Video tags in HTML

Today we will learn about Audio and Video tags in HTML . You can watch our video to learn how to use these tags. Click Here

Audio tag

The <audio> tag is used to embed sound content in html page, such as music clip or any other audio streams.  Within the <audio> tag you can put one or more <source> tags with different audio sources as different browsers support different formats. The browser will automatically pick up the first source it supports.

For e.g.

 <audio>
                <source src=”simple.mp3″ type=”audio/mpeg”>

                < source ….>

                <source …>
         Your browser does not support the audio tag.
</audio>

 

The text between the <audio> and </audio> tags will only be displayed in browsers that do not support the <audio> element.

 

Supporting audio formats in HTML

There are three formats that are supported                                  

MP3 which is Audio format from MPEG (Moving/Motion Pictures Experts Group)

AAC which is Advanced Audio Coding

OGG which is An Open container and free audio format

 

Attributes of audio tag

attributes of audio tag

<Video> Tag

 Video tag is used to embed video content in html page, such as a movie, ad or any video clip.

 

The <video> tag contains one or more <source> tags with different video sources. As different browsers support different video formats, the browser will choose the first source it supports.

E.g.

<video>
                <source src=”horse.mp4″ type=”video/mp4″>

                < source ….>

                <source …>
        Your browser does not support the audio tag.
</video>

 

The text between the <video> and </video> tags will only be displayed in browsers that do not support the <video> element.

 

Supported file formats for video tag

There are three supported video formats in HTML: MP4, WebM, and OGG.

You can add them with type value as shown.

e.g.

<video>
                <source src=”horse.mp4″ type=”video/mp4″>

                <source src=”horse.ogg” type=”video/ogg”>

                <source src=”horse.webm” type=”video/webm”>
  Your browser does not support the audio tag.
</video>

 

Attributes of video tag

Now the attributes autoplay, controls, muted, loop and preload is same as that of audio tag. In addition, it has height and width by which you can set the height and width in pixels of the display area. In addition it has poster tag by which you can specify a url of an image to be shown while the video is downloading, or until the user hits the play button.

 

attribute of video tag

Questions

  1. In HTML what are the supported Audio formats?

Ans.MP3, AAC and OGG are the supported Audio formats.

2. Which of these are supported video formats?

  • MP4
  • WebM
  • OGG
  • Avi
  • mov

Ans.The right answer is MP4, WebM, and OGG are the supported video formats.

  1. Which audio or video attribute specifies that the video will start over again, every time it is finished?

Ans .loop. When we use this attribute, video will restart itself

  1. Which audio or video attribute specifies that the video will start playing as soon as it is ready?

Ans.autoplay. When you specify this video will start playing as soon as its ready.

  1. What is muted attribute used for?

Ans. Muted attribute specifies that the audio output of the video should be muted

  1. Which of these are valid attributes for audio tag?
    • Poster
    • Width
    • Height
    • Autoplay
    • Src
    • muted

Ans.autoplay, src and muted.Remaining such as Poster, width, height are video attributes not audio attributes.

  1. What are the values for attribute preload?

Ans. auto, metadata and none are three values for preload attribute.

Programs

  • Share:
author avatar
Simply Coding

Previous post

Questions on Binary File Handling in Python
June 14, 2021

Next post

HTML List Tags
June 14, 2021

You may also like

HTML Table tags
HTML Table Tags
14 June, 2021
HTML List
HTML List Tags
14 June, 2021
html
HTML: Question Bank
3 November, 2020

Leave A Reply Cancel reply

You must be logged in to post a comment.

Categories

  • Uncategorized
  • Programs
    • Python
    • Java
  • Problems
    • Python
    • Java
    • Web Development
      • Internet
    • Emerging Technologies
  • Notes
    • General
    • QBasic
    • MS Access
    • Web Development
      • XML
      • HTML
      • JavaScript
      • Internet
    • Database
    • Logo Programming
    • Scratch
    • Emerging Trends
      • Artificial Intelligence
      • Internet of Things
      • Cloud Computing
      • Machine Learning
    • Computer Fundamentals
      • Computer Networks
      • E-Services
      • Computer Hardware
    • Python
    • Java
  • School
    • ICSE
      • Computers Class 9
        • Java Introduction
        • Tokens & Data Types
        • Java Operators
        • Math Library
        • if & switch
        • For & While
        • Nested loops
      • Computer Class 10
        • Sample Papers
        • OOPS concepts
        • Functions in Java
        • Constructors
        • Arrays in Java
        • Strings in Java
    • SSC
      • IT Class 11
        • IT Basics
        • DBMS
        • Web Designing
        • Cyber Laws
      • IT Class 12
        • Web Designing
        • SEO
        • Advanced JavaScript
        • Emerging Tech
        • Server Side Scripting
        • E-Com & E-Gov
      • Computer Science 11
      • Computer Science 12
    • CBSE
      • Computer 9
        • Basics of IT
        • Cyber Safety
        • Scratch
        • Python
      • Computer 10
        • Sample Papers
        • Networking
        • HTML
        • Cyber Ethics
        • Scratch
        • Python
      • Computer Science 11
        • Computer Systems
        • Python 11
          • Python Basics
          • Python Tokens
          • Python Operators
          • Python if-else
          • Python loops
          • Python Strings
          • Python List
          • Python Tuple
          • Python Dictionary
          • Python Modules
        • Data Management
      • Computer Science 12
        • Sample Papers
        • Python 12
          • Python Functions
          • Python File Handling
          • Python Libraries
          • Python Recursion
          • Data Structures
        • Computer Networks
        • Data Management
    • ISC
      • Computer Science 11
        • Introduction to Java
        • Values & Data Types
        • Operators
        • if & switch
        • Iterative Statements
        • Functions
        • Arrays
        • String
        • Data Structures
        • Cyber Ethics
      • Computer Science 12
        • Sample Papers
        • Boolean Algebra
        • OOPS
        • Wrapper Classes
        • Functions
        • Arrays
        • String
Simply Coding Computer Courses for School                Privacy Policy     Terms of Use     Contact Us

© 2021 Simply Coding

Login with your site account

Lost your password?

Not a member yet? Register now

Register a new account

Are you a member? Login now