Skip to content

Provides an embed code to show your current YouTube Live broadcast on any other site.

Notifications You must be signed in to change notification settings

macbookandrew/youtube-live

Repository files navigation

YouTube Live

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.

Setup

  1. Log into https://console.cloud.google.com/
  2. Create a new project
  3. Enable the YouTube Data API product
  4. Create an API key

Usage

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>

About

Provides an embed code to show your current YouTube Live broadcast on any other site.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages