In a wordpress page. I have a tag that autoplays whenever the page is loaded. Everytime i resize the window the video restarts playing.I have a function that everytime if the url contains (/home/en) it changes the video (src) attribute, but for some reason, sometimes it doesn't.
jQuery(window).resize(function() {
if(window.location.href.includes("/home/en")){
jQuery('#testID').attr('src','https://test.mp4');
}
});
Does anyone have any idea what might be the problem!