HTML YouTube Video Player Code

Showcase YouTube guides and product videos on your HTML website to boost visibility, engage viewers, and drive more leads and sales.
4.8 rating
10,000+ reviews
Free plan available
Create Widget for Free
No credit card needed
HTML YouTube Video Player Code

Create your YouTube Gallery widget

Configure your YouTube Video Player and add it to your HTML website for free!

Screenshots

HTML YouTube Video Player Code
1 / 6

Why People Love Elfsight

Videos turn static content into something dynamic. The Elfsight YouTube gallery makes that easy. You can embed a single video or entire channels, add YouTube Shorts, or show playlists – all in a gallery that looks like part of your page.

Setup is simple: get the HTML code required, paste it into your page, tweak design settings, and publish. No plugins, no complicated installs. It feels like sliding a piece of functionality into place.

Did you know?

Wistia State of Video Report found that visitors spend 1.4 times more time on pages with embedded videos rather than those without them.

Give visitors more reasons to stay longer on your website – add the Elfsight YouTube Video widget to your HTML website.

Key Features of the HTML YouTube Video Player

Here’s what makes Elfsight’s gallery so useful:

  • Custom content sources: Use a full channel, a playlist, or individual videos – whichever fits your content plan.
  • Flexible layouts: Grid, list, carousel, or popup styles; you control thumbnails, titles, and playback behavior.
  • Responsive design: Looks good on phones, tablets, and desktops automatically.
  • Lightweight load: Only videos in the initial view load immediately; others load on demand to keep your page fast.
  • Customization options: Adjust fonts, colors, thumbnail sizes, header info – so it matches your design.

See all features in action in the live editor now – no signup needed.

How to Add YouTube Videos to HTML

Here’s a simple way to embed YouTube video content on your HTML website:

  1. Select a Template: Open the Elfsight editor and select a template.
  2. Customize the Widget: Paste in your video, channel or playlist URL, customize layout, header, thumbnails, and style.
  3. Generate the Code: Click “Add to website for free” and copy the HTML embed code.
  4. Embed on Website: Open your HTML file, paste the snippet where you want the gallery to appear.

Need extra help? Visit our Help Center, see our blog on how to embed YouTube videos to your website, or suggest features on our Wishlist. For bugs and recent updates, check the Changelog.

Can I add the YouTube Gallery widget to any HTML template?

Yes, any website that supports custom JavaScript or HTML allows embedding Elfsight widgets.

Can I use YouTube Gallery on static hosting platforms?

Yes, Elfsight works on static hosting services like GitHub Pages, Netlify, or custom servers that serve HTML files.

What video sources can I display in the YouTube Gallery?

You can show videos from a YouTube channel, a specific playlist, or even a single video. It’s also possible to combine multiple channels and playlists within one gallery, with no limit on added sources.

Can I organize videos into categories inside my gallery?

Yes, using the Source Groups feature in the Elfsight editor, you can divide videos into separate sections with custom titles, creating structured categories instead of one continuous list.

Will newly uploaded videos appear automatically?

The gallery syncs with your connected sources automatically. It refreshes roughly every 24 hours, so new uploads usually show up within a day rather than instantly.

Can I add a channel using its @handle URL?

Yes, you can paste a YouTube channel’s @handle link (for example, https://www.youtube.com/@YourHandle), and the gallery will load its videos just like with a standard channel URL.

Are YouTube Shorts included in the gallery feed?

If your channel publishes Shorts, they are displayed by default together with regular videos. To exclude Shorts, you can use a custom playlist or add only selected video links.

How do I display a specific YouTube playlist on my HTML page?

Simply add the playlist URL as a source in the settings. The gallery will show all videos from that playlist in the same order as on YouTube.

Does the YouTube Gallery include a subscribe button?

The widget header can display a YouTube button that redirects visitors to your channel. Subscribing takes place directly on YouTube, not inside the gallery.

Is there a search option within the YouTube Gallery?

You can activate a built-in search bar which allows users to search among the displayed videos by keywords.

Can I change the interface language of the gallery in HTML?

Yes, the interface supports many popular languages. By selecting a language in the settings, all standard labels automatically adapt for your HTML website visitors.

Pricing

14-day money back guarantee. Risk-free, you can cancel at anytime.
Elfsight Apps
Multi-platform software
from $0 / month
start with free plan
Unlimited websites
24/7 support and well documented
Charge-free installation support
Special price for multiple apps
100% customizable