mirror of
https://github.com/SimpleMobileTools/Simple-Gallery.git
synced 2025-06-05 21:59:19 +02:00
automatically hide system UI at videoplayer activity, if desired
This commit is contained in:
@ -163,6 +163,12 @@ open class VideoPlayerActivity : SimpleActivity(), SeekBar.OnSeekBarChangeListen
|
|||||||
video_brightness_controller.beGone()
|
video_brightness_controller.beGone()
|
||||||
video_volume_controller.beGone()
|
video_volume_controller.beGone()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (config.hideSystemUI) {
|
||||||
|
Handler().postDelayed({
|
||||||
|
fullscreenToggled(true)
|
||||||
|
}, 500)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun initExoPlayer() {
|
private fun initExoPlayer() {
|
||||||
@ -176,10 +182,11 @@ open class VideoPlayerActivity : SimpleActivity(), SeekBar.OnSeekBarChangeListen
|
|||||||
|
|
||||||
val factory = DataSource.Factory { fileDataSource }
|
val factory = DataSource.Factory { fileDataSource }
|
||||||
val audioSource = ExtractorMediaSource(fileDataSource.uri, factory, DefaultExtractorsFactory(), null, null)
|
val audioSource = ExtractorMediaSource(fileDataSource.uri, factory, DefaultExtractorsFactory(), null, null)
|
||||||
mExoPlayer = ExoPlayerFactory.newSimpleInstance(applicationContext)
|
mExoPlayer = ExoPlayerFactory.newSimpleInstance(applicationContext).apply {
|
||||||
mExoPlayer!!.seekParameters = SeekParameters.CLOSEST_SYNC
|
seekParameters = SeekParameters.CLOSEST_SYNC
|
||||||
mExoPlayer!!.audioStreamType = C.STREAM_TYPE_MUSIC
|
audioStreamType = C.STREAM_TYPE_MUSIC
|
||||||
mExoPlayer!!.prepare(audioSource)
|
prepare(audioSource)
|
||||||
|
}
|
||||||
initExoPlayerListeners()
|
initExoPlayerListeners()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user