Skip to content

Instantly share code, notes, and snippets.

@cahva
Last active February 18, 2019 08:35
Show Gist options
  • Save cahva/f7a7de13a4905fedaf1713fe034513a6 to your computer and use it in GitHub Desktop.
Save cahva/f7a7de13a4905fedaf1713fe034513a6 to your computer and use it in GitHub Desktop.
Change priv policy text
<script>
/* wait for element to be ready and then change text */
function tryEl(e) {
var privEl = document.querySelector('.video-player');
if (!privEl) {
window.requestAnimationFrame(tryEl);
} else {
changeText(privEl);
}
}
function changeText(el) {
var youtubeUrl = 'https://www.youtube.com/embed/GmzWbgzo6B4';
var iFrame = document.createElement('iframe');
window.initBitmovin = function() { return false; }
bitmovin = null;
iFrame.setAttribute('style', 'width: 100%');
iFrame.setAttribute('frameborder', '0');
iFrame.setAttribute('allowfullscreen','1');
iFrame.setAttribute('allow', 'accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture');
iFrame.setAttribute('src', youtubeUrl);
el.appendChild(iFrame);
}
tryEl();
</script>
<iframe width="560" height="315" src="https://www.youtube.com/embed/GmzWbgzo6B4" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment