Video Player
Documentation and examples of the video player components.
Additional classes
Class | Description |
---|---|
|
Vertically center aligns the .u-media-player button to the parent class. |
|
Vertically center aligns the .u-media-player button to the parent class and offsets -50% to the left. |
Overview
With the help of a small hs.video-player.js
library, video contents are covered with an image and revealed after clicking to the play
button.
Rules are directly applied to <iframe>
, <embed>
, <video>
, and <object>
elements.
How to use?
Wrap an ID block in a parent element with .u-video-player
and an aspect ratio which triggers the player on click.
Copy-paste the following <script>
near the end of your pages under JS Implementing Plugins to enable it.
Copy-paste the following <script>
near the end of your pages under JS Front to enable it.
Copy-paste the init function under JS Plugins Init., before the closing </body>
tag, to enable it.
This plugin works with Bootstrap's embed utility.
Methods
Options can be passed via data attributes or JavaScript. For data attributes, append the option name to data-
, as in data-target=""
.
Attribute | Description |
---|---|
|
ID of a video player. For example:
![]() |
|
If data-autoplay="" is set to true , the video content will play on click. |
|
Target attribute that fires up the video content based on the parent ID. |
|
Specify a class for managing the video playback style. |