Chapter 4 - Enable video support with Splide¶
In this chapter, you will enable video support with Splide to display a slideshow that supports images as well as videos.
Steps¶
Download Splide Video extension¶
Splide offers different extensions to extend their library. The Video extension Splide is available on GitHub. Download the Git repository as a .zip
file with the following link: https://github.com/Splidejs/splide-extension-video/archive/refs/heads/master.zip.
At the time of writing this tutorial, Splide Video is at version 0.8.0
. Yours might be more recent but it should work nonetheless.
Open the archive. From the archive, copy the following files to their destinations in your working directory:
dist/css/splide-extension-video.min.css
topublic/css/splide-extension-video.min.css
dist/js/splide-extension-video.min.js
topublic/js/splide-extension-video.min.js
Include the extension in the slideshow template¶
Update the slideshow template.
- This file was added.
- This file was added.
- This video was added.
- The Video extension is loaded by Splide.
Check the results¶
Start the application and access http://localhost:3000. You should see a slideshow of three random images and a video. If you refresh, the images should change as well.
To stop your NestJS application, press Ctrl+C in your terminal.
Summary¶
Congrats! You have a NestJS application that displays a slideshow with random images as well as a video!