Quality Change Policy
The Quality Change Policy determines the behavior of Viblast when a new audio or video quality is selected. There are two possible values:
smooth- The buffered content from the previous quality will be played until its end and only then the new quality will be fed into the player. This achieves a smooth video/audio transition. But there is a delay before the new quality becomes "visible" for the viewer. This is the default behavior.
immediate- Any buffered content will be evicted. Playback pauses and resumes when a sufficient amount of the new quality is downloaded. The new quality immediately becomes "visible" for the viewer. The disadvantage is that the player will be paused while the new quality becomes available.
Please note that the
immediate policy is currently supported only for VoD streams.
Accessing and Mutating
Viblast offers separate properties for controlling the quality change policy of the audio and video streams.
var player = ...; console.log('current video policy:', player.viblast.video.qualityChangePolicy); console.log('current audio policy:', player.viblast.audio.qualityChangePolicy);
Mutating the policy is performed through the same properties. Here is an example:
player.viblast.video.qualityChangePolicy = 'smooth'; player.viblast.audio.qualityChangePolicy = 'immediate';
For convenience Viblast offers another property
viblast.qualityChangePolicy that changes both video and audio policies:
player.viblast.qualityChangePolicy = 'immediate'; // is equivalent to player.viblast.video.qualityChangePolicy = 'immediate'; player.viblast.audio.qualityChangePolicy = 'immediate';
For more information on accessing the Viblast API and changing audio/video quality refer to Accessing Viblast Player ABR Capabilities
See it in action
A complete example can be found in our codepen page