Video Extension with React Splide
Not an issue, but a question. Is there a way to get the video extension to work with React Splide?
Thanks for any help anyone may be able to provide!
Just wanted to follow up here. By any chance would someone know the answer to this?
Thanks in advance for any help you may be able to provide!
You can follow this guide: https://splidejs.com/extension-video/ Or did you encounter an error following the guide?
@tgrassl thanks for the response! I've followed that, but can't get it to work on the React Splide specifically. Is there a method for mounting it to the React Splide so that one can use the data-splide-youtube and data-splide-vimeo attributes?
I created a working example for you: https://codesandbox.io/s/charming-euclid-jsztn?file=/src/App.js
You can add Extensions using the Extensions prop:
<Splide
options={SPLIDE_OPTIONS}
Extensions={{ Video }}
>
The only bug i found is that the "data" attributes are not being passed down to the SplideSlide component: https://github.com/Splidejs/react-splide/blob/master/src/js/components/SplideSlide.jsx#L18
I created a PR in the react-splide repo to fix this issue: https://github.com/Splidejs/react-splide/pull/11 ⭐
Thank you so much! This is great!
Close the issue due to the major version update. Feel free to create a new issue or open a new discussion.