Create Custom Controls for your HTML5 Video Player
Today I thought it high time to revisit my Build an HTML5 Video Player tutorial and build upon what we created. That HTML5 player was fully functioning and incorporated quite a bit of functionality, including stop/start, pause, replay, volume, and mute actions. Since then, I received a lot of requests for a slider volume control instead of plus and minus buttons. Seeking and full screen viewing capabilities were also absent in that first incarnation. Therefore, we will be implementing those features today. As a bonus, we’re going to incorporate Access Keys as well.
New Controls
Take a look at the HTML markup below and you’ll notice a couple of new controls: the volume-bar range and the full screen button.
The accesskey attribute specifies a shortcut key to activate/focus a particular element. You can assign any key you wish, but note that the way of accessing the shortcut key varies in different browsers:
Browser
Windows
Linux
Mac
Internet Explorer
[Alt] + accesskey
N/A
N/A
Chrome
[Alt] + accesskey
[Alt] + accesskey
[Control] [Alt] + accesskey
Firefox
[Alt] [Shift] + accesskey
[Alt] [Shift] + accesskey
[Control] [Alt] + accesskey
Safari
[Alt] + accesskey
N/A
[Control] [Alt] + accesskey
Opera
Opera 15 or newer: [Alt] + accesskey Opera 12.1 or older: [Shift] [Esc] + accesskey
Hence, on Windows Chrome, the shortcut for the Play button would be [Alt] + P.
The accesskey functionality is completely built into the browser so no coding is necessary. No additional accessibility information should be required either as the nested text for
The original home of HTML tutorials. HTMLGoodies is a website dedicated to publishing tutorials that cover every aspect of being a web developer. We cover programming and web development tutorials on languages and technologies such as HTML, JavaScript, and CSS. In addition, our articles cover web frameworks like Angular and React.JS, as well as popular Content Management Systems (CMS) that include WordPress, Drupal, and Joomla. Website development platforms like Shopify, Squarespace, and Wix are also featured. Topics related to solid web design and Internet Marketing also find a home on HTMLGoodies, as we discuss UX/UI Design, Search Engine Optimization (SEO), and web dev best practices.
Advertiser Disclosure: Some of the products that appear on this site are from companies from which TechnologyAdvice receives compensation. This compensation may impact how and where products appear on this site including, for example, the order in which they appear. TechnologyAdvice does not include all companies or all types of products available in the marketplace.