Skip to content

Commit 110aa24

Browse files
committed
1.3.9
1 parent 2cd83a4 commit 110aa24

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

easyplayer2/src/main/java/loli/ball/easyplayer2/EasyPlayer.kt

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package loli.ball.easyplayer2
22

33
import android.view.ViewGroup
4+
import android.widget.FrameLayout
45
import androidx.compose.foundation.background
56
import androidx.compose.foundation.layout.*
67
import androidx.compose.runtime.*
@@ -115,14 +116,16 @@ fun EasyPlayer(
115116
AndroidView(
116117
modifier = Modifier.fillMaxSize(),
117118
factory = {
119+
val root = FrameLayout(it)
118120
vm.surfaceView.apply {
119121
kotlin.runCatching {
120122
(parent as? ViewGroup)?.removeView(this)
123+
root.addView(this, ViewGroup.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT))
121124
}.onFailure {
122125
it.printStackTrace()
123126
}
124-
125127
}
128+
root
126129
}
127130
)
128131
}

0 commit comments

Comments
 (0)