Solved

always show video controls

Posted on 2013-11-07
9
3,223 Views
Last Modified: 2013-11-16
Hello:

How do I always show the video controls on a HTML 5 Video Player? The only time they show is when the mouse hovers over the screen.

	<div id="video-container">
		<!-- Video -->
		<video id="video" width="640" height="365" poster="images/logo.png">
		  <source src="demo.mp4"  type="video/mp4">
		</video>
		<!-- Video Controls -->
		<div id="video-controls">
			<button type="button" id="play-pause" class="play">Play</button>
			<input type="range" id="seek-bar" value="0">
			<button type="button" id="mute">Mute</button>
			<input type="range" id="volume-bar" min="0" max="1" step="0.1" value="1">
			<button type="button" id="full-screen">Full-Screen</button>
		</div>
	</div>

Open in new window

0
Comment
Question by:RecipeDan
  • 4
  • 3
  • 2
9 Comments
 
LVL 53

Expert Comment

by:COBOLdinosaur
ID: 39632124
We will need a link to the page to do a diagnostic.

Cd&
0
 
LVL 1

Author Comment

by:RecipeDan
ID: 39632319
It is not pubic yet. I am creating it on my laptop.
0
 
LVL 10

Expert Comment

by:GeoffSutton
ID: 39632566
<video controls="true" will give you the default controls all the time, if that is what you need.  

According to the documentation, you can use control id "<<video-id>>-video-controls.  So rather than using the id "video-controls" on your controls div, try using "video-video-controls"

See http://dev.opera.com/articles/view/custom-html5-video-player-with-css3-and-jquery/ for full information on building custom video player.
0
 
LVL 1

Author Comment

by:RecipeDan
ID: 39632719
@GeoffSutton. Thank you but I am not familiar with JQuery. What I am trying to do is similiar to YouTube Videos where the video controls are always shown.
0
What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

 
LVL 10

Expert Comment

by:GeoffSutton
ID: 39633923
Try just adding the controls parameter to the video tag.  That will give you controls, although not the ones that you want.  Also, reading the page that I sent you, you can see how they used the naming scheme to link the controls to the video element.  I also strongly recommend becoming familiar with jQuery as it dramatically simplifies element manipulation and makes your job as a developer so much simpler :)
0
 
LVL 10

Expert Comment

by:GeoffSutton
ID: 39633972
Here is a great blog showing you how to wire up custom controls.  You have to use javascript, and it contains no jQuery for you.
http://blog.teamtreehouse.com/building-custom-controls-for-html5-videos

HTH,
G
0
 
LVL 53

Expert Comment

by:COBOLdinosaur
ID: 39633985
dramatically simplifies element manipulation and makes your job as a developer so much simpler

Actually what jquery does is teach you how to avoid learningcoding and understanding how things work; basically crippling your development unless you are already skilled in classical javascript, and knowledgeable of how client technologies work together.

Cd&
0
 
LVL 1

Author Comment

by:RecipeDan
ID: 39635051
@GeoffSutton. The link with the example is exactly what I am talking about. When you run the example, the custom control bar appears and disappears when the mouse is hovered over the video. What I want to do is make that custom control bar always visible.
0
 
LVL 10

Accepted Solution

by:
GeoffSutton earned 500 total points
ID: 39635102
Set a mouseover event on the video element, then using that set the  control element css visible to 'visible'
0

Featured Post

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

Having worked on larger scale sites, we found out that you are bound to look at more scalable solutions to integrating widgets, code snippets or complete applications and mesh them into functional sites, in any given composition. To share some of…
This article describes how to create custom column layout styles for Bootstrap. The article uses 5 columns to illustrate the concept, but the principle can be extended to any number of columns.
In this tutorial viewers will learn how to style transparent/translucent elements using alpha transparency in CSS Start with a normal styled element, such as a div.: Define its "background-color" property as "rgba (255, 255, 255, .5): The numbers in…
In this tutorial viewers will learn how to embed an audio file in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: : The declaration should display (CODE) HTML5 is supported by the most recent versions of all major browsers…

706 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now