Class: ThumbnailCanvas

.thumbnail.ThumbnailCanvas()

Class that provides tools to create, paint images on and remove canvas in the context of the webVTT thumbnails.

Constructor

new ThumbnailCanvas()

Author:
Source:

Methods

(static) createThumbnailCanvas(targetElement) → {Object}

Create canvas element, set default canvas settings and append it to a target element.
Parameters:
Name Type Description
targetElement Object Target element to append canvas as child.
Source:
Returns:
Canvas element.
Type
Object

(static) paintThumbnail(thumbnailObject, canvasElement, canvasWidth, canvasHeight)

Paint the image from a thumbnail object to a canvas element.
Parameters:
Name Type Description
thumbnailObject Object Thumbnail object, i.e., Object { time_start: "00:00:00.000", time_end: "00:00:00.280", data: "thumb.jpeg#xywh=0,0,250,141", url: "https://localhost/Desktop/marine-data/thumbnail-hover/thumb.jpeg", image: img }.
canvasElement Object Target canvas element.
canvasWidth Object Canvas width in pixel.
canvasHeight Object Canvas height in pixel.
Source:

(static) removeThumbnailCanvas(targetElement) → {Boolean}

Remove the first canvas element found in a target element.
Parameters:
Name Type Description
targetElement Object Target element that contain a canvas.
Source:
Returns:
Return true when canvas could be removed, else false.
Type
Boolean