HTML5 Audio and Video Flashcards
6 cards from real HTML5 practice questions. Tap to flip, then mark Knew It or Still Learning โ missed cards come back until you master them.
Read the first 6 HTML5 Audio and Video flashcards as text
What does the 'loop' attribute on an HTML5 element do?
Answer: Causes the audio to restart automatically when it finishes
The loop attribute causes the audio element to automatically restart playback from the beginning when the media reaches the end.
Which JavaScript method plays an HTML5 media element?
Answer: play()
The play() method on HTMLMediaElement begins or resumes playback and returns a Promise in modern browsers.
What does the 'muted' attribute on a element do?
Answer: Silences the audio track of the video
The muted attribute sets the default audio state to muted, which is often required by browsers before autoplay is allowed.
Which property of an HTML5 media element reports the current playback position in seconds?
Answer: currentTime
The currentTime property returns or sets the current playback position of the media in seconds.
What does the 'preload' attribute on an HTML5 element hint to the browser?
Answer: How much media data to load before the user starts playing
The preload attribute with values 'none', 'metadata', or 'auto' hints to the browser how much of the media to preload before the user presses play.
Which HTML5 API gives JavaScript programmatic control over media playback, seeking, and volume?
Answer: HTMLMediaElement API
The HTMLMediaElement API provides properties and methods like play(), pause(), currentTime, and volume for controlling audio and video elements.