Playing song after clicking on an item in recyclerView

I am kinda new so i am not able to figure it out.

I want to play a song after clicking on it in recyclerview but my current code is not playing the song and the mediaplayer.prepareAsync or mediaplayer.prepare is throwing IllegalStateException.

Android Monitor:

07-27 16:30:33.181 30799-30799/com.example.kapil.music W/System.err: java.lang.IllegalStateException
07-27 16:30:33.185 30799-30799/com.example.kapil.music W/System.err:     at android.media.MediaPlayer.prepare(Native Method)
07-27 16:30:33.189 30799-30799/com.example.kapil.music W/System.err:     at com.example.kapil.music.MainActivity$1.onItemClick(MainActivity.java:113)
07-27 16:30:33.190 30799-30799/com.example.kapil.music W/System.err:     at com.example.kapil.music.SongAdapter$SongHolder.onClick(SongAdapter.java:95)
07-27 16:30:33.190 30799-30799/com.example.kapil.music W/System.err:     at android.view.View.performClick(View.java:4456)
07-27 16:30:33.191 30799-30799/com.example.kapil.music W/System.err:     at android.view.View$PerformClick.run(View.java:18465)
07-27 16:30:33.194 30799-30799/com.example.kapil.music W/System.err:     at android.os.Handler.handleCallback(Handler.java:733)
07-27 16:30:33.195 30799-30799/com.example.kapil.music W/System.err:     at android.os.Handler.dispatchMessage(Handler.java:95)
07-27 16:30:33.195 30799-30799/com.example.kapil.music W/System.err:     at android.os.Looper.loop(Looper.java:136)
07-27 16:30:33.196 30799-30799/com.example.kapil.music W/System.err:     at android.app.ActivityThread.main(ActivityThread.java:5086)
07-27 16:30:33.196 30799-30799/com.example.kapil.music W/System.err:     at java.lang.reflect.Method.invokeNative(Native Method)
07-27 16:30:33.197 30799-30799/com.example.kapil.music W/System.err:     at java.lang.reflect.Method.invoke(Method.java:515)
07-27 16:30:33.198 30799-30799/com.example.kapil.music W/System.err:     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:785)
07-27 16:30:33.198 30799-30799/com.example.kapil.music W/System.err:     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:601)
07-27 16:30:33.198 30799-30799/com.example.kapil.music W/System.err:     at de.robv.android.xposed.XposedBridge.main(XposedBridge.java:132)
07-27 16:30:33.199 30799-30799/com.example.kapil.music W/System.err:     at dalvik.system.NativeStart.main(Native Method)

MainActivity.java

public class MainActivity extends AppCompatActivity {

    private ArrayList<SongInfo> songs = new ArrayList<>();
    RecyclerView recyclerView;
    SeekBar seekBar;
    SongAdapter songAdapter;
    public MediaPlayer mediaPlayer;
    SongInfo songInfo;
    Handler handler = new Handler();

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);

        //Reference to recyclerview and seekbar
        recyclerView = (RecyclerView) findViewById(R.id.recyclerView);
        seekBar = (SeekBar) findViewById(R.id.seekBar);

        //Passing context and arraylist to Songadapter class constructor
        songAdapter = new SongAdapter(this, songs);

        //Adding song to arrayList
        //songs.add(songInfo);

        //Layout manager for recyclerview
        LinearLayoutManager linearLayoutManager = new 
        LinearLayoutManager(this);

        recyclerView.setLayoutManager(linearLayoutManager);
        recyclerView.setAdapter(songAdapter);

    songAdapter.setOnItemClickListener(new SongAdapter.onItemClickListener() {
    @Override
    public void onItemClick(int position, View v) {

                try {
                    if (mediaPlayer != null) {
                        if (mediaPlayer.isPlaying()) {
                            mediaPlayer.stop();
                            mediaPlayer.reset();
                            mediaPlayer.release();
                            mediaPlayer = null;
                        }
                    } else {
                        mediaPlayer = new MediaPlayer();
                        mediaPlayer.prepare();
                        mediaPlayer.start();
                    }
                } catch (NullPointerException e) {}
                catch (IOException e){}
                catch (IllegalStateException e) {
                    Toast.makeText(MainActivity.this, "Illegal State Exception Caught", Toast.LENGTH_SHORT).show();
                    e.printStackTrace();
                }
    }

    @Override
    public void onItemLongClick(int position, View v) {}
});

LoadSongs();

}

SongAdapter.java

public class SongAdapter extends RecyclerView.Adapter<SongAdapter.SongHolder> {

    ArrayList<SongInfo> songs;
    Context context;

    onItemClickListener onItemClickListener;

    public SongAdapter(Context context, ArrayList<SongInfo> songs) {
        this.songs = songs;
        this.context = context;
    }

    //Adapter methods
    @Override
    public SongHolder onCreateViewHolder(ViewGroup viewGroup, int viewType) {

        View myView = LayoutInflater.from(context).inflate(R.layout.song_row, viewGroup, false);
        return new SongHolder(myView);
    }

    @Override
    public void onBindViewHolder(final SongHolder songholder, final int position) {

        final SongInfo c = songs.get(position); //Get the values of the song at Nth position
        songholder.songName.setText(c.songName);
        songholder.artistName.setText(c.artistName);

    @Override
    public int getItemCount() {
        return songs.size();
    }

    public interface onItemClickListener{
        //void onItemClick(Button button, View view, SongInfo songInfo, int position);
        void onItemClick(int position, View v);
        void onItemLongClick(int position, View v);
    }

    public void setOnItemClickListener(onItemClickListener onItemClickListener){
        this.onItemClickListener = onItemClickListener;
    }

    //Internal class
    public class SongHolder extends RecyclerView.ViewHolder implements View.OnClickListener, View.OnLongClickListener {

        TextView songName;
        TextView artistName;
        Button actnButton;


        public SongHolder(View itemView) {
            super(itemView);

            //Reference/Initialization to fields in song_row.xml
            songName = (TextView) itemView.findViewById(R.id.songName);
            artistName = (TextView) itemView.findViewById(R.id.artistName);
            actnButton = (Button) itemView.findViewById(R.id.actnButton);

            itemView.setOnClickListener(this);
            itemView.setOnLongClickListener(this);
        }

        @Override
        public void onClick(View v) {
            onItemClickListener.onItemClick(getAdapterPosition(), v);
        }

        @Override
        public boolean onLongClick(View v) {
            onItemClickListener.onItemLongClick(getAdapterPosition(), v);
            return false;
        }
    }
}

I tried to find a solution for it but wasn’t successful.