JavaScript Video Player and Gallery — No Framework
<!-- Anywhere in your HTML -->
<div class="elfsight-app-YOUR-WIDGET-ID" data-elfsight-app-lazy></div>
<script src="https://elfsightcdn.com/platform.js" async></script>
<script>
// Or add it dynamically
function mountVideoGallery(container, id) {
const el = document.createElement("div");
el.className = "elfsight-app-" + id;
el.setAttribute("data-elfsight-app-lazy", "");
container.appendChild(el);
if (!document.querySelector('script[src*="elfsightcdn.com/platform.js"]')) {
const s = document.createElement("script");
s.src = "https://elfsightcdn.com/platform.js";
s.async = true;
document.body.appendChild(s);
}
}
</script>Trusted by over 3,000,000 small businesses, agencies and top global brands worldwide
Configure it visually — drop it into your JavaScript app
- 1. Choose a template
- 2. Connect your videos
- 3. Add to website
Why build a video gallery in JavaScript from scratch?
What building it yourself really takes
Fetching and caching
Player and popup
Vertical video
Layouts
SEO and analytics
Maintenance
Client edits
With Elfsight Video Gallery
<div class="elfsight-app-YOUR-ID" data-elfsight-app-lazy></div>No API keys or quotas in your app
Feeds from YouTube, Vimeo, TikTok, Instagram Reels, Twitch and any link
7 layouts, popup player, CTA card
Schema.org markup and Google Analytics
Maintained by Elfsight when platforms change
Drop-in integration for JavaScript
The JavaScript component
No framework, no build step. One element and one async script.
Dynamic mounting. Add galleries at runtime with a small helper.
Any stack. Static sites, server-rendered pages, CMS templates.
<!-- Anywhere in your HTML -->
<div class="elfsight-app-YOUR-WIDGET-ID" data-elfsight-app-lazy></div>
<script src="https://elfsightcdn.com/platform.js" async></script>
<script>
// Or add it dynamically
function mountVideoGallery(container, id) {
const el = document.createElement("div");
el.className = "elfsight-app-" + id;
el.setAttribute("data-elfsight-app-lazy", "");
container.appendChild(el);
if (!document.querySelector('script[src*="elfsightcdn.com/platform.js"]')) {
const s = document.createElement("script");
s.src = "https://elfsightcdn.com/platform.js";
s.async = true;
document.body.appendChild(s);
}
}
</script>Performance and security
Async and lazy
No dependencies
No keys in your code
Works with strict security policies
Customize it like code — or don’t write any
Custom CSS
Custom JS
Visual editor
Filters and sorting
Hand off to clients
No redeploys
Everything the widget does for you

YouTube

TikTok

Instagram Reels

Vimeo

Twitch

Any video link

Popup player

CTA after the video

Schema.org markup

Channel header

Analytics events
Elfsight vs. building with JavaScript libraries
Time to ship
Video Gallery
Build with player libraries
Sources
Video Gallery
Build with player libraries
API keys in your app
Video Gallery
Build with player libraries
Feeds update automatically
Video Gallery
Build with player libraries
Layouts, popup, CTA card
Video Gallery
Build with player libraries
Schema.org and Google Analytics
Video Gallery
Build with player libraries
Custom styling and behavior
Video Gallery
Build with player libraries
Clients edit content without you
Video Gallery
Build with player libraries
Maintenance when APIs change
Video Gallery
Build with player libraries
Need DRM, custom analytics pipelines or a fully bespoke player? Build it — start with our Video.js vs react-player vs hls.js comparison.