Show:

I am the type definition of a ResourceVideo. I represent a video file resource on the server.

Unlike other resource types, which have one or no file at all, a video resource consists of an mp4 and a webm file, plus an arbitrary amount of subtitle files.

Methods

openPreview

(
  • elementOrigin
)

I create a preview dialog, call the .renderContent method of a given resource (e.g. ResourceImage/renderContent) and append the returned element to the dialog.

Parameters:

renderBasicPropertiesControls

(
  • overlay
)

When an Overlay got into Focus, its properties and some additional controls to edit the overlay's attributes should be shown in the right window of the player.

I provide a basic method, which can be extended by my sub-types.

I render properities controls for the UI for the overlay's following attributes:

  • overlay.data.start
  • overlay.data.end
  • overlay.data.position.top
  • overlay.data.position.left
  • overlay.data.position.width
  • overlay.data.position.height

Why is this function a method of Resource and not Overlay? --> Because there is only one type of Overlay, but this can hold in its resourceData attribute different types of Resources. And because the properties controls can depend on resourceData, the method is placed here and in the sub-types of Resource.

Parameters:

Returns:

{ controlsContainer: HTMLElement, changeStart: Function, changeEnd: Function, changeDimensions: Function }

renderContent

()

I render the content of myself, which is a <video> wrapped in a <div class="resourceDetail" ...>

Returns:

HTMLElement

renderPropertiesControls

(
  • overlay
)

See also Resource/renderBasicPropertiesControls()

I extent the PropertiesControls user interface element with special controls for a video overlay. This special control is an radio button chooser, to choose, wether the video overlay should be synchronized with the main video.

Parameters:

Returns:

{ controlsContainer: HTMLElement, changeStart: Function, changeEnd: Function, changeDimensions: Function }

renderThumb

(
  • id
)

Several modules need me to render a thumb of myself.

These thumbs have a special structure of HTMLElements, where several data-attributes carry the information needed by e.g. the ResourceManager.

The id parameter is optional. If it is not passed, the Database tries to find the resource object in its storage.

Parameters:

Returns:

thumbElement

Attributes

resourceData

I hold the data object of a ResourceVideo, which is stored in the Database and saved in the resource's _index.json.