Problem Statement In website there is an error popping up. If iframe has embedded youtube URL. Like below:
<iframe width="560" height="315" src="https://www.youtube.com/embed/GrHLNrXbOpk?loop=1&playlist=GrHLNrXbOpk" frameborder="0"></iframe>
Error is: page is stopped rendering post iframe loads. That means rest of the section of the page like footer etc. is not showing up. And chrome developer tool has following warning message under network tab:
Analysis and Findings: 1. This problem is present for all countries and all pages [where iframe has embedded youtube URL] but only in Live not in staging. That means same page is working in staging without any warning and error but not in live. 2. For staging, youtube request present under network tab showing ‘x-frame-option’ as ‘same origin’ but for live same request is showing error [request was cancelled] 3. For staging following iframe tag has been generated upon inspection using developer tool:
<iframe width="560" height="315" src="https://www.youtube.com/embed/GrHLNrXbOpk?loop=1&playlist=GrHLNrXbOpk" frameborder="0"></iframe>
But for live following iframe tag has been generated:
<iframe width="560" height="315" src="https://www.youtube.com/embed/GrHLNrXbOpk?loop=1&playlist=GrHLNrXbOpk&**enablejsapi=1&origin=https%3A%2F%2Fjp.medical.canon**" frameborder="0" data-gtm-yt-inspected-8017646_18="true" id="313798858" data-gtm-yt-inspected-8017646_35="true" data-gtm-yt-inspected-8017646_39="true" data-gtm-yt-inspected-8017646_40="true"></iframe>
The highlighted section is appending only in live though they are not part of content. 4. Interestingly if has been prepend with white space the video is loading properly in Live though warning messages are present. 5. In following youtube support page, it has mentioned ‘whitelisting of youtube URL has been required in firewall’ https://support.google.com/youtube/answer/171780?hl=en
Question
- why problem is only present for live pages?
- is youtube hostame need to whitelist in firewall?