JavaScript is the language, find something useful that will allow you to write the JavaScript for the HTML elements (
audio
or
video
). In most cases, ready-made plugins are a great solution to those problems. You can get a media player, embed it in your website and it handles everything for you. You don't have to do anything at all, most of them are free of cost and free of royalty also. I would also recommend that you get one of those plugins and use them rather than wasting 2-5 months in writing a new plugin by
asking for more code.
This
Google search[
^] gave like 10+ results for JavaScript plugins (jQuery plugins are built on top of jQuery; which in turn is written on top of JavaScript). You can chose from either one of them, and embed them in your code. Writing a plugin is easy, but needs much more understanding before you can do anything useful. :-)