0

Integrated VLC media player in android application.When for the first time the activity get opened ,trying to seek the video time for 10 sec. The code is as below

        var mediaObject = Media(mLibVLC, videoUrl)
        videoPlayer.media =  mediaObject         
        videoPlayer.play()         
        videoPlayer.setTime(10000,true)
        debug("===>isSeekable "+videoPlayer.isSeekable)
        

        Logcat ===>isSeekable false

Now i can see from the log cat that the video is not seekable, so the seeking is not working for the initial video, but when play the next video, isSeekable is true from next time onward.

How to change this behaviour.

Note: implementation "org.videolan.android:libvlc-all:3.4.2" using this version of vlc

caprica
  • 3,902
  • 4
  • 19
  • 39
Biplab De
  • 1,342
  • 10
  • 30

1 Answers1

0

I suspect that the video isn't yet playing.
Either set it playing, allowing a fraction of a second for it to fire-up and then seek or use the Media option and then use a form of Media.add_option('start-time='+restart_time).

Seek only works if the video is already playing.

Edit:
Any pause should be after the videoPlayer.play()

restart_time would be a string in seconds e.g. start_time=10.5
See the vlc command line --start-time=83.4 https://wiki.videolan.org/VLC_HowTo/Jump_to_a_certain_time/

Also as mfkl points out some media isn't seekable
Note: I work in python so you may have to translate to whatever Android is using, I've no clue.

Rolf of Saxony
  • 21,661
  • 5
  • 39
  • 60