expo-libmpv 0.3.10 → 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){
|