Skip to content

Commit 4dae8a6

Browse files
committed
Remove the API 34 workaround
1 parent e1610e5 commit 4dae8a6

File tree

1 file changed

+1
-12
lines changed

1 file changed

+1
-12
lines changed

pillarbox-ui/src/main/java/ch/srgssr/pillarbox/ui/widget/player/PillarboxPlayerSurface.kt

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@
44
*/
55
package ch.srgssr.pillarbox.ui.widget.player
66

7-
import android.os.Build
8-
import android.os.Build.VERSION_CODES.UPSIDE_DOWN_CAKE
97
import android.view.View
108
import androidx.compose.runtime.Composable
119
import androidx.compose.runtime.LaunchedEffect
@@ -45,7 +43,7 @@ fun PillarboxPlayerSurface(
4543
// the process. If this composable is guarded by some condition, it might never become visible
4644
// because the Player will not emit the relevant event, e.g. the first frame being ready.
4745
when (surfaceType) {
48-
SurfaceType.Surface -> PlayerSurfaceInternal(player = player, modifier = modifier)
46+
SurfaceType.Surface -> PlayerSurface(player = player, modifier = modifier, surfaceType = SURFACE_TYPE_SURFACE_VIEW)
4947
SurfaceType.Texture -> PlayerSurface(modifier = modifier, player = player, surfaceType = SURFACE_TYPE_TEXTURE_VIEW)
5048
SurfaceType.Spherical -> PlayerSurfaceSphericalInternal(player = player, modifier = modifier)
5149
}
@@ -97,15 +95,6 @@ private fun PlayerSurfaceSphericalInternal(player: Player?, modifier: Modifier)
9795
}
9896
}
9997

100-
@Composable
101-
private fun PlayerSurfaceInternal(player: Player?, modifier: Modifier) {
102-
if (Build.VERSION.SDK_INT == UPSIDE_DOWN_CAKE) {
103-
AndroidSurfaceViewWithApi34WorkAround(player = player, modifier = modifier)
104-
} else {
105-
PlayerSurface(modifier = modifier, player = player, surfaceType = SURFACE_TYPE_SURFACE_VIEW)
106-
}
107-
}
108-
10998
private var View.attachedPlayer: Player?
11099
get() = tag as? Player
111100
set(player) {

0 commit comments

Comments
 (0)