Android
Android

Reputation: 9033

android audio player

I want to develope audio player that has seek functionality. Right now I am doing only play and stop functionality. How can I add seek to functionality to it?

Thanks in advance

Upvotes: 2

Views: 804

Answers (3)

Android
Android

Reputation: 9033

<?xml version="1.0" encoding="utf-8"?><LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
          android:orientation="vertical"
          android:layout_width="fill_parent"
          android:layout_height="fill_parent"   >
<VideoView android:id="@+id/surface_view"
             android:layout_width="fill_parent"
             android:layout_height="fill_parent">
</VideoView></LinearLayout

Upvotes: 0

Android
Android

Reputation: 9033

    setContentView(R.layout.playingactivity);
    Toast.LENGTH_LONG).show();
    mPath = (EditText) findViewById(R.id.path);
    mPath.setText(GlobalVariable.getstrEmail());
    mVideoView = (VideoView) findViewById(R.id.surface_view);
    Uri uri = Uri.parse("/sdcard/download/test.mp3");   
    mediaController = new MediaController(this);
    mediaController.show(0);    
    mediaController.setAnchorView(mVideoView);
    mVideoView.setMediaController(mediaController);
    mVideoView.setVideoURI(uri);
    mVideoView.start();

Upvotes: 0

Nallath
Nallath

Reputation: 2116

Use: mediaPlayer.seekTo(int msec)

Upvotes: 1

Related Questions