Title: Video Iframes
Last modified: February 28, 2019

---

# Video Iframes

 *  Resolved [Bonaldi](https://wordpress.org/support/users/bonaldi/)
 * (@bonaldi)
 * [7 years, 2 months ago](https://wordpress.org/support/topic/iframes-9/)
 * 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](https://wordpress.org/support/users/rogierlankhorst/)
 * (@rogierlankhorst)
 * [7 years, 2 months ago](https://wordpress.org/support/topic/iframes-9/#post-11262030)
 * 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.
    -  This reply was modified 7 years, 2 months ago by [Rogier Lankhorst](https://wordpress.org/support/users/rogierlankhorst/).
 *  Plugin Contributor [Rogier Lankhorst](https://wordpress.org/support/users/rogierlankhorst/)
 * (@rogierlankhorst)
 * [7 years, 2 months ago](https://wordpress.org/support/topic/iframes-9/#post-11263360)
 * 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](https://github.com/rlankhorst/complianz-gdpr)
 *  Thread Starter [Bonaldi](https://wordpress.org/support/users/bonaldi/)
 * (@bonaldi)
 * [7 years, 2 months ago](https://wordpress.org/support/topic/iframes-9/#post-11263727)
 * 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](https://wordpress.org/support/users/rogierlankhorst/)
 * (@rogierlankhorst)
 * [7 years, 2 months ago](https://wordpress.org/support/topic/iframes-9/#post-11263743)
 * Ah, yes, you might be right about that.
 *  Thread Starter [Bonaldi](https://wordpress.org/support/users/bonaldi/)
 * (@bonaldi)
 * [7 years, 2 months ago](https://wordpress.org/support/topic/iframes-9/#post-11264628)
 * 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.

 * ![](https://ps.w.org/complianz-gdpr/assets/icon-256x256.png?rev=2881064)
 * [Complianz - GDPR/CCPA Cookie Consent](https://wordpress.org/plugins/complianz-gdpr/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/complianz-gdpr/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/complianz-gdpr/)
 * [Active Topics](https://wordpress.org/support/plugin/complianz-gdpr/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/complianz-gdpr/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/complianz-gdpr/reviews/)

 * 5 replies
 * 2 participants
 * Last reply from: [Bonaldi](https://wordpress.org/support/users/bonaldi/)
 * Last activity: [7 years, 2 months ago](https://wordpress.org/support/topic/iframes-9/#post-11264628)
 * Status: resolved