public int getCurrentPosition() {
   if (mMediaPlayerService != null && isMediaPlayerBound && mMediaPlayerService.isPlaying()) {
     return mMediaPlayerService.getPosition();
   } else {
     return 0;
   }
 }
 @Override
 public void onServiceConnected(ComponentName name, IBinder service) {
   MusicBinder binder = (MusicBinder) service;
   mMediaPlayerService = binder.getService();
   mMediaPlayerService.setPlayList(mTracks);
   mMediaPlayerService.setCurrentSong(mCurrentTrack);
   if (!isMediaPlayerBound) {
     seekHandler.postDelayed(updateSeekBar, 100);
   }
   if (!mMediaPlayerService.isSameTrack()) {
     mMediaPlayerService.playTrack();
   }
   isMediaPlayerBound = true;
 }
  public void updateMediaPlayerViews() {
    tvArtistName.setText(mTracks.get(mCurrentTrack).getArtist());
    tvAlbumName.setText(mTracks.get(mCurrentTrack).getAlbum());
    tvSongName.setText(mTracks.get(mCurrentTrack).getName());
    Picasso.with(getActivity())
        .load(mTracks.get(mCurrentTrack).getCoverImgs())
        .placeholder(R.drawable.album_art_missing)
        .into(ivCoverPicture);

    if (mMediaPlayerService != null && mMediaPlayerService.isPlaying()) {
      ibPlayPause.setImageResource(R.drawable.ic_pause);
    } else if (mMediaPlayerService != null && !mMediaPlayerService.isPlaying()) {
      ibPlayPause.setImageResource(R.drawable.ic_play);
    }
  }
 @Override
 public void onClick(View v) {
   int viewId = v.getId();
   switch (viewId) {
     case R.id.ib_play_pause:
       if (mMediaPlayerService.isPlaying()) {
         mMediaPlayerService.pauseTrack();
         seekHandler.removeCallbacks(updateSeekBar);
         ibPlayPause.setImageResource(R.drawable.ic_play);
       } else {
         mMediaPlayerService.resumeTrack();
         seekHandler.postDelayed(updateSeekBar, 100);
         ibPlayPause.setImageResource(R.drawable.ic_pause);
       }
       break;
     case R.id.ib_previous:
       mCurrentTrack = mMediaPlayerService.playPrevious();
       break;
     case R.id.ib_next:
       mCurrentTrack = mMediaPlayerService.playNext();
       break;
     case R.id.ib_repeat:
       repeat = mMediaPlayerService.turnOnRepeateat();
       updateRepeatIcon(repeat);
       break;
     case R.id.ib_shuffle:
       shuffle = mMediaPlayerService.turnOnShuffle();
       updateShuffleIcon(shuffle);
       break;
     case R.id.ib_share:
       shareSong();
       break;
   }
 }