Java Reference
In-Depth Information
video.muted = true;
The currentTime property is a number value that can be used to jump to another part of
the clip:
video.currentTime += 10; // jumps forward 10 seconds
The playbackRate property is used to fast-forward or rewind the clip by changing its
value. A value of 1 is playback at normal speed:
video.playbackRate = 8; // fast-forward at 8 times as fast
The loop property is a Boolean value that can be set to true to make the clip repeat in a
loop:
video.loop = true;
The duration property can be used to see how long the clip lasts:
video.duration;
<< 52.209
Audio and video clips also have a number of events that will fire when they occur, includ-
ing:
• the play event, which fires when the clip starts and when it resumes after a pause
• the pause event, which fires when the clip is paused
• the volumechange event, which fires when the volume is changed
These events allow you to respond to any interactions the user has with the video. For ex-
ample, the following event listener can be added to check whether the user has paused the
video:
video.addEventListener("pause", function(event) {
console.log("video has been paused"); }, false)
Search WWH ::




Custom Search