Initializing Video.js Events0:00
Let's talk about events. So why don't we pull in a file. Do we want to use Elixir? Not yet. Let's just reference a main.js file within the public directory. Okay, so why don't we do this. Let's find the video. You learned how to do that already. Video.js. And we called it myVideo. Okay, so just to make sure it's all working, I will log this to the console. And if we go back to Chrome, give it a refresh. Open Chrome DevTools. There's our player. So it's working. Okay, so first things first, we're going to say video when you're all set to go. So think of this almost like Video.js's version of jQuery's document.ready. Same basic idea. Once everything's loaded and processed and ready to go, then how do we want to proceed? So maybe something as simple as this, just for fun. Let's set a timeout, maybe after three seconds, and we're just going to play.
