title: How to seek a .ts file in vlc media player integrated in android application?
body: <p>I have used vlc media player integration in my android app (libvlc). I use it to play rtsp files which are in .ts format.I have implemented a feature in which I can playback the recorded files and it works fine only for playing but I can not seek through these files even though they are seek-able in vlc desktop version. To clarify this I played that stream on vlc android app and still I can not seek through it then I used Mx player android app and I can seek in this file.
  Is there a way to do this in vlc integration for android?</p>
  
  <pre><code> private LibVLC libvlc;
   private MediaController controller;
  
  private void CreateMediaplayer(String url, TextureView textureview)
      {
          try {
              ArrayList&lt;String&gt; options = new ArrayList&lt;String&gt;();
              options.add("--rtsp-tcp");
              options.add("-vvv"); // verbosity
         /*   options.add("--aout=opensles");
              options.add("--audio-time-stretch"); // time stretching
              options.add("--aout=opensles");
              options.add("--avcodec-codec=h264");*/
  
              controller = new MediaController(this.context);
              controller.setMediaPlayer(playerinterface);
              controller.setAnchorView(relativeLayout);
  
              if(isFullscreen){
                  controller.show(100000);
  
              }
  
              libvlc = new LibVLC(this.context, options);
              // Create media player
              mMediaPlayer = new MediaPlayer(libvlc);
              mMediaPlayer.setEventListener(this);
  
  
  
              // Set up video output
              final IVLCVout vout = mMediaPlayer.getVLCVout();
              mMediaPlayer.setScale(0);
              vout.detachViews();
              vout.setVideoView(textureview);
              vout.setWindowSize(textureview.getWidth(), textureview.getHeight());
              vout.attachViews();
              textureview.setKeepScreenOn(true);
  
              Media m = new Media(libvlc, Uri.parse(url));
              mMediaPlayer.setMedia(m);
              mMediaPlayer.play();
  
              progressBar.setVisibility(View.VISIBLE);
              }catch(Exception e1)
          {
              progressBar.setVisibility(View.VISIBLE);
          }
  
      }
   private MediaController.MediaPlayerControl playerinterface = new MediaController.MediaPlayerControl() {
          @Override
          public void start() {
             // mMediaPlayer.pause();
          }
  
          @Override
          public void pause() {
            // mMediaPlayer.play();
  
          }
  
          @Override
          public int getDuration() {
              return 0;
              //return (int)mMediaPlayer.getLength();
          }
  
          @Override
          public int getCurrentPosition() {
              return 0;
          }
  
          @Override
          public void seekTo(int i) {
              mMediaPlayer.setPosition((float)i);
              mMediaPlayer.play();
  
          }
  
          @Override
          public boolean isPlaying() {
              return false;
          }
  
          @Override
          public int getBufferPercentage() {
              return 0;
          }
  
          @Override
          public boolean canPause() {
              return true;
          }
  
          @Override
          public boolean canSeekBackward() {
              return true;
          }
  
          @Override
          public boolean canSeekForward() {
              return true;
          }
  
          @Override
          public int getAudioSessionId() {
              return 0;
          }
      };
  </code></pre>