Show:

I am the type definition of a ResourceYoutube. I represent an emmbedded Youtube.com player.

Methods

convertYoutubeTimeToSeconds

(
  • timestamp
)

Description

Parameters:

Returns:

timestamp

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 <iframe> containing the Youtube.com player and with class="resourceDetail".

Returns:

HTMLElement

renderPropertiesControls

(
  • overlay
)

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 ResourceYoutube, which is stored in the Database and saved in the resource's _index.json.