Jump to content

Lite YouTube Embed Module


jacmaes
 Share

Recommended Posts

This is my very first module, and I'm sure it needs a lot of improvements, so I'd like to get some feedback. I've kept it as simple as possible to fit my basic needs. Adapted from Ryan Cramer's TextformatterVideoEmbed, this TextFormatter module replaces plain YouTube links pasted in a CKEditor field with Paul Irish's blazing fast Lite YouTube Embed script:

https://github.com/jacmaes/TextformatterLiteYouTubeEmbed

Why? The Lite YouTube Embed script is indeed a lot faster than the standard iframe embed. The difference is pretty spectacular when you need to embed a series of videos. It's also more private as it uses youtube-nocookie.com (so no need for a cookie banner).

 

  • Like 12
Link to comment
Share on other sites

Thanks guys. I'll see what I can do this weekend, if I finally manage to have some free time.

PS: although I built the following page before this module, it does use the lite-youtube-embed script, so you can check how it looks and how fast the page loads with 14 videos:

https://www.spainculture.us/digital-projects/14-days-14-artists/

 

  • Like 2
Link to comment
Share on other sites

  • 3 years later...

I have been digging into the oembed fields/essence and this as well. First exposure to this feature and so cool to see where it is used.

If you run Plex, for example, and you use youtube-dl to grab audio from a music video, the comment on the exported audio file includes the youtube URL and when you load the music file into Plex, Plex pulls the oembed data and shows you the video description for the song!

I don't know if this is still being worked on, but I like this implementation for youtube so I will fork and add lite-vimeo-embed support if necessary.

Link to comment
Share on other sites

Slightly embarrassed to mention it given the code is currently 90% todo statements, but I did expand this module for a project I did a few months back to include Vimeo.

You can grab the code from

https://github.com/millipedia/TextformatterLiteVideoEmbed

and you can see a test page here

https://millipedia.com/video-test/

It definitely needs a lot of tidying up, but I have it running on a couple of live sites at the moment and it hasn't destroyed them yet (ymmv).

I'll try and find some time to polish up the code as soon as I can.

Edited by millipedia
Fixing broken link to github repository
  • Like 1
Link to comment
Share on other sites

Hi @millipedia

This is much faster than Ryan's one. One thing though, line 13, 14 of TextformatterLiteVideoEmbed.js should be modified as the following. Otherwise it doesn't work in pages other than the home page.

const LiteYTEmbed = await import(tflve_script_path + '/lite-youtube.js');
const LiteVimeoEmbed = await import(tflve_script_path + '/lite-vimeo.js');

Gideon

Link to comment
Share on other sites

52 minutes ago, Gideon So said:

 One thing though, line 13, 14 of TextformatterLiteVideoEmbed.js should be modified as the following. Otherwise it doesn't work in pages other than the home page.

const LiteYTEmbed = await import(tflve_script_path + '/lite-youtube.js');
const LiteVimeoEmbed = await import(tflve_script_path + '/lite-vimeo.js');

Hmm -  it works for me on several sites at different page depths - which webserver are you using? But you're right that I don't really think we need that leading period, and taking it out seems to  be fine, so I've made those changes as suggested.  Thanks for letting me know.

  • Like 1
Link to comment
Share on other sites

  • 5 weeks later...
On 4/27/2023 at 12:39 PM, millipedia said:

Slightly embarrassed to mention it given the code is currently 90% todo statements, but I did expand this module for a project I did a few months back to include Vimeo.

You can grab the code from

https://github.com/millipedia/TextformatterLiteVideoEmbed

and you can see a test page here

https://millipedia.com/video-test/

It definitely needs a lot of tidying up, but I have it running on a couple of live sites at the moment and it hasn't destroyed them yet (ymmv).

I'll try and find some time to polish up the code as soon as I can.

@millipedia I’d love to see your TextformatterLiteVideoEmbed have its own thread in the Forum. Maybe you an kick it off?

  • Like 2
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...