@@ -29,13 +29,16 @@ import androidx.compose.foundation.layout.aspectRatio
29
29
import androidx.compose.foundation.layout.fillMaxHeight
30
30
import androidx.compose.foundation.layout.fillMaxSize
31
31
import androidx.compose.foundation.layout.fillMaxWidth
32
+ import androidx.compose.foundation.layout.wrapContentHeight
33
+ import androidx.compose.foundation.layout.wrapContentWidth
32
34
import androidx.compose.material3.Surface
33
35
import androidx.compose.runtime.Composable
34
36
import androidx.compose.runtime.DisposableEffect
35
37
import androidx.compose.runtime.getValue
36
38
import androidx.compose.runtime.mutableStateOf
37
39
import androidx.compose.runtime.remember
38
40
import androidx.compose.runtime.setValue
41
+ import androidx.compose.ui.Alignment
39
42
import androidx.compose.ui.Modifier
40
43
import androidx.compose.ui.graphics.Color
41
44
import androidx.compose.ui.platform.LocalContext
@@ -83,9 +86,21 @@ internal fun PlaySurface(
83
86
ActualView (modifier.fillMaxSize(), player)
84
87
} else { /* if(fitMode == ContentScale.CROP) */
85
88
if (uiRatio <= contentRatio) {
86
- ActualView (modifier.fillMaxHeight(), player)
89
+ Box (
90
+ modifier = Modifier
91
+ .fillMaxSize()
92
+ .wrapContentWidth(unbounded = true , align = Alignment .CenterHorizontally )
93
+ ) {
94
+ ActualView (modifier.fillMaxHeight(), player)
95
+ }
87
96
} else {
88
- ActualView (modifier.fillMaxWidth(), player)
97
+ Box (
98
+ modifier = Modifier
99
+ .fillMaxSize()
100
+ .wrapContentHeight(unbounded = true , align = Alignment .CenterVertically )
101
+ ) {
102
+ ActualView (modifier.fillMaxWidth(), player)
103
+ }
89
104
}
90
105
}
91
106
}
0 commit comments