Returns the active IVideoBackend instance, constructing it on first call.
The backend wraps the <video> element and the hls.js instance.
Most consumers do not need to call this directly, as the player’s transport and track methods cover the common cases.
Low-level use cases that require direct backend access:
Injecting MediaKeys for DRM (the DrmPlugin does this)
The raw <video> element.
undefined until the first backend() call.
Prefer player.backend().mediaElement() for consistency; videoElement is a convenience shortcut on the player class.
import type { IVideoBackend } from '@nomercy-entertainment/nomercy-video-player';
Every backend implements this contract.
All methods follow the player’s overloaded-function convention: read by calling with no arguments, write by calling with an argument.
Lifecycle
Method
Signature
Description
load
(url: string, opts?) => Promise<void>
Load a media URL. Starts HLS attachment if the URL matches .m3u8
unload
() => void
Clears the source. Fires emptied on the element
dispose
() => void
Full teardown: destroys the hls.js instance and detaches the element
Transport
Method
Signature
Description
play
() => Promise<void>
Begin playback
pause
() => void
Pause playback
stop
() => void
Stop playback and reset position to 0; backend state becomes paused (idle requires unload)