From f05769d116e0beac7b9fcde1695db4da74ade124 Mon Sep 17 00:00:00 2001 From: mister-ben Date: Wed, 15 May 2024 15:02:01 +0200 Subject: [PATCH] Update typescript and jsdoc, use @import (#8723) --- .jsdoc.js | 69 ++++++++++++ .jsdoc.json | 72 ------------ build/doc-version.js | 12 -- package-lock.json | 103 ++++++++---------- package.json | 7 +- src/js/clickable-component.js | 4 +- src/js/close-button.js | 4 +- src/js/component.js | 6 +- .../audio-track-menu-item.js | 4 +- src/js/control-bar/fullscreen-toggle.js | 4 +- src/js/control-bar/live-display.js | 4 +- src/js/control-bar/mute-toggle.js | 4 +- .../control-bar/picture-in-picture-toggle.js | 4 +- src/js/control-bar/play-toggle.js | 4 +- .../playback-rate-menu-button.js | 4 +- .../playback-rate-menu-item.js | 4 +- .../progress-control/load-progress-bar.js | 4 +- .../progress-control/mouse-time-display.js | 4 +- .../progress-control/play-progress-bar.js | 4 +- .../progress-control/progress-control.js | 4 +- .../control-bar/progress-control/seek-bar.js | 4 +- .../progress-control/time-tooltip.js | 4 +- src/js/control-bar/seek-to-live.js | 4 +- .../caption-settings-menu-item.js | 4 +- .../text-track-controls/captions-button.js | 4 +- .../text-track-controls/chapters-button.js | 11 +- .../chapters-track-menu-item.js | 4 +- .../descriptions-button.js | 4 +- .../off-text-track-menu-item.js | 4 +- .../text-track-controls/subs-caps-button.js | 4 +- .../text-track-controls/subtitles-button.js | 4 +- .../text-track-controls/text-track-button.js | 4 +- .../text-track-menu-item.js | 4 +- .../time-controls/duration-display.js | 4 +- .../time-controls/remaining-time-display.js | 4 +- .../control-bar/time-controls/time-display.js | 4 +- src/js/control-bar/track-button.js | 4 +- .../volume-control/check-mute-support.js | 7 +- .../volume-control/check-volume-support.js | 7 +- .../mouse-volume-level-display.js | 4 +- .../control-bar/volume-control/volume-bar.js | 4 +- .../volume-control/volume-control.js | 4 +- .../volume-control/volume-level-tooltip.js | 4 +- src/js/control-bar/volume-panel.js | 4 +- src/js/error-display.js | 4 +- src/js/live-tracker.js | 4 +- src/js/menu/menu-button.js | 4 +- src/js/menu/menu-item.js | 4 +- src/js/menu/menu.js | 4 +- src/js/modal-dialog.js | 13 ++- src/js/player.js | 11 +- src/js/poster-image.js | 4 +- src/js/slider/slider.js | 4 +- src/js/spatial-navigation.js | 5 +- src/js/tech/loader.js | 4 +- src/js/tech/middleware.js | 17 +-- src/js/tech/setup-sourceset.js | 4 +- src/js/tech/tech.js | 6 +- src/js/tracks/audio-track-list.js | 8 +- src/js/tracks/html-track-element.js | 4 +- src/js/tracks/text-track-display.js | 4 +- src/js/tracks/text-track-fieldset.js | 11 +- src/js/tracks/text-track-list-converter.js | 4 +- src/js/tracks/text-track-list.js | 4 +- src/js/tracks/text-track-select.js | 7 +- src/js/tracks/text-track-settings-colors.js | 7 +- src/js/tracks/text-track-settings-font.js | 7 +- src/js/tracks/text-track-settings.js | 4 +- src/js/tracks/text-track.js | 5 +- src/js/tracks/track-list.js | 10 +- src/js/tracks/video-track-list.js | 6 +- src/js/utils/buffer.js | 4 +- src/js/utils/mimetypes.js | 4 +- 73 files changed, 367 insertions(+), 244 deletions(-) create mode 100644 .jsdoc.js delete mode 100644 .jsdoc.json delete mode 100644 build/doc-version.js diff --git a/.jsdoc.js b/.jsdoc.js new file mode 100644 index 0000000000..b29cbe866b --- /dev/null +++ b/.jsdoc.js @@ -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: + 'Video.js is a free and open source HTML5 video player. © Brightcove, Inc. View license', + 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, + }, +}; diff --git a/.jsdoc.json b/.jsdoc.json deleted file mode 100644 index 80cedde5d2..0000000000 --- a/.jsdoc.json +++ /dev/null @@ -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": "Video.js is a free and open source HTML5 video player. © Brightcove, Inc. View license", - "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 - } -} \ No newline at end of file diff --git a/build/doc-version.js b/build/doc-version.js deleted file mode 100644 index 1f8c6bb72e..0000000000 --- a/build/doc-version.js +++ /dev/null @@ -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)); diff --git a/package-lock.json b/package-lock.json index 189cc1a7ba..077a47c5a0 100644 --- a/package-lock.json +++ b/package-lock.json @@ -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": { diff --git a/package.json b/package.json index b5974dbb23..c6b990a2cd 100644 --- a/package.json +++ b/package.json @@ -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", diff --git a/src/js/clickable-component.js b/src/js/clickable-component.js index 24ff650732..1956774bba 100644 --- a/src/js/clickable-component.js +++ b/src/js/clickable-component.js @@ -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] diff --git a/src/js/close-button.js b/src/js/close-button.js index 56714be5ab..66abc875ce 100644 --- a/src/js/close-button.js +++ b/src/js/close-button.js @@ -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] diff --git a/src/js/component.js b/src/js/component.js index 6b60b9596d..cfcdd45835 100644 --- a/src/js/component.js +++ b/src/js/component.js @@ -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() { diff --git a/src/js/control-bar/audio-track-controls/audio-track-menu-item.js b/src/js/control-bar/audio-track-controls/audio-track-menu-item.js index 22e6e6f4a7..4c7d344e83 100644 --- a/src/js/control-bar/audio-track-controls/audio-track-menu-item.js +++ b/src/js/control-bar/audio-track-controls/audio-track-menu-item.js @@ -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] diff --git a/src/js/control-bar/fullscreen-toggle.js b/src/js/control-bar/fullscreen-toggle.js index dfcf3ae0c3..2c6271b8d6 100644 --- a/src/js/control-bar/fullscreen-toggle.js +++ b/src/js/control-bar/fullscreen-toggle.js @@ -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] diff --git a/src/js/control-bar/live-display.js b/src/js/control-bar/live-display.js index 2bec75f95d..d62c4cc9e5 100644 --- a/src/js/control-bar/live-display.js +++ b/src/js/control-bar/live-display.js @@ -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] diff --git a/src/js/control-bar/mute-toggle.js b/src/js/control-bar/mute-toggle.js index 86bf03ebf2..091a739fbc 100644 --- a/src/js/control-bar/mute-toggle.js +++ b/src/js/control-bar/mute-toggle.js @@ -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] diff --git a/src/js/control-bar/picture-in-picture-toggle.js b/src/js/control-bar/picture-in-picture-toggle.js index 1a81f5a74f..9a37643232 100644 --- a/src/js/control-bar/picture-in-picture-toggle.js +++ b/src/js/control-bar/picture-in-picture-toggle.js @@ -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] diff --git a/src/js/control-bar/play-toggle.js b/src/js/control-bar/play-toggle.js index bb22ba9ee2..424f579e6f 100644 --- a/src/js/control-bar/play-toggle.js +++ b/src/js/control-bar/play-toggle.js @@ -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={}] diff --git a/src/js/control-bar/playback-rate-menu/playback-rate-menu-button.js b/src/js/control-bar/playback-rate-menu/playback-rate-menu-button.js index 484aca62cb..147f040719 100644 --- a/src/js/control-bar/playback-rate-menu/playback-rate-menu-button.js +++ b/src/js/control-bar/playback-rate-menu/playback-rate-menu-button.js @@ -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] diff --git a/src/js/control-bar/playback-rate-menu/playback-rate-menu-item.js b/src/js/control-bar/playback-rate-menu/playback-rate-menu-item.js index 6caf28a1f0..b0b145a5df 100644 --- a/src/js/control-bar/playback-rate-menu/playback-rate-menu-item.js +++ b/src/js/control-bar/playback-rate-menu/playback-rate-menu-item.js @@ -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] diff --git a/src/js/control-bar/progress-control/load-progress-bar.js b/src/js/control-bar/progress-control/load-progress-bar.js index ed3f4c750c..0da4ff2a80 100644 --- a/src/js/control-bar/progress-control/load-progress-bar.js +++ b/src/js/control-bar/progress-control/load-progress-bar.js @@ -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] diff --git a/src/js/control-bar/progress-control/mouse-time-display.js b/src/js/control-bar/progress-control/mouse-time-display.js index 6d0b5cc98c..f14bde1358 100644 --- a/src/js/control-bar/progress-control/mouse-time-display.js +++ b/src/js/control-bar/progress-control/mouse-time-display.js @@ -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] diff --git a/src/js/control-bar/progress-control/play-progress-bar.js b/src/js/control-bar/progress-control/play-progress-bar.js index abb4ea1f95..479790815f 100644 --- a/src/js/control-bar/progress-control/play-progress-bar.js +++ b/src/js/control-bar/progress-control/play-progress-bar.js @@ -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] diff --git a/src/js/control-bar/progress-control/progress-control.js b/src/js/control-bar/progress-control/progress-control.js index a2d1e64d94..cbff618485 100644 --- a/src/js/control-bar/progress-control/progress-control.js +++ b/src/js/control-bar/progress-control/progress-control.js @@ -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] diff --git a/src/js/control-bar/progress-control/seek-bar.js b/src/js/control-bar/progress-control/seek-bar.js index d27eac1760..539b80b2b6 100644 --- a/src/js/control-bar/progress-control/seek-bar.js +++ b/src/js/control-bar/progress-control/seek-bar.js @@ -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] diff --git a/src/js/control-bar/progress-control/time-tooltip.js b/src/js/control-bar/progress-control/time-tooltip.js index 3a4be1e703..aecd8b3617 100644 --- a/src/js/control-bar/progress-control/time-tooltip.js +++ b/src/js/control-bar/progress-control/time-tooltip.js @@ -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] diff --git a/src/js/control-bar/seek-to-live.js b/src/js/control-bar/seek-to-live.js index 9d4d28d860..d448267561 100644 --- a/src/js/control-bar/seek-to-live.js +++ b/src/js/control-bar/seek-to-live.js @@ -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] diff --git a/src/js/control-bar/text-track-controls/caption-settings-menu-item.js b/src/js/control-bar/text-track-controls/caption-settings-menu-item.js index fdd128a2e5..5d08e6d960 100644 --- a/src/js/control-bar/text-track-controls/caption-settings-menu-item.js +++ b/src/js/control-bar/text-track-controls/caption-settings-menu-item.js @@ -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] diff --git a/src/js/control-bar/text-track-controls/captions-button.js b/src/js/control-bar/text-track-controls/captions-button.js index 7de4224ef5..8f5f6da073 100644 --- a/src/js/control-bar/text-track-controls/captions-button.js +++ b/src/js/control-bar/text-track-controls/captions-button.js @@ -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] diff --git a/src/js/control-bar/text-track-controls/chapters-button.js b/src/js/control-bar/text-track-controls/chapters-button.js index 6d416f7215..8366179a75 100644 --- a/src/js/control-bar/text-track-controls/chapters-button.js +++ b/src/js/control-bar/text-track-controls/chapters-button.js @@ -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() { diff --git a/src/js/control-bar/text-track-controls/chapters-track-menu-item.js b/src/js/control-bar/text-track-controls/chapters-track-menu-item.js index e5942ac5ba..2463564889 100644 --- a/src/js/control-bar/text-track-controls/chapters-track-menu-item.js +++ b/src/js/control-bar/text-track-controls/chapters-track-menu-item.js @@ -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] diff --git a/src/js/control-bar/text-track-controls/descriptions-button.js b/src/js/control-bar/text-track-controls/descriptions-button.js index 04544727d8..320cc35f0f 100644 --- a/src/js/control-bar/text-track-controls/descriptions-button.js +++ b/src/js/control-bar/text-track-controls/descriptions-button.js @@ -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] diff --git a/src/js/control-bar/text-track-controls/off-text-track-menu-item.js b/src/js/control-bar/text-track-controls/off-text-track-menu-item.js index 5a19ffc999..7f117a1106 100644 --- a/src/js/control-bar/text-track-controls/off-text-track-menu-item.js +++ b/src/js/control-bar/text-track-controls/off-text-track-menu-item.js @@ -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] diff --git a/src/js/control-bar/text-track-controls/subs-caps-button.js b/src/js/control-bar/text-track-controls/subs-caps-button.js index 8629879a0e..576b4d0947 100644 --- a/src/js/control-bar/text-track-controls/subs-caps-button.js +++ b/src/js/control-bar/text-track-controls/subs-caps-button.js @@ -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] diff --git a/src/js/control-bar/text-track-controls/subtitles-button.js b/src/js/control-bar/text-track-controls/subtitles-button.js index 205cdc0327..f7c530caa6 100644 --- a/src/js/control-bar/text-track-controls/subtitles-button.js +++ b/src/js/control-bar/text-track-controls/subtitles-button.js @@ -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] diff --git a/src/js/control-bar/text-track-controls/text-track-button.js b/src/js/control-bar/text-track-controls/text-track-button.js index 6848ab8a72..0744986ecb 100644 --- a/src/js/control-bar/text-track-controls/text-track-button.js +++ b/src/js/control-bar/text-track-controls/text-track-button.js @@ -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={}] diff --git a/src/js/control-bar/text-track-controls/text-track-menu-item.js b/src/js/control-bar/text-track-controls/text-track-menu-item.js index c4b06f1fc9..757e18bb4f 100644 --- a/src/js/control-bar/text-track-controls/text-track-menu-item.js +++ b/src/js/control-bar/text-track-controls/text-track-menu-item.js @@ -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] diff --git a/src/js/control-bar/time-controls/duration-display.js b/src/js/control-bar/time-controls/duration-display.js index 675e748109..bd02d69402 100644 --- a/src/js/control-bar/time-controls/duration-display.js +++ b/src/js/control-bar/time-controls/duration-display.js @@ -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] diff --git a/src/js/control-bar/time-controls/remaining-time-display.js b/src/js/control-bar/time-controls/remaining-time-display.js index 8cb635e4fb..b3842c8483 100644 --- a/src/js/control-bar/time-controls/remaining-time-display.js +++ b/src/js/control-bar/time-controls/remaining-time-display.js @@ -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] diff --git a/src/js/control-bar/time-controls/time-display.js b/src/js/control-bar/time-controls/time-display.js index 9c6af2d0f4..2fa558dcfe 100644 --- a/src/js/control-bar/time-controls/time-display.js +++ b/src/js/control-bar/time-controls/time-display.js @@ -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] diff --git a/src/js/control-bar/track-button.js b/src/js/control-bar/track-button.js index bbdbbe73dc..99ab39c7bf 100644 --- a/src/js/control-bar/track-button.js +++ b/src/js/control-bar/track-button.js @@ -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] diff --git a/src/js/control-bar/volume-control/check-mute-support.js b/src/js/control-bar/volume-control/check-mute-support.js index 044269e9ed..8665883e2a 100644 --- a/src/js/control-bar/volume-control/check-mute-support.js +++ b/src/js/control-bar/volume-control/check-mute-support.js @@ -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 diff --git a/src/js/control-bar/volume-control/check-volume-support.js b/src/js/control-bar/volume-control/check-volume-support.js index 2b4f2b4681..88f287b8d1 100644 --- a/src/js/control-bar/volume-control/check-volume-support.js +++ b/src/js/control-bar/volume-control/check-volume-support.js @@ -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 diff --git a/src/js/control-bar/volume-control/mouse-volume-level-display.js b/src/js/control-bar/volume-control/mouse-volume-level-display.js index c7e433d1a6..467d7b530e 100644 --- a/src/js/control-bar/volume-control/mouse-volume-level-display.js +++ b/src/js/control-bar/volume-control/mouse-volume-level-display.js @@ -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] diff --git a/src/js/control-bar/volume-control/volume-bar.js b/src/js/control-bar/volume-control/volume-bar.js index d9878fce9c..4e2a02c3fd 100644 --- a/src/js/control-bar/volume-control/volume-bar.js +++ b/src/js/control-bar/volume-control/volume-bar.js @@ -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] diff --git a/src/js/control-bar/volume-control/volume-control.js b/src/js/control-bar/volume-control/volume-control.js index ed628ed1ab..723e9c3fef 100644 --- a/src/js/control-bar/volume-control/volume-control.js +++ b/src/js/control-bar/volume-control/volume-control.js @@ -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={}] diff --git a/src/js/control-bar/volume-control/volume-level-tooltip.js b/src/js/control-bar/volume-control/volume-level-tooltip.js index 14ae47301a..9df9843d0c 100644 --- a/src/js/control-bar/volume-control/volume-level-tooltip.js +++ b/src/js/control-bar/volume-control/volume-level-tooltip.js @@ -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] diff --git a/src/js/control-bar/volume-panel.js b/src/js/control-bar/volume-panel.js index 131a2bc567..5bbfa074d7 100644 --- a/src/js/control-bar/volume-panel.js +++ b/src/js/control-bar/volume-panel.js @@ -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={}] diff --git a/src/js/error-display.js b/src/js/error-display.js index 20ed994f67..d9df3e51ad 100644 --- a/src/js/error-display.js +++ b/src/js/error-display.js @@ -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] diff --git a/src/js/live-tracker.js b/src/js/live-tracker.js index 28e12c549b..3e18d73c33 100644 --- a/src/js/live-tracker.js +++ b/src/js/live-tracker.js @@ -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] diff --git a/src/js/menu/menu-button.js b/src/js/menu/menu-button.js index 4dafbf5601..4de500b1e3 100644 --- a/src/js/menu/menu-button.js +++ b/src/js/menu/menu-button.js @@ -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={}] diff --git a/src/js/menu/menu-item.js b/src/js/menu/menu-item.js index aaf7f6c92d..415ab04897 100644 --- a/src/js/menu/menu-item.js +++ b/src/js/menu/menu-item.js @@ -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. `
  • ` * @@ -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={}] diff --git a/src/js/menu/menu.js b/src/js/menu/menu.js index 883c473b9f..647d422274 100644 --- a/src/js/menu/menu.js +++ b/src/js/menu/menu.js @@ -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] diff --git a/src/js/modal-dialog.js b/src/js/modal-dialog.js index 4b841f0c33..d2bc31806c 100644 --- a/src/js/modal-dialog.js +++ b/src/js/modal-dialog.js @@ -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) { diff --git a/src/js/player.js b/src/js/player.js index da7f48388b..00391e8459 100644 --- a/src/js/player.js +++ b/src/js/player.js @@ -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 diff --git a/src/js/poster-image.js b/src/js/poster-image.js index a96528a824..ea0e02ee46 100644 --- a/src/js/poster-image.js +++ b/src/js/poster-image.js @@ -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] diff --git a/src/js/slider/slider.js b/src/js/slider/slider.js index 1ed1cfb769..6aef393c93 100644 --- a/src/js/slider/slider.js +++ b/src/js/slider/slider.js @@ -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] diff --git a/src/js/spatial-navigation.js b/src/js/spatial-navigation.js index 08c91e2fa6..4cfeacc968 100644 --- a/src/js/spatial-navigation.js +++ b/src/js/spatial-navigation.js @@ -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(); diff --git a/src/js/tech/loader.js b/src/js/tech/loader.js index c2c72f35e0..59a4b66eff 100644 --- a/src/js/tech/loader.js +++ b/src/js/tech/loader.js @@ -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] diff --git a/src/js/tech/middleware.js b/src/js/tech/middleware.js index 5eebac619a..bb034ad3b4 100644 --- a/src/js/tech/middleware.js +++ b/src/js/tech/middleware.js @@ -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) { diff --git a/src/js/tech/setup-sourceset.js b/src/js/tech/setup-sourceset.js index c4d48132cd..621b62fe15 100644 --- a/src/js/tech/setup-sourceset.js +++ b/src/js/tech/setup-sourceset.js @@ -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} diff --git a/src/js/tech/tech.js b/src/js/tech/tech.js index 71628b56dd..ca91365c60 100644 --- a/src/js/tech/tech.js +++ b/src/js/tech/tech.js @@ -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. */ diff --git a/src/js/tracks/audio-track-list.js b/src/js/tracks/audio-track-list.js index 0552323656..8d113cc65d 100644 --- a/src/js/tracks/audio-track-list.js +++ b/src/js/tracks/audio-track-list.js @@ -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 diff --git a/src/js/tracks/html-track-element.js b/src/js/tracks/html-track-element.js index 677755808c..ac00e7d063 100644 --- a/src/js/tracks/html-track-element.js +++ b/src/js/tracks/html-track-element.js @@ -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'] diff --git a/src/js/tracks/text-track-display.js b/src/js/tracks/text-track-display.js index 06f45652da..c0b05a618f 100644 --- a/src/js/tracks/text-track-display.js +++ b/src/js/tracks/text-track-display.js @@ -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] diff --git a/src/js/tracks/text-track-fieldset.js b/src/js/tracks/text-track-fieldset.js index f2ac5e3643..b8f69df9f3 100644 --- a/src/js/tracks/text-track-fieldset.js +++ b/src/js/tracks/text-track-fieldset.js @@ -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'. * diff --git a/src/js/tracks/text-track-list-converter.js b/src/js/tracks/text-track-list-converter.js index f608ecbac2..e0e5584c3e 100644 --- a/src/js/tracks/text-track-list-converter.js +++ b/src/js/tracks/text-track-list-converter.js @@ -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} diff --git a/src/js/tracks/text-track-list.js b/src/js/tracks/text-track-list.js index 92af54d35a..dfdd3027ea 100644 --- a/src/js/tracks/text-track-list.js +++ b/src/js/tracks/text-track-list.js @@ -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 diff --git a/src/js/tracks/text-track-select.js b/src/js/tracks/text-track-select.js index 75f3e3ba1e..e196247d8e 100644 --- a/src/js/tracks/text-track-select.js +++ b/src/js/tracks/text-track-select.js @@ -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] diff --git a/src/js/tracks/text-track-settings-colors.js b/src/js/tracks/text-track-settings-colors.js index 8e4e910795..47ba4da627 100644 --- a/src/js/tracks/text-track-settings-colors.js +++ b/src/js/tracks/text-track-settings-colors.js @@ -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] diff --git a/src/js/tracks/text-track-settings-font.js b/src/js/tracks/text-track-settings-font.js index 9db7f43676..17f3e1a09e 100644 --- a/src/js/tracks/text-track-settings-font.js +++ b/src/js/tracks/text-track-settings-font.js @@ -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] diff --git a/src/js/tracks/text-track-settings.js b/src/js/tracks/text-track-settings.js index a051f2a674..27afa28a00 100644 --- a/src/js/tracks/text-track-settings.js +++ b/src/js/tracks/text-track-settings.js @@ -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] diff --git a/src/js/tracks/text-track.js b/src/js/tracks/text-track.js index c108a3b0bb..31eda8f450 100644 --- a/src/js/tracks/text-track.js +++ b/src/js/tracks/text-track.js @@ -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_ = { diff --git a/src/js/tracks/track-list.js b/src/js/tracks/track-list.js index 4327ac2929..00f97fe47f 100644 --- a/src/js/tracks/track-list.js +++ b/src/js/tracks/track-list.js @@ -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) { diff --git a/src/js/tracks/video-track-list.js b/src/js/tracks/video-track-list.js index 518e3d73bd..d6f8bfb05f 100644 --- a/src/js/tracks/video-track-list.js +++ b/src/js/tracks/video-track-list.js @@ -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 diff --git a/src/js/utils/buffer.js b/src/js/utils/buffer.js index 8e5c18585f..221b9c05b7 100644 --- a/src/js/utils/buffer.js +++ b/src/js/utils/buffer.js @@ -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 diff --git a/src/js/utils/mimetypes.js b/src/js/utils/mimetypes.js index d593e2fd9e..528a947943 100644 --- a/src/js/utils/mimetypes.js +++ b/src/js/utils/mimetypes.js @@ -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