These API calls are used to listen to or update the video quality if multiple quality levels of a video are provided. Quality levels are sorted and given index numbers.


.setCurrentQuality(index)Change the quality level to the provided index. The index must not exceed the amount of available qualities.


.on('levels')Fired when the list of available quality levels is updated. Happens e.g. shortly after a playlist item starts playing.
.on('levelsChanged')Fired when the active quality level is changed. Happens in response to e.g. a user clicking an option in the quality menu or a script calling setCurrentQuality.
.on('visualQuality')Fired when the active quality level is changed for HLS. This is different than levelsChanged since this will trigger when adaptive streaming automatically shifts quality.