1
0
mirror of https://github.com/videojs/video.js.git synced 2024-11-24 08:42:25 +02:00

Update typescript and jsdoc, use @import (#8723)

This commit is contained in:
mister-ben 2024-05-15 15:02:01 +02:00 committed by GitHub
parent 7b0aede1c3
commit f05769d116
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
73 changed files with 367 additions and 244 deletions

69
.jsdoc.js Normal file
View File

@ -0,0 +1,69 @@
"use strict";
const pkg = require('./package.json');
module.exports = {
source: {
include: ['src/js/'],
includePattern: '.js$',
},
opts: {
destination: 'docs/api',
readme: 'docs/index.md',
template: 'node_modules/clean-jsdoc-theme',
package: '',
recurse: true,
encoding: 'utf8',
theme_opts: {
homepageTitle: 'Video.js API docs',
menu: [
{
title: 'Video.js website',
link: 'https://videojs.com',
class: 'link-vjs',
},
{
title: `v${pkg.version} source`,
link: 'https://github.com/videojs/video.js',
class: 'link-gh',
},
{
title: 'Twitter',
link: 'https://twitter.com/videojs',
class: 'link-tw',
},
],
favicon: 'https://videojs.com/favicon.ico',
footer:
'<span class="copyright"><a href="https://videojs.com">Video.js</a> is a free and open source HTML5 video player. © <a href="https://brightcove.com" target="_blank">Brightcove, Inc</a>. <a href="https://github.com/videojs/video.js/blob/master/LICENSE" class="button blue" target="_blank">View license</a></span>',
include_css: ['./build/docs/styles/videojs.css'],
displayModuleHeade: true,
meta: [
{
name: 'name',
content: 'Video.js API documentation',
},
{
name: 'description',
content:
`Generated API documentation for the latest version of Video.js (${pkg.version}).`,
},
],
},
},
templates: {
default: {
staticFiles: {
include: ['build/docs/'],
},
},
},
plugins: [
'plugins/markdown',
'build/jsdoc-typeof-plugin',
],
markdown: {
tags: ['example'],
idInHeadings: true,
},
};

View File

@ -1,72 +0,0 @@
{
"source": {
"include": [
"src/js/"
],
"includePattern": ".js$"
},
"opts": {
"destination": "docs/api",
"readme": "docs/index.md",
"template": "node_modules/clean-jsdoc-theme",
"package": "",
"recurse": true,
"encoding": "utf8",
"theme_opts": {
"homepageTitle": "Video.js API docs",
"menu": [
{
"title": "Video.js website",
"link": "https://videojs.com",
"class": "link-vjs"
},
{
"title": "v8.2.1 source",
"link": "https://github.com/videojs/video.js",
"class": "link-gh"
},
{
"title": "Twitter",
"link": "https://twitter.com/videojs",
"class": "link-tw"
}
],
"favicon": "https://videojs.com/favicon.ico",
"footer": "<span class='copyright'><a href='https://videojs.com'>Video.js</a> is a free and open source HTML5 video player. © <a href='https://brightcove.com' target='_blank'>Brightcove, Inc</a>. <a href='https://github.com/videojs/video.js/blob/master/LICENSE' class='button blue' target='_blank'>View license</a></span>",
"include_css": [
"./build/docs/styles/videojs.css"
],
"displayModuleHeader": true,
"meta": [
{
"name": "name",
"content": "Video.js API documentation"
},
{
"name": "description",
"content": "Generated API documentation for the latest version of Video.js."
}
]
}
},
"templates": {
"default": {
"staticFiles": {
"include": [
"build/docs/"
]
}
}
},
"plugins": [
"node_modules/jsdoc-tsimport-plugin/index.js",
"plugins/markdown",
"build/jsdoc-typeof-plugin"
],
"markdown": {
"tags": [
"example"
],
"idInHeadings": true
}
}

View File

@ -1,12 +0,0 @@
// Updates the "vX.X.X source" link to github in .jsdoc.json
// that will be included in the menu of the API docs
const fs = require('fs');
const jsdocConfig = require('../.jsdoc.json');
const pkgJson = require('../package.json');
jsdocConfig.opts.theme_opts.menu.find(menuItem => {
return menuItem.link === 'https://github.com/videojs/video.js';
}).title = `v${pkgJson.version} source`;
fs.writeFileSync('.jsdoc.json', JSON.stringify(jsdocConfig, null, 2));

103
package-lock.json generated
View File

@ -1675,19 +1675,19 @@
"dev": true
},
"@types/linkify-it": {
"version": "3.0.3",
"resolved": "https://registry.npmjs.org/@types/linkify-it/-/linkify-it-3.0.3.tgz",
"integrity": "sha512-pTjcqY9E4nOI55Wgpz7eiI8+LzdYnw3qxXCfHyBDdPbYvbyLgWLJGh8EdPvqawwMK1Uo1794AUkkR38Fr0g+2g==",
"version": "5.0.0",
"resolved": "https://registry.npmjs.org/@types/linkify-it/-/linkify-it-5.0.0.tgz",
"integrity": "sha512-sVDA58zAw4eWAffKOaQH5/5j3XeayukzDk+ewSsnv3p4yJEZHCCzMDiZM8e0OUrRvmpGZ85jf4yDHkHsgBNr9Q==",
"dev": true
},
"@types/markdown-it": {
"version": "12.2.3",
"resolved": "https://registry.npmjs.org/@types/markdown-it/-/markdown-it-12.2.3.tgz",
"integrity": "sha512-GKMHFfv3458yYy+v/N8gjufHO6MSZKCOXpZc5GXIWWy8uldwfmPn98vp81gZ5f9SVw8YYBctgfJ22a2d7AOMeQ==",
"version": "14.1.1",
"resolved": "https://registry.npmjs.org/@types/markdown-it/-/markdown-it-14.1.1.tgz",
"integrity": "sha512-4NpsnpYl2Gt1ljyBGrKMxFYAYvpqbnnkgP/i/g+NLpjEUa3obn1XJCur9YbEXKDAkaXqsR1LbDnGEJ0MmKFxfg==",
"dev": true,
"requires": {
"@types/linkify-it": "*",
"@types/mdurl": "*"
"@types/linkify-it": "^5",
"@types/mdurl": "^2"
}
},
"@types/mdast": {
@ -1700,9 +1700,9 @@
}
},
"@types/mdurl": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/@types/mdurl/-/mdurl-1.0.2.tgz",
"integrity": "sha512-eC4U9MlIcu2q0KQmXszyn5Akca/0jrQmwDRgpAMJai7qBWq4amIQhZyNau4VYGtCeALvW1/NtjzJJ567aZxfKA==",
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/@types/mdurl/-/mdurl-2.0.0.tgz",
"integrity": "sha512-RGdgjQUZba5p6QEFAVx2OGb8rQDL/cPRG7GiedRzMcJ1tYnUANBncjbSB1NRGwbvjcPeikRABz2nshyPk1bhWg==",
"dev": true
},
"@types/minimist": {
@ -8209,25 +8209,25 @@
"dev": true
},
"jsdoc": {
"version": "3.6.11",
"resolved": "https://registry.npmjs.org/jsdoc/-/jsdoc-3.6.11.tgz",
"integrity": "sha512-8UCU0TYeIYD9KeLzEcAu2q8N/mx9O3phAGl32nmHlE0LpaJL71mMkP4d+QE5zWfNt50qheHtOZ0qoxVrsX5TUg==",
"version": "4.0.3",
"resolved": "https://registry.npmjs.org/jsdoc/-/jsdoc-4.0.3.tgz",
"integrity": "sha512-Nu7Sf35kXJ1MWDZIMAuATRQTg1iIPdzh7tqJ6jjvaU/GfDf+qi5UV8zJR3Mo+/pYFvm8mzay4+6O5EWigaQBQw==",
"dev": true,
"requires": {
"@babel/parser": "^7.9.4",
"@types/markdown-it": "^12.2.3",
"@babel/parser": "^7.20.15",
"@jsdoc/salty": "^0.2.1",
"@types/markdown-it": "^14.1.1",
"bluebird": "^3.7.2",
"catharsis": "^0.9.0",
"escape-string-regexp": "^2.0.0",
"js2xmlparser": "^4.0.2",
"klaw": "^3.0.0",
"markdown-it": "^12.3.2",
"markdown-it-anchor": "^8.4.1",
"markdown-it": "^14.1.0",
"markdown-it-anchor": "^8.6.7",
"marked": "^4.0.10",
"mkdirp": "^1.0.4",
"requizzle": "^0.2.3",
"strip-json-comments": "^3.1.0",
"taffydb": "2.6.2",
"underscore": "~1.13.2"
},
"dependencies": {
@ -8260,12 +8260,6 @@
}
}
},
"jsdoc-tsimport-plugin": {
"version": "1.0.5",
"resolved": "https://registry.npmjs.org/jsdoc-tsimport-plugin/-/jsdoc-tsimport-plugin-1.0.5.tgz",
"integrity": "sha512-6mvyF+tXdanf3zxEumTF9Uf/sXGlANP+XohSuiJiOVVWPGxi+3f2a2sy5Ew3W+0PMYUkcGYNxfYd5mMZsIHQpg==",
"dev": true
},
"jsdoc-type-pratt-parser": {
"version": "1.2.0",
"resolved": "https://registry.npmjs.org/jsdoc-type-pratt-parser/-/jsdoc-type-pratt-parser-1.2.0.tgz",
@ -8886,12 +8880,12 @@
"dev": true
},
"linkify-it": {
"version": "3.0.3",
"resolved": "https://registry.npmjs.org/linkify-it/-/linkify-it-3.0.3.tgz",
"integrity": "sha512-ynTsyrFSdE5oZ/O9GEf00kPngmOfVwazR5GKDq6EYfhlpFug3J2zybX56a2PRRpc9P+FuSoGNAwjlbDs9jJBPQ==",
"version": "5.0.0",
"resolved": "https://registry.npmjs.org/linkify-it/-/linkify-it-5.0.0.tgz",
"integrity": "sha512-5aHCbzQRADcdP+ATqnDuhhJ/MRIqDkZX5pyjFHRRysS8vZ5AbqGEoFIb6pYHPZ+L/OC2Lc+xT8uHVVR5CAK/wQ==",
"dev": true,
"requires": {
"uc.micro": "^1.0.1"
"uc.micro": "^2.0.0"
}
},
"lint-staged": {
@ -9460,16 +9454,17 @@
"dev": true
},
"markdown-it": {
"version": "12.3.2",
"resolved": "https://registry.npmjs.org/markdown-it/-/markdown-it-12.3.2.tgz",
"integrity": "sha512-TchMembfxfNVpHkbtriWltGWc+m3xszaRD0CZup7GFFhzIgQqxIfn3eGj1yZpfuflzPvfkt611B2Q/Bsk1YnGg==",
"version": "14.1.0",
"resolved": "https://registry.npmjs.org/markdown-it/-/markdown-it-14.1.0.tgz",
"integrity": "sha512-a54IwgWPaeBCAAsv13YgmALOF1elABB08FxO9i+r4VFk5Vl4pKokRPeX8u5TCgSsPi6ec1otfLjdOpVcgbpshg==",
"dev": true,
"requires": {
"argparse": "^2.0.1",
"entities": "~2.1.0",
"linkify-it": "^3.0.1",
"mdurl": "^1.0.1",
"uc.micro": "^1.0.5"
"entities": "^4.4.0",
"linkify-it": "^5.0.0",
"mdurl": "^2.0.0",
"punycode.js": "^2.3.1",
"uc.micro": "^2.1.0"
},
"dependencies": {
"argparse": {
@ -9477,12 +9472,6 @@
"resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz",
"integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==",
"dev": true
},
"entities": {
"version": "2.1.0",
"resolved": "https://registry.npmjs.org/entities/-/entities-2.1.0.tgz",
"integrity": "sha512-hCx1oky9PFrJ611mf0ifBLBRW8lUUVRlFolb5gWRfIELabBlbp9xZvrqZLZAs+NxFnbfQoeGd8wDkygjg7U85w==",
"dev": true
}
}
},
@ -9694,9 +9683,9 @@
}
},
"mdurl": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/mdurl/-/mdurl-1.0.1.tgz",
"integrity": "sha512-/sKlQJCBYVY9Ers9hqzKou4H6V5UWc/M59TH2dvkt+84itfnq7uFOMLpOiOS4ujvHP4etln18fmIxA5R5fll0g==",
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/mdurl/-/mdurl-2.0.0.tgz",
"integrity": "sha512-Lf+9+2r+Tdp5wXDXC4PcIBjTDtq4UKjCPMQhKIuzpJNW0b96kVqSwW0bT7FhRSfmAiFYgP+SCRvdrDozfh0U5w==",
"dev": true
},
"media-typer": {
@ -11581,6 +11570,12 @@
"integrity": "sha512-rRV+zQD8tVFys26lAGR9WUuS4iUAngJScM+ZRSKtvl5tKeZ2t5bvdNFdNHBW9FWR4guGHlgmsZ1G7BSm2wTbuA==",
"dev": true
},
"punycode.js": {
"version": "2.3.1",
"resolved": "https://registry.npmjs.org/punycode.js/-/punycode.js-2.3.1.tgz",
"integrity": "sha512-uxFIHU0YlHYhDQtV4R9J6a52SLx28BCjT+4ieh7IGbgwVJWO+km431c4yRlREUAsAmt/uMjQUyQHNEPf0M39CA==",
"dev": true
},
"pupa": {
"version": "2.1.1",
"resolved": "https://registry.npmjs.org/pupa/-/pupa-2.1.1.tgz",
@ -14045,12 +14040,6 @@
}
}
},
"taffydb": {
"version": "2.6.2",
"resolved": "https://registry.npmjs.org/taffydb/-/taffydb-2.6.2.tgz",
"integrity": "sha512-y3JaeRSplks6NYQuCOj3ZFMO3j60rTwbuKCvZxsAraGYH2epusatvZ0baZYA01WsGqJBq/Dl6vOrMUJqyMj8kA==",
"dev": true
},
"tapable": {
"version": "0.1.10",
"resolved": "https://registry.npmjs.org/tapable/-/tapable-0.1.10.tgz",
@ -14444,9 +14433,9 @@
}
},
"typescript": {
"version": "4.9.5",
"resolved": "https://registry.npmjs.org/typescript/-/typescript-4.9.5.tgz",
"integrity": "sha512-1FXk9E2Hm+QzZQ7z+McJiHL4NW1F2EzMu9Nq9i3zAaGqibafqYwCVU6WyWAuyQRRzOlxou8xZSyXLEN8oKj24g==",
"version": "5.5.0-beta",
"resolved": "https://registry.npmjs.org/typescript/-/typescript-5.5.0-beta.tgz",
"integrity": "sha512-FRg3e/aQg3olEG3ff8YjHOERsO4IM0m4qGrsE4UMvILaq4TdDZ6gQX4+2Rq9SjTpfSe/ebwiHcsjm/7FfWWQ6Q==",
"dev": true
},
"ua-parser-js": {
@ -14456,9 +14445,9 @@
"dev": true
},
"uc.micro": {
"version": "1.0.6",
"resolved": "https://registry.npmjs.org/uc.micro/-/uc.micro-1.0.6.tgz",
"integrity": "sha512-8Y75pvTYkLJW2hWQHXxoqRgV7qb9B+9vFEtidML+7koHUFapnVJAZ6cKs+Qjz5Aw3aZWHMC6u0wJE3At+nSGwA==",
"version": "2.1.0",
"resolved": "https://registry.npmjs.org/uc.micro/-/uc.micro-2.1.0.tgz",
"integrity": "sha512-ARDJmphmdvUk6Glw7y9DQ2bFkKBHwQHLi2lsaH6PPmz/Ka9sFOBsBluozhDltWmnv9u/cF6Rt87znRTPV+yp/A==",
"dev": true
},
"uglify-js": {

View File

@ -69,7 +69,7 @@
"test:a11y": "node build/test-a11y.js",
"test:unit": "karma start test/karma.conf.js",
"docs": "npm-run-all clean docs:lint docs:api",
"docs:api": "node ./build/doc-version.js && jsdoc -c .jsdoc.json",
"docs:api": "jsdoc -c .jsdoc.js",
"postdocs:api": "node ./build/fix-api-docs.js",
"docs:lint": "remark -- \"./{,!(node_modules)/**/}!(CHANGELOG)*.md\"",
"docs:fix": "remark --output -- \"./{,!(node_modules)/**/}!(CHANGELOG)*.md\"",
@ -125,8 +125,7 @@
"humanize-duration": "^3.26.0",
"husky": "^1.3.1",
"is-ci": "^3.0.0",
"jsdoc": "^3.6.11",
"jsdoc-tsimport-plugin": "^1.0.5",
"jsdoc": "^4.0.3",
"karma": "^6.4.0",
"lint-staged": "^10.5.4",
"markdown-table": "^1.1.3",
@ -162,7 +161,7 @@
"shelljs": "^0.8.5",
"shx": "^0.3.2",
"sinon": "^11.1.1",
"typescript": "^4.8.4",
"typescript": "^5.5.0-beta",
"uglify-js": "^3.6.0",
"unified": "^7.0.2",
"videojs-generate-karma-config": "^8.0.1",

View File

@ -6,6 +6,8 @@ import * as Dom from './utils/dom.js';
import log from './utils/log.js';
import keycode from 'keycode';
/** @import Player from './player' */
/**
* Component which is clickable or keyboard actionable, but is not a
* native HTML button.
@ -17,7 +19,7 @@ class ClickableComponent extends Component {
/**
* Creates an instance of this class.
*
* @param { import('./player').default } player
* @param {Player} player
* The `Player` that this class should be attached to.
*
* @param {Object} [options]

View File

@ -5,6 +5,8 @@ import Button from './button';
import Component from './component';
import keycode from 'keycode';
/** @import Player from './player' */
/**
* The `CloseButton` is a `{@link Button}` that fires a `close` event when
* it gets clicked.
@ -16,7 +18,7 @@ class CloseButton extends Button {
/**
* Creates an instance of the this class.
*
* @param { import('./player').default } player
* @param {Player} player
* The `Player` that this class should be attached to.
*
* @param {Object} [options]

View File

@ -14,6 +14,8 @@ import {toTitleCase, toLowerCase} from './utils/str.js';
import {merge} from './utils/obj.js';
import keycode from 'keycode';
/** @import Player from './player' */
/**
* Base class for all UI Components.
* Components are UI objects which represent both a javascript object and an element
@ -35,7 +37,7 @@ class Component {
/**
* Creates an instance of this class.
*
* @param { import('./player').default } player
* @param {Player} player
* The `Player` that this class should be attached to.
*
* @param {Object} [options]
@ -292,7 +294,7 @@ class Component {
/**
* Return the {@link Player} that the `Component` has attached to.
*
* @return { import('./player').default }
* @return {Player}
* The player that this `Component` has attached to.
*/
player() {

View File

@ -5,6 +5,8 @@ import MenuItem from '../../menu/menu-item.js';
import Component from '../../component.js';
import * as Dom from '../../utils/dom.js';
/** @import Player from '../../player' */
/**
* An {@link AudioTrack} {@link MenuItem}
*
@ -15,7 +17,7 @@ class AudioTrackMenuItem extends MenuItem {
/**
* Creates an instance of this class.
*
* @param { import('../../player').default } player
* @param {Player} player
* The `Player` that this class should be attached to.
*
* @param {Object} [options]

View File

@ -5,6 +5,8 @@ import Button from '../button.js';
import Component from '../component.js';
import document from 'global/document';
/** @import Player from './player' */
/**
* Toggle fullscreen video
*
@ -15,7 +17,7 @@ class FullscreenToggle extends Button {
/**
* Creates an instance of this class.
*
* @param { import('./player').default } player
* @param {Player} player
* The `Player` that this class should be attached to.
*
* @param {Object} [options]

View File

@ -5,6 +5,8 @@ import Component from '../component';
import * as Dom from '../utils/dom.js';
import document from 'global/document';
/** @import Player from './player' */
// TODO - Future make it click to snap to live
/**
@ -17,7 +19,7 @@ class LiveDisplay extends Component {
/**
* Creates an instance of this class.
*
* @param { import('./player').default } player
* @param {Player} player
* The `Player` that this class should be attached to.
*
* @param {Object} [options]

View File

@ -7,6 +7,8 @@ import * as Dom from '../utils/dom.js';
import checkMuteSupport from './volume-control/check-mute-support';
import * as browser from '../utils/browser.js';
/** @import Player from './player' */
/**
* A button component for muting the audio.
*
@ -17,7 +19,7 @@ class MuteToggle extends Button {
/**
* Creates an instance of this class.
*
* @param { import('./player').default } player
* @param {Player} player
* The `Player` that this class should be attached to.
*
* @param {Object} [options]

View File

@ -6,6 +6,8 @@ import Component from '../component.js';
import document from 'global/document';
import window from 'global/window';
/** @import Player from './player' */
/**
* Toggle Picture-in-Picture mode
*
@ -16,7 +18,7 @@ class PictureInPictureToggle extends Button {
/**
* Creates an instance of this class.
*
* @param { import('./player').default } player
* @param {Player} player
* The `Player` that this class should be attached to.
*
* @param {Object} [options]

View File

@ -5,6 +5,8 @@ import Button from '../button.js';
import Component from '../component.js';
import {silencePromise} from '../utils/promise';
/** @import Player from './player' */
/**
* Button to toggle between play and pause.
*
@ -15,7 +17,7 @@ class PlayToggle extends Button {
/**
* Creates an instance of this class.
*
* @param { import('./player').default } player
* @param {Player} player
* The `Player` that this class should be attached to.
*
* @param {Object} [options={}]

View File

@ -6,6 +6,8 @@ import PlaybackRateMenuItem from './playback-rate-menu-item.js';
import Component from '../../component.js';
import * as Dom from '../../utils/dom.js';
/** @import Player from '../../player' */
/**
* The component for controlling the playback rate.
*
@ -16,7 +18,7 @@ class PlaybackRateMenuButton extends MenuButton {
/**
* Creates an instance of this class.
*
* @param { import('../../player').default } player
* @param {Player} player
* The `Player` that this class should be attached to.
*
* @param {Object} [options]

View File

@ -4,6 +4,8 @@
import MenuItem from '../../menu/menu-item.js';
import Component from '../../component.js';
/** @import Player from '../../player' */
/**
* The specific menu item type for selecting a playback rate.
*
@ -14,7 +16,7 @@ class PlaybackRateMenuItem extends MenuItem {
/**
* Creates an instance of this class.
*
* @param { import('../../player').default } player
* @param {Player} player
* The `Player` that this class should be attached to.
*
* @param {Object} [options]

View File

@ -6,6 +6,8 @@ import * as Dom from '../../utils/dom.js';
import {clamp} from '../../utils/num';
import document from 'global/document';
/** @import Player from '../../player' */
// get the percent width of a time compared to the total end
const percentify = (time, end) => clamp((time / end) * 100, 0, 100).toFixed(2) + '%';
@ -19,7 +21,7 @@ class LoadProgressBar extends Component {
/**
* Creates an instance of this class.
*
* @param { import('../../player').default } player
* @param {Player} player
* The `Player` that this class should be attached to.
*
* @param {Object} [options]

View File

@ -4,6 +4,8 @@
import Component from '../../component.js';
import * as Fn from '../../utils/fn.js';
/** @import Player from '../../player' */
import './time-tooltip';
/**
@ -19,7 +21,7 @@ class MouseTimeDisplay extends Component {
/**
* Creates an instance of this class.
*
* @param { import('../../player').default } player
* @param {Player} player
* The {@link Player} that this class should be attached to.
*
* @param {Object} [options]

View File

@ -5,6 +5,8 @@ import Component from '../../component.js';
import {IS_IOS, IS_ANDROID} from '../../utils/browser.js';
import * as Fn from '../../utils/fn.js';
/** @import Player from '../../player' */
import './time-tooltip';
/**
@ -18,7 +20,7 @@ class PlayProgressBar extends Component {
/**
* Creates an instance of this class.
*
* @param { import('../../player').default } player
* @param {Player} player
* The {@link Player} that this class should be attached to.
*
* @param {Object} [options]

View File

@ -7,6 +7,8 @@ import {clamp} from '../../utils/num.js';
import {bind_, throttle, UPDATE_REFRESH_INTERVAL} from '../../utils/fn.js';
import {silencePromise} from '../../utils/promise';
/** @import Player from '../../player' */
import './seek-bar.js';
/**
@ -20,7 +22,7 @@ class ProgressControl extends Component {
/**
* Creates an instance of this class.
*
* @param { import('../../player').default } player
* @param {Player} player
* The `Player` that this class should be attached to.
*
* @param {Object} [options]

View File

@ -11,6 +11,8 @@ import {silencePromise} from '../../utils/promise';
import keycode from 'keycode';
import document from 'global/document';
/** @import Player from '../../player' */
import './load-progress-bar.js';
import './play-progress-bar.js';
import './mouse-time-display.js';
@ -32,7 +34,7 @@ class SeekBar extends Slider {
/**
* Creates an instance of this class.
*
* @param { import('../../player').default } player
* @param {Player} player
* The `Player` that this class should be attached to.
*
* @param {Object} [options]

View File

@ -6,6 +6,8 @@ import * as Dom from '../../utils/dom.js';
import {formatTime} from '../../utils/time.js';
import * as Fn from '../../utils/fn.js';
/** @import Player from '../../player' */
/**
* Time tooltips display a time above the progress bar.
*
@ -16,7 +18,7 @@ class TimeTooltip extends Component {
/**
* Creates an instance of this class.
*
* @param { import('../../player').default } player
* @param {Player} player
* The {@link Player} that this class should be attached to.
*
* @param {Object} [options]

View File

@ -5,6 +5,8 @@ import Button from '../button';
import Component from '../component';
import * as Dom from '../utils/dom.js';
/** @import Player from './player' */
/**
* Displays the live indicator when duration is Infinity.
*
@ -15,7 +17,7 @@ class SeekToLive extends Button {
/**
* Creates an instance of this class.
*
* @param { import('./player').default } player
* @param {Player} player
* The `Player` that this class should be attached to.
*
* @param {Object} [options]

View File

@ -4,6 +4,8 @@
import TextTrackMenuItem from './text-track-menu-item.js';
import Component from '../../component.js';
/** @import Player from '../../player' */
/**
* The menu item for caption track settings menu
*
@ -14,7 +16,7 @@ class CaptionSettingsMenuItem extends TextTrackMenuItem {
/**
* Creates an instance of this class.
*
* @param { import('../../player').default } player
* @param {Player} player
* The `Player` that this class should be attached to.
*
* @param {Object} [options]

View File

@ -5,6 +5,8 @@ import TextTrackButton from './text-track-button.js';
import Component from '../../component.js';
import CaptionSettingsMenuItem from './caption-settings-menu-item.js';
/** @import Player from '../../player' */
/**
* The button component for toggling and selecting captions
*
@ -15,7 +17,7 @@ class CaptionsButton extends TextTrackButton {
/**
* Creates an instance of this class.
*
* @param { import('../../player').default } player
* @param {Player} player
* The `Player` that this class should be attached to.
*
* @param {Object} [options]

View File

@ -6,6 +6,11 @@ import Component from '../../component.js';
import ChaptersTrackMenuItem from './chapters-track-menu-item.js';
import {toTitleCase} from '../../utils/str.js';
/** @import Player from '../../player' */
/** @import Menu from '../../menu/menu' */
/** @import TextTrack from '../../tracks/text-track' */
/** @import TextTrackMenuItem from '../text-track-controls/text-track-menu-item' */
/**
* The button component for toggling and selecting chapters
* Chapters act much differently than other text tracks
@ -18,7 +23,7 @@ class ChaptersButton extends TextTrackButton {
/**
* Creates an instance of this class.
*
* @param { import('../../player').default } player
* @param {Player} player
* The `Player` that this class should be attached to.
*
* @param {Object} [options]
@ -160,7 +165,7 @@ class ChaptersButton extends TextTrackButton {
/**
* Create menu from chapter track
*
* @return { import('../../menu/menu').default }
* @return {Menu}
* New menu for the chapter buttons
*/
createMenu() {
@ -171,7 +176,7 @@ class ChaptersButton extends TextTrackButton {
/**
* Create a menu item for each text track
*
* @return { import('./text-track-menu-item').default[] }
* @return {TextTrackMenuItem[]}
* Array of menu items
*/
createItems() {

View File

@ -4,6 +4,8 @@
import MenuItem from '../../menu/menu-item.js';
import Component from '../../component.js';
/** @import Player from '../../player' */
/**
* The chapter track menu item
*
@ -14,7 +16,7 @@ class ChaptersTrackMenuItem extends MenuItem {
/**
* Creates an instance of this class.
*
* @param { import('../../player').default } player
* @param {Player} player
* The `Player` that this class should be attached to.
*
* @param {Object} [options]

View File

@ -5,6 +5,8 @@ import TextTrackButton from './text-track-button.js';
import Component from '../../component.js';
import * as Fn from '../../utils/fn.js';
/** @import Player from '../../player' */
/**
* The button component for toggling and selecting descriptions
*
@ -15,7 +17,7 @@ class DescriptionsButton extends TextTrackButton {
/**
* Creates an instance of this class.
*
* @param { import('../../player').default } player
* @param {Player} player
* The `Player` that this class should be attached to.
*
* @param {Object} [options]

View File

@ -4,6 +4,8 @@
import TextTrackMenuItem from './text-track-menu-item.js';
import Component from '../../component.js';
/** @import Player from '../../player' */
/**
* A special menu item for turning off a specific type of text track
*
@ -14,7 +16,7 @@ class OffTextTrackMenuItem extends TextTrackMenuItem {
/**
* Creates an instance of this class.
*
* @param { import('../../player').default } player
* @param {Player} player
* The `Player` that this class should be attached to.
*
* @param {Object} [options]

View File

@ -7,6 +7,8 @@ import CaptionSettingsMenuItem from './caption-settings-menu-item.js';
import SubsCapsMenuItem from './subs-caps-menu-item.js';
import {toTitleCase} from '../../utils/str.js';
/** @import Player from '../../player' */
/**
* The button component for toggling and selecting captions and/or subtitles
*
@ -17,7 +19,7 @@ class SubsCapsButton extends TextTrackButton {
/**
* Creates an instance of this class.
*
* @param { import('../../player').default } player
* @param {Player} player
* The `Player` that this class should be attached to.
*
* @param {Object} [options]

View File

@ -4,6 +4,8 @@
import TextTrackButton from './text-track-button.js';
import Component from '../../component.js';
/** @import Player from '../../player' */
/**
* The button component for toggling and selecting subtitles
*
@ -14,7 +16,7 @@ class SubtitlesButton extends TextTrackButton {
/**
* Creates an instance of this class.
*
* @param { import('../../player').default } player
* @param {Player} player
* The `Player` that this class should be attached to.
*
* @param {Object} [options]

View File

@ -6,6 +6,8 @@ import Component from '../../component.js';
import TextTrackMenuItem from './text-track-menu-item.js';
import OffTextTrackMenuItem from './off-text-track-menu-item.js';
/** @import Player from '../../player' */
/**
* The base class for buttons that toggle specific text track types (e.g. subtitles)
*
@ -16,7 +18,7 @@ class TextTrackButton extends TrackButton {
/**
* Creates an instance of this class.
*
* @param { import('../../player').default } player
* @param {Player} player
* The `Player` that this class should be attached to.
*
* @param {Object} [options={}]

View File

@ -6,6 +6,8 @@ import Component from '../../component.js';
import window from 'global/window';
import document from 'global/document';
/** @import Player from '../../player' */
/**
* The specific menu item type for selecting a language within a text track kind
*
@ -16,7 +18,7 @@ class TextTrackMenuItem extends MenuItem {
/**
* Creates an instance of this class.
*
* @param { import('../../player').default } player
* @param {Player} player
* The `Player` that this class should be attached to.
*
* @param {Object} [options]

View File

@ -4,6 +4,8 @@
import TimeDisplay from './time-display';
import Component from '../../component.js';
/** @import Player from '../../player' */
/**
* Displays the duration
*
@ -14,7 +16,7 @@ class DurationDisplay extends TimeDisplay {
/**
* Creates an instance of this class.
*
* @param { import('../../player').default } player
* @param {Player} player
* The `Player` that this class should be attached to.
*
* @param {Object} [options]

View File

@ -5,6 +5,8 @@ import TimeDisplay from './time-display';
import Component from '../../component.js';
import * as Dom from '../../utils/dom.js';
/** @import Player from '../../player' */
/**
* Displays the time left in the video
*
@ -15,7 +17,7 @@ class RemainingTimeDisplay extends TimeDisplay {
/**
* Creates an instance of this class.
*
* @param { import('../../player').default } player
* @param {Player} player
* The `Player` that this class should be attached to.
*
* @param {Object} [options]

View File

@ -7,6 +7,8 @@ import * as Dom from '../../utils/dom.js';
import {formatTime} from '../../utils/time.js';
import log from '../../utils/log.js';
/** @import Player from '../../player' */
/**
* Displays time information about the video
*
@ -17,7 +19,7 @@ class TimeDisplay extends Component {
/**
* Creates an instance of this class.
*
* @param { import('../../player').default } player
* @param {Player} player
* The `Player` that this class should be attached to.
*
* @param {Object} [options]

View File

@ -5,6 +5,8 @@ import MenuButton from '../menu/menu-button.js';
import Component from '../component.js';
import * as Fn from '../utils/fn.js';
/** @import Player from './player' */
/**
* The base class for buttons that toggle specific track types (e.g. subtitles).
*
@ -15,7 +17,7 @@ class TrackButton extends MenuButton {
/**
* Creates an instance of this class.
*
* @param { import('./player').default } player
* @param {Player} player
* The `Player` that this class should be attached to.
*
* @param {Object} [options]

View File

@ -1,11 +1,14 @@
/** @import Component from '../../component' */
/** @import Player from '../../player' */
/**
* Check if muting volume is supported and if it isn't hide the mute toggle
* button.
*
* @param { import('../../component').default } self
* @param {Component} self
* A reference to the mute toggle button
*
* @param { import('../../player').default } player
* @param {Player} player
* A reference to the player
*
* @private

View File

@ -1,11 +1,14 @@
/** @import Component from '../../component' */
/** @import Player from '../../player' */
/**
* Check if volume control is supported and if it isn't hide the
* `Component` that was passed using the `vjs-hidden` class.
*
* @param { import('../../component').default } self
* @param {Component} self
* The component that should be hidden if volume is unsupported
*
* @param { import('../../player').default } player
* @param {Player} player
* A reference to the player
*
* @private

View File

@ -4,6 +4,8 @@
import Component from '../../component.js';
import * as Fn from '../../utils/fn.js';
/** @import Player from '../../player' */
import './volume-level-tooltip';
/**
@ -19,7 +21,7 @@ class MouseVolumeLevelDisplay extends Component {
/**
* Creates an instance of this class.
*
* @param { import('../../player').default } player
* @param {Player} player
* The {@link Player} that this class should be attached to.
*
* @param {Object} [options]

View File

@ -7,6 +7,8 @@ import * as Dom from '../../utils/dom.js';
import {clamp} from '../../utils/num.js';
import {IS_IOS, IS_ANDROID} from '../../utils/browser.js';
/** @import Player from '../../player' */
// Required children
import './volume-level.js';
import './mouse-volume-level-display.js';
@ -21,7 +23,7 @@ class VolumeBar extends Slider {
/**
* Creates an instance of this class.
*
* @param { import('../../player').default } player
* @param {Player} player
* The `Player` that this class should be attached to.
*
* @param {Object} [options]

View File

@ -6,6 +6,8 @@ import checkVolumeSupport from './check-volume-support';
import {isPlain} from '../../utils/obj';
import {throttle, bind_, UPDATE_REFRESH_INTERVAL} from '../../utils/fn.js';
/** @import Player from '../../player' */
// Required children
import './volume-bar.js';
@ -19,7 +21,7 @@ class VolumeControl extends Component {
/**
* Creates an instance of this class.
*
* @param { import('../../player').default } player
* @param {Player} player
* The `Player` that this class should be attached to.
*
* @param {Object} [options={}]

View File

@ -5,6 +5,8 @@ import Component from '../../component';
import * as Dom from '../../utils/dom.js';
import * as Fn from '../../utils/fn.js';
/** @import Player from '../../player' */
/**
* Volume level tooltips display a volume above or side by side the volume bar.
*
@ -15,7 +17,7 @@ class VolumeLevelTooltip extends Component {
/**
* Creates an instance of this class.
*
* @param { import('../../player').default } player
* @param {Player} player
* The {@link Player} that this class should be attached to.
*
* @param {Object} [options]

View File

@ -7,6 +7,8 @@ import * as Events from '../utils/events.js';
import keycode from 'keycode';
import document from 'global/document';
/** @import Player from './player' */
// Required children
import './volume-control/volume-control.js';
import './mute-toggle.js';
@ -22,7 +24,7 @@ class VolumePanel extends Component {
/**
* Creates an instance of this class.
*
* @param { import('./player').default } player
* @param {Player} player
* The `Player` that this class should be attached to.
*
* @param {Object} [options={}]

View File

@ -4,6 +4,8 @@
import Component from './component';
import ModalDialog from './modal-dialog';
/** @import Player from './player' */
/**
* A display that indicates an error has occurred. This means that the video
* is unplayable.
@ -15,7 +17,7 @@ class ErrorDisplay extends ModalDialog {
/**
* Creates an instance of this class.
*
* @param { import('./player').default } player
* @param {Player} player
* The `Player` that this class should be attached to.
*
* @param {Object} [options]

View File

@ -3,6 +3,8 @@ import {merge} from './utils/obj.js';
import window from 'global/window';
import * as Fn from './utils/fn.js';
/** @import Player from './player' */
const defaults = {
trackingThreshold: 20,
liveTolerance: 15
@ -20,7 +22,7 @@ class LiveTracker extends Component {
/**
* Creates an instance of this class.
*
* @param { import('./player').default } player
* @param {Player} player
* The `Player` that this class should be attached to.
*
* @param {Object} [options]

View File

@ -11,6 +11,8 @@ import { IS_IOS } from '../utils/browser.js';
import document from 'global/document';
import keycode from 'keycode';
/** @import Player from '../player' */
/**
* A `MenuButton` class for any popup {@link Menu}.
*
@ -21,7 +23,7 @@ class MenuButton extends Component {
/**
* Creates an instance of this class.
*
* @param { import('../player').default } player
* @param {Player} player
* The `Player` that this class should be attached to.
*
* @param {Object} [options={}]

View File

@ -7,6 +7,8 @@ import {MenuKeys} from './menu-keys.js';
import keycode from 'keycode';
import {createEl} from '../utils/dom.js';
/** @import Player from '../player' */
/**
* The component for a menu item. `<li>`
*
@ -17,7 +19,7 @@ class MenuItem extends ClickableComponent {
/**
* Creates an instance of the this class.
*
* @param { import('../player').default } player
* @param {Player} player
* The `Player` that this class should be attached to.
*
* @param {Object} [options={}]

View File

@ -7,6 +7,8 @@ import * as Dom from '../utils/dom.js';
import * as Events from '../utils/events.js';
import keycode from 'keycode';
/** @import Player from '../player' */
/**
* The Menu component is used to build popup menus, including subtitle and
* captions selection menus.
@ -18,7 +20,7 @@ class Menu extends Component {
/**
* Create an instance of this class.
*
* @param { import('../player').default } player
* @param {Player} player
* the player that this component should attach to
*
* @param {Object} [options]

View File

@ -7,6 +7,9 @@ import window from 'global/window';
import document from 'global/document';
import keycode from 'keycode';
/** @import Player from './player' */
/** @import { ContentDescriptor } from './utils/dom' */
const MODAL_CLASS_NAME = 'vjs-modal-dialog';
/**
@ -23,13 +26,13 @@ class ModalDialog extends Component {
/**
* Creates an instance of this class.
*
* @param { import('./player').default } player
* @param {Player} player
* The `Player` that this class should be attached to.
*
* @param {Object} [options]
* The key/value store of player options.
*
* @param { import('./utils/dom').ContentDescriptor} [options.content=undefined]
* @param {ContentDescriptor} [options.content=undefined]
* Provide customized content for this modal.
*
* @param {string} [options.description]
@ -329,7 +332,7 @@ class ModalDialog extends Component {
* @fires ModalDialog#beforemodalfill
* @fires ModalDialog#modalfill
*
* @param { import('./utils/dom').ContentDescriptor} [content]
* @param {ContentDescriptor} [content]
* The same rules apply to this as apply to the `content` option.
*/
fillWith(content) {
@ -406,12 +409,12 @@ class ModalDialog extends Component {
* This does not update the DOM or fill the modal, but it is called during
* that process.
*
* @param { import('./utils/dom').ContentDescriptor} [value]
* @param {ContentDescriptor} [value]
* If defined, sets the internal content value to be used on the
* next call(s) to `fill`. This value is normalized before being
* inserted. To "clear" the internal content value, pass `null`.
*
* @return { import('./utils/dom').ContentDescriptor}
* @return {ContentDescriptor}
* The current content of the modal dialog
*/
content(value) {

View File

@ -57,6 +57,9 @@ import './title-bar.js';
// Import Html5 tech, at least for disposing the original video tag.
import './tech/html5.js';
/** @import { TimeRange } from './utils/time' */
/** @import HtmlTrackElement from './tracks/html-track-element' */
// The following tech events are simply re-triggered
// on the player when they happen
const TECH_EVENTS_RETRIGGER = [
@ -2484,7 +2487,7 @@ class Player extends Component {
* Get a TimeRange object representing the current ranges of time that the user
* has played.
*
* @return { import('./utils/time').TimeRange }
* @return {TimeRange}
* A time range object that represents all the increments of time that have
* been played.
*/
@ -2652,7 +2655,7 @@ class Player extends Component {
*
* @see [Buffered Spec]{@link http://dev.w3.org/html5/spec/video.html#dom-media-buffered}
*
* @return { import('./utils/time').TimeRange }
* @return {TimeRange}
* A mock {@link TimeRanges} object (following HTML spec)
*/
buffered() {
@ -2671,7 +2674,7 @@ class Player extends Component {
*
* @see [Seekable Spec]{@link https://html.spec.whatwg.org/multipage/media.html#dom-media-seekable}
*
* @return { import('./utils/time').TimeRange }
* @return {TimeRange}
* A mock {@link TimeRanges} object (following HTML spec)
*/
seekable() {
@ -4703,7 +4706,7 @@ class Player extends Component {
* from the TextTrackList and HtmlTrackElementList
* after a source change
*
* @return { import('./tracks/html-track-element').default }
* @return {HtmlTrackElement}
* the HTMLTrackElement that was created and added
* to the HtmlTrackElementList and the remote
* TextTrackList

View File

@ -6,6 +6,8 @@ import Component from './component.js';
import * as Dom from './utils/dom.js';
import {silencePromise} from './utils/promise';
/** @import Player from './player' */
/**
* A `ClickableComponent` that handles showing the poster image for the player.
*
@ -16,7 +18,7 @@ class PosterImage extends ClickableComponent {
/**
* Create an instance of this class.
*
* @param { import('./player').default } player
* @param {Player} player
* The `Player` that this class should attach to.
*
* @param {Object} [options]

View File

@ -7,6 +7,8 @@ import {IS_CHROME} from '../utils/browser.js';
import {clamp} from '../utils/num.js';
import keycode from 'keycode';
/** @import Player from '../player' */
/**
* The base functionality for a slider. Can be vertical or horizontal.
* For instance the volume bar or the seek bar on a video is a slider.
@ -18,7 +20,7 @@ class Slider extends Component {
/**
* Create an instance of this class
*
* @param { import('../player').default } player
* @param {Player} player
* The `Player` that this class should be attached to.
*
* @param {Object} [options]

View File

@ -5,6 +5,9 @@ import EventTarget from './event-target';
import keycode from 'keycode';
import SpatialNavKeyCodes from './utils/spatial-navigation-key-codes';
/** @import Component from './component' */
/** @import Player from './player' */
// The number of seconds the `step*` functions move the timeline.
const STEP_SECONDS = 5;
@ -22,7 +25,7 @@ class SpatialNavigation extends EventTarget {
* Sets up the player instance, and prepares the spatial navigation system.
*
* @class
* @param {Object} player - The Video.js player instance to which the spatial navigation is attached.
* @param {Player} player - The Video.js player instance to which the spatial navigation is attached.
*/
constructor(player) {
super();

View File

@ -6,6 +6,8 @@ import Tech from './tech.js';
import {toTitleCase} from '../utils/str.js';
import {merge} from '../utils/obj.js';
/** @import Player from '../player' */
/**
* The `MediaLoader` is the `Component` that decides which playback technology to load
* when a player is initialized.
@ -17,7 +19,7 @@ class MediaLoader extends Component {
/**
* Create an instance of this class.
*
* @param { import('../player').default } player
* @param {Player} player
* The `Player` that this class should attach to.
*
* @param {Object} [options]

View File

@ -4,6 +4,9 @@
*/
import {toTitleCase} from '../utils/str.js';
/** @import Player from '../player' */
/** @import Tech from '../tech/tech' */
const middlewares = {};
const middlewareInstances = {};
@ -27,7 +30,7 @@ export const TERMINATOR = {};
* passed in as an argument.
*
* @callback MiddlewareFactory
* @param { import('../player').default } player
* @param {Player} player
* A Video.js player.
*/
@ -69,7 +72,7 @@ export function getMiddleware(type) {
* matching middlewares and calling `setSource` on each, passing along the
* previous returned value each time.
*
* @param { import('../player').default } player
* @param {Player} player
* A {@link Player} instance.
*
* @param {Tech~SourceObject} src
@ -88,7 +91,7 @@ export function setSource(player, src, next) {
* @param {Object[]} middleware
* An array of middleware instances.
*
* @param { import('../tech/tech').default } tech
* @param {Tech} tech
* A Video.js tech.
*/
export function setTech(middleware, tech) {
@ -102,7 +105,7 @@ export function setTech(middleware, tech) {
* @param {Object[]} middleware
* An array of middleware instances.
*
* @param { import('../tech/tech').default } tech
* @param {Tech} tech
* The current tech.
*
* @param {string} method
@ -122,7 +125,7 @@ export function get(middleware, tech, method) {
* @param {Object[]} middleware
* An array of middleware instances.
*
* @param { import('../tech/tech').default } tech
* @param {Tech} tech
* The current tech.
*
* @param {string} method
@ -148,7 +151,7 @@ export function set(middleware, tech, method, arg) {
* @param {Object[]} middleware
* An array of middleware instances.
*
* @param { import('../tech/tech').default } tech
* @param {Tech} tech
* The current tech.
*
* @param {string} method
@ -240,7 +243,7 @@ function executeRight(mws, method, value, terminated) {
/**
* Clear the middleware cache for a player.
*
* @param { import('../player').default } player
* @param {Player} player
* A {@link Player} instance.
*/
export function clearCacheForPlayer(player) {

View File

@ -3,6 +3,8 @@ import document from 'global/document';
import {merge} from '../utils/obj';
import {getAbsoluteURL} from '../utils/url';
/** @import Html5 from './html5' */
/**
* This function is used to fire a sourceset when there is something
* similar to `mediaEl.load()` being called. It will try to find the source via
@ -10,7 +12,7 @@ import {getAbsoluteURL} from '../utils/url';
* with the source that was found or empty string if we cannot know. If it cannot
* find a source then `sourceset` will not be fired.
*
* @param { import('./html5').default } tech
* @param {Html5} tech
* The tech object that sourceset was setup on
*
* @return {boolean}

View File

@ -16,6 +16,8 @@ import {toTitleCase, toLowerCase} from '../utils/str.js';
import vtt from 'videojs-vtt.js';
import * as Guid from '../utils/guid.js';
/** @import { TimeRange } from '../utils/time' */
/**
* An Object containing a structure like: `{src: 'url', type: 'mimetype'}` or string
* that just contains the src url alone.
@ -275,7 +277,7 @@ class Tech extends Component {
/**
* Get and create a `TimeRange` object for buffering.
*
* @return { import('../utils/time').TimeRange }
* @return {TimeRange}
* The time range object that was created.
*/
buffered() {
@ -480,7 +482,7 @@ class Tech extends Component {
* > NOTE: This implementation is incomplete. It does not track the played `TimeRange`.
* It only checks whether the source has played at all or not.
*
* @return { import('../utils/time').TimeRange }
* @return {TimeRange}
* - A single time range if this video has played
* - An empty set of ranges if not.
*/

View File

@ -3,6 +3,8 @@
*/
import TrackList from './track-list';
/** @import AudioTrack from './audio-track' */
/**
* Anywhere we call this function we diverge from the spec
* as we only support one enabled audiotrack at a time
@ -10,7 +12,7 @@ import TrackList from './track-list';
* @param {AudioTrackList} list
* list to work on
*
* @param { import('./audio-track').default } track
* @param {AudioTrack} track
* The track to skip
*
* @private
@ -36,7 +38,7 @@ class AudioTrackList extends TrackList {
/**
* Create an instance of this class.
*
* @param { import('./audio-track').default[] } [tracks=[]]
* @param {AudioTrack[]} [tracks=[]]
* A list of `AudioTrack` to instantiate the list with.
*/
constructor(tracks = []) {
@ -56,7 +58,7 @@ class AudioTrackList extends TrackList {
/**
* Add an {@link AudioTrack} to the `AudioTrackList`.
*
* @param { import('./audio-track').default } track
* @param {AudioTrack} track
* The AudioTrack to add to the list
*
* @fires TrackList#addtrack

View File

@ -5,6 +5,8 @@
import EventTarget from '../event-target';
import TextTrack from '../tracks/text-track';
/** @import Tech from '../tech/tech' */
/**
* A single track represented in the DOM.
*
@ -19,7 +21,7 @@ class HTMLTrackElement extends EventTarget {
* @param {Object} options={}
* Object of option names and values
*
* @param { import('../tech/tech').default } options.tech
* @param {Tech} options.tech
* A reference to the tech that owns this HTMLTrackElement.
*
* @param {TextTrack~Kind} [options.kind='subtitles']

View File

@ -6,6 +6,8 @@ import * as Fn from '../utils/fn.js';
import * as Dom from '../utils/dom.js';
import window from 'global/window';
/** @import Player from '../player' */
const darkGray = '#222';
const lightGray = '#ccc';
const fontMap = {
@ -102,7 +104,7 @@ class TextTrackDisplay extends Component {
/**
* Creates an instance of this class.
*
* @param { import('../player').default } player
* @param {Player} player
* The `Player` that this class should be attached to.
*
* @param {Object} [options]

View File

@ -3,6 +3,9 @@ import * as Dom from '../utils/dom';
import * as Guid from '../utils/guid';
import TextTrackSelect from './text-track-select';
/** @import Player from './player' */
/** @import { ContentDescriptor } from '../utils/dom' */
/**
* Creates fieldset section of 'TextTrackSettings'.
* Manganes two versions of fieldsets, one for type of 'colors'
@ -16,13 +19,13 @@ class TextTrackFieldset extends Component {
/**
* Creates an instance of this class.
*
* @param { import('./player').default } player
* @param {Player} player
* The `Player` that this class should be attached to.
*
* @param {Object} [options]
* The key/value store of player options.
*
* @param { import('../utils/dom').ContentDescriptor} [options.content=undefined]
* @param {ContentDescriptor} [options.content=undefined]
* Provide customized content for this modal.
*
* @param {string} [options.legendId]
@ -36,11 +39,11 @@ class TextTrackFieldset extends Component {
* @param {string} [options.legendText]
* A text to use as the text content of the legend element.
*
* @param {array} [options.selects]
* @param {Array} [options.selects]
* Array that contains the selects that are use to create 'selects'
* components.
*
* @param {array} [options.SelectOptions]
* @param {Array} [options.SelectOptions]
* Array that contains the value & textContent of for each of the
* options elements, it passes to 'TextTrackSelect'.
*

View File

@ -5,6 +5,8 @@
* @module text-track-list-converter
*/
/** @import Tech from '../tech/tech' */
/**
* Examine a single {@link TextTrack} and return a JSON-compatible javascript object that
* represents the {@link TextTrack}'s state.
@ -46,7 +48,7 @@ const trackToJson_ = function(track) {
* state of all {@link TextTrack}s currently configured. The return array is compatible with
* {@link text-track-list-converter:jsonToTextTracks}.
*
* @param { import('../tech/tech').default } tech
* @param {Tech} tech
* The tech object to query
*
* @return {Array}

View File

@ -3,6 +3,8 @@
*/
import TrackList from './track-list';
/** @import TextTrack from './text-track' */
/**
* The current list of {@link TextTrack} for a media file.
*
@ -14,7 +16,7 @@ class TextTrackList extends TrackList {
/**
* Add a {@link TextTrack} to the `TextTrackList`
*
* @param { import('./text-track').default } track
* @param {TextTrack} track
* The text track to add to the list.
*
* @fires TrackList#addtrack

View File

@ -1,6 +1,9 @@
import Component from '../component';
import * as Dom from '../utils/dom';
/** @import Player from './player' */
/** @import { ContentDescriptor } from '../utils/dom' */
/**
* Creates DOM element of 'select' & its options.
*
@ -11,13 +14,13 @@ class TextTrackSelect extends Component {
/**
* Creates an instance of this class.
*
* @param { import('./player').default } player
* @param {Player} player
* The `Player` that this class should be attached to.
*
* @param {Object} [options]
* The key/value store of player options.
*
* @param { import('../utils/dom').ContentDescriptor} [options.content=undefined]
* @param {ContentDescriptor} [options.content=undefined]
* Provide customized content for this modal.
*
* @param {string} [options.legendId]

View File

@ -2,6 +2,9 @@ import Component from '../component';
import * as Dom from '../utils/dom';
import TextTrackFieldset from './text-track-fieldset';
/** @import Player from './player' */
/** @import { ContentDescriptor } from '../utils/dom' */
/**
* The component 'TextTrackSettingsColors' displays a set of 'fieldsets'
* using the component 'TextTrackFieldset'.
@ -13,13 +16,13 @@ class TextTrackSettingsColors extends Component {
/**
* Creates an instance of this class.
*
* @param { import('./player').default } player
* @param {Player} player
* The `Player` that this class should be attached to.
*
* @param {Object} [options]
* The key/value store of player options.
*
* @param { import('../utils/dom').ContentDescriptor} [options.content=undefined]
* @param {ContentDescriptor} [options.content=undefined]
* Provide customized content for this modal.
*
* @param {Array} [options.fieldSets]

View File

@ -2,6 +2,9 @@ import Component from '../component';
import * as Dom from '../utils/dom';
import TextTrackFieldset from './text-track-fieldset';
/** @import Player from './player' */
/** @import { ContentDescriptor } from '../utils/dom' */
/**
* The component 'TextTrackSettingsFont' displays a set of 'fieldsets'
* using the component 'TextTrackFieldset'.
@ -13,13 +16,13 @@ class TextTrackSettingsFont extends Component {
/**
* Creates an instance of this class.
*
* @param { import('./player').default } player
* @param {Player} player
* The `Player` that this class should be attached to.
*
* @param {Object} [options]
* The key/value store of player options.
*
* @param { import('../utils/dom').ContentDescriptor} [options.content=undefined]
* @param {ContentDescriptor} [options.content=undefined]
* Provide customized content for this modal.
*
* @param {Array} [options.fieldSets]

View File

@ -11,6 +11,8 @@ import TextTrackSettingsColors from './text-track-settings-colors';
import TextTrackSettingsFont from './text-track-settings-font';
import TrackSettingsControls from './text-track-settings-controls';
/** @import Player from '../player' */
const LOCAL_STORAGE_KEY = 'vjs-text-track-settings';
const COLOR_BLACK = ['#000', 'Black'];
@ -252,7 +254,7 @@ class TextTrackSettings extends ModalDialog {
/**
* Creates an instance of this class.
*
* @param { import('../player').default } player
* @param {Player} player
* The `Player` that this class should be attached to.
*
* @param {Object} [options]

View File

@ -11,6 +11,8 @@ import { isCrossOrigin } from '../utils/url.js';
import XHR from '@videojs/xhr';
import {merge} from '../utils/obj';
/** @import Tech from '../tech/tech' */
/**
* Takes a webvtt file contents and parses it into cues
*
@ -128,7 +130,7 @@ class TextTrack extends Track {
* @param {Object} options={}
* Object of option names and values
*
* @param { import('../tech/tech').default } options.tech
* @param {Tech} options.tech
* A reference to the tech that owns this TextTrack.
*
* @param {TextTrack~Kind} [options.kind='subtitles']
@ -441,6 +443,7 @@ class TextTrack extends Track {
/**
* cuechange - One or more cues in the track have become active or stopped being active.
*
* @protected
*/
TextTrack.prototype.allowedEvents_ = {

View File

@ -4,6 +4,8 @@
import EventTarget from '../event-target';
import {isEvented} from '../mixins/evented';
/** @import Track from './track' */
/**
* Common functionaliy between {@link TextTrackList}, {@link AudioTrackList}, and
* {@link VideoTrackList}
@ -14,7 +16,7 @@ class TrackList extends EventTarget {
/**
* Create an instance of this class
*
* @param { import('./track').default[] } tracks
* @param { Track[] } tracks
* A list of tracks to initialize the list with.
*
* @abstract
@ -44,7 +46,7 @@ class TrackList extends EventTarget {
/**
* Add a {@link Track} to the `TrackList`
*
* @param { import('./track').default } track
* @param {Track} track
* The audio, video, or text track to add to the list.
*
* @fires TrackList#addtrack
@ -102,7 +104,7 @@ class TrackList extends EventTarget {
/**
* Remove a {@link Track} from the `TrackList`
*
* @param { import('./track').default } rtrack
* @param {Track} rtrack
* The audio, video, or text track to remove from the list.
*
* @fires TrackList#removetrack
@ -147,7 +149,7 @@ class TrackList extends EventTarget {
*
* @param {string} id - the id of the track to get
* @method getTrackById
* @return { import('./track').default }
* @return {Track}
* @private
*/
getTrackById(id) {

View File

@ -3,13 +3,15 @@
*/
import TrackList from './track-list';
/** @import VideoTrack from './video-track' */
/**
* Un-select all other {@link VideoTrack}s that are selected.
*
* @param {VideoTrackList} list
* list to work on
*
* @param { import('./video-track').default } track
* @param {VideoTrack} track
* The track to skip
*
* @private
@ -71,7 +73,7 @@ class VideoTrackList extends TrackList {
/**
* Add a {@link VideoTrack} to the `VideoTrackList`.
*
* @param { import('./video-track').default } track
* @param {VideoTrack} track
* The VideoTrack to add to the list
*
* @fires TrackList#addtrack

View File

@ -4,10 +4,12 @@
*/
import { createTimeRange } from './time.js';
/** @import { TimeRange } from './time' */
/**
* Compute the percentage of the media that has been buffered.
*
* @param { import('./time').TimeRange } buffered
* @param {TimeRange} buffered
* The current `TimeRanges` object representing buffered time ranges
*
* @param {number} duration

View File

@ -1,5 +1,7 @@
import * as Url from '../utils/url.js';
/** @import Player from '../player' */
/**
* Mimetypes
*
@ -51,7 +53,7 @@ export const getMimetype = function(src = '') {
* Find the mime type of a given source string if possible. Uses the player
* source cache.
*
* @param { import('../player').default } player
* @param {Player} player
* The player object
*
* @param {string} src