hide stub view when player ready

Signed-off-by: parneet-guraya <gurayaparneet@gmail.com>
This commit is contained in:
parneet-guraya 2024-09-01 21:58:45 +05:30
parent fbb51b0935
commit f02a997ed0
No known key found for this signature in database
GPG key ID: 63B807C4B2A9064B

View file

@ -259,7 +259,7 @@ class PreviewMediaActivity :
binding.emptyView.emptyListView.visibility = View.VISIBLE
}
private fun setVideoErrorMessage(headline: String, @StringRes message: Int) {
private fun setErrorMessage(headline: String, @StringRes message: Int) {
binding.emptyView.run {
emptyListViewHeadline.text = headline
emptyListViewText.setText(message)
@ -401,6 +401,7 @@ class PreviewMediaActivity :
override fun onPlaybackStateChanged(playbackState: Int) {
if (playbackState == Player.STATE_READY) {
hideProgressLayout()
binding.emptyView.emptyListView.visibility = View.GONE
}
}
@ -720,7 +721,7 @@ class PreviewMediaActivity :
}
} else {
emptyListView?.visibility = View.VISIBLE
setVideoErrorMessage(
setErrorMessage(
weakReference.getString(R.string.stream_not_possible_headline),
R.string.stream_not_possible_message
)