don't toast when livestream

This commit is contained in:
Bnyro 2022-11-05 19:10:48 +01:00
parent 9795f9846f
commit 74c0fe85e2

View File

@ -863,20 +863,16 @@ class PlayerFragment : BaseFragment(), OnlinePlayerOptions {
}
})
// check if livestream
if (response.duration > 0) {
// download clicked
binding.relPlayerDownload.setOnClickListener {
if (!DownloadService.IS_DOWNLOAD_RUNNING) {
val newFragment = DownloadDialog(videoId!!)
newFragment.show(childFragmentManager, DownloadDialog::class.java.name)
} else {
Toast.makeText(context, R.string.dlisinprogress, Toast.LENGTH_SHORT)
.show()
}
binding.relPlayerDownload.setOnClickListener {
if (response.duration <= 0) {
Toast.makeText(context, R.string.cannotDownload, Toast.LENGTH_SHORT).show()
} else if (!DownloadService.IS_DOWNLOAD_RUNNING) {
val newFragment = DownloadDialog(videoId!!)
newFragment.show(childFragmentManager, DownloadDialog::class.java.name)
} else {
Toast.makeText(context, R.string.dlisinprogress, Toast.LENGTH_SHORT)
.show()
}
} else {
Toast.makeText(context, R.string.cannotDownload, Toast.LENGTH_SHORT).show()
}
if (response.hls != null) {