UNPKG

nuxt-lazytube

Version:

A Nuxt module for lazy loading YouTube and Vimeo videos with lightweight iframes to improve page performance

18 lines (17 loc) 1.34 kB
/** Helper method to fetch oembed data */ declare const fetchingOembed: (src: string, type?: "youtube" | "vimeo") => Promise<Response>; /** Helper method to dynamically create iframe */ declare const createIframe: (videoID: string, urlCompare: string, getTitle: string, iframeClass: string, iframePolicy: string, type: "youtube" | "vimeo", flag?: boolean) => HTMLIFrameElement | null; /** Helper method to check if postMessage features is available */ declare const isPostMessageSupported: () => boolean; /** Helper method to calculate aspect */ declare const calcAspect: (aspect: string) => number; /** Helper method to get youtube video ID from url */ declare const getYouTubeID: (url: string) => string; /** Helper method to get vimeo video ID from url */ declare const getVimeoID: (url: string) => string; /** Helper method to get Thumbnail for youtube video */ declare const getYoutubeThumbnail: (video_id: string, quality?: "default" | "medium" | "high" | "standard" | "maxres") => string | false; /** Helper method to get Thumbnail for vimeo video */ declare const getVimeoThumbnail: (video_id: string, quality?: "default" | "medium" | "high" | "standard" | "maxres") => string | false; export { createIframe, isPostMessageSupported, calcAspect, fetchingOembed, getYouTubeID, getYoutubeThumbnail, getVimeoID, getVimeoThumbnail, };