expo-libmpv 0.5.8 → 0.5.10

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.
@@ -295,11 +295,12 @@ class LibmpvRenderer(
295
295
 
296
296
  try {
297
297
  loadedUrl = url
298
- MPVLib.setOptionString("start", "0")
299
-
300
- val start = session.seekToSeconds
301
- if (start != null) {
302
- MPVLib.setOptionString("start", start.toLong().toString())
298
+ val initialSeek = session.seekToSeconds
299
+ if (initialSeek != null && session.needsApply(LibmpvSession.MpvIntent.SEEK)) {
300
+ MPVLib.setOptionString("start", initialSeek.toString())
301
+ session.markApplied(LibmpvSession.MpvIntent.SEEK)
302
+ } else {
303
+ MPVLib.setOptionString("start", "0")
303
304
  }
304
305
 
305
306
  MPVLib.command(
@@ -354,16 +355,15 @@ class LibmpvRenderer(
354
355
  }
355
356
  }
356
357
 
357
- if (session.needsApply(LibmpvSession.MpvIntent.SEEK)) {
358
- val target = session.seekToSeconds
359
- if (target != null) {
360
- if (!session.hasFileLoaded) {
361
- return
362
- }
358
+ session.seekToSeconds?.let { seekToSeconds ->
359
+ if (
360
+ session.needsApply(LibmpvSession.MpvIntent.SEEK) &&
361
+ session.hasFileLoaded
362
+ ) {
363
363
  MPVLib.command(
364
364
  arrayOf(
365
365
  "seek",
366
- target.toString(),
366
+ seekToSeconds.toString(),
367
367
  "absolute"
368
368
  )
369
369
  )
@@ -526,4 +526,4 @@ class LibmpvRenderer(
526
526
  Log.e(TAG, "mpv error", e)
527
527
  }
528
528
  }
529
- }
529
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "expo-libmpv",
3
- "version": "0.5.8",
3
+ "version": "0.5.10",
4
4
  "description": "A libmpv Fabric component for Android",
5
5
  "main": "build/index.js",
6
6
  "types": "build/index.d.ts",