Support » Plugin: Complianz | GDPR/CCPA Cookie Consent » Youtube player changes in size

  • Maartenvveen


    Hi guys,

    In Complianz, I finally found a cookie plugin that works! You guys are the best.
    the Wizard/turtorial was very helpful as well.

    There is one thing that confuses me, on activating the plugin it changes the size of my embedded youtube players. Is there any way to fix this? Because while it funtions correctly (blocking the video until consent is given) it doesn’t look as pretty.

    Thanks in advance for your reply.

Viewing 15 replies - 16 through 30 (of 84 total)
  • Plugin Author RogierLankhorst


    When I look on your site, I notice that the youtube movie seems to be the right size after accepting cookies. Only before, when youtube is blocked, and you get the blocked content placeholder and message, this message is not full screen. If this is the issue you are experiencing, this is not a fitvids issue, as there is not video yet. This is a custom CSS issue. If you can confirm this I can find a css solution for your setup, to make sure your placeholder banner will show full screen, like the video.

    Plugin Author RogierLankhorst


    The blocked container div inherits the height of it’s parent, but in this case the parent does not have a height. For the homepage content container, the following CSS may resolve the height problem of this container div (.home limits the css to the homepage only):

    .home .cmplz-blocked-content-container {
        height: 100vh;

    Thank you for your involvement Rogier.

    The size problem is indeed partially solved since 2.1.5, when the video is unblocked.

    I confirm to you that when it is blocked, the problem comes from the css Fitvids which is no longer loaded because of the method of the plugin, which modifies the code and prevents Fitvids from finding a video address in src.

    I know that by playing on the theme css I could give a fixed height to the header. But I am in larger analysis of your plugin because I plan to activate it on several sites, with different themes.
    I can not see myself going to resume the css of each to seek an adaptation. Especially since the problem does not exist only on the home page, but on all pages. For example, you can not put 100vh heigh on all site videos.

    My point of view is that it would be more profitable to adapt the plugin to the current scripts, rather than having to modify themes, whose scripts work well without the plugin.

    I hope you’ll find a more universal method and remain at your disposal to discuss the subject.


    More about the tip of css that you propose me, the home page video should not be the height of the screen: without plugin, it is precisely adapted dynamically by Fitvids.
    As you can see after unlocking.

    Plugin Author RogierLankhorst


    I understand. I have added a small jquery script which resizes the blocked content container based on the width, to have a height of 3/4 of the width, which should make it the same aspect ratio as a video.

    With the latest gitversion you can test if this resolves the blocked content div’s height issue.

    Let me know if this helps!

    Sorry, this is not the right solution, in my opinion.
    The div should take the aspect ratio of maxresdefault.jpg or hqdefault.jpg to be logical.

    You can check in my header video: the parallax orange background image should not be visible, as when the video is unblocked.

    Plugin Author RogierLankhorst


    Is see it. I assumed the aspect ratio would always be the same. I have found a way to detect the aspect ratio of the image, then resize the div accordingly.

    This is now committed on github. Let me know how this works for you.

    Good job Rogier, you got it, it works for YouTube.

    I’m trying to build themes compatible with YouTube, but also Vimeo and DailyMotion at a minimum.

    It seems that for DailyMotion the thumbnail is not called.
    You can see it on my post

    If this can help you:


    Plugin Author RogierLankhorst


    Hi @bonaldi,

    Dailymotion isn’t supported yet, but I’ll look into this, and see if I can get it added in the release this week.

    OK Rogier, thanks for everything.
    If we fixed the problem, @maartenvveen could possibly close the topic?

    Plugin Author RogierLankhorst


    You can test the latest beta version with dailymotion support. Dailymotion has quite a lot of different possible URL’s, which makes it difficult to make sure every possible variant is taken care of, so if you encounter exceptions to the dailymotion url setup, please post the embed code here so i can test it.

    A thumbnail DailyMotion appears well, but it has no height in the class .cmplz-blocked-content-container cmplz-video

    Plugin Author RogierLankhorst


    This can be fixed, but it will then take the height of the placeholder, which for dailymotion seems not to have the same height as the video.

    I noticed in function.php some set_transient("cmplz_vimeo_image_ in switch case ‘dailymotion’:, line 72

Viewing 15 replies - 16 through 30 (of 84 total)
  • The topic ‘Youtube player changes in size’ is closed to new replies.