/* eslint-disable max-len */ // Type definitions for Video.js 7.8 // Project: https://github.com/videojs/video.js, https://videojs.com // Definitions by: Vincent Bortone // Simon Clériot // Sean Bennett // Christoph Wagner // Gio Freitas // Grzegorz Błaszczyk // Stéphane Roucheray // Adam Eisenreich // Mei Qingguang // Joe Flateau // KuanYu Chu // Carl Kittelberger // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.1 // The Video.js API allows you to interact with the video through // Javascript, whether the browser is playing the video through HTML5 // video, Flash, or any other supported playback technologies. /** * Doubles as the main function for users to create a inplayer instance and also * the main library object. * The `videojs` function can be used to initialize or retrieve a player. * * @param id * Video element or video element ID * * @param [options] * Optional options object for config/settings * * @param [ready] * Optional ready callback * * @return A player instance */ declare function videojs(id: any, options?: videojs.PlayerOptions, ready?: () => void): videojs.Player; export default videojs; export as namespace videojs; declare namespace videojs { /** * Adding languages so that they're available to all players. * Example: `addLanguage('es', { 'Hello': 'Hola' });` * * @param code * The language code or dictionary property * * @param data * The data values to be translated * * @return The resulting language dictionary object */ function addLanguage(code: string, data: LanguageTranslations): LanguageTranslations; /** * Bind (a.k.a proxy or Context). A simple method for changing the context of a function * It also stores a unique id on the function so it can be easily removed from events. * * @param context * The object to bind as scope. * * @param fn * The function to be bound to a scope. * * @param [uid] * An optional unique ID for the function to be set * * @return The new function that will be bound into the context given */ function bind any>(context: any, fn: F, uid?: number): F; /** * Should create a fake `TimeRange` object which mimics an HTML5 time range instance. * * @param start * The start of a single range or an array of ranges * * @param end * The end of a single range. */ function createTimeRanges(start?: number | TimeRange[], end?: number): TimeRange; /** * A suite of browser and device tests from {@link browser}. * */ const browser: Browser; const dom: Dom; /** * Format seconds as a time string, H:MM:SS or M:SS. Supplying a guide (in seconds) * will force a number of leading zeros to cover the length of the guide. * * @param seconds * Number of seconds to be turned into a string * * @param guide * Number (in seconds) to model the string after * * @return Time formatted as H:MM:SS or M:SS */ function formatTime(seconds: number, guide: number): string; /** * Returns an array of all current players. * * @return An array of all players. The array will be in the order that * `Object.keys` provides, which could potentially vary between * JavaScript engines. * */ function getAllPlayers(): Player[]; /** * Get a component class object by name * * @borrows Component.getComponent as getComponent */ const getComponent: typeof Component.getComponent; /** * Get a single player based on an ID or DOM element. * * This is useful if you want to check if an element or ID has an associated * Video.js player, but not create one if it doesn't. * * @param id * An HTML element - `