Skip to content

Latest commit

 

History

History
46 lines (32 loc) · 1.26 KB

File metadata and controls

46 lines (32 loc) · 1.26 KB

Plugin: Mobile

Adds mobile-specific behaviors for touch devices.

Overview

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

The plugin is automatically no-op on non-touch devices. It relies on the internal player.isTouch flag, so desktop behavior is not affected.

Behavior on touch devices

On touch devices only:

  • A tap on the overlay (.v-overlay) behaves as:
    • First tap (control bar hidden): shows the control bar
    • Next taps (control bar visible): toggles play/pause

Usage

HTML

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

JavaScript

import 'vlitejs/vlite.css';
import Vlitejs from 'vlitejs';
import VlitejsMobile from 'vlitejs/plugins/mobile/mobile.js';

Vlitejs.registerPlugin('mobile', VlitejsMobile);

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