Hide video preview on error

This commit is contained in:
Naveen Singh 2024-09-27 22:39:05 +05:30
parent fafd6343d9
commit 43eff348e6
No known key found for this signature in database
GPG key ID: AF5D43C216778C0B

View file

@ -450,6 +450,7 @@ class VideoFragment : ViewPagerFragment(), TextureView.SurfaceTextureListener, S
override fun onPlayerErrorChanged(error: PlaybackException?) { override fun onPlayerErrorChanged(error: PlaybackException?) {
binding.errorMessageHolder.errorMessage.apply { binding.errorMessageHolder.errorMessage.apply {
if (error != null) { if (error != null) {
binding.videoPreview.beGone()
binding.videoPlayOutline.beGone() binding.videoPlayOutline.beGone()
text = error.localizedMessage ?: getString(R.string.failed_to_load_media) text = error.localizedMessage ?: getString(R.string.failed_to_load_media)
setTextColor(if (context.config.blackBackground) Color.WHITE else context.getProperTextColor()) setTextColor(if (context.config.blackBackground) Color.WHITE else context.getProperTextColor())