Skip to content

Commit

Permalink
Simplify
Browse files Browse the repository at this point in the history
  • Loading branch information
MattiasBuelens committed Aug 28, 2024
1 parent 741ffe7 commit ae85501
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions ui/src/main/java/com/theoplayer/android/ui/UIController.kt
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,10 @@ fun UIController(

PlayerContainer(modifier = modifier, player = player) {
CompositionLocalProvider(LocalPlayer provides player) {
if (player.playingAd) {
// Remove player UI entirely while playing an ad, to make clickthrough work
return@CompositionLocalProvider
}
AnimatedContent(
label = "ContentAnimation",
modifier = Modifier
Expand Down Expand Up @@ -359,8 +363,7 @@ private fun PlayerContainer(
ViewCompositionStrategy.DisposeOnLifecycleDestroyed(lifecycle)
)
setContent {
if (player.playingAd.not())
ui()
ui()
}
}
// Host the THEOplayer view inside our AndroidView
Expand Down

0 comments on commit ae85501

Please sign in to comment.