Git Product home page Git Product logo

videojs-markers's Introduction

Video.js Markers

Alt text

A plugin that displays customizable markers upon progress bars of the video with Video.js. This could be used to show video breaks and show overlaid text on the video when playback reaches the specific break point.

Demo and Documentation

See [here] (http://www.sampingchuang.com/videojs-markers)

JSBin Demo can be found [here] (http://jsbin.com/befob/7/edit)

Features

  • Display markers on progress bar, with hover-over tooltips
  • Display break overlays
  • Flexible styling
  • Support dynamically adding and removing markers

Quick Start

Add the 'videojs.markers.js' plugin and stylesheet after including videojs script and jQuery library

<link href="http://vjs.zencdn.net/4.2/video-js.css" rel="stylesheet">
<link href="videojs.markers.css" rel="stylesheet">
<script src="http://code.jquery.com/jquery-2.0.3.min.js"></script>
<script src="http://vjs.zencdn.net/4.2/video.js"></script>
<script src='../src/videojs.markers.js'></script>

Basic usage: display break markers in the video.

To add breaks in the video, simply add a new time (in seconds) in the list of breaks option.

// initialize video.js
var video = videojs('test_video');

//load the marker plugin
video.markers({
  markers: [
     {time: 9.5, text: "this"},
     {time: 16,  text: "is"},
     {time: 23.6,text: "so"},
     {time: 28,  text: "cool"}
  ]
});

Customize marker style:

The style of the markers could be modified by passing an optional setting "markerStyle" with your preference of css styles.

video.markers({
  markerStyle: {
     'width':'8px',
     'background-color': 'red'
  },
  markers: [
     {time: 9.5, text: "this"},
     {time: 16,  text: "is"},
     {time: 23.6,text: "so"},
     {time: 28,  text: "cool"}
  ]    
});

History

  • 0.4
    • change display_time to displayTime
    • markers now takes an array of object containing time, text, overlay text
    • add markerReached callback
    • markerTip and overlay text is now a clalback function for higher flexibility
    • Add many markers APIs for adding and removing markers dynamically.
  • 0.1
    • initial release

License

This project is licensed under MIT.

videojs-markers's People

Contributors

spchuang avatar rgauss avatar shanet avatar davibe avatar andekande avatar

Watchers

Manuel Ramirez 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.