Giter VIP home page Giter VIP logo

videojs-bif's Introduction

videojs-bif

Video.js plugin for supporting BIF.

For more information on BIF, see https://sdkdocs.roku.com/display/sdkdoc/Trick+Mode+Support.

Example

Getting Started

Include

<script src="/path/to/videojs.bif.min.js"></script>

Enable

// Generally BIF files are large, so you have the ability to manage fetching on your own.
// If this is the route you take, you can update plugin configuration at any time by rerunning the plugin.
//
// See documentation or example for more detail.
videojs('player_id').bif({
  src: '/path/to/bif.bif',
});

Note: There are multiple ways to enable plugins. For more information, please visit Video.js.

Options

[createBIFImage]

Type: function
Default:

createBIFImage() {
  const BIFImage = document.createElement('img');

  BIFImage.className = 'bif-image';

  return BIFImage;
}

Will be updated with new image previews—dependent on the current mouse over time in the video.

[createBIFTime]

Type: function
Default:

createBIFTime() {
  const BIFTime = document.createElement('span');

  BIFTime.className = 'bif-time';

  return BIFTime;
}

Will be updated with new time—dependent on the current mouse over time in the video.

data

Type: ArrayBuffer

[template]

Type: function
Default:

template() {
  const template = document.createElement('div');

  template.className = 'bif';

  // append image element only if the images are ready
  if (this.hasImages()) {
    template.appendChild(this.BIFImage);
  }

  template.appendChild(this.BIFTime);

  return template;
}

Will be updated every time configuration changes—default implementation will show time immediately, then show images when available.

[src]

Type: string

The source must abide by the BIF format.

Contributing + Example

npm install -g grunt-cli

npm install

npm start

License

Code licensed under The MIT License.

videojs-bif's People

Contributors

chemoish 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.