RepositoryJavaScriptRSSerbia
stamat

stamat/youtube-background

ESM / jQuery plugin for creating video backgrounds from YouTube, Vimeo or video file links.

189sao
51fork
0issue
2lượt xem

📺 youtube-background — Video nền đa nền tảng, không cần CSS

Tạo video nền từ YouTube, Vimeo hoặc file video chỉ với một thuộc tính data-vbg.

Dự án youtube-background là một thư viện JavaScript (ESM hoặc jQuery plugin) giúp nhúng video nền vào bất kỳ phần tử HTML nào — thường dùng cho hero/banner. Khởi tạo chỉ bằng cách thêm data-vbg="link-video" và gọi new VideoBackgrounds(...) hoặc .youtube_background().

✨ Điểm nổi bật

  • Không cần CSS: toàn bộ styling do script tự xử lý.
  • Hỗ trợ YouTube, Vimeo, file video: dùng cho mọi nguồn video.
  • ESM + jQuery plugin: dùng tùy trường hợp, jQuery là tùy chọn.
  • Lazyload: iframe/video chỉ tải khi cần.
  • Tắt cookie mặc định: không gửi cookie cho YouTube/Vimeo.
  • Tải API khi dùng: tránh tải script API không cần thiết.
  • Quản lý thể hiện: truy cập UID qua .get()/.add(), điều khiển play/pause/mute.
  • MutationObserver hỗ trợ thủ công: tự động khởi tạo video khi thêm phần tử mới.

💡 Vì sao đáng chú ý

Không chỉ là công cụ nhúng video đơn thuần, dự án cung cấp API quản lý thể hiện (instance) chi tiết: truy cập trạng thái phát, âm thanh, vị trí viewport, và điều khiển chương trình qua UID. Phù hợp cho trang web cần hiệu ứng video nền mượt mà mà không viết CSS phức tạp.


#JavaScript #VideoBackground #YouTubeEmbed #OpenSource #TiniX

Dự án tương tự

Khám phá các dự án và mô hình AI khác có sự tương đồng.

Repository
getify/You-Dont-Know-JS

A book series (2 published editions) on the JS language.

184.8k
Oct 31, 2026
RepositoryJavaScript
airbnb/javascript

JavaScript Style Guide

148.0k
Apr 16, 2026
RepositoryTypeScript
morluto/rea

Reverse engineer anything with agents, from app behavior down to native binaries.

487.0k
Dec 2, 2026
RepositoryJavaScript
react/react

The library for web and native user interfaces.

253.0k
Nov 30, 2026
RepositoryJavaScript
trekhleb/javascript-algorithms

📝 Algorithms and data structures implemented in JavaScript with explanations and links to further readings

196.8k
Jul 26, 2026
RepositoryTypeScript
freeCodeCamp/freeCodeCamp

freeCodeCamp.org's open-source codebase and curriculum. Learn math, programming, and computer science for free.

459.9k
Dec 2, 2026
RepositoryPython
practical-tutorials/project-based-learning

Curated list of project-based tutorials

290.9k
Nov 30, 2026
RepositoryTypeScript
vuejs/vue

This is the repo for Vue 2. For Vue 3, go to https://github.com/vuejs/core

212.6k
Oct 10, 2024
RepositoryJavaScript
jquery-form/form

jQuery Form Plugin

5.1k
Nov 29, 2026