Skip to content

Commit

Permalink
Fixing seek bar.
Browse files Browse the repository at this point in the history
  • Loading branch information
jeancsanchez committed Sep 3, 2018
1 parent 9db608c commit 96da507
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,7 @@ class JcPlayerService : Service(), MediaPlayer.OnPreparedListener, MediaPlayer.O
JcStatus.PlayState.STOP -> {
mediaPlayer?.let {
it.stop()
it.reset()
it.release()
mediaPlayer = null
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,6 @@ class JcPlayerView : LinearLayout, View.OnClickListener, SeekBar.OnSeekBarChange
btnRepeat?.setOnClickListener(this)
btnRepeatOne?.setOnClickListener(this)
seekBar?.setOnSeekBarChangeListener(this)
seekBar?.isEnabled = false
}

private fun setAttributes(attrs: TypedArray) {
Expand Down Expand Up @@ -458,6 +457,8 @@ class JcPlayerView : LinearLayout, View.OnClickListener, SeekBar.OnSeekBarChange
val currentPosition = status.currentPosition.toInt()
seekBar?.post { seekBar?.progress = currentPosition }
txtCurrentDuration?.post { txtCurrentDuration?.text = toTimeSongString(currentPosition) }


}

override fun onPaused(status: JcStatus) {
Expand Down

0 comments on commit 96da507

Please sign in to comment.