animation
June 5, 2016

LightEmbed

Wanting to practice my javascript skills and looking for the simplest way to embed a video onto a website, I built LightEmbed which I use here on the site but in a handful of other projects as well.

All you need is the ID of a Vimeo or YouTube video to automatically embed it in a lightbox/modal on your website. LightEmbed detects the video type and displays the video above your content on that page. It’s not perfect, but it works. I’m sure a javascript ninja could massively improve this script.

But, as is, it works in two ways.

Javascript
The first is by calling a javascript function called create_box with the ID passed in the function like “create_box(‘12345678’);”.
YouTube Example / Vimeo Example

GET Variable in URL
The second is by including the ID in a GET variable in the URL named “embed” like greggblanchard.com?embed=12345678.
YouTube Example / Vimeo Example

That’s pretty much it. If you’d like the code, just give me a holler.

More Thoughts & Such

How to Subscribe to Blogs / RSS Feeds via Email
February 16, 2024   Read this post →

A Little of Both
January 3, 2024   Read this post →

Put it On Paper
November 3, 2023   Read this post →

An Ode to Awe
October 16, 2023   Read this post →

Change Has to Be Sold
September 27, 2023   Read this post →

Knowing When to Stop
July 21, 2023   Read this post →

The Language of Uncertainty
July 21, 2023   Read this post →

Solving…Problems
July 7, 2023   Read this post →

Who am I? Who do I want to be?
June 29, 2023   Read this post →

Somewhere Between Don & Steve
June 28, 2023   Read this post →

Hi, I'm Gregg.

I'm a SaaS marketer and maker.

       

Never heard of me? All good, these days I don't chase influence as much as I do balance. By day I run marketing for Inntopia and evenings see me building SendView, but my happy place is playing in the mountains with my family.