Giter Club home page Giter Club logo

video-step-player's Introduction

Step Player

A plugin for video

Getting Started

Once you've added the plugin script to your page, you can use it with any video:

<script src="video.js"></script>
<script src="stepplayer.js"></script>
<script>
  videojs(document.querySelector('video')).stepplayer({
  	steps:[
  		{time: x},
  		{time: y},
  		{time: z},
  		...
  	]
  });
</script>

There's also a working example of the plugin you can check out if you're having trouble.

Documentation

Plugin Options

You may pass in an options object to the plugin upon initialization. This object may contain any of the following properties:

hasAccordion

Type: boolean Default: true

It initiates the default accordion state and toggle method. Set hasAccordion: false to disable the default collapse function.

If hasAccordion: true, set up your accordion using data-step attribute with according step number, see below:

	<div class="accordion">
		// If the first time value in steps is not equal to 0,
		// add an introduction section by setting the data-step to 0
    <div class="accordion-group" data-step="0">
      <div class="accordion-heading">
        <a class="accordion-toggle"> Introduction</a>
      </div>
      <div id="step0" class="accordion-body collapse in">
        <div class="accordion-inner">some description</div>
      </div>
    </div>
    <div class="accordion-group" data-step="1">
      <div class="accordion-heading">
        <a class="accordion-toggle"> Step 1</a>
      </div>
      <div id="step1" class="accordion-body collapse in">
        <div class="accordion-inner">some description</div>
      </div>
    </div>

accordionCtrl

Type: boolean Default: true

This propoty controls the click event of accordions. If it is set to true, toogling accordion will jump the video to its according point. Otherwise, it will not interfere with the video player.

classname

Type: String Default: "vjs-stepplayer"

Set your own classname to customize the css of video player control bar.

keyboard

Type: boolean Default: true

It enables/disables the keyboard control of video player. Currently enabled keyboard controls includes:

  • Space key to play/pause video
  • Left arrow key to the previous section
  • right arrow key to the next section

steps

Type: array Default: []

The steps propoty takes in a array of objects, each of which should at least contains a time propoty, like this: {time: 10}

onReachedCallback

Type: function Default: null

This propoty takes a callbck function. It fires when the video player is reached preset stop points.

Release History

  • 0.1.0: Initial release

video-step-player's People

Contributors

litopia avatar

Watchers

James Cloos avatar  avatar

video-step-player's Issues

Add Spacebar Control

Can you please add the ability to start and pause playback using the keyboard spacebar.

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.