Add missing initial update to the subtitle button in the session demo

The button gets only updated after an onTracksChanged callback but
isn't set to the initial state similar to other changes triggered
by callbacks (e.g. updateRepeatSwitchUI)

PiperOrigin-RevId: 522274800
This commit is contained in:
tonihei 2023-04-06 09:30:53 +01:00 committed by Ian Baker
parent 3fc61bb7c7
commit 14ba173dfe

View File

@ -135,6 +135,7 @@ class PlayerActivity : AppCompatActivity() {
updateMediaMetadataUI(controller.mediaMetadata)
updateShuffleSwitchUI(controller.shuffleModeEnabled)
updateRepeatSwitchUI(controller.repeatMode)
playerView.setShowSubtitleButton(controller.currentTracks.isTypeSupported(TRACK_TYPE_TEXT))
controller.addListener(
object : Player.Listener {