disable time-bar animation

This commit is contained in:
Jannik 2020-11-06 10:21:57 +01:00
parent 6526b8868e
commit d3f078c661
Signed by: Seil0
GPG Key ID: E8459F3723C52C24
3 changed files with 8 additions and 2 deletions

View File

@ -10,7 +10,7 @@ android {
applicationId "org.mosad.teapod"
minSdkVersion 23
targetSdkVersion 30
versionCode 1000 //00.01.0000
versionCode 1000 //00.01.000
versionName "0.2.0-beta1"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"

View File

@ -13,6 +13,7 @@ import com.google.android.exoplayer2.MediaItem
import com.google.android.exoplayer2.Player
import com.google.android.exoplayer2.SimpleExoPlayer
import com.google.android.exoplayer2.source.hls.HlsMediaSource
import com.google.android.exoplayer2.ui.StyledPlayerControlView
import com.google.android.exoplayer2.upstream.DataSource
import com.google.android.exoplayer2.upstream.DefaultDataSourceFactory
import com.google.android.exoplayer2.util.Util
@ -23,6 +24,7 @@ class PlayerActivity : AppCompatActivity() {
private lateinit var player: SimpleExoPlayer
private lateinit var dataSourceFactory: DataSource.Factory
private lateinit var controller: StyledPlayerControlView
private var streamUrl = ""
@ -96,6 +98,7 @@ class PlayerActivity : AppCompatActivity() {
player = SimpleExoPlayer.Builder(this).build()
dataSourceFactory = DefaultDataSourceFactory(this, Util.getUserAgent(this, "Teapod"))
controller = video_view.findViewById<StyledPlayerControlView>(R.id.exo_controller)
val mediaSource = HlsMediaSource.Factory(dataSourceFactory)
.createMediaSource(MediaItem.fromUri(Uri.parse(streamUrl)))
@ -124,6 +127,9 @@ class PlayerActivity : AppCompatActivity() {
}
})
// disable controls animation (time-bar) TODO enable and hide time to end with animation
controller.isAnimationEnabled = false
// when the player controls get hidden, hide the bars too
video_view.setControllerVisibilityListener {
if (it == View.GONE) hideBars()

View File

@ -71,7 +71,7 @@
app:layout_constraintTop_toTopOf="parent" />
<View
android:id="@id/exo_progress_placeholder"
android:id="@+id/exo_progress_placeholder"
android:layout_width="0dp"
android:layout_height="@dimen/exo_styled_progress_layout_height"
app:layout_constraintBottom_toBottomOf="parent"