mirror of
https://github.com/discourse/discourse.git
synced 2025-05-22 07:53:49 +08:00
DEV: Remove lazy-yt and replace with lazy-videos (#20722)
- Refactors the old plugin to remove jquery usage - Adds support for Vimeo videos (default on) and Tiktok (experimental and default off)
This commit is contained in:
@ -0,0 +1,13 @@
|
||||
export default function getVideoAttributes(cooked) {
|
||||
if (!cooked.classList.contains("lazy-video-container")) {
|
||||
return {};
|
||||
}
|
||||
|
||||
const url = cooked.querySelector("a")?.getAttribute("href");
|
||||
const thumbnail = cooked.querySelector("img")?.getAttribute("src");
|
||||
const title = cooked.dataset.videoTitle;
|
||||
const providerName = cooked.dataset.providerName;
|
||||
const id = cooked.dataset.videoId;
|
||||
|
||||
return { url, thumbnail, title, providerName, id };
|
||||
}
|
Reference in New Issue
Block a user