Show:

I am the OverlaysController. I am responsible for managing all the overlays in the current HypervideoModel, and for displaying them for viewing and editing.

Methods

addSyncedMedia

(
  • overlay
)

I add an overlay to an array, which is used by this.syncMedia() to keep time-based overlays in sync with the main video. .

Parameters:

deleteOverlay

(
  • overlay
)

I am the central function for deleting an overlay. I call all other methods necessary to delete it.

Parameters:

initController

()

I tell all overlays in the HypervideoModel/overlays attribute to render themselves into the DOM.

initEditOptions

()

I prepare the "edit options" area, when the overlay editing mode is started. I fill the space with a list of thumbnails representing all resources, which can then be dragged onto the overlay container.

See makeTimelineDroppable().

makeTimelineDroppable

(
  • droppable
)

I make the overlay container (not the timeline, despite my name) ready to accept dropped elements. These elements are thumbnails rendered from from the respective [ResourceType]/renderThumb() method.

Upon drop, I read the meta-data stored in the data attributes of the thumbelement, and create and initialize the new overlay object.

When my parameter is not true, I reset the drop functionality of the overlay container.

Parameters:

muteMedia

()

I set the muted state of all media overlays (currently only

removePropertiesControls

()

I am the counterpart of renderPropertiesControls method. I remove the DOM element and the update functions.

removeSyncedMedia

(
  • overlay
)

I remove the overlay given as argument from the array of synced media. See also this.syncMedia()

Parameters:

renderPropertiesControls

(
  • propertiesControlsInterface
)

When an overlay got "into focus", its gotInFocus method calls this method, to do two jobs:

  • first, append the properties controls elements to the respective DOM element.
  • secondly, save references to the update functions of the control interface, so that the textual data values of the controls (like start and end time or dimensions) can be updated, when they are changed directly by mouse interactions with the timeline or overlay element.

Parameters:

  • propertiesControlsInterface Object

resetTimelineView

()

I reset the timeline to its default CSS configuration.

setOverlayInFocus

(
  • overlay
)

I set the overlay from the parameter (when given) "in focus" and remove any previous overlay from focus.

Parameters:

stackTimelineView

()

I change the behavior and appearnace of the timeline of overlays, so that overlays are displayed "stacked" and do not overlap each other.

syncMedia

()

I synchronize the currentTime and the play/pause state of all overlays in the array of syncedMedia with the main video.

toggleEditMode

(
  • editMode
  • oldEditMode
)

I react to a change in the global state "editMode".

When we enter the editMode "overlays", I prepare all overlays and the editor interface elements.

When leaving the editMode "overlays", I restore them.

Parameters:

updateStatesOfOverlays

(
  • currentTime
)

I am the central method for coordinating the time-based state of the overlays. I switch them active or inactive based on the current time.

Parameters:

Attributes

overlayInFocus

Overlay or null

I hold the overlay "in focus", which is choosen by selecting the timeline element or the overlay element. I use the setOverlayInFocus method.

updateControlsDimensions

Function readonly

I hold the callback function for dimension attributes (overlay.data.position[]) of the properties controls interface (see renderPropertiesControls).

I am called from the "drag" event handler in Overlay/makeOverlayElementDraggable() and from the "resize" event handler in Overlay/makeOverlayElementResizeable().

updateControlsEnd

Function readonly

I hold the callback function for end time (overlay.data.end) of the properties controls interface (see renderPropertiesControls).

I am called from the "drag" event handler in Overlay/makeTimelineElementDraggable() and from the "resize" event handler in Overlay/makeTimelineElementResizeable().

updateControlsStart

Function readonly

I hold the callback function for start time (overlay.data.start) of the properties controls interface (see renderPropertiesControls).

I am called from the "drag" event handler in Overlay/makeTimelineElementDraggable() and from the "resize" event handler in Overlay/makeTimelineElementResizeable().