Skip to content

Instantly share code, notes, and snippets.

@xynztya
Created July 7, 2019 11:00
Show Gist options
  • Select an option

  • Save xynztya/62a58a003ad0972266c67e8f290688af to your computer and use it in GitHub Desktop.

Select an option

Save xynztya/62a58a003ad0972266c67e8f290688af to your computer and use it in GitHub Desktop.
YouTube Ambilight Prototype
$(document).ready ->
ambilight.on "KSqttO3NtCg", ".video"
ambilight =
on: (yt_id, container) ->
$(container).append("<iframe width='560' height='315' src='//www.youtube.com/embed/"+yt_id+"?rel=0&controls=0&showinfo=0&autoplay=1' frameborder='0' allowfullscreen></iframe>")
$("body").tubular({videoId: yt_id});
<script src="//cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script>
<script src="http://www.seanmccambridge.com/tubular/js/jquery.tubular.1.0.js"></script>
* {
padding: 0;
margin: 0;
border: 0;
outline: 0;
}
body {
background-color: #000;
}
#tubular-container {
filter: blur(50px) brightness(.5);
-webkit-filter: blur(50px) brightness(.5);
z-index: 0;
}
.video {
width: 560px;
height: 315px;
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
margin: auto;
z-index: 100;
}

YouTube Ambilight Prototype

Thanks to the jQuery plugin "tubular". This was my first approach to make my HTML5 Video Ambilight possible for youtube videos. Unfortunately it doesn't work that good. Pretty async :(

I like it anyway :D What do you think?

A Pen by Max on CodePen.

License.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment