Support » Plugin: mb.YTPlayer for background videos » A way to de-activate for certain resolutions?

  • Hey Matteo! Last question, I promise! Your lovely plugin is a very important element to my site so I’m keen to get it working perfectly.

    I have my video background set to autoplay and have a fallback div for resolutions under 1050px (mobile devices). The issue is that <1050px desktop browsers are seeing the fallback div and hearing the audio from mb.YTPlayer at the same time. I only want these people to see the fallback div and not see mb.YTPlayer at all.

    Can I disable the player for certain resolutions with a media query or would I instead need to input something into the .js file?

    Any help on this would be very much appreciated! Thanks.


Viewing 1 replies (of 1 total)
  • Plugin Author pupunzi


    You can only do that via javascript creating your own function to detect screen size on resizing and removing the YTPlayer container if the resolution is lower than 1050. You can’t do it via CSS.

    Should be something like:

      var video = $("#bgndVideo1");
      if($(window).width()<1050 && ! video.attr("paused")){
        video.attr("paused", true)
        video.attr("paused", false)
Viewing 1 replies (of 1 total)
  • The topic ‘A way to de-activate for certain resolutions?’ is closed to new replies.