Added android fix

This commit is contained in:
Alex Kim
2024-12-07 06:01:04 +11:00
parent 38445c6959
commit 39f86a9eb1
2 changed files with 5 additions and 1 deletions

View File

@@ -9,7 +9,9 @@ class VlcPlayerModule : Module() {
View(VlcPlayerView::class) {
Prop("source") { view: VlcPlayerView, source: Map<String, Any> ->
view.setSource(source)
if (!view.hasSource) {
view.setSource(source)
}
}
Prop("paused") { view: VlcPlayerView, paused: Boolean ->

View File

@@ -32,6 +32,7 @@ class VlcPlayerView(context: Context, appContext: AppContext) : ExpoView(context
private var startPosition: Int? = 0
private var isMediaReady: Boolean = false
private var externalTrack: Map<String, String>? = null
var hasSource: Boolean = false
init {
setupView()
@@ -87,6 +88,7 @@ class VlcPlayerView(context: Context, appContext: AppContext) : ExpoView(context
// Log.d("VlcPlayerView", "Debug: Subtitle track index is less than -1, not setting")
// }
hasSource = true
if (autoplay) {
Log.d("VlcPlayerView", "Playing...")