stamat / youtube-background

ESM / jQuery plugin for creating video backgrounds from YouTube, Vimeo or video file links.

Home Page:https://stamat.github.io/youtube-background/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[Violation] Added non-passive event listener to a scroll-blocking 'touchstart' event. Consider marking event handler as 'passive' to make the page more responsive

dnguyencode opened this issue · comments

Hi, I get this error when trying to load the background using
jQuery(document).ready(function () {
jQuery("[data-vbg]").youtube_background();
});
new VideoBackgrounds("[data-vbg]");

And the default demo code doesn't work for me. Has Youtube released a breaking change to the app?

@dnguyencode hey hey! ☺️ Hmmm, you either need to use this 👇

jQuery(document).ready(function () {
jQuery("[data-vbg]").youtube_background();
});

Or this 👇

new VideoBackgrounds("[data-vbg]");

One is using the jQuery and the other is vanilla JS way. I can't recreate this violation, but I browsed through youtube-backgrounds code and there is no "touchstart" event bound anywhere. Are you 100% sure this is due the introduction of this code?

You can check the demo to see if it's working or not https://stamat.github.io/youtube-background/, if YouTube made a change to the iframe API like they did a while back, videos would not work on this demo page.

Let me know if this helped you clear your doubts! Merry Christmas and happy holidays! 🎄 🎉 ✨ 🎁