Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

html5 video player with simplest controls (only play and pause)

Somehow, there are really little tutorials out there for html5 video and audio playback.

I simply want to embed video and audio files with customized controls. However, the controls should be fairly simple. I only need a play-button. If clicked, play gets replaced by pause. That's all!

However, I even don't know how to embed/display a video without “preload controls”. Somehow, if I only set (without preload controls) Firefox doesn't even show anything. Chrome does show a black window.

I would love to be able to use jQuery to control the video play and pause button. Maybe you have some little start-approach for me!

Thank you very much!

like image 567
matt Avatar asked Jun 05 '10 08:06

matt


People also ask

How do you add a play and pause button to a video in HTML?

Complete code for Play and Pause button for HTML5 video After you play the video by clicking play button the “Play” text will immediately change into “Pause” text and after you click on pause it will again be “Play”. All these will be done by the addEventListener function of JavaScript.

How do you hide the controls of a video in HTML?

We can hide the controls by not adding the controls attribute to the video element. Even without controls attribute on the elements the user can view the controls section by right-clicking on the video and enabling the show controls .


2 Answers

It's basically all stated here: HTML 5 video custom controls

like image 200
Silvia Avatar answered Oct 16 '22 03:10

Silvia


There's an article co-written by one of the authors (Bruce Lawson) of the above article which, if you scroll down to, shows you how to create your own controls: Introduction to HTML5 video.

like image 31
Ian Devlin Avatar answered Oct 16 '22 02:10

Ian Devlin