WEEK 5: Audio/Video API
(February 3 & 5)

To Do This Week:

Start Javascript Codecademy #2 (DUE February 19)


View Interactive Websites

 

Review

 

New Stuff

Random Numbers:

Generate a random number in a range:

// Random generator
function getRandomInt(min, max) {
    return Math.floor(Math.random() * (max - min + 1)) + min;
}

getRandomInt(5, 10);

Audio/Video Element & JavaScript:

Important notes:

Examples:


In-class Exercise

Audio/Video API

Student Pairings

Project: Build a page with a video player and synced comments. Students use the Audio/Video API and timeupdate events to change text commentary as the video plays. 

Main Concepts: Audio/Video API, DOM manipulation, event listeners, and time-based updates.