npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

videojs-mobile-ui

v1.1.1

Published

Mobile tap controls and fullscreen on rotate for Video.js

Downloads

22,692

Readme

videojs-mobile-ui

Mobile UI for Video.js.

Touch controls:

  • Double-tap the left side of the player to rewind ten seconds
  • Double-tap the right side of the player to fast-forward ten seconds
  • Single-tap the screen to show a play/pause toggle

Fullscreen control:

  • Rotate to landscape to enter Fullscreen
  • Lock to fullscreen on rotate
  • Always lock to landscape when entering fullscreen (works even when device rotation is disabled/non-functional)

Table of Contents

Installation

Installation

npm install video.js
npm install videojs-mobile-ui

Version 1.x requires video.js 8.x as a peer dependency. Lowever video.js versions are not supported. 0.7.0 supports video.js 7.x. To install the latest version that works with Video.js 7, use the latest7 tag:

npm install videojs-mobile-ui@latest7

Plugin Options

Default options

{
  fullscreen: {
    enterOnRotate: true,
    exitOnRotate: true,
    lockOnRotate: true,
    lockToLandscapeOnEnter: false,
    disabled: false
  },
  touchControls: {
    seekSeconds: 10,
    tapTimeout: 300,
    disableOnEnd: false,
    disabled: false,
  }
};

Options

  • fullscreen.enterOnRotate boolean Whether to go fullscreen when rotating to landscape
  • fullscreen.exitOnRotate boolean Whether to leave fullscreen when rotating to portrait (if not locked)
  • fullscreen.lockOnRotate boolean Whether to lock to fullscreen when rotating to landscape
  • fullscreen.lockToLandscapeOnEnter boolean Whether to lock to landscape when entering fullscreen (works even when device rotation is disabled/non-functional)
  • fullscreen.disabled boolean If true no fullscreen handling except the deprecated iOS fullwindow hack
  • touchControls.seekSeconds int Seconds to seek when double-tapping
  • touchControls.tapTimeout int Milliseconds to consider a double-tap
  • touchControls.disableOnEnd boolean Whether to disable touch controls when the video has ended, e.g. if an endscreen is used. Automatically disables if the endscreen plugin is present when this plugin initialises
  • touchControls.disabled boolean If true no touch controls are added.

Usage

To include videojs-mobile-ui on your website or web application, use any of the following methods.

<script> Tag

This is the simplest case. Get the script in whatever way you prefer and include the plugin after you include video.js, so that the videojs global is available.

<link rel="stylesheet" href="//path/to/videojs-mobile-ui.css">  
<script src="//path/to/video.min.js"></script>
<script src="//path/to/videojs-mobile-ui.min.js"></script>
<script>
  var player = videojs('my-video');

  player.mobileUi();
</script>

The release versions will be available on jdselivr, unpkg etc.

  • https://cdn.jsdelivr.net/npm/videojs-mobile-ui/dist/videojs-mobile-ui.min.js
  • https://cdn.jsdelivr.net/npm/videojs-mobile-ui/dist/videojs-mobile-ui.css

Browserify/CommonJS

When using with Browserify, install videojs-mobile-ui via npm and require the plugin as you would any other module.

var videojs = require('video.js');

// The actual plugin function is exported by this module, but it is also
// attached to the `Player.prototype`; so, there is no need to assign it
// to a variable.
require('videojs-mobile-ui');

var player = videojs('my-video');

player.mobileUi();

Also include the CSS.

RequireJS/AMD

When using with RequireJS (or another AMD library), get the script in whatever way you prefer and require the plugin as you normally would:

require(['video.js', 'videojs-mobile-ui'], function(videojs) {
  var player = videojs('my-video');

  player.mobileUi();
});

Also include the CSS.

Import

To import into React etc import both the package and the script

import videojs from 'video.js'
import 'videojs-mobile-ui/dist/videojs-mobile-ui.css';
import 'videojs-mobile-ui';

License

MIT. Copyright (c) mister-ben <[email protected]>