File tree Expand file tree Collapse file tree 2 files changed +21
-10
lines changed
core/commonui/components/src/commonMain/kotlin/com/livefast/eattrash/raccoonforfriendica/core/commonui/components Expand file tree Collapse file tree 2 files changed +21
-10
lines changed Original file line number Diff line number Diff line change @@ -31,8 +31,8 @@ import chaintech.videoplayer.model.AudioPlayerConfig
31
31
import chaintech.videoplayer.ui.audio.AlbumArt
32
32
import chaintech.videoplayer.ui.audio.AudioPlayerComposable
33
33
import chaintech.videoplayer.ui.audio.TimeDetails
34
+ import com.livefast.eattrash.raccoonforfriendica.core.appearance.theme.Spacing
34
35
import com.livefast.eattrash.raccoonforfriendica.core.l10n.LocalStrings
35
- import com.livefast.eattrash.raccoonforfriendica.core.resources.di.getCoreResources
36
36
37
37
@Composable
38
38
fun AudioPlayer (
@@ -41,9 +41,11 @@ fun AudioPlayer(
41
41
modifier : Modifier = Modifier ,
42
42
autoplay : Boolean = false,
43
43
) {
44
- val resources = remember { getCoreResources() }
45
- val config = resources.getAudioPlayerConfig()
46
44
var isInitial by remember { mutableStateOf(true ) }
45
+ val config =
46
+ AudioPlayerConfig (
47
+ controlsBottomPadding = Spacing .s,
48
+ )
47
49
48
50
if (! autoplay && isInitial) {
49
51
FakeAudioPlayerComposable (
Original file line number Diff line number Diff line change @@ -3,12 +3,13 @@ package com.livefast.eattrash.raccoonforfriendica.core.commonui.components
3
3
import androidx.compose.foundation.layout.Box
4
4
import androidx.compose.material3.MaterialTheme
5
5
import androidx.compose.runtime.Composable
6
- import androidx.compose.runtime.remember
7
6
import androidx.compose.ui.Modifier
8
7
import androidx.compose.ui.layout.ContentScale
8
+ import chaintech.videoplayer.host.VideoPlayerHost
9
+ import chaintech.videoplayer.model.ScreenResize
10
+ import chaintech.videoplayer.model.VideoPlayerConfig
9
11
import chaintech.videoplayer.ui.preview.VideoPreviewComposable
10
12
import chaintech.videoplayer.ui.video.VideoPlayerComposable
11
- import com.livefast.eattrash.raccoonforfriendica.core.resources.di.getCoreResources
12
13
13
14
@Composable
14
15
fun VideoPlayer (
@@ -17,15 +18,23 @@ fun VideoPlayer(
17
18
contentScale : ContentScale = ContentScale .FillWidth ,
18
19
muted : Boolean = true,
19
20
) {
20
- val resources = remember { getCoreResources() }
21
21
val config =
22
- resources.getPlayerConfig(
23
- contentScale = contentScale,
24
- muted = muted,
22
+ VideoPlayerConfig (
23
+ isFullScreenEnabled = false ,
25
24
)
26
25
VideoPlayerComposable (
27
26
modifier = modifier,
28
- url = url,
27
+ playerHost =
28
+ VideoPlayerHost (
29
+ url = url,
30
+ isMuted = muted,
31
+ initialVideoFitMode =
32
+ if (contentScale == ContentScale .Fit ) {
33
+ ScreenResize .FIT
34
+ } else {
35
+ ScreenResize .FILL
36
+ },
37
+ ),
29
38
playerConfig = config,
30
39
)
31
40
}
You can’t perform that action at this time.
0 commit comments