Android how can play song for 30 seconds only in mediaPlayer
<pre><code>I am working in android , i am creating a player for audio songs. I want to play a song only for 30 seconds. after that player must be closed.It should be start again if i press START button again. 

this is the code for creating a media player:-

    MediaPlayer mediaPlayer = new MediaPlayer();
public void songPreview(String songURL){

        try{
        mediaPlayer=new MediaPlayer();
        mediaPlayer.setDataSource(songURL);
             mediaPlayer.prepare();
             mediaPlayer.start();

        } catch(Exception ex){
            ex.printStackTrace();
        }
    }

Please suggest me what code should i use to play my song only for 30 seconds after that it will stop. and if i want to play again then i have to press start button.

Note:- please provide me logic to stop media player after 30 second.

Thank you in advance.
</code></pre>
