Generates a sprite of SVG icons to change the default video.js icons.
To change the appearance of the audio-description.svg
icon to the corresponding "Material Symbols" icon, simply :
- Download the icon
- Rename the downloaded file to
audio-description.svg
. - Replace the file of the same name in the "icons" directory
- Run the
npm run build
command - Move the generated
vjs-sprite-icons.svg
into your project
The npm run build
command will generate a directory named vjs-sprite
which will contain an index.html
allowing you to view the final result, as well as the vjs-sprite-icons.svg
file which can be used to replace the default video.js icons as follows:
import playerIcons from './asset/vjs-sprite-icons.svg';
const player = videojs('my-player', {
experimentalSvgIcons: playerIcons,
// ...
});
Or a good old fashion copy and paste (...) :
const player = videojs('my-player', {
experimentalSvgIcons: `
<svg>
...
</svg>
`,
// ...
});
This project uses svgo and svg-sprite.