Global

Methods

module:auth_token(options) → {string}

Generate an authorization token
Parameters:
Name Type Description
options Object
Properties
Name Type Attributes Default Description
key string the secret key required to sign the token
ip string <optional>
the IP address of the client
start_time number <optional>
now the start time of the token in seconds from epoch
expiration string <optional>
the expiration time of the token in seconds from epoch
duration string <optional>
the duration of the token (from start_time)
acl string <optional>
the ACL for the token
url string <optional>
the URL to authentication in case of a URL token
Source:
Returns:
the authorization token
Type
string

option_consume(options, option_name, default_valueopt)

Deletes `option_name` from `options` and return the value if present. If `options` doesn't contain `option_name` the default value is returned.
Parameters:
Name Type Attributes Description
options Object a collection
option_name String the name (key) of the desired value
default_value <optional>
the value to return is option_name is missing
Source:

video(public_id, optionsopt) → {string}

Creates an HTML video tag for the provided public_id
Parameters:
Name Type Attributes Description
public_id String the resource public ID
options Object <optional>
options for the resource and HTML tag
Properties
Name Type Attributes Description
source_types String | Array.<String> <optional>
Specify which source type the tag should include. defaults to webm, mp4 and ogv.
source_transformation String <optional>
specific transformations to use for a specific source type.
poster String | Object <optional>
image URL or poster options that may include a public_id key and poster-specific transformations
Source:
Returns:
HTML video tag
Type
string
Example

Example of generating a video tag:

$.cloudinary.video("mymovie.mp4");
$.cloudinary.video("mymovie.mp4", {source_types: 'webm'});
$.cloudinary.video("mymovie.ogv", {poster: "myspecialplaceholder.jpg"});
$.cloudinary.video("mymovie.webm", {source_types: ['webm', 'mp4'], poster: {effect: 'sepia'}});