Class: VideoTag

VideoTag


new VideoTag(publicId, options)

Creates an HTML (DOM) Video tag using Cloudinary as the source.

Parameters:
Name Type Argument Description
publicId string <optional>
options Object <optional>

Extends

Methods


#attributes()

Get the attributes of the tag.

Inherited From:
Returns: Object

attributes

Type
Object

#getAttr(name)

Get the value of the tag attribute name

Parameters:
Name Type Description
name string

the name of the attribute

Inherited From:
Returns: *
Type
*

#getOption(name)

Get the value of option name

Parameters:
Name Type Description
name string

the name of the option

Inherited From:
Returns: *

Returns the value of the option

Type
*

#getOptions()

Get all options related to this tag.

Inherited From:
Returns: Object

the options

Type
Object

#removeAttr(name)

Remove the tag attributed named name

Parameters:
Name Type Description
name string

the name of the attribute

Inherited From:
Returns: *
Type
*

#setAttr(name, value)

Set a tag attribute named name to value

Parameters:
Name Type Description
name string

the name of the attribute

value string

the value of the attribute

Inherited From:

#setFallbackContent(value)

Set the content to use as fallback in the video tag

Parameters:
Name Type Description
value string

the content to use, in HTML format

Returns: VideoTag

Returns this instance for chaining purposes.

Type
VideoTag

#setPoster(value)

Set the poster to be used in the video tag

Parameters:
Name Type Description
value string | Object
  • string: a URL to use for the poster
  • Object: transformation parameters to apply to the poster. May optionally include a public_id to use instead of the video public_id.
Returns: VideoTag

Returns this instance for chaining purposes.

Type
VideoTag

#setSourceTransformation(an)

Set the transformation to apply on each source

Parameters:
Name Type Description
an Object

object with pairs of source type and source transformation

Returns: VideoTag

Returns this instance for chaining purposes.

Type
VideoTag

#setSourceTypes(an)

Set the source types to include in the video tag

Parameters:
Name Type Description
an Array.<string>

array of source types

Returns: VideoTag

Returns this instance for chaining purposes.

Type
VideoTag

#toAttribute(key, value)

Represent the given key and value as an HTML attribute.

Parameters:
Name Type Description
key string

attribute name

value * | boolean

the value of the attribute. If the value is boolean true, return the key only.

Inherited From:
Returns: string

the attribute

Type
string

#toDOM()

Creates a DOM object representing the tag.

Inherited From:
Returns: Element
Type
Element

#toHtml()

Generates an HTML representation of the tag.

Inherited From:
Returns: string

Returns HTML in string format

Type
string