HTML and CSS Reference
In-Depth Information
});
}
4. Within the function block of this event listener, add a statement that calls the play() method on the
video variable.
// Add an event listener for the play button.
playBtn.addEventListener(“click", function(e) {
// Play the video.
video.play();
});
5. Save the video.js file.
Open the About page in your web browser. If all went according to plan, a Play button should be beneath the video,
as shown in Figure 11-4. Click the button and the video should start playing. Success!
Figure 11-4 The new Play button.
Search WWH ::




Custom Search