|
4 | 4 | */ |
5 | 5 | package ch.srgssr.pillarbox.ui.widget.player |
6 | 6 |
|
7 | | -import android.os.Build |
8 | | -import android.os.Build.VERSION_CODES.UPSIDE_DOWN_CAKE |
9 | 7 | import android.view.View |
10 | 8 | import androidx.compose.runtime.Composable |
11 | 9 | import androidx.compose.runtime.LaunchedEffect |
@@ -45,7 +43,7 @@ fun PillarboxPlayerSurface( |
45 | 43 | // the process. If this composable is guarded by some condition, it might never become visible |
46 | 44 | // because the Player will not emit the relevant event, e.g. the first frame being ready. |
47 | 45 | when (surfaceType) { |
48 | | - SurfaceType.Surface -> PlayerSurfaceInternal(player = player, modifier = modifier) |
| 46 | + SurfaceType.Surface -> PlayerSurface(player = player, modifier = modifier, surfaceType = SURFACE_TYPE_SURFACE_VIEW) |
49 | 47 | SurfaceType.Texture -> PlayerSurface(modifier = modifier, player = player, surfaceType = SURFACE_TYPE_TEXTURE_VIEW) |
50 | 48 | SurfaceType.Spherical -> PlayerSurfaceSphericalInternal(player = player, modifier = modifier) |
51 | 49 | } |
@@ -97,15 +95,6 @@ private fun PlayerSurfaceSphericalInternal(player: Player?, modifier: Modifier) |
97 | 95 | } |
98 | 96 | } |
99 | 97 |
|
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 | | - |
109 | 98 | private var View.attachedPlayer: Player? |
110 | 99 | get() = tag as? Player |
111 | 100 | set(player) { |
|
0 commit comments