Home Reference Source Test Repository
import Embed from 'url-embed/lib/classes/Embed.js'
public class | source

Embed

Embed data object that holds embedOptions and resulting data.

Constructor Summary

Public Constructor
public

constructor(embedURL: String, embedOptions: Object)

Member Summary

Public Members
public

data: {html: String}

Data object for the resolved embed

public

Milliseconds elapsed during resolving embed

public

The URL to be embedded

public

Will be populated with an Error object if an error occurs while processing this embed

public

Time the embed finished resolving

public

The provider API URL that was used to resolve the embed

public

Options for this Embed

public

Time the embed began resolving

public

Default markup for unprocessed embed.data.html

Method Summary

Public Methods
public

Timestamps the end of the embed resolve process and calculates elapsedMs

public

Timestamps the beginning of the embed resolve process.

Public Constructors

public constructor(embedURL: String, embedOptions: Object) source

Params:

NameTypeAttributeDescription
embedURL String

URL to be embedded

embedOptions Object

Additional options

Throw:

EmbedValidationError

if embedURL is undefined.

Public Members

public data: {html: String} source

Data object for the resolved embed

Note: there should always be a populated data.html property, even if the embed encounters an error while resolving.

public elapsedMs: number source

Milliseconds elapsed during resolving embed

public embedURL: String source

The URL to be embedded

public error: Error source

Will be populated with an Error object if an error occurs while processing this embed

public finishedDate: Date source

Time the embed finished resolving

public oembedAPIURL: String source

The provider API URL that was used to resolve the embed

public options: Object source

Options for this Embed

public startedDate: Date source

Time the embed began resolving

public stubMarkup: String source

Default markup for unprocessed embed.data.html

Public Methods

public markFinished() source

Timestamps the end of the embed resolve process and calculates elapsedMs

public markStarted() source

Timestamps the beginning of the embed resolve process.