Private
_varsStart a log
a Log object with the levels of log to call
Get the current bitrate constraint
Get the maximum bitrate
Update the maximum bitrate
Get the minimum bitrate
Update the minimum bitrate
Get the configured initial bitrate
Update the initial bitrate
Get the MediaStream if set
Get the current bitrate
Private
_bitrateProtected
_computeImplement this method to define your own congestion algorithm, the method must return the wanted bitrate or undefined to not change the current bitrate.
the current bitrate
Optional
bitrateConstraint: numberthe current bitrate constraint
Optional
mediaReport: MediaReportthe media report structure received from the server
the wanted bitrate or undefined to not change the current bitrate
Private
_decreasePrivate
_decreasePrivate
_formatPrivate
_increasePrivate
_increaseProtected
_updateCall this method regularly to control if we have to increase or decrease the stream bitrate depending on the network conditions.
the current bitrate
Optional
bitrateConstraint: numberthe current bitrate constraint
Optional
mediaReport: MediaReportthe media report structure received from the server
the wanted bitrate
Event subscription
Name of event without the on
prefix (ex: log
to onLog
event declared)
Subscriber Function
Optional
options: { Optional
signal?: AbortSignalOptional AbortSignal
to stop this or multiple subscriptions in same time
Event subscription only one time, once time fired it's automatically unsubscribe
Name of event without the on
prefix (ex: log
to onLog
event declared)
Subscriber Function
Optional
options: { Optional
signal?: AbortSignalGenerated using TypeDoc
ABRGrade is an adaptive bitrate algorithm implementing ABRAbstract that uses current bitrate, bitrateConstraint, loss infos of mediaReport and some level constants to adapt the bitrate in a robust way