1.3.5 • Published 10 months ago
@theonlyducks/videojs-zoom v1.3.5
Video.js Zoom
Simple plugin to zoom in video.js player
Table of contents
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: Numberin 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: Stringuse + 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
});- showZoomshow/hide +- zoom buttons. default- true
- showMoveshow/hide up, left, right, reset and down buttons. default- true
- showRotateshow/hide rotate and flip buttons. default- true
- gestureHandlerenable 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
yarnStart server listening https://localhost:3000
yarn startLicense
1.3.5
10 months ago
1.3.4
1 year ago
1.3.1
2 years ago
1.3.0
2 years ago
1.2.0
2 years ago
1.1.2
3 years ago
1.1.0
3 years ago
1.0.16
3 years ago
1.0.14
3 years ago
1.0.13
3 years ago
1.0.12
3 years ago
1.0.11
3 years ago
1.0.10
3 years ago
1.0.9
3 years ago
1.0.8
3 years ago
1.0.7
3 years ago
1.0.6
3 years ago
1.0.5
3 years ago
1.0.4
3 years ago
1.0.3
3 years ago
1.0.2
3 years ago
1.0.1
3 years ago
1.0.0
3 years ago