Provides an embed code to show your current YouTube Live broadcast on any other site.
Basically this is a simpler, hosted version of my WordPress plugin.
- Log into https://console.cloud.google.com/
- Create a new project
- Enable the YouTube Data API product
- Create an API key
Add this markup to your page:
<iframe src="https://youtube-live.andrewrminion.com/live/{channelId}" id="youtube-live"></iframe>
<script>
let iframe = document.querySelector('#youtube-live');
window.addEventListener('message', function(e) {
// message that was passed from iframe page
let message = e.data;
iframe.style.height = message.height + 'px';
iframe.style.width = message.width + 'px';
} , false);
</script>