Skip to main content

@social-embed/lib

Enumerations#

Type aliases#

ProviderKey#

Ƭ ProviderKey: keyof typeof Provider

Defined in#

utils.ts:47


ProviderType#

Ƭ ProviderType: typeof Provider[Provider]

Defined in#

utils.ts:48

Variables#

ProviderIdFunctionMap#

Const ProviderIdFunctionMap: { [P in ValueOfProvider]: function}

Defined in#

utils.ts:51


ProviderIdUrlFunctionMap#

Const ProviderIdUrlFunctionMap: { [P in ValueOfProvider]: function}

Defined in#

utils.ts:63


dailyMotionUrlRegex#

Const dailyMotionUrlRegex: RegExp

Defined in#

providers/dailymotion.ts:2


edPuzzleUrlRegex#

Const edPuzzleUrlRegex: RegExp

Matches ID from URLs matching: https://edpuzzle.com/media/606b413369971e424ec6021e

Defined in#

providers/edpuzzle.ts:12


genericUrlRegex#

Const genericUrlRegex: RegExp

Defined in#

providers/generic.ts:15


loomUrlRegex#

Const loomUrlRegex: RegExp

Matches ID from URLs matching: https://www.loom.com/share/e883f70b219a49f6ba7fbeac71a72604

Defined in#

providers/loom.ts:16


spotifySymbolRegex#

Const spotifySymbolRegex: RegExp

Defined in#

providers/spotify.ts:6


spotifyUrlRegex#

Const spotifyUrlRegex: RegExp

Defined in#

providers/spotify.ts:3


vimeoUrlRegex#

Const vimeoUrlRegex: RegExp

Defined in#

providers/vimeo.ts:2


wistiaUrlRegex#

Const wistiaUrlRegex: RegExp

Matches ID from URLs matching:

While these are not used, these are mentions on Wistia's embed construction docs:

Defined in#

providers/wistia.ts:24


youTubeUrlRegex#

Const youTubeUrlRegex: "^(?:(?:https?):)?(?://)?[^/]*(?:youtube(?:-nocookie)?.com|youtu.be).*[=/]([-\\w]{11})(?:\\?|=|&|$)"

Regex matcher for YouTube URLs

Defined in#

providers/youtube.ts:4

Functions#

convertUrlToEmbedUrl#

Const convertUrlToEmbedUrl(url): string

Converts URL variations from sites to their "embed-friendly" URL.

Parameters#

NameType
urlstring

Returns#

string

Defined in#

utils.ts:78


getDailyMotionEmbedFromId#

Const getDailyMotionEmbedFromId(dailyMotionId): string

Parameters#

NameType
dailyMotionIdstring

Returns#

string

Defined in#

providers/dailymotion.ts:7


getDailyMotionIdFromUrl#

Const getDailyMotionIdFromUrl(url): string

Parameters#

NameType
urlstring

Returns#

string

Defined in#

providers/dailymotion.ts:4


getEdPuzzleEmbedUrlFromId#

Const getEdPuzzleEmbedUrlFromId(edPuzzleId): string

Return embed-friendly URL from ID.

Parameters#

NameTypeDescription
edPuzzleIdstringID of embed

Returns#

string

Defined in#

providers/edpuzzle.ts:33


getEdPuzzleIdFromUrl#

Const getEdPuzzleIdFromUrl(url): string

Return ID from shared link.

Parameters#

NameTypeDescription
urlstringShared URL link.

Returns#

string

Defined in#

providers/edpuzzle.ts:21


getLoomEmbedUrlFromId#

Const getLoomEmbedUrlFromId(loomId): string

Return embed-friendly URL from ID.

Parameters#

NameTypeDescription
loomIdstringID of embed

Returns#

string

Defined in#

providers/loom.ts:37


getLoomIdFromUrl#

Const getLoomIdFromUrl(url): string

Return ID from shared link.

Parameters#

NameTypeDescription
urlstringShared URL link.

Returns#

string

Defined in#

providers/loom.ts:25


getProviderFromUrl#

Const getProviderFromUrl(url): Provider

Parameters#

NameType
urlstring

Returns#

Provider

Defined in#

utils.ts:19


getSpotifyEmbedUrlFromIdAndType#

Const getSpotifyEmbedUrlFromIdAndType(spotifyId, spotifyType): string

Parameters#

NameType
spotifyIdstring
spotifyTypestring

Returns#

string

Defined in#

providers/spotify.ts:16


getSpotifyIdAndTypeFromUrl#

Const getSpotifyIdAndTypeFromUrl(url): [string, string]

Parameters#

NameType
urlstring

Returns#

[string, string]

Defined in#

providers/spotify.ts:9


getVimeoEmbedUrlFromId#

Const getVimeoEmbedUrlFromId(vimeoId): string

Parameters#

NameType
vimeoIdstring

Returns#

string

Defined in#

providers/vimeo.ts:8


getVimeoIdFromUrl#

Const getVimeoIdFromUrl(url): string

Parameters#

NameType
urlstring

Returns#

string

Defined in#

providers/vimeo.ts:5


getWistiaEmbedUrlFromId#

Const getWistiaEmbedUrlFromId(wistiaId): string

Return embed-friendly URL from ID.

Parameters#

NameTypeDescription
wistiaIdstringID of embed

Returns#

string

Defined in#

providers/wistia.ts:46


getWistiaIdFromUrl#

Const getWistiaIdFromUrl(url): string

Return ID from shared link.

Parameters#

NameTypeDescription
urlstringShared URL link.

Returns#

string

Defined in#

providers/wistia.ts:34


getYouTubeEmbedUrlFromId#

Const getYouTubeEmbedUrlFromId(youtubeID): string

Parameters#

NameType
youtubeIDstring

Returns#

string

Defined in#

providers/youtube.ts:15


getYouTubeIdFromUrl#

Const getYouTubeIdFromUrl(url): string

Parameters#

NameType
urlstring

Returns#

string

Defined in#

providers/youtube.ts:7


isValidUrl#

Const isValidUrl(value): boolean

Parameters#

NameType
valuestring

Returns#

boolean

Defined in#

providers/generic.ts:18