expo-libvlc-player 3.2.1 → 3.2.3
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.
package/android/build.gradle
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
apply plugin: "com.android.library"
|
|
2
2
|
|
|
3
3
|
group = "expo.modules.libvlcplayer"
|
|
4
|
-
version = "3.2.
|
|
4
|
+
version = "3.2.3"
|
|
5
5
|
|
|
6
6
|
def expoModulesCorePlugin = new File(project(":expo-modules-core").projectDir.absolutePath, "ExpoModulesCorePlugin.gradle")
|
|
7
7
|
apply from: expoModulesCorePlugin
|
|
@@ -27,7 +27,7 @@ android {
|
|
|
27
27
|
namespace "expo.modules.libvlcplayer"
|
|
28
28
|
defaultConfig {
|
|
29
29
|
versionCode 1
|
|
30
|
-
versionName "3.2.
|
|
30
|
+
versionName "3.2.3"
|
|
31
31
|
consumerProguardFiles("proguard-rules.pro")
|
|
32
32
|
}
|
|
33
33
|
lintOptions {
|
|
@@ -126,13 +126,14 @@ class LibVlcPlayerModule : Module() {
|
|
|
126
126
|
view.autoplay = autoplay ?: true
|
|
127
127
|
}
|
|
128
128
|
|
|
129
|
+
OnViewDidUpdateProps { view: LibVlcPlayerView ->
|
|
130
|
+
view.createPlayer()
|
|
131
|
+
}
|
|
132
|
+
|
|
129
133
|
OnViewDestroys { view: LibVlcPlayerView ->
|
|
130
134
|
MediaPlayerManager.unregisterPlayerView(view)
|
|
131
|
-
view.destroyPlayer()
|
|
132
|
-
}
|
|
133
135
|
|
|
134
|
-
|
|
135
|
-
view.createPlayer()
|
|
136
|
+
view.destroyPlayer()
|
|
136
137
|
}
|
|
137
138
|
|
|
138
139
|
AsyncFunction("play") { view: LibVlcPlayerView ->
|
|
@@ -164,6 +164,7 @@ class LibVlcPlayerView(
|
|
|
164
164
|
mediaPlayer = null
|
|
165
165
|
libVLC?.release()
|
|
166
166
|
libVLC = null
|
|
167
|
+
removeAllViews()
|
|
167
168
|
}
|
|
168
169
|
|
|
169
170
|
fun setPlayerTracks() {
|
|
@@ -242,11 +243,9 @@ class LibVlcPlayerView(
|
|
|
242
243
|
var scaleY = 1f
|
|
243
244
|
|
|
244
245
|
if (videoAspect > viewAspect) {
|
|
245
|
-
scaleX = 1f
|
|
246
246
|
scaleY = videoAspect / viewAspect
|
|
247
247
|
} else {
|
|
248
248
|
scaleX = viewAspect / videoAspect
|
|
249
|
-
scaleY = 1f
|
|
250
249
|
}
|
|
251
250
|
|
|
252
251
|
matrix.setScale(scaleX, scaleY, pivotX, pivotY)
|
|
@@ -158,13 +158,9 @@ class LibVlcPlayerView: ExpoView {
|
|
|
158
158
|
// No transform required
|
|
159
159
|
break
|
|
160
160
|
case .cover:
|
|
161
|
-
var scale =
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
scale = videoAspect / viewAspect
|
|
165
|
-
} else {
|
|
166
|
-
scale = viewAspect / videoAspect
|
|
167
|
-
}
|
|
161
|
+
var scale = videoAspect > viewAspect ?
|
|
162
|
+
videoAspect / viewAspect :
|
|
163
|
+
viewAspect / videoAspect
|
|
168
164
|
|
|
169
165
|
transform = CGAffineTransform(scaleX: scale, y: scale)
|
|
170
166
|
case .fill:
|
|
@@ -172,11 +168,9 @@ class LibVlcPlayerView: ExpoView {
|
|
|
172
168
|
var scaleY = 1.0
|
|
173
169
|
|
|
174
170
|
if videoAspect > viewAspect {
|
|
175
|
-
scaleX = 1.0
|
|
176
171
|
scaleY = videoAspect / viewAspect
|
|
177
172
|
} else {
|
|
178
173
|
scaleX = viewAspect / videoAspect
|
|
179
|
-
scaleY = 1.0
|
|
180
174
|
}
|
|
181
175
|
|
|
182
176
|
transform = CGAffineTransform(scaleX: scaleX, y: scaleY)
|