• Resolved Bonaldi

    (@bonaldi)


    Hi Rogier,

    This code worked on github in version 2.1.5.3 cookieconfig.js and cookieconfig.min.js:

    //reset video height adjustments
    $('.cmplz-video').each(function (i, obj) {
    	$(this).height('inherit');
    });
    
    //iframes
    $('.cmplz-iframe').each(function (i, obj) {
    	var src = $(this).data('src-cmplz');
    	$(this).attr('src', src);
    
    	//fitvids needs to be reinitialized, if it is used.
    	if (jQuery.fn.fitVids && $(this).parent().hasClass('cmplz-video')) {
    		$(this).parent().fitVids();
    	}
    });

    Pushed version 2.1.5 on repo has changed code and doesn’t work anymore:

    //some video specific actions
    $('.cmplz-video').each(function (i, obj) {
    	//reset video height adjustments
    	$(this).height('inherit');
    	//fitvids needs to be reinitialized, if it is used.
    	if (jQuery.fn.fitVids) {
    		$(this).fitVids();
    	}
    });
    
    //iframes
    $('.cmplz-iframe').each(function (i, obj) {
    	var src = $(this).data('src-cmplz');
    	$(this).attr('src', src);
    });
Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Contributor Rogier Lankhorst

    (@rogierlankhorst)

    hmmm, strange.

    I changed this code as it is more efficient. But I will put it back to the previous code. Although you can see the effect should be the same:

    #1:
    on each cmplz-iframe class, if the parent has class cmplz-video, instantiate fitvids on the parent.

    #2:
    on each cmplz-video class, instantiate fitvids

    In the second case, it instantiates on the video item itself, in the first case it instantiates on the parent item, if it is the video item.

    Can’t see why this would be different. But as it is not a big deal, I will change it back. It’s just a little less elegant.

    Plugin Contributor Rogier Lankhorst

    (@rogierlankhorst)

    Another user had an issue where resetting the height after enabling cookies caused an issue. I have now adjusted this code so the height will not get reset when the container has a large padding, which is sometimes used for responsive video as alternative to fidvids.

    This should not affect the solution for your setup, but let me know if it does.
    https://github.com/rlankhorst/complianz-gdpr

    Thread Starter Bonaldi

    (@bonaldi)

    Maybe because the Fitvids reinitialisation needs to be done AFTER the src modification, otherwise by doing it before, it can not find a video type and insert Fitvids div…

    Plugin Contributor Rogier Lankhorst

    (@rogierlankhorst)

    Ah, yes, you might be right about that.

    Thread Starter Bonaldi

    (@bonaldi)

    Thanks, I think so.
    I close this topic.

Viewing 5 replies - 1 through 5 (of 5 total)

The topic ‘Video Iframes’ is closed to new replies.