Created
November 29, 2017 13:09
-
-
Save juliendn/e9a9fed9a241a432a16e295bea237dea to your computer and use it in GitHub Desktop.
Extremely simple timebar for exoplayer
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package fr.juliendenadai.player | |
import android.content.Context | |
import android.util.AttributeSet | |
import android.widget.ProgressBar | |
import com.google.android.exoplayer2.ui.TimeBar | |
/** | |
* Created by Julien DE NADAI on 28/11/2017. | |
*/ | |
class CustomTimeBar | |
@JvmOverloads constructor( | |
context: Context?, | |
attrs: AttributeSet? = null, | |
defStyleAttr: Int = 0 | |
) : ProgressBar(context, attrs, defStyleAttr), TimeBar { | |
override fun setKeyCountIncrement(count: Int) {} | |
override fun setKeyTimeIncrement(time: Long) {} | |
override fun setPosition(position: Long) { | |
progress = position.toInt() | |
} | |
override fun setListener(listener: TimeBar.OnScrubListener?) {} | |
override fun setBufferedPosition(bufferedPosition: Long) {} | |
override fun setDuration(duration: Long) { | |
max = duration.toInt() | |
} | |
override fun setAdGroupTimesMs(adGroupTimesMs: LongArray?, playedAdGroups: BooleanArray?, adGroupCount: Int) {} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment