diff --git a/package-lock.json b/package-lock.json index 06fb5710a8..44d3e56e1f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1587,9 +1587,9 @@ } }, "@rollup/pluginutils": { - "version": "5.0.4", - "resolved": "https://registry.npmjs.org/@rollup/pluginutils/-/pluginutils-5.0.4.tgz", - "integrity": "sha512-0KJnIoRI8A+a1dqOYLxH8vBf8bphDmty5QvIm2hqm7oFCFYKCAZWWd2hXgMibaPsNDhI0AtpYfQZJG47pt/k4g==", + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/@rollup/pluginutils/-/pluginutils-5.1.0.tgz", + "integrity": "sha512-XTIWOPPcpvyKI6L1NHo0lFlCyznUEyPmPY1mc3KpPVDYulHSTvyeLNVW00QTLIAFNhR3kYnJTQHeGqU4M3n09g==", "dev": true, "requires": { "@types/estree": "^1.0.0", @@ -12402,6 +12402,16 @@ "chalk": "^2.4.2" } }, + "rollup-plugin-replace": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/rollup-plugin-replace/-/rollup-plugin-replace-2.2.0.tgz", + "integrity": "sha512-/5bxtUPkDHyBJAKketb4NfaeZjL5yLZdeUihSfbF2PQMz+rSTEb8ARKoOl3UBT4m7/X+QOXJo3sLTcq+yMMYTA==", + "dev": true, + "requires": { + "magic-string": "^0.25.2", + "rollup-pluginutils": "^2.6.0" + } + }, "rollup-plugin-stub": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/rollup-plugin-stub/-/rollup-plugin-stub-1.2.0.tgz", diff --git a/package.json b/package.json index 044948e166..a1fbe6a45f 100644 --- a/package.json +++ b/package.json @@ -105,6 +105,7 @@ "@babel/preset-env": "^7.9.0", "@rollup/plugin-image": "^3.0.2", "@rollup/plugin-replace": "^2.4.1", + "@rollup/pluginutils": "^5.1.0", "@types/node": "^18.8.3", "access-sniff": "^3.2.0", "autoprefixer": "^10.2.5", @@ -153,6 +154,7 @@ "rollup-plugin-multi-entry": "^2.0.2", "rollup-plugin-node-resolve": "^4.2.4", "rollup-plugin-progress": "^1.1.2", + "rollup-plugin-replace": "^2.2.0", "rollup-plugin-stub": "^1.2.0", "rollup-plugin-svg": "^2.0.0", "sass": "^1.34.0", diff --git a/rollup.config.js b/rollup.config.js index 4a97d0156e..18cdc6ffef 100644 --- a/rollup.config.js +++ b/rollup.config.js @@ -17,6 +17,7 @@ import image from '@rollup/plugin-image'; import istanbul from 'rollup-plugin-istanbul'; import externalGlobals from 'rollup-plugin-external-globals'; import svg from 'rollup-plugin-svg'; +import { excludeLines } from './build/rollup-ignore'; const excludeCoverage = [ 'test/**', @@ -143,6 +144,10 @@ export default cliargs => [ }, external: externals.browser, plugins: [ + excludeLines({ + include: 'src/**', + patterns: [/\/\/\s*exclude\s*start[\s\S]*?\/\/\s*exclude\s*end/g] + }), alias({ 'video.js': path.resolve(__dirname, './src/js/video.js') }), diff --git a/src/js/player.js b/src/js/player.js index e9c7300a56..05c833cda8 100644 --- a/src/js/player.js +++ b/src/js/player.js @@ -5325,6 +5325,42 @@ class Player extends Component { */ this.trigger('playbackrateschange'); } + + /** + * Reports whether or not a player has a plugin available. + * + * This does not report whether or not the plugin has ever been initialized + * on this player. For that, [usingPlugin]{@link Player#usingPlugin}. + * + * @method hasPlugin + * @param {string} name + * The name of a plugin. + * + * @return {boolean} + * Whether or not this player has the requested plugin available. + */ + // exclude start + hasPlugin(name) { + return false; + } + // exclude end + + /** + * Reports whether or not a player is using a plugin by name. + * + * For basic plugins, this only reports whether the plugin has _ever_ been + * initialized on this player. + * + * @method Player#usingPlugin + * @param {string} name + * The name of a plugin. + * + * @return {boolean} + * Whether or not this player is using the requested plugin. + */ + usingPlugin(name) { + return false; + } } /** @@ -5527,33 +5563,5 @@ TECH_EVENTS_RETRIGGER.forEach(function(event) { * @type {Event} */ -/** - * Reports whether or not a player has a plugin available. - * - * This does not report whether or not the plugin has ever been initialized - * on this player. For that, [usingPlugin]{@link Player#usingPlugin}. - * - * @method Player#hasPlugin - * @param {string} name - * The name of a plugin. - * - * @return {boolean} - * Whether or not this player has the requested plugin available. - */ - -/** - * Reports whether or not a player is using a plugin by name. - * - * For basic plugins, this only reports whether the plugin has _ever_ been - * initialized on this player. - * - * @method Player#usingPlugin - * @param {string} name - * The name of a plugin. - * - * @return {boolean} - * Whether or not this player is using the requested plugin. - */ - Component.registerComponent('Player', Player); export default Player;