expo-libmpv 0.4.6 → 0.5.1

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.
@@ -1,289 +1,120 @@
1
1
  package com.libmpv
2
2
 
3
3
  import android.content.Context
4
- import android.os.Handler
5
- import android.os.Looper
6
4
  import android.view.SurfaceHolder
7
5
  import android.view.SurfaceView
8
6
  import android.widget.FrameLayout
9
7
  import androidx.lifecycle.DefaultLifecycleObserver
10
8
  import androidx.lifecycle.LifecycleOwner
11
- import dev.jdtech.mpv.MPVLib
9
+ import com.libmpv.LibmpvSession
12
10
  import expo.modules.kotlin.AppContext
13
11
  import expo.modules.kotlin.views.ExpoView
14
12
  import expo.modules.kotlin.viewevent.EventDispatcher
15
13
 
16
- class LibmpvView(context: Context, appContext: AppContext) :
17
- ExpoView(context,appContext),
18
- SurfaceHolder.Callback,
19
- MPVLib.LogObserver,
20
- MPVLib.EventObserver {
21
-
22
- private val onLibmpvLog by EventDispatcher()
23
- private val onLibmpvEvent by EventDispatcher()
24
-
25
- private var isSurfaceCreated: Boolean = false
26
- val mpv: LibmpvWrapper = LibmpvWrapper(context)
27
- private val surfaceView: SurfaceView = SurfaceView(context)
28
-
29
- // JavaScript props
30
- var playUrl: String? = null
31
- var surfaceWidth: Int? = null
32
- var surfaceHeight: Int? = null
33
- var audioIndex: Int? = null
34
- var subtitleIndex: Int? = null
35
- var videoOutput: String? = null
36
- var decodingMode: String? = null
37
- var acceleratedCodecs: String? = null
38
-
39
- init {
40
- surfaceView.holder.addCallback(this)
41
- val layoutParams = FrameLayout.LayoutParams(
42
- FrameLayout.LayoutParams.MATCH_PARENT,
43
- FrameLayout.LayoutParams.MATCH_PARENT
44
- )
45
- appContext.activityProvider?.currentActivity?.let { activity ->
46
- if (activity is androidx.lifecycle.LifecycleOwner) {
47
- activity.lifecycle.addObserver(object : DefaultLifecycleObserver {
48
- override fun onDestroy(owner: LifecycleOwner) {
49
- log("LibmpvView", "Lifecycle onDestroy -> cleanup()")
50
- cleanup()
14
+ class LibmpvView(
15
+ context: Context,
16
+ appContext: AppContext
17
+ ) : ExpoView(context, appContext), SurfaceHolder.Callback {
18
+
19
+ val session = LibmpvSession()
20
+ private val onLibmpvLog by EventDispatcher()
21
+ private val onLibmpvEvent by EventDispatcher()
22
+ private val surfaceView = SurfaceView(context)
23
+ private var surfaceReady = false
24
+ private var attached = false
25
+ private var renderer: LibmpvRenderer? = null
26
+
27
+ init {
28
+ surfaceView.holder.addCallback(this)
29
+ addView(
30
+ surfaceView,
31
+ FrameLayout.LayoutParams(
32
+ FrameLayout.LayoutParams.MATCH_PARENT,
33
+ FrameLayout.LayoutParams.MATCH_PARENT
34
+ )
35
+ )
36
+ appContext.activityProvider?.currentActivity?.let { activity ->
37
+ if (activity is LifecycleOwner) {
38
+ activity.lifecycle.addObserver(object : DefaultLifecycleObserver {
39
+ override fun onDestroy(owner: LifecycleOwner) {
40
+ cleanup()
41
+ }
42
+ })
43
+ }
51
44
  }
52
- })
53
45
  }
54
- }
55
-
56
- addView(surfaceView, layoutParams)
57
- }
58
46
 
59
- fun isSurfaceReady(): Boolean {
60
- return isSurfaceCreated
61
- }
62
-
63
- fun attemptCreation(){
64
- val allPropsReady =
65
- playUrl != null &&
66
- surfaceWidth != null &&
67
- surfaceHeight != null &&
68
- audioIndex != null &&
69
- subtitleIndex != null &&
70
- videoOutput != null &&
71
- decodingMode != null &&
72
- acceleratedCodecs != null
73
-
74
-
75
- if (allPropsReady) {
76
- log("LibmpvView.attemptCreation", "Initializing MPV instance")
77
- createNativePlayer()
78
- } else {
79
- log("LibmpvView.attemptCreation", "attemptCreation wasn't ready")
80
- }
81
- }
82
-
83
- fun createNativePlayer() {
84
- mpv.createManagedInstance()
85
- prepareMpvSettings()
86
- log("LibmpvView.createNativePlayer", "mpv settings prepared. Waiting on surface creation.")
87
- }
88
-
89
- fun runCommand(orders: String){
90
- mpv.command(orders.split("|").toTypedArray())
91
- }
92
-
93
- fun setOptionString(options: String){
94
- val parts = options.split("|").toTypedArray()
95
- mpv.setOptionString(parts[0],parts[1])
96
- }
97
-
98
- private fun prepareMpvSettings() {
99
- mpv.addLogObserver(this)
100
- mpv.addEventObserver(this)
101
- mpv.setOptionString("force-window", "no")
102
-
103
- mpv.setOptionString("config", "yes")
104
- val mpvDir = mpv.getMpvDirectoryPath()
105
- mpvDir?.let{
106
- mpv.setOptionString("config-dir", mpvDir)
107
- mpv.setOptionString("sub-font-dir", mpvDir)
47
+ private fun shouldHaveRenderer(): Boolean {
48
+ return attached && surfaceReady
108
49
  }
109
50
 
110
- mpv.setOptionString("keep-open", "always")
111
- mpv.setOptionString("save-position-on-quit", "no")
112
- mpv.setOptionString("ytdl", "no")
113
- mpv.setOptionString("msg-level", "all=no")
114
-
115
- videoOutput?.let { vo -> mpv.setOptionString("vo", vo) }
51
+ private fun reconcileRenderer() {
52
+ if (shouldHaveRenderer() && renderer == null) {
53
+ renderer = LibmpvRenderer(
54
+ session = session,
55
+ surfaceView = surfaceView,
56
+ onLog = { payload -> onLibmpvLog(payload) },
57
+ onEvent = { payload -> onLibmpvEvent(payload) }
58
+ )
59
+ renderer!!.start()
60
+ return
61
+ }
116
62
 
117
- decodingMode?.let { mode ->
118
- acceleratedCodecs?.let { codecs ->
119
- mpv.setOptionString("hwdec", mode)
120
- if (decodingMode != "no"){
121
- mpv.setOptionString("hwdec-codecs", codecs)
63
+ if (!shouldHaveRenderer() && renderer != null) {
64
+ renderer!!.destroy()
65
+ renderer = null
122
66
  }
123
- }
124
67
  }
125
68
 
126
- mpv.setOptionString("gpu-context", "android")
127
- mpv.setOptionString("opengl-es", "yes")
128
-
129
- // Nearly all of this block is to prevent choppy playback on Google streaming devices
130
- mpv.setOptionString("video-sync", "audio")
131
- mpv.setOptionString("audio-pitch-correction","yes")
132
- mpv.setOptionString("scale", "bilinear")
133
- mpv.setOptionString("dscale", "bilinear")
134
- mpv.setOptionString("interpolation","no")
135
- mpv.setOptionString("tscale","off")
136
- mpv.setOptionString("correct-pts","yes")
137
-
138
- mpv.setOptionString("ao", "audiotrack")
139
- mpv.setOptionString("alang", "")
140
-
141
- mpv.setOptionString("sub-font-provider", "none")
142
- mpv.setOptionString("slang", "")
143
- mpv.setOptionString("sub-scale-with-window", "yes")
144
- mpv.setOptionString("sub-use-margins", "no")
145
-
146
- mpv.setOptionString("cache", "yes")
147
- mpv.setOptionString("cache-pause-initial", "yes")
148
- mpv.setOptionString("audio-buffer","0.5")
149
- mpv.setOptionString("autosync", "0")
150
- }
69
+ fun onSessionUpdatedFromProps() {
70
+ reconcileRenderer()
71
+ renderer?.onSessionUpdated()
72
+ }
151
73
 
152
- fun log(method: String, argument: String) {
153
- onLibmpvLog(mapOf(
154
- "method" to method,
155
- "argument" to argument
156
- ))
157
- }
74
+ override fun onAttachedToWindow() {
75
+ super.onAttachedToWindow()
76
+ attached = true
77
+ reconcileRenderer()
78
+ }
158
79
 
159
- private fun prepareMpvPlayback() {
160
- mpv.initNativeBinding()
161
- mpv.setOptionString("force-window", "yes")
162
- var options = "vid=1"
163
- options += if (audioIndex == -1) {
164
- ",aid=no"
165
- } else {
166
- ",aid=${(audioIndex ?: 0) + 1}"
80
+ override fun onDetachedFromWindow() {
81
+ attached = false
82
+ reconcileRenderer()
83
+ super.onDetachedFromWindow()
167
84
  }
168
- options += if (subtitleIndex == -1) {
169
- ",sid=no"
170
- } else {
171
- ",sid=${(subtitleIndex ?: 0) + 1}"
85
+
86
+ override fun surfaceCreated(holder: SurfaceHolder) {
87
+ surfaceReady = true
88
+ reconcileRenderer()
172
89
  }
173
- val url: String = (playUrl as? String) ?: ""
174
- mpv.play(url, options)
175
- }
176
90
 
177
- // SurfaceHolder.Callback
178
- override fun surfaceCreated(holder: SurfaceHolder) {
179
- val width = surfaceWidth ?: 0
180
- val height = surfaceHeight ?: 0
91
+ override fun surfaceDestroyed(holder: SurfaceHolder) {
92
+ surfaceReady = false
93
+ reconcileRenderer()
94
+ }
181
95
 
182
- mpv.attachSurface(surfaceView)
183
- prepareMpvPlayback()
184
- mpv.setOptionString("vf", "scale=${width}:${height}")
185
- isSurfaceCreated = true
186
- log("LibmpvView.surfaceCreated", "Surface created and MPV should be playing")
187
- }
96
+ override fun surfaceChanged(
97
+ holder: SurfaceHolder,
98
+ format: Int,
99
+ width: Int,
100
+ height: Int
101
+ ) = Unit
188
102
 
189
- override fun surfaceChanged(holder: SurfaceHolder, format: Int, width: Int, height: Int) {
190
- try{
191
- mpv.setSurfaceHeight(height)
192
- mpv.setSurfaceWidth(width)
103
+ fun runCommand(orders: String) {
104
+ val parts = orders.split("|")
105
+ renderer?.runCommand(parts.toTypedArray())
193
106
  }
194
- catch(e:Exception){}
195
- }
196
107
 
197
- fun cleanup() {
198
- // Launch on background executor so UI returns immediately
199
- Thread {
200
- try {
201
- try { mpv.setPropertyString("pause", "yes") } catch (_: Throwable) {}
202
- try { mpv.setPropertyString("ao", "null") } catch (_: Throwable) {}
203
- Handler(Looper.getMainLooper()).post {
204
- try {
205
- surfaceView.holder.removeCallback(this@LibmpvView)
206
- mpv.cleanup()
207
- } catch (e: Exception) {
208
- }
108
+ fun setOptionString(options: String) {
109
+ val parts = options.split("|")
110
+ if (parts.size == 2) {
111
+ renderer?.setOptionString(parts[0], parts[1])
209
112
  }
210
- } catch (t: Throwable) {}
211
- }.start()
212
- }
213
-
214
- override fun surfaceDestroyed(holder: SurfaceHolder) {
215
- try {
216
- mpv.setPropertyString("pause", "yes")
217
- mpv.setPropertyString("vo", "null")
218
- mpv.setPropertyString("force-window", "no")
219
- } catch (t: Throwable) {}
220
- try {
221
- mpv.detachSurface()
222
- } catch (t: Throwable) {}
223
- }
224
-
225
-
226
- // MPVLib.LogObserver
227
- override fun logMessage(prefix: String, level: Int, text: String) {
228
- onLibmpvLog(mapOf(
229
- "prefix" to prefix,
230
- "level" to "$level",
231
- "text" to text
232
- ))
233
- }
234
-
235
- // MPVLib.EventObserver
236
- override fun eventProperty(property: String) {
237
- onLibmpvEvent(mapOf(
238
- "property" to property,
239
- "kind" to "none"
240
- ))
241
- }
242
-
243
- override fun eventProperty(property: String, value: Long) {
244
- onLibmpvEvent(mapOf(
245
- "property" to property,
246
- "kind" to "long",
247
- "value" to "$value"
248
- ))
249
- }
250
-
251
- override fun eventProperty(property: String, value: Double) {
252
- onLibmpvEvent(mapOf(
253
- "property" to property,
254
- "kind" to "double",
255
- "value" to "$value"
256
- ))
257
- }
258
-
259
- override fun eventProperty(property: String, value: Boolean) {
260
- onLibmpvEvent(mapOf(
261
- "property" to property,
262
- "kind" to "boolean",
263
- "value" to if (value) "true" else "false"
264
- ))
265
- }
266
-
267
- override fun eventProperty(property: String, value: String) {
268
- onLibmpvEvent(mapOf(
269
- "property" to property,
270
- "kind" to "string",
271
- "value" to value
272
- ))
273
- }
274
-
275
- override fun event(eventId: Int) {
276
- onLibmpvEvent(mapOf(
277
- "eventId" to "$eventId",
278
- "kind" to "eventId"
279
- ))
280
- }
113
+ }
281
114
 
282
- override fun onDetachedFromWindow() {
283
- try{
284
- super.onDetachedFromWindow()
285
- cleanup()
115
+ fun cleanup() {
116
+ renderer?.destroy()
117
+ renderer = null
118
+ surfaceView.holder.removeCallback(this)
286
119
  }
287
- catch(e:Exception){}
288
- }
289
120
  }
@@ -4,119 +4,89 @@ import expo.modules.kotlin.modules.Module
4
4
  import expo.modules.kotlin.modules.ModuleDefinition
5
5
 
6
6
  class LibmpvViewModule : Module() {
7
- override fun definition() = ModuleDefinition {
8
- Name("LibmpvView")
9
7
 
10
- View(LibmpvView::class) {
11
- Events("onLibmpvLog", "onLibmpvEvent")
8
+ override fun definition() = ModuleDefinition {
9
+ Name("LibmpvView")
12
10
 
13
- AsyncFunction("runCommand") { view: LibmpvView, orders: String ->
14
- view.runCommand(orders)
15
- }
11
+ View(LibmpvView::class) {
16
12
 
17
- AsyncFunction("setOptionString") { view: LibmpvView, options: String ->
18
- view.setOptionString(options)
19
- }
13
+ Events(
14
+ "onLibmpvLog",
15
+ "onLibmpvEvent"
16
+ )
20
17
 
21
- AsyncFunction("cleanup") { view: LibmpvView ->
22
- view.cleanup()
23
- }
18
+ AsyncFunction("runCommand") { view: LibmpvView, orders: String ->
19
+ view.runCommand(orders)
20
+ }
24
21
 
25
- Prop("videoOutput") { view: LibmpvView, videoOutput: String ->
26
- view.videoOutput = videoOutput
27
- view.attemptCreation()
28
- view.log("setVideoOutput", videoOutput)
29
- }
22
+ AsyncFunction("setOptionString") { view: LibmpvView, options: String ->
23
+ view.setOptionString(options)
24
+ }
30
25
 
31
- Prop("playUrl") { view: LibmpvView, playUrl: String ->
32
- view.playUrl = playUrl
33
- if (view.isSurfaceReady()) {
34
- view.mpv.play(playUrl)
35
- } else {
36
- view.attemptCreation()
26
+ AsyncFunction("cleanup") { view: LibmpvView ->
27
+ view.cleanup()
37
28
  }
38
- view.log("setPlayUrl", playUrl)
39
- }
40
29
 
41
- Prop("decodingMode") { view: LibmpvView, decodingMode: String ->
42
- view.decodingMode = decodingMode
43
- view.attemptCreation()
44
- view.log("setDecodingMode", "$decodingMode")
45
- }
30
+ Prop("playUrl") { view: LibmpvView, value: String ->
31
+ view.session.playUrl = value
32
+ view.onSessionUpdatedFromProps()
33
+ }
46
34
 
47
- Prop("acceleratedCodecs") { view: LibmpvView, acceleratedCodecs: String ->
48
- view.acceleratedCodecs = acceleratedCodecs
49
- view.attemptCreation()
50
- view.log("setAcceleratedCodecs", "$acceleratedCodecs")
51
- }
35
+ Prop("seekToSeconds") { view: LibmpvView, seconds: Double ->
36
+ view.session.seekToSeconds = seconds
37
+ view.session.markDirty(LibmpvSession.MpvIntent.SEEK)
38
+ view.onSessionUpdatedFromProps()
39
+ }
52
40
 
53
- Prop("surfaceWidth") { view: LibmpvView, surfaceWidth: Int ->
54
- view.surfaceWidth = surfaceWidth
55
- if (view.isSurfaceReady()) {
56
- view.mpv.setSurfaceWidth(surfaceWidth)
57
- } else {
58
- view.attemptCreation()
41
+ Prop("selectedAudioTrack") { view: LibmpvView, index: Int ->
42
+ view.session.selectedAudioTrack = index
43
+ view.session.markDirty(LibmpvSession.MpvIntent.AUDIO_TRACK)
44
+ view.onSessionUpdatedFromProps()
59
45
  }
60
- view.log("setSurfaceWidth", "$surfaceWidth")
61
- }
62
46
 
63
- Prop("surfaceHeight") { view: LibmpvView, surfaceHeight: Int ->
64
- view.surfaceHeight = surfaceHeight
65
- if (view.isSurfaceReady()) {
66
- view.mpv.setSurfaceHeight(surfaceHeight)
67
- } else {
68
- view.attemptCreation()
47
+ Prop("selectedSubtitleTrack") { view: LibmpvView, index: Int ->
48
+ view.session.selectedSubtitleTrack = index
49
+ view.session.markDirty(LibmpvSession.MpvIntent.SUBTITLE_TRACK)
50
+ view.onSessionUpdatedFromProps()
69
51
  }
70
- view.log("setSurfaceHeight", "$surfaceHeight")
71
- }
72
52
 
73
- Prop("selectedAudioTrack") { view: LibmpvView, audioTrackIndex: Int ->
74
- view.audioIndex = audioTrackIndex
75
- if (view.isSurfaceReady()) {
76
- val mpvIndex = if (audioTrackIndex != -1) (audioTrackIndex + 1).toString() else "no"
77
- view.mpv.setOptionString("aid", mpvIndex)
78
- } else {
79
- view.attemptCreation()
53
+ Prop("isPlaying") { view: LibmpvView, playing: Boolean ->
54
+ view.session.isPlaying = playing
55
+ view.onSessionUpdatedFromProps()
80
56
  }
81
- view.log("selectAudioTrack", "$audioTrackIndex")
82
- }
83
57
 
84
- Prop("selectedSubtitleTrack") { view: LibmpvView, subtitleTrackIndex: Int ->
85
- view.subtitleIndex = subtitleTrackIndex
86
- if (view.isSurfaceReady()) {
87
- val mpvIndex = if (subtitleTrackIndex != -1) (subtitleTrackIndex + 1).toString() else "no"
88
- view.mpv.setOptionString("sid", mpvIndex)
89
- } else {
90
- view.attemptCreation()
58
+ Prop("videoOutput") { view: LibmpvView, value: String ->
59
+ view.session.videoOutput = value
60
+ view.onSessionUpdatedFromProps()
91
61
  }
92
- view.log("selectSubtitleTrack", "$subtitleTrackIndex")
93
- }
94
62
 
95
- Prop("seekToSeconds") { view: LibmpvView, seconds: Int ->
96
- if (view.isSurfaceReady()) {
97
- view.mpv.seekToSeconds(seconds)
63
+ Prop("decodingMode") { view: LibmpvView, value: String ->
64
+ view.session.decodingMode = value
65
+ view.onSessionUpdatedFromProps()
98
66
  }
99
- view.log("seekToSeconds", "$seconds")
100
- }
101
67
 
102
- Prop("isPlaying") { view: LibmpvView, isPlaying: Boolean ->
103
- if (view.isSurfaceReady() && view.mpv.hasPlayedOnce()) {
104
- when {
105
- isPlaying && !view.mpv.isPlaying() -> {
106
- view.mpv.unpause()
107
- }
108
- !isPlaying && view.mpv.isPlaying() -> {
109
- view.mpv.pause()
110
- }
111
- }
112
- } else {
113
- view.attemptCreation()
68
+ Prop("acceleratedCodecs") { view: LibmpvView, value: String ->
69
+ view.session.acceleratedCodecs = value
70
+ view.onSessionUpdatedFromProps()
71
+ }
72
+
73
+ Prop("videoSync") { view: LibmpvView, value: String ->
74
+ view.session.videoSync = value
75
+ view.onSessionUpdatedFromProps()
114
76
  }
115
- }
116
77
 
117
- OnViewDestroys { view: LibmpvView ->
118
- view.cleanup()
78
+ Prop("surfaceWidth") { view: LibmpvView, value: Int ->
79
+ view.session.surfaceWidth = value
80
+ }
81
+
82
+ Prop("surfaceHeight") { view: LibmpvView, value: Int ->
83
+ view.session.surfaceHeight = value
84
+ }
85
+
86
+
87
+ OnViewDestroys { view: LibmpvView ->
88
+ view.cleanup()
89
+ }
119
90
  }
120
91
  }
121
- }
122
92
  }
package/app.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "expo": {
3
- "runtimeVersion": "0.4.5",
3
+ "runtimeVersion": "0.5.0",
4
4
  "plugins": [
5
5
  [
6
6
  "expo-build-properties",
@@ -1 +1 @@
1
- {"version":3,"file":"LibmpvView.d.ts","sourceRoot":"","sources":["../src/LibmpvView.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,eAAe,EAAE,uBAAuB,EAAE,MAAM,mBAAmB,CAAC;AAkC7E,eAAO,MAAM,qBAAqB,EAAE,MAA0B,CAAA;AAE9D,eAAO,MAAM,0BAA0B,EAAE,MAAiD,CAAA;AAE1F,eAAO,MAAM,UAAU,8GAwDrB,CAAA;AAEF,eAAe,UAAU,CAAA"}
1
+ {"version":3,"file":"LibmpvView.d.ts","sourceRoot":"","sources":["../src/LibmpvView.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,eAAe,EAAE,uBAAuB,EAAE,MAAM,mBAAmB,CAAC;AAkC7E,eAAO,MAAM,qBAAqB,EAAE,MAA0B,CAAA;AAE9D,eAAO,MAAM,0BAA0B,EAAE,MAAiD,CAAA;AAE1F,eAAO,MAAM,UAAU,8GA+DrB,CAAA;AAEF,eAAe,UAAU,CAAA"}
@@ -66,10 +66,14 @@ export const LibmpvView = React.forwardRef((props, parentRef) => {
66
66
  return props.onLibmpvLog(libmpvLog);
67
67
  }
68
68
  };
69
+ let seekProps = {};
70
+ if (typeof props?.seekToSeconds === 'number' && props?.seekToSeconds >= 0) {
71
+ seekProps.seekToSeconds = props.seekToSeconds;
72
+ }
69
73
  // The order props are handled in the native code is non-deterministic
70
74
  // Each native prop setter checks to see if all required props are set
71
75
  // Only then will it try to create an instance of mpv
72
- return <LibmpvViewNative ref={parentRef} style={props.surfaceStyle ? props.surfaceStyle : styles.videoPlayer} videoOutput={props.videoOutput} playUrl={props.playUrl} isPlaying={props.isPlaying} decodingMode={props.decodingMode} acceleratedCodecs={props.acceleratedCodecs} surfaceWidth={props.surfaceWidth} surfaceHeight={props.surfaceHeight} selectedAudioTrack={props.selectedAudioTrack} selectedSubtitleTrack={props.selectedSubtitleTrack} seekToSeconds={props.seekToSeconds} onLibmpvEvent={onLogEvent} onLibmpvLog={onLibmpvLog}/>;
76
+ return <LibmpvViewNative ref={parentRef} {...seekProps} style={props.surfaceStyle ? props.surfaceStyle : styles.videoPlayer} videoOutput={props.videoOutput} playUrl={props.playUrl} isPlaying={props.isPlaying} decodingMode={props.decodingMode} acceleratedCodecs={props.acceleratedCodecs} videoSync={props.videoSync} surfaceWidth={props.surfaceWidth} surfaceHeight={props.surfaceHeight} selectedAudioTrack={props.selectedAudioTrack} selectedSubtitleTrack={props.selectedSubtitleTrack} onLibmpvEvent={onLogEvent} onLibmpvLog={onLibmpvLog}/>;
73
77
  });
74
78
  export default LibmpvView;
75
79
  //# sourceMappingURL=LibmpvView.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"LibmpvView.js","sourceRoot":"","sources":["../src/LibmpvView.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,MAAM,CAAC;AACzC,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,MAAM,MAAM,GAAQ;IAClB,WAAW,EAAE;QACX,QAAQ,EAAE,UAAU;QACpB,IAAI,EAAE,CAAC;QACP,MAAM,EAAE,CAAC;QACT,KAAK,EAAE,CAAC;QACR,GAAG,EAAE,CAAC;KACP;CACF,CAAC;AAEF,MAAM,YAAY,GAAQ;IACxB,CAAC,EAAE,MAAM;IACT,CAAC,EAAE,UAAU;IACb,CAAC,EAAE,aAAa;IAChB,CAAC,EAAE,oBAAoB;IACvB,CAAC,EAAE,oBAAoB;IACvB,CAAC,EAAE,eAAe;IAClB,CAAC,EAAE,YAAY;IACf,CAAC,EAAE,UAAU;IACb,CAAC,EAAE,aAAa;IAChB,EAAE,EAAE,gBAAgB;IACpB,EAAE,EAAE,gBAAgB;IACpB,EAAE,EAAE,gBAAgB;IACpB,EAAE,EAAE,MAAM;IACV,EAAE,EAAE,kBAAkB;IACtB,EAAE,EAAE,iBAAiB;IACrB,EAAE,EAAE,gBAAgB;IACpB,EAAE,EAAE,MAAM;CACX,CAAA;AAED,MAAM,gBAAgB,GAAyC,iBAAiB,CAAC,YAAY,CAAC,CAAC;AAE/F,MAAM,CAAC,MAAM,qBAAqB,GAAW,iBAAiB,CAAA;AAE9D,MAAM,C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EAAE,EAAE;QACrC,IAAI,KAAK,CAAC,WAAW,EAAE,CAAC;YACtB,IAAI,SAAS,IAAI,SAAS,CAAC,WAAW,EAAE,CAAC;gBACvC,SAAS,GAAG,SAAS,CAAC,WAAW,CAAA;YACnC,CAAC;YACD,OAAO,KAAK,CAAC,WAAW,CAAC,SAAS,CAAC,CAAC;QACtC,CAAC;IACH,CAAC,CAAA;IAED,sEAAsE;IACtE,sEAAsE;IACtE,qDAAqD;IACrD,OAAO,CAAC,gBAAgB,CACtB,GAAG,CAAC,CAAC,SAAS,CAAC,CACf,KAAK,CAAC,CAAC,KAAK,CAAC,YAAY,CAAC,CAAC,CAAC,KAAK,CAAC,YAAY,CAAC,CAAC,CAAC,MAAM,CAAC,WAAW,CAAC,CACpE,WAAW,CAAC,CAAC,KAAK,CAAC,WAAW,CAAC,CAC/B,OAAO,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CACvB,SAAS,CAAC,CAAC,KAAK,CAAC,SAAS,CAAC,CAC3B,YAAY,CAAC,CAAC,KAAK,CAAC,YAAY,CAAC,CACjC,iBAAiB,CAAC,CAAC,KAAK,CAAC,iBAAiB,CAAC,CAC3C,YAAY,CAAC,CAAC,KAAK,CAAC,YAAY,CAAC,CACjC,aAAa,CAAC,CAAC,KAAK,CAAC,aAAa,CAAC,CACnC,kBAAkB,CAAC,CAAC,KAAK,CAAC,kBAAkB,CAAC,CAC7C,qBAAqB,CAAC,CAAC,KAAK,CAAC,qBAAqB,CAAC,CACnD,aAAa,CAAC,CAAC,KAAK,CAAC,aAAa,CAAC,CACnC,aAAa,CAAC,CAAC,UAAU,CAAC,CAC1B,WAAW,CAAC,CAAC,WAAW,CAAC,EACzB,CAAA;AACJ,CAAC,CAAC,CAAA;AAEF,eAAe,UAAU,CAAA","sourcesContent":["import { requireNativeView } from 'expo';\nimport * as React from 'react';\nimport { LibmpvViewProps, LibmpvViewNativeMethods } from './LibmpvViewTypes';\n\nconst styles: any = {\n videoPlayer: {\n position: \"absolute\",\n left: 0,\n bottom: 0,\n right: 0,\n top: 0\n }\n};\n\nconst EVENT_LOOKUP: any = {\n 0: 'NONE',\n 1: 'SHUTDOWN',\n 2: 'LOG_MESSAGE',\n 3: 'GET_PROPERTY_REPLY',\n 4: 'SET_PROPERTY_REPLY',\n 5: 'COMMAND_REPLY',\n 6: 'START_FILE',\n 7: 'END_FILE',\n 8: 'FILE_LOADED',\n 16: 'CLIENT_MESSAGE',\n 17: 'VIDEO_RECONFIG',\n 18: 'AUDIO_RECONFIG',\n 20: 'SEEK',\n 21: 'PLAYBACK_RESTART',\n 22: 'PROPERTY_CHANGE',\n 24: 'QUEUE_OVERFLOW',\n 25: 'HOOK'\n}\n\nconst LibmpvViewNative: React.ComponentType<LibmpvViewProps> = requireNativeView('LibmpvView');\n\nexport const DEFAULT_DECODING_MODE: string = \"mediacodec-copy\"\n\nexport const DEFAULT_ACCELERATED_CODECS: string = \"h264,hevc,mpeg4,mpeg2video,vp8,vp9,av1\"\n\nexport const LibmpvView = React.forwardRef<LibmpvViewNativeMethods, LibmpvViewProps>((props: any, parentRef: any) => {\n React.useEffect(() => {\n return () => {\n if (parentRef?.current?.cleanup) {\n parentRef.current.cleanup();\n }\n };\n }, []);\n\n // Pass mpv events and logs back up to the parent\n const onLogEvent = (libmpvEvent: any) => {\n if (props.onLibmpvEvent) {\n if (libmpvEvent && libmpvEvent.nativeEvent) {\n libmpvEvent = libmpvEvent.nativeEvent\n }\n if (libmpvEvent.eventId) {\n libmpvEvent.value = parseInt(libmpvEvent.eventId, 10)\n libmpvEvent.eventKind = EVENT_LOOKUP[libmpvEvent.eventId]\n }\n else if (libmpvEvent.kind === 'long' || libmpvEvent.kind === 'double') {\n libmpvEvent.value = Number(libmpvEvent.value)\n }\n else if (libmpvEvent.kind === 'boolean') {\n libmpvEvent.value = libmpvEvent.value === 'true'\n }\n return props.onLibmpvEvent(libmpvEvent)\n }\n }\n const onLibmpvLog = (libmpvLog: any) => {\n if (props.onLibmpvLog) {\n if (libmpvLog && libmpvLog.nativeEvent) {\n libmpvLog = libmpvLog.nativeEvent\n }\n return props.onLibmpvLog(libmpvLog);\n }\n }\n\n // The order props are handled in the native code is non-deterministic\n // Each native prop setter checks to see if all required props are set\n // Only then will it try to create an instance of mpv\n return <LibmpvViewNative\n ref={parentRef}\n style={props.surfaceStyle ? props.surfaceStyle : styles.videoPlayer}\n videoOutput={props.videoOutput}\n playUrl={props.playUrl}\n isPlaying={props.isPlaying}\n decodingMode={props.decodingMode}\n acceleratedCodecs={props.acceleratedCodecs}\n surfaceWidth={props.surfaceWidth}\n surfaceHeight={props.surfaceHeight}\n selectedAudioTrack={props.selectedAudioTrack}\n selectedSubtitleTrack={props.selectedSubtitleTrack}\n seekToSeconds={props.seekToSeconds}\n onLibmpvEvent={onLogEvent}\n onLibmpvLog={onLibmpvLog}\n />\n})\n\nexport default LibmpvView"]}
1
+ {"version":3,"file":"LibmpvView.js","sourceRoot":"","sources":["../src/LibmpvView.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,MAAM,CAAC;AACzC,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,MAAM,MAAM,GAAQ;IAClB,WAAW,EAAE;QACX,QAAQ,EAAE,UAAU;QACpB,IAAI,EAAE,CAAC;QACP,MAAM,EAAE,CAAC;QACT,KAAK,EAAE,CAAC;QACR,GAAG,EAAE,CAAC;KACP;CACF,CAAC;AAEF,MAAM,YAAY,GAAQ;IACxB,CAAC,EAAE,MAAM;IACT,CAAC,EAAE,UAAU;IACb,CAAC,EAAE,aAAa;IAChB,CAAC,EAAE,oBAAoB;IACvB,CAAC,EAAE,oBAAoB;IACvB,CAAC,EAAE,eAAe;IAClB,CAAC,EAAE,YAAY;IACf,CAAC,EAAE,UAAU;IACb,CAAC,EAAE,aAAa;IAChB,EAAE,EAAE,gBAAgB;IACpB,EAAE,EAAE,gBAAgB;IACpB,EAAE,EAAE,gBAAgB;IACpB,EAAE,EAAE,MAA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C,CAC3B,YAAY,CAAC,CAAC,KAAK,CAAC,YAAY,CAAC,CACjC,aAAa,CAAC,CAAC,KAAK,CAAC,aAAa,CAAC,CACnC,kBAAkB,CAAC,CAAC,KAAK,CAAC,kBAAkB,CAAC,CAC7C,qBAAqB,CAAC,CAAC,KAAK,CAAC,qBAAqB,CAAC,CACnD,aAAa,CAAC,CAAC,UAAU,CAAC,CAC1B,WAAW,CAAC,CAAC,WAAW,CAAC,EACzB,CAAA;AACJ,CAAC,CAAC,CAAA;AAEF,eAAe,UAAU,CAAA","sourcesContent":["import { requireNativeView } from 'expo';\nimport * as React from 'react';\nimport { LibmpvViewProps, LibmpvViewNativeMethods } from './LibmpvViewTypes';\n\nconst styles: any = {\n videoPlayer: {\n position: \"absolute\",\n left: 0,\n bottom: 0,\n right: 0,\n top: 0\n }\n};\n\nconst EVENT_LOOKUP: any = {\n 0: 'NONE',\n 1: 'SHUTDOWN',\n 2: 'LOG_MESSAGE',\n 3: 'GET_PROPERTY_REPLY',\n 4: 'SET_PROPERTY_REPLY',\n 5: 'COMMAND_REPLY',\n 6: 'START_FILE',\n 7: 'END_FILE',\n 8: 'FILE_LOADED',\n 16: 'CLIENT_MESSAGE',\n 17: 'VIDEO_RECONFIG',\n 18: 'AUDIO_RECONFIG',\n 20: 'SEEK',\n 21: 'PLAYBACK_RESTART',\n 22: 'PROPERTY_CHANGE',\n 24: 'QUEUE_OVERFLOW',\n 25: 'HOOK'\n}\n\nconst LibmpvViewNative: React.ComponentType<LibmpvViewProps> = requireNativeView('LibmpvView');\n\nexport const DEFAULT_DECODING_MODE: string = \"mediacodec-copy\"\n\nexport const DEFAULT_ACCELERATED_CODECS: string = \"h264,hevc,mpeg4,mpeg2video,vp8,vp9,av1\"\n\nexport const LibmpvView = React.forwardRef<LibmpvViewNativeMethods, LibmpvViewProps>((props: any, parentRef: any) => {\n React.useEffect(() => {\n return () => {\n if (parentRef?.current?.cleanup) {\n parentRef.current.cleanup();\n }\n };\n }, []);\n\n // Pass mpv events and logs back up to the parent\n const onLogEvent = (libmpvEvent: any) => {\n if (props.onLibmpvEvent) {\n if (libmpvEvent && libmpvEvent.nativeEvent) {\n libmpvEvent = libmpvEvent.nativeEvent\n }\n if (libmpvEvent.eventId) {\n libmpvEvent.value = parseInt(libmpvEvent.eventId, 10)\n libmpvEvent.eventKind = EVENT_LOOKUP[libmpvEvent.eventId]\n }\n else if (libmpvEvent.kind === 'long' || libmpvEvent.kind === 'double') {\n libmpvEvent.value = Number(libmpvEvent.value)\n }\n else if (libmpvEvent.kind === 'boolean') {\n libmpvEvent.value = libmpvEvent.value === 'true'\n }\n return props.onLibmpvEvent(libmpvEvent)\n }\n }\n const onLibmpvLog = (libmpvLog: any) => {\n if (props.onLibmpvLog) {\n if (libmpvLog && libmpvLog.nativeEvent) {\n libmpvLog = libmpvLog.nativeEvent\n }\n return props.onLibmpvLog(libmpvLog);\n }\n }\n\n let seekProps: any = {}\n if (typeof props?.seekToSeconds === 'number' && props?.seekToSeconds >= 0) {\n seekProps.seekToSeconds = props.seekToSeconds\n }\n\n // The order props are handled in the native code is non-deterministic\n // Each native prop setter checks to see if all required props are set\n // Only then will it try to create an instance of mpv\n\n return <LibmpvViewNative\n ref={parentRef}\n {...seekProps}\n style={props.surfaceStyle ? props.surfaceStyle : styles.videoPlayer}\n videoOutput={props.videoOutput}\n playUrl={props.playUrl}\n isPlaying={props.isPlaying}\n decodingMode={props.decodingMode}\n acceleratedCodecs={props.acceleratedCodecs}\n videoSync={props.videoSync}\n surfaceWidth={props.surfaceWidth}\n surfaceHeight={props.surfaceHeight}\n selectedAudioTrack={props.selectedAudioTrack}\n selectedSubtitleTrack={props.selectedSubtitleTrack}\n onLibmpvEvent={onLogEvent}\n onLibmpvLog={onLibmpvLog}\n />\n})\n\nexport default LibmpvView"]}
@@ -6,6 +6,7 @@ export type LibmpvViewProps = {
6
6
  isPlaying: boolean;
7
7
  decodingMode: string;
8
8
  acceleratedCodecs: string;
9
+ videoSync: string;
9
10
  selectedAudioTrack: number;
10
11
  selectedSubtitleTrack: number;
11
12
  seekToSeconds: number;
@@ -1 +1 @@
1
- {"version":3,"file":"LibmpvViewTypes.d.ts","sourceRoot":"","sources":["../src/LibmpvViewTypes.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,eAAe,GAAG;IAC5B,GAAG,EAAE,GAAG,CAAC;IACT,KAAK,EAAE,GAAG,CAAC;IACX,WAAW,EAAE,MAAM,CAAC;IACpB,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,OAAO,CAAC;IACnB,YAAY,EAAE,MAAM,CAAC;IACrB,iBAAiB,EAAE,MAAM,CAAC;IAC1B,kBAAkB,EAAE,MAAM,CAAC;IAC3B,qBAAqB,EAAE,MAAM,CAAC;IAC9B,aAAa,EAAE,MAAM,CAAC;IACtB,YAAY,EAAE,MAAM,CAAC;IACrB,aAAa,EAAE,MAAM,CAAC;IACtB,aAAa,EAAE,CAAC,WAAW,EAAE,GAAG,KAAK,IAAI,CAAC;IAC1C,WAAW,EAAE,CAAC,SAAS,EAAE,GAAG,KAAK,IAAI,CAAC;CACvC,CAAC;AAEF,MAAM,MAAM,uBAAuB,GAAG;IACpC,UAAU,EAAE,CAAC,sBAAsB,EAAE,MAAM,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACrE,eAAe,EAAE,CAAC,sBAAsB,EAAE,MAAM,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CAC3E,CAAC"}
1
+ {"version":3,"file":"LibmpvViewTypes.d.ts","sourceRoot":"","sources":["../src/LibmpvViewTypes.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,eAAe,GAAG;IAC5B,GAAG,EAAE,GAAG,CAAC;IACT,KAAK,EAAE,GAAG,CAAC;IACX,WAAW,EAAE,MAAM,CAAC;IACpB,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,OAAO,CAAC;IACnB,YAAY,EAAE,MAAM,CAAC;IACrB,iBAAiB,EAAE,MAAM,CAAC;IAC1B,SAAS,EAAE,MAAM,CAAC;IAClB,kBAAkB,EAAE,MAAM,CAAC;IAC3B,qBAAqB,EAAE,MAAM,CAAC;IAC9B,aAAa,EAAE,MAAM,CAAC;IACtB,YAAY,EAAE,MAAM,CAAC;IACrB,aAAa,EAAE,MAAM,CAAC;IACtB,aAAa,EAAE,CAAC,WAAW,EAAE,GAAG,KAAK,IAAI,CAAC;IAC1C,WAAW,EAAE,CAAC,SAAS,EAAE,GAAG,KAAK,IAAI,CAAC;CACvC,CAAC;AAEF,MAAM,MAAM,uBAAuB,GAAG;IACpC,UAAU,EAAE,CAAC,sBAAsB,EAAE,MAAM,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACrE,eAAe,EAAE,CAAC,sBAAsB,EAAE,MAAM,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CAC3E,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"LibmpvViewTypes.js","sourceRoot":"","sources":["../src/LibmpvViewTypes.ts"],"names":[],"mappings":"","sourcesContent":["export type LibmpvViewProps = {\n ref: any,\n style: any,\n videoOutput: string,\n playUrl: string,\n isPlaying: boolean,\n decodingMode: string,\n acceleratedCodecs: string,\n selectedAudioTrack: number,\n selectedSubtitleTrack: number,\n seekToSeconds: number,\n surfaceWidth: number,\n surfaceHeight: number,\n onLibmpvEvent: (libmpvEvent: any) => void,\n onLibmpvLog: (libmpvLog: any) => void,\n};\n\nexport type LibmpvViewNativeMethods = {\n runCommand: (pipeDelimitedArguments: string) => void | Promise<void>;\n setOptionString: (pipeDelimitedArguments: string) => void | Promise<void>;\n};"]}
1
+ {"version":3,"file":"LibmpvViewTypes.js","sourceRoot":"","sources":["../src/LibmpvViewTypes.ts"],"names":[],"mappings":"","sourcesContent":["export type LibmpvViewProps = {\n ref: any,\n style: any,\n videoOutput: string,\n playUrl: string,\n isPlaying: boolean,\n decodingMode: string,\n acceleratedCodecs: string,\n videoSync: string,\n selectedAudioTrack: number,\n selectedSubtitleTrack: number,\n seekToSeconds: number,\n surfaceWidth: number,\n surfaceHeight: number,\n onLibmpvEvent: (libmpvEvent: any) => void,\n onLibmpvLog: (libmpvLog: any) => void,\n};\n\nexport type LibmpvViewNativeMethods = {\n runCommand: (pipeDelimitedArguments: string) => void | Promise<void>;\n setOptionString: (pipeDelimitedArguments: string) => void | Promise<void>;\n};"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "expo-libmpv",
3
- "version": "0.4.6",
3
+ "version": "0.5.1",
4
4
  "description": "A libmpv Fabric component for Android",
5
5
  "main": "build/index.js",
6
6
  "types": "build/index.d.ts",