@types/videojs-seek-buttons
TypeScript icon, indicating that this package has built-in type declarations

2.1.3 • Public • Published

Installation

npm install --save @types/videojs-seek-buttons

Summary

This package contains type definitions for videojs-seek-buttons (https://github.com/mister-ben/videojs-seek-buttons#readme).

Details

Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/videojs-seek-buttons.

index.d.ts

// eslint-disable-next-line @definitelytyped/no-import-default-of-export-equals
import videojs from "video.js";

/**
 * A video.js plugin.
 *
 * In the plugin function, the value of `this` is a video.js `Player`
 * instance. You cannot rely on the player being in a "ready" state here,
 * depending on how the plugin is invoked. This may or may not be important
 * to you; if not, remove the wait for "ready"!
 *
 * @param     [options={}]
 *           An object of options left to the plugin author to define.
 */
declare function seekButtons(options?: seekButtons.Options): void;

declare namespace seekButtons {
    const VERSION: typeof videojs.VERSION;
    interface SeekButtonOptions {
        direction: "forward" | "back";
        seconds: number;
    }

    class SeekButton extends videojs.Button {
        /**
         * Constructor for class
         *
         * @param player The player
         * @param options Button options
         */
        constructor(player: videojs.Player, options?: SeekButtonOptions);
        /**
         * Return button class names which include the seek amount.
         *
         * @return css class string
         */
        buildCSSClass(): string;
        /**
         * Seek with the button's configured offset
         */
        handleClick(): void;
    }

    interface Options {
        /**
         * if a number greater than 0, a seek forward button will be added which seeks that number of seconds
         */
        forward?: number | undefined;
        /**
         * if a number greater than 0, a seek back button will be added which seeks that number of seconds
         */
        back?: number | undefined;
        /**
         * the position in the control bar to insert the button.
         * @default 1
         */
        forwardIndex?: number | undefined;
        /**
         * the position in the control bar to insert the button
         * @default 1
         */
        backIndex?: number | undefined;
    }
}

export = seekButtons;

declare module "video.js" {
    interface VideoJsPlayer {
        seekButtons: typeof seekButtons;
    }
    interface VideoJsPlayerPluginOptions {
        seekButtons?: seekButtons.Options;
    }
}

Additional Details

  • Last updated: Tue, 07 Nov 2023 15:11:36 GMT
  • Dependencies: @types/video.js

Credits

These definitions were written by Piotr Błażejewicz.

Readme

Keywords

none

Package Sidebar

Install

npm i @types/videojs-seek-buttons

Weekly Downloads

1,954

Version

2.1.3

License

MIT

Unpacked Size

7.19 kB

Total Files

5

Last publish

Collaborators

  • types