GithubHelp home page GithubHelp logo

video-js-plugins / video.js-rewind-fast-forward Goto Github PK

View Code? Open in Web Editor NEW
0.0 0.0 0.0 1.49 MB

This is a library give you for enable-disable fast forward with rewind

License: MIT License

JavaScript 100.00%
videojs-plugin videojs-skin

video.js-rewind-fast-forward's Introduction

Fast forward with rewind

This is a library give you for enable-disable fast forward with rewind.

Support reactjs

Demo rewind fast forward

Install

npm i @video-js-plugins/videojs-rewind-fast-forward

or with yarn

yarn add @video-js-plugins/videojs-rewind-fast-forward

Usage

Calling a plugin on a player.

player.rewindFastForward(player, rewind)

Params

Name Required Value Default Value Description
player Yes video.js instance - This value is variable from video.js instance
rewind No boolean false This value is to allow to rewind or not. is set true will allow to rewind. if set false disable all progress control

Example

import videojs from "video.js";
import "video.js/dist/video-js.css";

import "@video-js-plugins/videojs-rewind-fast-forward"


export const VideoPlayer = ({ options, onReady }) => {

    const videoRef  = React.useRef(null);
    const playerRef = React.useRef(null);

    React.useEffect(() => {
        // make sure Video.js player is only initialized once
        
        if (!playerRef.current) {
            const videoElement = videoRef.current;
            if (!videoElement) return;

            const player = playerRef.current = videojs(videoElement, options, () => {
                console.log("player is ready");
                onReady && onReady(player);
            });

            player.rewindFastForward(player) // here the plugin rewindFastForward called
        }
    }, [options, videoRef]);

...

// return jsx
<div data-vjs-player>
    <video ref={videoRef} className="video-js-player" />
</div>

video.js-rewind-fast-forward's People

Contributors

otnansirk avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.