Skip to content

Commit

Permalink
1.3.9
Browse files Browse the repository at this point in the history
  • Loading branch information
heyanLE committed Jun 7, 2024
1 parent 2cd83a4 commit 110aa24
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package loli.ball.easyplayer2

import android.view.ViewGroup
import android.widget.FrameLayout
import androidx.compose.foundation.background
import androidx.compose.foundation.layout.*
import androidx.compose.runtime.*
Expand Down Expand Up @@ -115,14 +116,16 @@ fun EasyPlayer(
AndroidView(
modifier = Modifier.fillMaxSize(),
factory = {
val root = FrameLayout(it)
vm.surfaceView.apply {
kotlin.runCatching {
(parent as? ViewGroup)?.removeView(this)
root.addView(this, ViewGroup.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT))
}.onFailure {
it.printStackTrace()
}

}
root
}
)
}
Expand Down

0 comments on commit 110aa24

Please sign in to comment.