Viewer

Methods

inner convertImgToBlob(img)

Helper function to store images as blobs.

Parameters:
Name Type Description
img object

image tag to convert to blob.

async, inner deleteTV(params)

Delete tv from the filesystem / db.

Parameters:
Name Type Description
params any

the file to remove

async, inner dropImages()

Drop the image database. Mainly for testing purpose.

async, inner findDL()

Get files downloaded and process them to the DOM.

inner getImgDB(data) → {Promise}

Get images from the DB, if they exist in the DB.

Parameters:
Name Type Description
data Array

Data needed to identify the image in the DB.

Returns:
Promise

async, inner getImgs()

Get images for each of the downloaded files.

inner getPath() → {Promise.<string>}

Get the path for downloads.

Returns:
Promise.<string>

inner handleEventHandlers()

Add and remove event handlers for the stop video button

inner handleVids(e)

On video metadata loaded, add it to the JSON.

Parameters:
Name Type Description
e object

event.

inner resetTime(params)

Reset the time watched.

Parameters:
Name Type Description
params object

the x / y of the image.

inner vidFinished(e)

Called when a video is finished.

Parameters:
Name Type Description
e object

the event.

inner vidProgress(e)

On time update in the video, throttled for every few seconds.

Parameters:
Name Type Description
e object

video event.

async, inner watchedTime(vid, elem, figcap) → {Promise.<Element>}

Check how long video has been watched, and add a bar going across the videos image to graphically represent it.

Parameters:
Name Type Description
vid Element

DOM element for the image.

elem Element

The HR DOM element that changes width based on watched time.

figcap Element

The caption.

Returns:
Promise.<Element>