cancel
Showing results for 
Search instead for 
Did you mean: 

Change IFRAME tag for videos on the frontend product page

Change IFRAME tag for videos on the frontend product page

Hi 

In order to comply with GDPR, I need to change the iframe tag for videos on the frontend product page, so that it includes a class and also changes the 'src' attribute to 'data-src'. For example the current tag looks like 

 

<iframe frameborder="0" 
		allowfullscreen="1" 
		allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" 
		title="YouTube video player" 
		width="100%" 
		height="100%" 
		src="https://www.youtube.com/embed/gNtJ4HdMavo?autoplay=1&amp;rel=0&amp;enablejsapi=1&amp;origin=https%3A%2F%2Fwww.example.com&amp;widgetid=1" 
		id="widget2">
</iframe>

the tag needs to change to

<iframe frameborder="0" 
		allowfullscreen="1" 
		allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" 
		title="YouTube video player" 
		width="100%" 
		height="100%" 
		class="optanon-category-VID01" 
		data-src="https://www.youtube.com/embed/gNtJ4HdMavo?autoplay=1&amp;rel=0&amp;enablejsapi=1&amp;origin=https%3A%2F%2Fwww.example.com&amp;widgetid=1" 
		id="widget2">
</iframe>

 

Does anyone know if this is possible? And if so how do I  go about doing it?

 

Any help with this, would be brill.

 

Cheers

Rob

2 REPLIES 2

Re: Change IFRAME tag for videos on the frontend product page

Developers mainly use the iframe tag to embed another HTML ... like button), a YouTube video, or an advertising section on your website. ... Here is another example in which we display a button to tweet your web page on Twitter: ... and everything that could help her fellow front-end web developers Download iMessage for PC

Re: Change IFRAME tag for videos on the frontend product page

An iFrame is a way to embed a web page into the content of another page. This is done using HTML tags 

download kindle app for pc