Gestures plugin

0.8 KB gzip
@tomato-player/plugin-gestures

Adds touch gestures: double-tap the left or right side to seek, with a ripple showing how far you jumped.

On a touch screen, double-tap the left or right side of the video.

Install

npm i @tomato-player/plugin-gestures

Usage

player.ts — ts
import { createPlayer } from '@tomato-player/core';
import { minimal } from '@tomato-player/skin-minimal';
import { gestures } from '@tomato-player/plugin-gestures';
​
createPlayer('#player', {
src: 'movie.mp4',
skin: minimal(),
plugins: [gestures({ seekStep: 10, zone: 0.35 })],
});

Options

OptionTypeDescription
seekStepnumberSeconds per double-tap (default 10).
zonenumberWidth of each side zone as a fraction of the player (default 0.35).

Other plugins

HotkeysKeyboard shortcuts with familiar defaults, fully remappable.
ChaptersChapters from an array or WebVTT, with seek-bar markers.
ThumbnailsSeek-bar preview thumbnails from WebVTT sprite sheets.
PlaylistNext and previous, auto-advance and loop.
AnalyticsVendor-neutral QoE events: startup time, quartiles, rebuffering, watch time.
Media SessionLock-screen controls, artwork and hardware media keys.
PersistRemember volume, speed, captions and resume position.