mirror of
https://gitlab.futo.org/videostreaming/grayjay.git
synced 2025-04-20 03:24:50 +00:00
Offline playback toast now doesn't show more than once every 5 seconds.
This commit is contained in:
parent
9823337375
commit
ce66937429
1 changed files with 8 additions and 5 deletions
|
@ -1799,8 +1799,13 @@ class VideoDetailView : ConstraintLayout {
|
|||
private fun onSourceChanged(videoSource: IVideoSource?, audioSource: IAudioSource?, resume: Boolean){
|
||||
Logger.i(TAG, "onSourceChanged(videoSource=$videoSource, audioSource=$audioSource, resume=$resume)")
|
||||
|
||||
if((videoSource == null || videoSource is LocalVideoSource) && (audioSource == null || audioSource is LocalAudioSource))
|
||||
UIDialogs.toast(context, context.getString(R.string.offline_playback), false);
|
||||
if((videoSource == null || videoSource is LocalVideoSource) && (audioSource == null || audioSource is LocalAudioSource)) {
|
||||
Logger.i(TAG, "Time since last offline playback toast: " + (System.currentTimeMillis() - _lastOfflinePlaybackToastTime).toString())
|
||||
if (System.currentTimeMillis() - _lastOfflinePlaybackToastTime > 5000) {
|
||||
UIDialogs.toast(context, context.getString(R.string.offline_playback), false);
|
||||
_lastOfflinePlaybackToastTime = System.currentTimeMillis()
|
||||
}
|
||||
}
|
||||
//If LiveStream, set to end
|
||||
if(videoSource is IDashManifestSource || videoSource is IHLSManifestSource) {
|
||||
if (video?.isLive == true) {
|
||||
|
@ -3030,8 +3035,6 @@ class VideoDetailView : ConstraintLayout {
|
|||
const val TAG_MORE = "MORE";
|
||||
|
||||
private val _buttonPinStore = FragmentedStorage.get<StringArrayStorage>("videoPinnedButtons");
|
||||
|
||||
|
||||
|
||||
private var _lastOfflinePlaybackToastTime: Long = 0
|
||||
}
|
||||
}
|
Loading…
Add table
Reference in a new issue