GithubHelp home page GithubHelp logo

igv's Introduction

IGV

Usage

You could just install this repo as a bower component and include the files from it.

  1. Include igv.js and igv.scss in your project. (Requires jQuery.)
  2. Set data-igv-* attributes on one or more DIVs (see below).
  3. Call IGV.run() whenever you're ready for it to enhance the elements.

Data attributes

  • data-igv="foo"required – sets the video name, used for loading files (foo.mp4, foo.webm, etc.)
  • data-igv-loop – optional – makes this an auto-playing, looping video, which will be paused whenever the element is no longer in view.
  • data-igv-scrollelement=".some-class" – optional, only for use in conjunction with data-igv-loop – this sets the video's closest ancestor that matches the given selector as the element whose scroll position will be tracked (for auto-pausing purposes).
  • data-igv-playbutton – adds a play button
  • data-igv-subtitles – IGV will load a subs file too (foo.srt), and load a special version for iOS which has hardcoded subs (foo.subs.mp4).

JavaScript API

IGV.debug = true; // to see debug info
IGV.visibilityThreshold = 50; // default=100
IGV.enableLoopingVideos = false; // eg, if (!Modernizr.videodesktop)

// Set video defaults for 
var defaults = {
  baseURL: '//interactivegraphics.ft-static.com/sites/2013/seasonal-appeal/videos/'
};

IGV.run(defaults, function () {
  // videos have now been set up
});

CSS

The IGV element has these classes added automatically: igv, igv--playing, igv--paused

igv's People

Contributors

callumlocke avatar kavanagh avatar sdbernard avatar

Watchers

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