Nine Percent Milk

    @pluginjs/bg-video

    0.8.12 • Public • Published

    BgVideo

    npm package

    A flexible modern bg-video js plugin.

    Samples

    Introduction

    Installation

    Yarn

    yarn add @pluginjs/bg-video

    NPM

    npm i @pluginjs/bg-video

    Getting Started

    CDN:

    Development:

    <script src="https://unpkg.com/@pluginjs/bg-video/dist/bg-video.js"></script>
    <link rel="stylesheet" href="https://unpkg.com/@pluginjs/bg-video/dist/bg-video.css">

    Production:

    <script src="https://unpkg.com/@pluginjs/bg-video/dist/bg-video.min.js"></script>
    <link rel="stylesheet" href="https://unpkg.com/@pluginjs/bg-video/dist/bg-video.min.css">

    Initialize

    HTML:

    <div class="element"></div>

    ECMAScript Module:

    import BgVideo from "@pluginjs/bg-video"
    import "@pluginjs/bg-video/dist/bg-video.css"
    
    BgVideo.of(document.querySelector('.element'), options)

    CommonJS:

    require("@pluginjs/bg-video/dist/bg-video.css")
    const BgVideo = require("@pluginjs/bg-video")
    
    BgVideo.of(document.querySelector('.element'), options)

    Browser:

    <link rel="stylesheet" href="https://unpkg.com/@pluginjs/bg-video/dist/bg-video.css">
    <script src="https://unpkg.com/@pluginjs/bg-video/dist/bg-video.js"></script>
    <script>
      Pj.bgVideo('.element', options)
    </script>

    API

    Options

    Options are called on bgVideo instances through the bgVideo options itself. You can also save the instances to variable for further use.

    Name Description Default
    "template" Main structure template function() {...}
    "type" Different video sources, such as HTML5 Youtube Vimeo ``
    "video" Video configuration {"id":"","url":"","mute":true,"repeat":true,"autoplay":true,"mobileImage":""}

    Events

    Events are called on bgVideo instances through the bgVideo 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
    "play" Gets fired when video is play
    "pause" Gets fired when video is pause
    "stop" Gets fired when video is stop

    Methods

    Methods are called on bgVideo instances through the bgVideo method itself. You can also save the instances to variable for further use.

    Name Description
    "destroy" Destroy plugin
    "play" Play video
    "pause" Pause video
    "stop" Stop video
    "setVolume" Set the video volume
    "change" Switch video

    Classes

    Name | Description | Default --|| "NAMESPACE" | Declare plugin namespace | pj-bgVideo "OVERLAY" | Declare plugin overlay | {namespace}-overlay "POINTEREVENTNONE" | Event penetration effect | pointer-events-none

    Browser support

    Tested on all major browsers.

    IE / EdgeIE / Edge FirefoxFirefox ChromeChrome SafariSafari OperaOpera
    IE11, Edge last 2 versions last 2 versions last 2 versions last 2 versions

    License

    @pluginjs/bg-video is Licensed under the GPL-v3 license.

    If you want to use @pluginjs/bg-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 purchase@thecreation.co.

    Copyright

    Copyright (C) 2022 Creation Studio Limited.

    Keywords

    none

    Install

    npm i @pluginjs/bg-video

    Homepage

    pluginjs.com

    DownloadsWeekly Downloads

    66

    Version

    0.8.12

    License

    GPL-3.0

    Unpacked Size

    33.2 kB

    Total Files

    13

    Last publish

    Collaborators

    • thecreation
    • kaptinlin