disable time-bar animation
This commit is contained in:
parent
6526b8868e
commit
d3f078c661
|
@ -10,7 +10,7 @@ android {
|
||||||
applicationId "org.mosad.teapod"
|
applicationId "org.mosad.teapod"
|
||||||
minSdkVersion 23
|
minSdkVersion 23
|
||||||
targetSdkVersion 30
|
targetSdkVersion 30
|
||||||
versionCode 1000 //00.01.0000
|
versionCode 1000 //00.01.000
|
||||||
versionName "0.2.0-beta1"
|
versionName "0.2.0-beta1"
|
||||||
|
|
||||||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
||||||
|
|
|
@ -13,6 +13,7 @@ import com.google.android.exoplayer2.MediaItem
|
||||||
import com.google.android.exoplayer2.Player
|
import com.google.android.exoplayer2.Player
|
||||||
import com.google.android.exoplayer2.SimpleExoPlayer
|
import com.google.android.exoplayer2.SimpleExoPlayer
|
||||||
import com.google.android.exoplayer2.source.hls.HlsMediaSource
|
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.DataSource
|
||||||
import com.google.android.exoplayer2.upstream.DefaultDataSourceFactory
|
import com.google.android.exoplayer2.upstream.DefaultDataSourceFactory
|
||||||
import com.google.android.exoplayer2.util.Util
|
import com.google.android.exoplayer2.util.Util
|
||||||
|
@ -23,6 +24,7 @@ class PlayerActivity : AppCompatActivity() {
|
||||||
|
|
||||||
private lateinit var player: SimpleExoPlayer
|
private lateinit var player: SimpleExoPlayer
|
||||||
private lateinit var dataSourceFactory: DataSource.Factory
|
private lateinit var dataSourceFactory: DataSource.Factory
|
||||||
|
private lateinit var controller: StyledPlayerControlView
|
||||||
|
|
||||||
private var streamUrl = ""
|
private var streamUrl = ""
|
||||||
|
|
||||||
|
@ -96,6 +98,7 @@ class PlayerActivity : AppCompatActivity() {
|
||||||
|
|
||||||
player = SimpleExoPlayer.Builder(this).build()
|
player = SimpleExoPlayer.Builder(this).build()
|
||||||
dataSourceFactory = DefaultDataSourceFactory(this, Util.getUserAgent(this, "Teapod"))
|
dataSourceFactory = DefaultDataSourceFactory(this, Util.getUserAgent(this, "Teapod"))
|
||||||
|
controller = video_view.findViewById<StyledPlayerControlView>(R.id.exo_controller)
|
||||||
|
|
||||||
val mediaSource = HlsMediaSource.Factory(dataSourceFactory)
|
val mediaSource = HlsMediaSource.Factory(dataSourceFactory)
|
||||||
.createMediaSource(MediaItem.fromUri(Uri.parse(streamUrl)))
|
.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
|
// when the player controls get hidden, hide the bars too
|
||||||
video_view.setControllerVisibilityListener {
|
video_view.setControllerVisibilityListener {
|
||||||
if (it == View.GONE) hideBars()
|
if (it == View.GONE) hideBars()
|
||||||
|
|
|
@ -71,7 +71,7 @@
|
||||||
app:layout_constraintTop_toTopOf="parent" />
|
app:layout_constraintTop_toTopOf="parent" />
|
||||||
|
|
||||||
<View
|
<View
|
||||||
android:id="@id/exo_progress_placeholder"
|
android:id="@+id/exo_progress_placeholder"
|
||||||
android:layout_width="0dp"
|
android:layout_width="0dp"
|
||||||
android:layout_height="@dimen/exo_styled_progress_layout_height"
|
android:layout_height="@dimen/exo_styled_progress_layout_height"
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
|
|
Loading…
Reference in New Issue