Skip to content

Files

Latest commit

 

History

History
62 lines (46 loc) · 2 KB

README.md

File metadata and controls

62 lines (46 loc) · 2 KB

Plugin: Hotkeys

Supports for hotkeys to add keyboard shortcuts.

The player accepts the following keyboard shortcuts.

Key Action
space Toggle playback
Esc Exit the fullscreen
Seek backward of 5s
Seek forward of 5s
Increase volume of 10%
Decrease volume of 10%

Overview

Name hotkeys
Path vlitejs/plugins/hotkeys
Entry point vlitejs/plugins/hotkeys/hotkeys.js
Provider² 'html5', 'youtube', 'vimeo', 'dailymotion'
Media type³ 'video', 'audio'

Usage

HTML

<video id="player" src="<path_to_video_mp4>"></video>

JavaScript

import 'vlitejs/vlite.css';
import Vlitejs from 'vlitejs';
import VlitejsHotkeys from 'vlitejs/plugins/hotkeys.js';

Vlitejs.registerPlugin('hotkeys', VlitejsHotkeys);

new Vlitejs('#player', {
  plugins: ['hotkeys']
});

Configuration

The plugin allows customization with an optional object as the third parameter of the registerPlugin function.

Event Type Type Default Description
seekTime Number 5 Set seek time seconds of the backward and forward shortcuts
volumeStep Number 0.1 Set the volume step (between 0 and 1) of the increase and decrease shortcuts
Vlitejs.registerPlugin('hotkeys', VlitejsHotkeys, {
  seekTime: 3,
  volumeStep: 0.2
});