Being a beginner and having no idea what I’m doing: I’ve been wondering just how hard it is to write a library to manipulate HTML video tags. I look at videojs and I’m baffled before I even begin.
- Is it really necessary to have that much JavaScript, when all you’re doing is fine tuning those tags?
- How do you make sense of what is there, anyway? It just looks like it is spaghetti
- Where do you start? Thoughts?
Top comments (4)
It all depends on what you're trying to do. Videojs looks like a comprehensive solution for a number of things that you may (or may not) care about when showing video on the web. It's also extensible with options to add skins and plugins. It probably deals with a bunch of cross browser issues, wrapping up native classes and so on.
If you are just looking to replace the
controls
of a video component with something you want to build yourself, then you definitely don't need all of that.I'd start with the HTMLVideoElement (and it's parent HTMLMediaElement and see what you can achieve with the API available. Start with controlling playback and showing progress and see how you go. Then decide what you want to attack next.
Thanks, Phil. I did see the MediaElement one and it did look simpler. So I'll take that as a win if I could glean that! I'll have a more in-depth look.
The
HTMLMediaElement
is direct API access to what a<video>
element can do through JavaScript. Ultimately videojs will be accessing that API too.Ah sorry, I was talking about MediaElement.js