Explore advanced multimedia features in HTML with 30 multiple-choice questions covering interactive media, embedding media streams, and customizing <audio> and <video> players using JavaScript. This guide is perfect for web developers looking to enhance multimedia integration.
Which HTML tag is used to specify subtitles for a video? a) <caption> b) <sub> c) <track> d) <video>
What is the purpose of the <track> tag in HTML? a) To add music to the video b) To specify metadata for the video c) To add captions, subtitles, or descriptions to the video d) To change video resolution
What is required inside the <track> tag to define the subtitles? a) src attribute b) video source c) audio source d) playback rate
Which attribute of the <track> tag specifies the type of text track? a) kind b) type c) src d) label
What is the default kind of track for the <track> tag if no kind is specified? a) subtitles b) captions c) descriptions d) metadata
Which of the following is an appropriate file format for subtitles in the <track> tag? a) .mp3 b) .srt c) .wav d) .mp4
What does the “srclang” attribute in the <track> tag specify? a) Language of the video b) Language of the track c) Source of the video d) Source of the track
Can multiple <track> tags be added to a video? a) Yes, for different languages and formats b) No, only one <track> tag is allowed c) Yes, but only for audio tracks d) Yes, but only for captions
What does the “default” attribute in the <track> tag indicate? a) To display the track by default b) To enable autoplay for the track c) To indicate the track type d) To add the track as a background music
Which of the following is a valid value for the “kind” attribute in the <track> tag? a) audio b) caption c) subtitle d) description
Embedding Media Streams
What HTML tag is used to embed audio or video media on a webpage? a) <media> b) <video> c) <embed> d) <audio>
Which protocol is commonly used for embedding media streams in HTML5? a) FTP b) HTTP c) RTSP d) HTTPS
Which HTML tag allows embedding a streaming video from YouTube or other media platforms? a) <media> b) <video> c) <iframe> d) <embed>
What attribute in the <video> tag specifies the source URL for the media stream? a) source b) src c) file d) url
Which video streaming format is typically supported by the HTML5 <video> element? a) .flv b) .mp4 c) .mkv d) .mov
What is the purpose of the “controls” attribute in the <audio> and <video> tags? a) To loop the media b) To automatically play the media c) To add play, pause, and volume buttons d) To adjust the resolution of the media
Can you stream live media using the HTML5 <video> element? a) Yes, by using a proper streaming protocol b) No, the <video> element only supports recorded media c) Yes, by adding a live flag to the <video> element d) No, live streaming is only possible with the <audio> element
Which attribute is used to specify the media type in the <audio> or <video> tag? a) type b) format c) media-type d) mime-type
How do you specify the poster image that appears before a video plays? a) Using the “poster” attribute in the <video> tag b) Using the “cover” attribute in the <audio> tag c) By using an <img> tag before the video d) By using the “src” attribute in the <track> tag
What does the “preload” attribute in the <audio> or <video> tag control? a) The looping behavior of the media b) Whether to preload the media before playback c) The media resolution d) The font size of subtitles
Customizing <audio> and <video> with JavaScript
Which JavaScript method is used to play an audio or video element? a) play() b) start() c) begin() d) run()
How do you pause an <audio> or <video> element using JavaScript? a) pause() b) stop() c) end() d) halt()
Which JavaScript method is used to change the current time of an <audio> or <video> element? a) setTime() b) changeTime() c) currentTime() d) seekTo()
How can you check if an audio or video element is paused using JavaScript? a) element.isPaused() b) element.paused c) element.playing d) element.state == ‘paused’
Which JavaScript event is triggered when an audio or video finishes playing? a) onplay b) onpause c) onended d) onstop
What is the correct JavaScript method to mute an audio or video element? a) mute() b) volume = 0 c) setMute() d) audio.muted = true
Which JavaScript property can be used to control the volume of an audio or video element? a) volume() b) volumeLevel c) volume d) soundLevel
How do you loop an audio or video element using JavaScript? a) element.loop = true b) element.repeat = true c) element.replay() d) element.cycle = true
What does the “autoplay” attribute do when used in <audio> or <video> tags? a) Starts the media automatically when the page loads b) Loops the media continuously c) Displays a preview of the media d) Makes the media pause automatically
How do you control whether a video element shows a poster image before playing, using JavaScript? a) video.poster = ‘image.jpg’; b) video.showPoster = true; c) video.posterImage() d) video.displayPoster = true;
Answer Key:
Qno
Answer
1
c) <track>
2
c) To add captions, subtitles, or descriptions to the video
3
a) src attribute
4
a) kind
5
b) captions
6
b) .srt
7
b) Language of the track
8
a) Yes, for different languages and formats
9
a) To display the track by default
10
b) caption
11
b) <video>
12
c) RTSP
13
c) <iframe>
14
b) src
15
b) .mp4
16
c) To add play, pause, and volume buttons
17
a) Yes, by using a proper streaming protocol
18
a) type
19
a) Using the “poster” attribute in the <video> tag
20
b) Whether to preload the media before playback
21
a) play()
22
a) pause()
23
c) currentTime()
24
b) element.paused
25
c) onended
26
b) volume = 0
27
c) volume
28
a) element.loop = true
29
a) Starts the media automatically when the page loads