@pluginjs/video
v0.8.12
Published
A flexible modern video js plugin.
Downloads
75
Readme
Video
A flexible modern video js plugin.
Introduction
Installation
Yarn
yarn add @pluginjs/video
NPM
npm i @pluginjs/video
Getting Started
CDN:
Development:
<script src="https://unpkg.com/@pluginjs/video/dist/video.js"></script>
<link rel="stylesheet" href="https://unpkg.com/@pluginjs/video/dist/video.css">
Production:
<script src="https://unpkg.com/@pluginjs/video/dist/video.min.js"></script>
<link rel="stylesheet" href="https://unpkg.com/@pluginjs/video/dist/video.min.css">
Initialize
HTML:
<div class="element"></div>
ECMAScript Module:
import Video from "@pluginjs/video"
import "@pluginjs/video/dist/video.css"
Video.of(document.querySelector('.element'), options)
CommonJS:
require("@pluginjs/video/dist/video.css")
const Video = require("@pluginjs/video")
Video.of(document.querySelector('.element'), options)
Browser:
<link rel="stylesheet" href="https://unpkg.com/@pluginjs/video/dist/video.css">
<script src="https://unpkg.com/@pluginjs/video/dist/video.js"></script>
<script>
Pj.video('.element', options)
</script>
API
Options
Options are called on video instances through the video options itself. You can also save the instances to variable for further use.
Name | Description | Default
--|--|--
"template"
| Main structure template | function() {...}
"templates"
| Template blocks | {}
"url"
| Video url | `"id"` | Video id |
"type"
| Different video sources, such as HTML5 Youtube Vimeo | `"autoplay"` | Whether to play automatically when loading video | `true`
`"loop"` | Whether to loop the video | `true`
`"controls"` | Whether to show the video controller | `false`
`"poster"` | Whether to display the poster |
Events
Events are called on video instances through the video events itself. You can also save the instances to variable for further use.
Name | Description
--|--
"ready"
| Gets fired when plugin is ready
"destroy"
| Gets fired when plugin is destroy
"load"
| Gets fired when video is loading
"loaded"
| Gets fired when video is loaded
"play"
| Gets fired when video is play
"pause"
| Gets fired when video is pause
"stop"
| Gets fired when video is stop
"playend"
| Gets fired when video is playend
"playerr"
| Gets fired when video is playerr
Methods
Methods are called on video instances through the video method itself. You can also save the instances to variable for further use.
Name | Description
--|--
"enable"
| Enabled plugin if plugin is disabled
"disable"
| Disable plugin
"destroy"
| Destroy plugin
"pause"
| Pause video
"load"
| Load video
"play"
| Play video
"stop"
| Stop video
"volume"
| Set the video volume
Classes
Name | Description | Default
--||
"NAMESPACE"
| Declare plugin namespace | pj-video
"THEME"
| Declare plugin theme | {namespace}--{theme}
"POSTER"
| Declare plugin poster | {namespace}-poster
Browser support
Tested on all major browsers.
| IE / Edge | Firefox | Chrome | Safari | Opera | | --------- | --------- | --------- | --------- | --------- | | IE11, Edge| last 2 versions| last 2 versions| last 2 versions| last 2 versions|
License
@pluginjs/video is Licensed under the GPL-v3 license.
If you want to use @pluginjs/video project to develop commercial sites, themes, projects, and applications, the Commercial license is the appropriate license. With this option, your source code is kept proprietary.
For purchase an Commercial License, contact us [email protected].
Copyright
Copyright (C) 2022 Creation Studio Limited.