splide
                                
                                 splide copied to clipboard
                                
                                    splide copied to clipboard
                            
                            
                            
                        Unable to use breakpoint destroy when using video extension.
Checks
- [X] Not a duplicate.
- [X] Not a question, feature request, or anything other than a bug report directly related to Splide. Use Discussions for these topics: https://github.com/Splidejs/splide/discussions
Version
v4.0.7
Description
Unable to use breakpoint destroy when using video extension.
var videos = new Splide('.videos', { pagination: false, width: '100%', type: 'loop', breakpoints: { 640: { destroy: true, }, } });
Getting this error
Uncaught TypeError: Cannot read properties of undefined (reading 'addEventListener') at HTMLVideoPlayer.destroy (main.js?ver=1.0.4:561:24) at Player.destroy (main.js?ver=1.0.4:3382:19) at main.js?ver=1.0.4:3405:14 at forOwn$1 (main.js?ver=1.0.4:98:13) at Object.destroy (main.js?ver=1.0.4:3404:5) at main.js?ver=1.0.4:6605:40 at forOwn (main.js?ver=1.0.4:3660:13) at _Splide.destroy (main.js?ver=1.0.4:6604:7) at MediaQueryList.update (main.js?ver=1.0.4:4130:15)
Reproduction Link
https://codesandbox.io/s/dreamy-chaplygin-50qxn7
Steps to Reproduce
Adding breakpoints: { 500: { destroy: true } }
Expected Behaviour
Destroying with video causes error