Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@theonlyducks/videojs-zoom

Package Overview
Dependencies
Maintainers
0
Versions
19
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@theonlyducks/videojs-zoom

Simple plugin to zoom in video.js player

  • 1.3.4
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
257
increased by23.56%
Maintainers
0
Weekly downloads
 
Created
Source

Video.js Zoom

Simple plugin to zoom in video.js player

Version Project Size Dependencies Licence

Table of contents

  • Documentation
  • Getting started
  • Methods
  • Options
  • Development
  • License

Documentation

Getting started

Requirements

  • With browser Video.js
  • With npm npm istall video.js
  • With yarn yarn add video.js

Installation

  • With browser Download
  • With npm npm install @theonlyducks/videojs-zoom@latest
  • With yarn yarn add @theonlyducks/videojs-zoom@latest

Usage

  • With Browser
<link rel="stylesheet" type="text/css" href="/dist/videojs-zoom.css">
<script src="/dist/videojs-zoom.js"></script>
  • With Node
import '@theonlyducks/videojs-zoom/styles';
import '@theonlyducks/videojs-zoom';

Example

const video = videojs('my-video');
const zoomPlugin = video.zoomPlugin();
zoomPlugin.listen('change', data => {
	console.log(data);
});

Methods

zoom(value): void

Zoom function

  • value
    • type: Number
const zoomPlugin = video.zoomPlugin();
zoomPlugin.zoom(2);

rotate(value): void

Rotate function

  • value
    • type: Number in deg
const zoomPlugin = video.zoomPlugin();
zoomPlugin.rotate(180);

move(x, y): void

Rotate function

  • x
    • type: Number
  • y
    • type: Number
const zoomPlugin = video.zoomPlugin();
zoomPlugin.move(0, 0);

toggle(): void

Open and close modal function

const zoomPlugin = video.zoomPlugin();
zoomPlugin.toggle();

flip(signal): void

Flip video image

  • x
    • type: String use + or - for flip image
const zoomPlugin = video.zoomPlugin();
zoomPlugin.flip("-");

enablePlugin(): void

Enable the plugin if it is disabled

const zoomPlugin = video.zoomPlugin();
zoomPlugin.enablePlugin();

disablePlugin(): void

Disables all visual features of the plugin if enabled

const zoomPlugin = video.zoomPlugin();
zoomPlugin.disablePlugin();

Options

Example:

const zoomPlugin = video.zoomPlugin({
	showZoom: true,
	showMove: true,
	showRotate: true,
	gestureHandler: false
});
  • showZoom show/hide +- zoom buttons. default true
  • showMove show/hide up, left, right, reset and down buttons. default true
  • showRotate show/hide rotate and flip buttons. default true
  • gestureHandler enable gesture zoom drag and drop, wheel. default false

Events

listen(event, callback): void

Listen events of the zoom plugin

  • event
    • type: String
    • options:
      • 'change' when click in buttons modal
      • 'click' when modal is opened or closed
  • callback
    • type: Function
const zoomPlugin = video.zoomPlugin();
zoomPlugin.listen('click', () => {
    console.log('click');
});

Development

Install

yarn

Start server listening https://localhost:3000

yarn start

License

MIT © The Only Ducks

Keywords

FAQs

Package last updated on 05 Aug 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc