Initializing Video.js Player0:41
I'll put this at the bottom of the page, and then this one within my head, of course. Okay. So, with that alone, if I go back to Chrome and we load our site, we're still not going to see anything. It looks like it hasn't hooked in just yet, and it hasn't. We have to use a class to tell Video.js where our player is and where we want it to be activated. So, we come back. I'll give this a class of Video.js. That's just the necessary styling to make the player look like you'd expect. And then I will also add a data-setup attribute here, and we can default that to an empty
Getting Player Instance3:34
Let's give this an ID of myVideo. Now what you'll find here is that because we pulled in Video.js, you also have a Video.js global function that you can reference anywhere. So for example, I could say var video equals Video.js, and then I pass in our ID here. Now what you'll find here is that because we pulled in Video.js, you also get a global Video.js function out of the box. So that means, for example, if we reference our ID, yeah, you're going to get a player instance in response. So why don't we store that within a variable? And now, you know what, you already know some of the API, and that's because Video.js will
Testing Basic Player API6:00
So let's give it a refresh. Try it again. And then let's manually go up here. There we go. OK. Video.pause. Video.currentTime is 1 second. And there you go. It has moved back accordingly. OK, so already you know a lot here.
