Class: HTML5Player<Config>
HTML5Player is a base playback class for HTML5 video playback. It is also used as the base for other playback dependent on HTML5 video. /**
Extends
Playback
<Config
>
Type Parameters
• Config = Record
<string
, unknown
>
Constructors
new HTML5Player()
new HTML5Player<
Config
>(context
):HTML5Player
<Config
>
Creates an instance of HTML5Player.
Parameters
• context: Context
The context object.
Returns
HTML5Player
<Config
>
Overrides
Defined in
modules/playback/html5.ts:43 (opens in a new tab)
Other
hooks
hooks:
Hook
<HTML5Player
<Config
>>
Inherited from
Defined in
modules/common/module.ts:22 (opens in a new tab)
name
name:
string
='HTML5Player'
The name of the player.
Overrides
Defined in
modules/playback/html5.ts:21 (opens in a new tab)
playbackType
playbackType:
PlaybackType
=PlaybackType.VOD
The type of playback.
Overrides
Defined in
modules/playback/html5.ts:29 (opens in a new tab)
type
readonly
type:PLAYBACK
=PluginType.PLAYBACK
Inherited from
Defined in
modules/playback/base_playback.ts:11 (opens in a new tab)
autoLevelEnabled
get
autoLevelEnabled():boolean
Gets whether auto level selection is enabled.
Returns
boolean
Overrides
Defined in
modules/playback/html5.ts:193 (opens in a new tab)
bridge
get
protected
bridge():PlatformBridgeController
Protected getter for the bridge instance
Returns
PlatformBridgeController
Inherited from
Defined in
modules/common/module.ts:85 (opens in a new tab)
bufferedPercentage
get
bufferedPercentage():number
Gets the buffered percentage of the video.
Returns
number
Overrides
Defined in
modules/playback/html5.ts:290 (opens in a new tab)
controller
get
protected
controller():Controller
Protected getter for the controller instance
Returns
Inherited from
Defined in
modules/common/module.ts:78 (opens in a new tab)
currentLevel
get
currentLevel():Level
Gets the current video level.
Throws
Will throw an error since this method is not implemented.
Returns
Overrides
Defined in
modules/playback/html5.ts:332 (opens in a new tab)
currentTime
get
currentTime():number
Gets the current playback time.
Returns
number
Overrides
Defined in
modules/playback/html5.ts:283 (opens in a new tab)
duration
get
duration():number
Gets the duration of the video.
Returns
number
Overrides
Defined in
modules/playback/html5.ts:233 (opens in a new tab)
emit
get
protected
emit(): (name
,data
?) =>void
Protected getter for the 'emit' event emission method
Returns
Function
Parameters
• name: string
| number
• data?: undefined
Returns
void
Inherited from
Defined in
modules/common/module.ts:128 (opens in a new tab)
emitIfChanged
get
protected
emitIfChanged(): (name
,data
) =>void
Protected getter for the 'emitIfChanged' event emission method
Returns
Function
Parameters
• name: string
| number
• data: any
Returns
void
Inherited from
Defined in
modules/common/module.ts:135 (opens in a new tab)
events
get
protected
events():string
[]
Protected getter for the events array
Returns
string
[]
Array of event names
Inherited from
Defined in
modules/common/module.ts:114 (opens in a new tab)
hasEnded
get
hasEnded():boolean
Checks if the video has ended.
Returns
boolean
Overrides
Defined in
modules/playback/html5.ts:304 (opens in a new tab)
isLive
get
isLive():boolean
Checks if the video is a live stream.
Returns
boolean
Overrides
Defined in
modules/playback/html5.ts:240 (opens in a new tab)
isMuted
get
isMuted():boolean
Checks if the video is muted.
Returns
boolean
Overrides
Defined in
modules/playback/html5.ts:247 (opens in a new tab)
isPlaying
get
isPlaying():boolean
Checks if the video is playing.
Returns
boolean
Overrides
Defined in
modules/playback/html5.ts:297 (opens in a new tab)
levels
get
levels():Level
[]
Gets the available video levels.
Returns
Level
[]
An empty array since this method is not implemented.
Overrides
Defined in
modules/playback/html5.ts:340 (opens in a new tab)
logger
get
protected
logger():Logger
Protected getter for the logger instance
Returns
Logger
Logger instance for this module
Inherited from
Defined in
modules/common/module.ts:40 (opens in a new tab)
nativeEl
get
nativeEl():HTMLVideoElement
Gets the native HTMLVideoElement used for playback.
Returns
HTMLVideoElement
Overrides
Defined in
modules/playback/html5.ts:142 (opens in a new tab)
off
get
protected
off(): (name
,listener
) =>void
Protected getter for the 'off' event unbinding method
Returns
Function
Parameters
• name: string
| number
• listener: Listener
<void
>
Returns
void
Inherited from
Defined in
modules/common/module.ts:99 (opens in a new tab)
on
get
protected
on(): (name
,listener
) =>Disposable
Protected getter for the 'on' event binding method
Returns
Function
Parameters
• name: string
| number
• listener: Listener
<void
>
Returns
Inherited from
Defined in
modules/common/module.ts:92 (opens in a new tab)
once
get
protected
once(): (name
,listener
) =>void
Protected getter for the 'once' event binding method
Returns
Function
Parameters
• name: string
| number
• listener: Listener
<void
>
Returns
void
Inherited from
Defined in
modules/common/module.ts:106 (opens in a new tab)
playbackRate
get
playbackRate():number
Gets the current playback rate.
Returns
number
Overrides
Defined in
modules/playback/html5.ts:268 (opens in a new tab)
storage
get
protected
storage():StorageController
Protected getter for the storage instance
Returns
StorageController
Inherited from
Defined in
modules/common/module.ts:71 (opens in a new tab)
volume
get
volume():number
Gets the current volume level.
Returns
number
Overrides
Defined in
modules/playback/html5.ts:217 (opens in a new tab)
connectedCallback()
connectedCallback():
void
Callback function called when the player is connected to the DOM.
Returns
void
Overrides
Defined in
modules/playback/html5.ts:78 (opens in a new tab)
disconnectedCallback()
disconnectedCallback():
void
Callback function called when the player is disconnected from the DOM.
Returns
void
Overrides
Defined in
modules/playback/html5.ts:131 (opens in a new tab)
getConfig()
protected
getConfig():Config
Protected method to get the plugin configuration
Returns
Config
The plugin configuration
Inherited from
Defined in
modules/common/module.ts:64 (opens in a new tab)
load()
load(
startTime
?):void
Loads the media, optionally setting the start time.
Parameters
• startTime?: number
The start time in seconds to set for the media.
Returns
void
Overrides
Defined in
modules/playback/html5.ts:67 (opens in a new tab)
mute()
mute():
void
Mutes the video.
Returns
void
Overrides
Defined in
modules/playback/html5.ts:254 (opens in a new tab)
pause()
pause():
void
Pauses the video playback.
Returns
void
Overrides
Defined in
modules/playback/html5.ts:175 (opens in a new tab)
play()
play():
Promise
<void
>
Starts playing the video.
Returns
Promise
<void
>
A Promise that resolves when playback has begun.
Overrides
Defined in
modules/playback/html5.ts:158 (opens in a new tab)
replay()
replay():
Promise
<void
>
Replays the video from the beginning.
Returns
Promise
<void
>
A Promise that resolves when playback has begun.
Overrides
Defined in
modules/playback/html5.ts:167 (opens in a new tab)
seekPercentage()
seekPercentage(
percentage
):void
Seeks to a specific percentage of the video duration.
Parameters
• percentage: number
The percentage of the video duration to seek to.
Returns
void
Overrides
Defined in
modules/playback/html5.ts:209 (opens in a new tab)
seekTo()
seekTo(
time
):void
Seeks to a specific time in the video.
Parameters
• time: number
The time in seconds to seek to.
Returns
void
Overrides
Defined in
modules/playback/html5.ts:201 (opens in a new tab)
selectAudioLanguage()
selectAudioLanguage(
_
):void
Selects an audio language.
Parameters
• _: string
The string representing the audio language to select (unused).
Returns
void
Overrides
Defined in
modules/playback/html5.ts:357 (opens in a new tab)
selectLevel()
selectLevel(
_
):void
Selects a video level.
Parameters
• _: "auto"
| Level
The LevelDto object or "auto" to select the level (unused).
Returns
void
Overrides
Defined in
modules/playback/html5.ts:349 (opens in a new tab)
setPlaybackRate()
setPlaybackRate(
playbackRate
):void
Sets the playback rate.
Parameters
• playbackRate: number
The new playback rate as a number.
Returns
void
Overrides
Defined in
modules/playback/html5.ts:276 (opens in a new tab)
setSource()
setSource(
src
):void
Sets the source URL for the video.
Parameters
• src: string
The URL of the video source.
Returns
void
Overrides
Defined in
modules/playback/html5.ts:150 (opens in a new tab)
setVolume()
setVolume(
volume
):void
Sets the volume level.
Parameters
• volume: number
The volume level as a number between 0 and 1.
Returns
void
Overrides
Defined in
modules/playback/html5.ts:225 (opens in a new tab)
stop()
stop():
void
Stops the video playback and removes the video source.
Returns
void
Overrides
Defined in
modules/playback/html5.ts:183 (opens in a new tab)
syncWithLive()
syncWithLive():
void
Syncs the video with live playback.
Returns
void
Overrides
Defined in
modules/playback/html5.ts:364 (opens in a new tab)
unmute()
unmute():
void
Unmutes the video.
Returns
void
Overrides
Defined in
modules/playback/html5.ts:261 (opens in a new tab)
canPlay()
static
canPlay(source
):boolean
Checks if the current player can play the given source.
Parameters
• source: string
The URL of the video source to check.
Returns
boolean
A boolean value indicating if the player can play the source.