Browse Hugo Video.js Module

Configure Hugo Video.js Module

Learn how to configure Hugo Video.js Module.

Site Parameters

css_url

NameContextTypeRequiredDefaultSinceExample
css_urlvideo_jsstring-https://unpkg.com/video.js/dist/video-js.min.css--

The style URL.

js_url

NameContextTypeRequiredDefaultSinceExample
js_urlvideo_jsstring-https://unpkg.com/video.js/dist/video.min.js--

The JavaScript URL.

lang_js_url

NameContextTypeRequiredDefaultSinceExample
lang_js_urlvideo_jsstring-https://unpkg.com/video.js/dist/lang/%s.js--

The localization URL, %s is the placeholder of language, please do not change it.

playback_rates

NameContextTypeRequiredDefaultSinceExample
playback_ratesvideo_jsarray-[0.5, 1, 1.5, 2]--

The playback rates.

skip_forward

NameContextTypeRequiredDefaultSinceExample
skip_forwardvideo_jsnumber----

the time to skip forward, in seconds.

Available options: 5, 10, 30.

skip_backward

NameContextTypeRequiredDefaultSinceExample
skip_backwardvideo_jsnumber----

the time to skip backward, in seconds.

Available options: 5, 10, 30.

Site Parameters Example

hugo.yaml

 1params:
 2  video_js:
 3    css_url: https://unpkg.com/video.js/dist/video-js.min.css
 4    js_url: https://unpkg.com/video.js/dist/video.min.js
 5    lang_js_url: https://unpkg.com/video.js/dist/lang/%s.js
 6    playback_rates:
 7    - 0.5
 8    - 1
 9    - 1.5
10    - 2

hugo.toml

1[params]
2  [params.video_js]
3    css_url = 'https://unpkg.com/video.js/dist/video-js.min.css'
4    js_url = 'https://unpkg.com/video.js/dist/video.min.js'
5    lang_js_url = 'https://unpkg.com/video.js/dist/lang/%s.js'
6    playback_rates = [0.5, 1, 1.5, 2]

hugo.json

 1{
 2   "params": {
 3      "video_js": {
 4         "css_url": "https://unpkg.com/video.js/dist/video-js.min.css",
 5         "js_url": "https://unpkg.com/video.js/dist/video.min.js",
 6         "lang_js_url": "https://unpkg.com/video.js/dist/lang/%s.js",
 7         "playback_rates": [
 8            0.5,
 9            1,
10            1.5,
11            2
12         ]
13      }
14   }
15}

Page Parameters

video_js

NameContextTypeRequiredDefaultSinceExample
video_js-boolean-false--

Indicate the current page is using Video.js to load the CSS and JS.

You don’t have to specify the video_js when using shortcode, since this module is able to recognize the pages that using Video.js.