You need to load the plugin and initialize it as explained below. The only required plugin's parameters are a list of images to slide and an audio file URL.
In the example below, we included the class "vjs-16-9," which ensures the player maintains the 16:9 aspect ratio. You can use other sizing options using classes "vjs-4-3," "vjs-9-16," "vjs-1-1" or define your own fixed width and height in pixels.
Code snippet
<audio id="my_slideshow" class="video-js vjs-16-9" controls playsinline></audio>
<link href="/videojs/skins/treso/videojs.min.css" rel="stylesheet" type="text/css" /><script src="/videojs/video.min.js></script><script src="/videojs/nuevo.min.js></script><script src="/videojs/plugins/nuevo slideshow.js></script>
<script>const slides = [....];const player=videojs("my_slideshow");player.nuevo();player.slideshow({slides:my_slides, sound:"//audio-url/mp3"})</script>Code snippet
const slides = [{ src:"//slide1-url.jpg" },{ src:"//slide2-url.jpg" },{ src:"//slide3-url.jpg" }]Code snippet
{ src:"//slide1-url.jpg", caption:"slide-caption" },Code snippet
{ src:"//slide1-url.jpg", caption:"slide-caption", credits:"© Copyright: ..." },player.slideshow({src:my_slides, sound:"//audio-url/mp3"});Slides change every five seconds by default. You can set any other interval value.
Code snippet
player.slideshow({src:my_slides, sound:"//audio-url/mp3", timeout:10});Code snippet
player.slideshow({src:my_slides, sound:"//audio-url/mp3", background:"#FFFFFF"});Code snippet
player.slideshow({src:my_slides, sound:"//audio-url/mp3", shuffle:true});