capacitor-plugin-playlist icon indicating copy to clipboard operation
capacitor-plugin-playlist copied to clipboard

Android: seekTo

Open PavelShvets-dev opened this issue 3 years ago • 3 comments

Unfortunately I haven't found the reason yet, but if you'll try to add seconds with 'seekTo' method as float - it won't work. The issue is only reproduced:

  • Android
  • state: isPlaying
  • position is not integer

:green_circle: Works: audioPlayer.seekTo(currentPosition + 15) :red_circle: Failed: audioPlayer.seekTo(currentPosition + 15.1)

PavelShvets-dev avatar Mar 22 '22 19:03 PavelShvets-dev

You are right, I noticed this bug as well. I am always using

player.seekTo(parseInt(time))

thoasty-dev avatar Mar 23 '22 07:03 thoasty-dev

@PavelShvets-dev do you have a stack trace, i am having an assumpsion around android/src/main/java/org/dwbn/plugins/playlist/PlaylistPlugin.kt:277 but not sure about the cause

phiamo avatar Mar 27 '22 01:03 phiamo

@phiamo hi! btw thank you for plugin, great work 🙂 I tried to add some logs into PlaylistPlugin and results are here: V/Capacitor: callback: 29660263, pluginId: Playlist, methodName: seekTo, methodData: {"position":15.85} I/PlaylistPlugin: >>currentProgress 0 (log after 272 line) I/PlaylistPlugin: >>position 850 (log after 277 line) I/PlaylistPlugin: >>seekPosition 0 (log after 277 line)

So, android/src/main/java/org/dwbn/plugins/playlist/PlaylistPlugin.kt:275 already returns wrong value (just a decimal part of seek value)

PavelShvets-dev avatar Mar 29 '22 11:03 PavelShvets-dev

if this is still persisting please reopen

phiamo avatar Jul 26 '24 22:07 phiamo