expo-libmpv 0.5.7 → 0.5.8

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.
@@ -357,6 +357,9 @@ class LibmpvRenderer(
357
357
  if (session.needsApply(LibmpvSession.MpvIntent.SEEK)) {
358
358
  val target = session.seekToSeconds
359
359
  if (target != null) {
360
+ if (!session.hasFileLoaded) {
361
+ return
362
+ }
360
363
  MPVLib.command(
361
364
  arrayOf(
362
365
  "seek",
@@ -367,6 +370,7 @@ class LibmpvRenderer(
367
370
  session.markApplied(LibmpvSession.MpvIntent.SEEK)
368
371
  }
369
372
  }
373
+
370
374
  }
371
375
 
372
376
  private fun stopPlayback() {
@@ -395,10 +399,7 @@ class LibmpvRenderer(
395
399
 
396
400
  override fun event(eventId: Int) {
397
401
  when (eventId) {
398
- MPVLib.MpvEvent.MPV_EVENT_FILE_LOADED -> {
399
- session.hasFileLoaded = true
400
- }
401
-
402
+ MPVLib.MpvEvent.MPV_EVENT_FILE_LOADED,
402
403
  MPVLib.MpvEvent.MPV_EVENT_PLAYBACK_RESTART -> {
403
404
  session.hasFileLoaded = true
404
405
  applyDeferredState()
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "expo-libmpv",
3
- "version": "0.5.7",
3
+ "version": "0.5.8",
4
4
  "description": "A libmpv Fabric component for Android",
5
5
  "main": "build/index.js",
6
6
  "types": "build/index.d.ts",