npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@straas/videojs-thumbnails

v0.4.0

Published

progress bar thumbnails plugin for video.js

Downloads

70

Readme

Video.js Thumbnails

A plugin that allows you to configure thumbnails to display when the user is hovering over the progress bar or dragging it to seek.

Build Status

Using the Plugin

The plugin automatically registers itself when you include video.thumbnails.js in your page:

<script src='videojs.thumbnails.js'></script>

You probably want to include the default stylesheet, too. It handles showing and hiding thumbnails while hovering over the progress bar and a quick animation during the transition:

<link href="videojs.thumbnails.css" rel="stylesheet">

After calling "videojs" function to create the video, you can activate the thumbnail plugin by specifying the options which schema lists as follows:

videojs.thumbnails({
  preload: true,
  grid: {
    src: "the url of image source",
    tileWidth: 100,
    tileHeight: 100,
    leftToRightAllocation: [{
      src: "this image source will override the parent's src property",
      columnNumber: 3,
      rowNumber: 3,
      interval: 5,
      startPosition: 0,
    }],
    tileSettings: [
      {
        position: 10,
        columnIndex: 0,
        rowIndex: 0
      }
    ]
  }
})

The src key of grid object is an URL pointing to an image that composed of small tile images to form a grid; each tile has the same width and height and can be accessed by the index of column and row.

To display the tile image at the correct time, specifying the position value which ranges from 0 to the video duration.

When the position of the cursor on the progress bar is equal to or greater than the position of the specific tile setting, that tile will display on the progress bar.

If the position of each tile has the same interval, and the order of tiles is from left to right, top to bottom, considering use "leftToRightAllocation" instead of specifying each tile option.

Assign the preload property to true will fetch all the image sources when the document is ready to improve the user experience, this is done by injecting link elements with "rel" attribute which assigned to "preload" value.

Reference: https://developer.mozilla.org/en-US/docs/Web/HTML/Preloading_content