Class: DOMElements

DOMElements()

A class responsible for managing and providing references to the DOM elements needed for video player functionality, which are created and appended dynamically.

Constructor

new DOMElements()

Initializes the DOM elements, creates necessary HTML elements, and appends them to a container.
Source:

Methods

createCanvasElement() → {HTMLCanvasElement}

Creates the canvas element.
Source:
Returns:
The canvas element.
Type
HTMLCanvasElement

createContainer() → {HTMLElement}

Creates the main container for all video player elements.
Source:
Returns:
The container element.
Type
HTMLElement

createLoadingIndicator() → {HTMLDivElement}

Creates the loading indicator element.
Source:
Returns:
The loading indicator element.
Type
HTMLDivElement

createPlayButton() → {HTMLButtonElement}

Creates the play button element.
Source:
Returns:
The play button element.
Type
HTMLButtonElement

createVideoElement() → {HTMLVideoElement}

Creates the video element.
Source:
Returns:
The video element.
Type
HTMLVideoElement

resetCanvas()

Resets the canvas element by clearing its width and height.
Source:

setCanvasSize()

Sets the canvas size to match the video element's size.
Source:

toggleLoadingIndicator(isVisible)

Toggles the visibility of the loading indicator.
Parameters:
Name Type Description
isVisible boolean True to show, false to hide the loading indicator.
Source:

togglePlayButton(isVisible)

Toggles the visibility of the play button.
Parameters:
Name Type Description
isVisible boolean True to show, false to hide the play button.
Source: