Class: HTML5Video

.player.HTML5Video()

Define methods for the HTML5 video player.

Constructor

new HTML5Video()

Author:
Source:

Methods

(static) disablePIP(target)

Disable the picture-in-picture mode of HTML5 videos (default: enabled). Does not work in Firefox and Samsung Internet in 2022.
Parameters:
Name Type Description
target string/HTMLElement HTML element.
Source:

(static) hasAudio(target)

Returns true if a HTML5 video tag contains audio.
Parameters:
Name Type Description
target string/HTMLElement HTML element.
Source:

(static) initAudio(target)

Set the audio volume to 50%.
Parameters:
Name Type Description
target string/HTMLElement HTML element.
Source:

(static) initKeyControl(target, initPlayerWithKeyFocus, playbackRates)

Set an key eventlistener to the body.
Parameters:
Name Type Default Description
target string/HTMLElement HTML element containing video element.
initPlayerWithKeyFocus Boolean false Focus video element when key control is initialized, so key commands are sent directly to the video without having to click on it.
playbackRates Array List of playback rates for key control.
Source:

(static) poster(target, path, showPosterAfterVideoLoaded, removePosterAfterVideoLoaded)

Set a poster attribute in the HTML5 video element.
Parameters:
Name Type Default Description
target string/HTMLElement HTML element.
path string Path to the poster image.
showPosterAfterVideoLoaded boolean true Show poster after video has loaded completely, else show during loading.
removePosterAfterVideoLoaded boolean false Indicates if poster should be removed from the video when it has loaded.
Source: