drab
Version:
Interactivity for You
32 lines (31 loc) • 1.04 kB
TypeScript
import { Base, type BaseAttributes } from "../base/index.js";
export type YouTubeAttributes = BaseAttributes & {
autoplay?: boolean;
start?: number;
uid: string;
};
/**
* Embeds a YouTube video iframe into a website with the video uid, using www.youtube-nocookie.com.
*/
export declare class YouTube extends Base {
static observedAttributes: readonly ["autoplay", "start", "uid"];
constructor();
/** The `HTMLIFrameElement` within the element. */
get iframe(): HTMLIFrameElement;
/** Whether the video should start playing when loaded. */
get autoplay(): boolean;
set autoplay(value: boolean);
/** The start time of the video (seconds). */
get start(): string;
set start(value: string);
/**
* The video's YouTube uid, found within the url of the video.
*
* For example if the video url is https://youtu.be/gouiY85kD2o,
* the `uid` is `"gouiY85kD2o"`.
*/
get uid(): string;
set uid(v: string);
mount(): void;
attributeChangedCallback(): void;
}