expo-libmpv 0.3.9 → 0.3.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -18,6 +18,7 @@ class LibmpvWrapper(private val applicationContext: Context) {
18
18
  }
19
19
 
20
20
  @Volatile private var created = false
21
+ @Volatile private var inited = false
21
22
  @Volatile private var destroyed = false
22
23
  @Volatile private var cleaning = false
23
24
  @Volatile private var isPlaying = false
@@ -46,6 +47,7 @@ class LibmpvWrapper(private val applicationContext: Context) {
46
47
  }
47
48
 
48
49
  fun createManagedInstance(): Boolean {
50
+ if(isCreated){ return }
49
51
  try{
50
52
  MPVLib.create(applicationContext)
51
53
  createMpvDirectory()
@@ -57,9 +59,10 @@ class LibmpvWrapper(private val applicationContext: Context) {
57
59
  }
58
60
 
59
61
  fun initNativeBinding() {
60
- if (destroyed || !created){ return }
62
+ if (destroyed || !created || inited){ return }
61
63
  try {
62
64
  MPVLib.init()
65
+ inited = true
63
66
  } catch (e: Exception) {
64
67
  logException(e)
65
68
  if (!SWALLOW){
@@ -87,8 +90,8 @@ class LibmpvWrapper(private val applicationContext: Context) {
87
90
  }
88
91
 
89
92
  // Copy conf
90
- val mpvConfPath = "${mpvDir}/MPVLib.conf"
91
- applicationContext.assets.open("MPVLib.conf").use { mpvConfIn ->
93
+ val mpvConfPath = "${mpvDir}/mpv.conf"
94
+ applicationContext.assets.open("mpv.conf").use { mpvConfIn ->
92
95
  FileOutputStream(mpvConfPath).use { confOut ->
93
96
  mpvConfIn.copyTo(confOut)
94
97
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "expo-libmpv",
3
- "version": "0.3.9",
3
+ "version": "0.3.11",
4
4
  "description": "A libmpv Fabric component for Android",
5
5
  "main": "build/index.js",
6
6
  "types": "build/index.d.ts",