royaff0/Megumin

seek bug in PlayerActivity.kt

Closed this issue · 0 comments

seek offset does not apply sign for backward.
playerView.seekOffsetTo(s * 1000)

private fun onKeyboardSeekUpdate(times: Int, isFinish: Boolean = false) {
        val isForward = keyPressingCode == KeyEvent.KEYCODE_DPAD_RIGHT
        val s = times * 5

        mToast.setText(getString(if (isForward) R.string.toast_forward else R.string.toast_backward).format(s))
        mToast.show()

        if (isFinish) {
            playerView.seekOffsetTo(s * 1000)
            mToast.cancel()
        }
    }