Youtube image embedding
This library allows developers to embed images from youtube video directly using Video Link and Timestamps
Library needs ytdl-cfworker to work. Host your own for Availability.
Add .yt-image-embed class and data- attributes
- data-url:(Required) url of youtube video
- data-time:(Required) video timestamp of frame to embed. eg values 5h1m12s, 05:01:12
- data-width:(Optional) defaults to element width or parent container width or screen width
- data-height:(Optional) calculates using aspect ratio of video if not present
<!-- image at 11 minutes and 17 seconds with width of 600px --> <div data-url="https://youtu.be/0if71HOyVjY" data-time="11m17s" data-width="600"></div> <!-- Include Library --> <script src="ytimage-embeds.js"></script> <!-- Run --> <script> // worker hosted with free plan. use own for availability. const cfwurl = 'https://ytdl-cfworker.arjun11.workers.dev/'; // checkout ytdl-cfworker to host your own let ytEmbedder = YTIE(cfwurl); ytEmbedder.loadAll(); </script>