Hi everyone,
Recently, I encountered an issue while upgrading the Bitmovin Player SDK to its latest version on my Android TV project. After upgrading to version 3.47.0, the player was functioning properly until I began testing the video quality.
Whenever I change the video quality, the player view momentarily shrinks before returning to its original size.
player.source?.setVideoQuality({VideoQuality.id})
I tested the Bitmovin sample code and observed the same behaviour. Here’s the link to the sample project on Github.
In MainActivity.kt, I initialize the player and load the source. Once the source is loaded, I create a function that continuously changes the video quality.
player = Player.create(
this,
PlayerConfig(
playbackConfig = PlaybackConfig(isAutoplayEnabled = true)
),
AnalyticsConfig(analyticsKey)
)
player.load(SourceConfig(sourceURL, SourceType.Dash))
// change video quality when source loaded
player.on<SourceEvent.Loaded>{
changeVideoQuality()
}
changeVideoQuality()
/*
* This function iterates through all available video qualities
* and sets the player source with the new quality after a 7-second delay.
*/
private fun changeVideoQuality(){
CoroutineScope(Dispatchers.Main).launch {
player.source?.availableVideoQualities?.forEach {
delay(7000)
Toast.makeText(this@MainActivity, "set video quality = ${it.height}x${it.width}\"", Toast.LENGTH_SHORT).show()
player.source?.setVideoQuality(it.id)
}
changeVideoQuality()
}
}
Now if you launch the app, you will see the player view briefly shrinks before returning to its original size when setVideoQuality() is called. You can find the video demo here
This problem happens on Bitmovin player versions 3.46.0 and 3.47.0
Thank you in advance for your time!