Skip to content

Instantly share code, notes, and snippets.

@cahva
Created October 16, 2019 14:12
Show Gist options
  • Save cahva/925adf2d8c102fad1615ef2511557139 to your computer and use it in GitHub Desktop.
Save cahva/925adf2d8c102fad1615ef2511557139 to your computer and use it in GitHub Desktop.
<script>
function tryEl(e) {
var privEl = document.querySelector('#bitmovinplayer-video-bitmovin-player');
if (!privEl) {
window.requestAnimationFrame(tryEl);
} else {
removeBackground(privEl);
}
}
function changeBG(el) {
var bmovCont = document.querySelector('.bitmovinplayer-container');
bmovCont.style.backgroundColor = 'transparent';
el.target.removeEventListener('loadeddata', changeBG);
}
function removeBackground(el) {
var elListener = el.addEventListener('loadeddata', changeBG);
}
tryEl();
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment