
Security News
Risky Biz Podcast: Making Reachability Analysis Work in Real-World Codebases
This episode explores the hard problem of reachability analysis, from static analysis limits to handling dynamic languages and massive dependency trees.
videojs-responsive-controls
Advanced tools
Adapts Video.js controls to different player sizes.
npm install --save videojs-responsive-controls
Basic usage:
import 'videojs-responsive-controls';
player.responsiveControls({
controls: {
remainingTimeDisplay: { mini: false, small: false },
'vjs-resolution-button': { mini: false },
'vjs-language-container': { mini: false }
}
});
Allows controlling both Video.js native plugins and legacy plugins (via their class names).
Default breakpoints are:
mini
: <450px,small
: <600px,default
: any higher resolutionDefault settings are:
currentTimeDisplay: {
mini: false,
},
timeDivider: {
mini: false,
},
durationDisplay: {
mini: false,
},
remainingTimeDisplay: {
mini: false,
small: false,
},
captionsButton: {
mini: false,
},
If user did not specified visibility for given plugin/breakpoint, and the visibility is also not specified in default settings - the plugin will be visible.
You can specify own breakpoints like this:
player.responsiveControls({
sizes: {
custom: 1024,
},
controls: {
remainingTimeDisplay: { custom: false }
}
});
Default breakpoints will be overwritten by this setting, therefore if you wish to use defaults too you'll have to specify default breakpoints along with your custom ones like so:
player.responsiveControls({
sizes: {
mini: 450,
small: 600,
custom: 1024,
},
controls: {
remainingTimeDisplay: { custom: false }
}
});
Breakpoints are mobile-up so specified value is a maximum size video player can have to be affected by this breakpoint.
To hide element by default use default
breakpoint:
player.responsiveControls({
controls: {
remainingTimeDisplay: { default: false, mini: true }
}
});
Legacy plugins does not register in videojs.controlBar
space but you can still manage them throught
this script passing class name in options, like this:
player.responsiveControls({
controls: {
'vjs-language-container': { mini: false }
}
});
To include videojs-responsive-controls on your website or web application, use any of the following legacy methods.
<script>
TagThis is the simplest case. Get the script in whatever way you prefer and include the plugin after you include video.js, so that the videojs
global is available.
<script src="//path/to/video.min.js"></script>
<script src="//path/to/videojs-responsive-controls.min.js"></script>
<script>
var player = videojs('my-video');
player.responsiveControls();
</script>
When using with Browserify, install videojs-responsive-controls via npm and require
the plugin as you would any other module.
var videojs = require('video.js');
// The actual plugin function is exported by this module, but it is also
// attached to the `Player.prototype`; so, there is no need to assign it
// to a variable.
require('videojs-responsive-controls');
var player = videojs('my-video');
player.responsiveControls();
When using with RequireJS (or another AMD library), get the script in whatever way you prefer and require
the plugin as you normally would:
require(['video.js', 'videojs-responsive-controls'], function(videojs) {
var player = videojs('my-video');
player.responsiveControls();
});
MIT. Copyright (c) Tomasz Janiczek <tjaniczek@twig-world.com>
FAQs
Adapts controls to different player sizes
The npm package videojs-responsive-controls receives a total of 14 weekly downloads. As such, videojs-responsive-controls popularity was classified as not popular.
We found that videojs-responsive-controls demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
This episode explores the hard problem of reachability analysis, from static analysis limits to handling dynamic languages and massive dependency trees.
Security News
/Research
Malicious Nx npm versions stole secrets and wallet info using AI CLI tools; Socket’s AI scanner detected the supply chain attack and flagged the malware.
Security News
CISA’s 2025 draft SBOM guidance adds new fields like hashes, licenses, and tool metadata to make software inventories more actionable.