API Docs for: 0.8.0
Show:

VineMediaRenderer Class

Constructor

Item Index

Methods

Properties

Methods

getEmbedUrl

(
  • mediaId
)
String static

Retrieves the source URI that will be used when generating the rendering

Parameters:

  • mediaId String

    The unique (only to the type) media identifier

Returns:

String:

A properly formatted URI string that points to the resource represented by the media Id

getIcon

(
  • type
)
String static

Retrieves the Font Awesome icon class. It is safe to assume that the type provided will be a supported type by the renderer.

Parameters:

  • type String

Returns:

String:

getMediaId

() static

Retrieves the unique identifier from the URL provided. The value should distinguish the media resource from the others of this type and provide insight on how to generate the embed URL.

getMeta

(
  • urlStr
  • isFile
  • cb
)
static

Retrieves any meta data about the media represented by the URL.

Parameters:

  • urlStr String
  • isFile Boolean

    indicates if the URL points to a file that was uploaded to the PB server

  • cb Function

    A callback that provides an Error if occurred and an Object if meta was collected. NULL if no meta was collected

getName

() String static

Retrieves the name of the renderer.

Returns:

String:

getNativeUrl

() static

Retrieves the native URL for the media resource. This can be the raw page where it was found or a direct link to the content.

getStyle

(
  • viewType
)
Object static

Retrieves the style for the specified type of view

Parameters:

  • viewType String

    The view type calling for a styling

Returns:

Object:

a hash of style properties

getSupportedExtensions

() Array static

Retrieves the supported extension types for the renderer.

Returns:

Array:

getSupportedTypes

() Object static

Retrieves the supported media types as a hash.

Returns:

Object:

getThumbnail

(
  • urlStr
  • cb
)
static

Retrieves a URI to a thumbnail for the media resource

Parameters:

  • urlStr String
  • cb Function

    A callback where the first parameter is an Error if occurred and the second is the URI string to the thumbnail. Empty string or NULL if no thumbnail is available

getType

(
  • urlStr
)
String static

Gets the specific type of the media resource represented by the provided URL

Parameters:

  • urlStr String

Returns:

String:

isFullSite

(
  • parsedUrl
)
Boolean static

Indicates if the passed URL to a media resource points to the main website that provides the media represented by this media renderer

Parameters:

  • parsedUrl Object | String

    The URL string or URL object

Returns:

Boolean:

TRUE if URL points to the main domain and media resource, FALSE if not

isSupported

(
  • urlStr
)
Boolean static

Determines if the URL to a media object is supported by this renderer

Parameters:

  • urlStr String

Returns:

Boolean:

TRUE if the URL is supported by the renderer, FALSE if not

render

(
  • media
  • [options]
  • cb
)
static

Renders the media resource via the media descriptor object. It is only guaranteed that the "location" property will be available at the time of rendering.

Parameters:

  • media Object
    • location String

      The unique resource identifier (only to the media type) for the media resource

  • [options] Object optional
    • [attrs] Object optional

      A hash of all attributes (excluding style) that will be applied to the element generated by the rendering

    • [style] Object optional

      A hash of all attributes that will be applied to the style of the element generated by the rendering.

  • cb Function

    A callback where the first parameter is an Error if occurred and the second is the rendering of the media resource as a HTML formatted string

renderByUrl

(
  • urlStr
  • [options]
  • cb
)
static

Renders the media resource via the raw URL to the resource

Parameters:

  • urlStr String
  • [options] Object optional
    • [attrs] Object optional

      A hash of all attributes (excluding style) that will be applied to the element generated by the rendering

    • [style] Object optional

      A hash of all attributes that will be applied to the style of the element generated by the rendering.

  • cb Function

    A callback where the first parameter is an Error if occurred and the second is the rendering of the media resource as a HTML formatted string

Properties

STYLES

Object private static

Provides the styles used by each type of view

TYPE

String private static

The media type supported by the provider