diff --git a/app/src/main/java/com/futo/platformplayer/fragment/mainactivity/main/ContentFeedView.kt b/app/src/main/java/com/futo/platformplayer/fragment/mainactivity/main/ContentFeedView.kt index bccbe8d5da068b6456790417fe6397e2630810a8..da6329cc689a85119c1687e283bd868f13c661e6 100644 --- a/app/src/main/java/com/futo/platformplayer/fragment/mainactivity/main/ContentFeedView.kt +++ b/app/src/main/java/com/futo/platformplayer/fragment/mainactivity/main/ContentFeedView.kt @@ -166,11 +166,14 @@ abstract class ContentFeedView<TFragment> : FeedView<TFragment, IPlatformContent protected open fun onContentClicked(content: IPlatformContent, time: Long) { if(content is IPlatformVideo) { - StatePlayer.instance.clearQueue(); - if (Settings.instance.playback.shouldResumePreview(time)) - fragment.navigate<VideoDetailFragment>(content.withTimestamp(time)).maximizeVideoDetail(); - else - fragment.navigate<VideoDetailFragment>(content).maximizeVideoDetail(); + if (StatePlayer.instance.hasQueue) { + StatePlayer.instance.addToQueue(content) + } else { + if (Settings.instance.playback.shouldResumePreview(time)) + fragment.navigate<VideoDetailFragment>(content.withTimestamp(time)).maximizeVideoDetail(); + else + fragment.navigate<VideoDetailFragment>(content).maximizeVideoDetail(); + } } else if (content is IPlatformPlaylist) { fragment.navigate<PlaylistFragment>(content); } else if (content is IPlatformPost) { diff --git a/app/src/main/java/com/futo/platformplayer/states/StatePlayer.kt b/app/src/main/java/com/futo/platformplayer/states/StatePlayer.kt index 028c5b6084d5d30f87e334692d7cde29ea069e5b..54991ed3e573bbabbe63b82884ab67716af26cdf 100644 --- a/app/src/main/java/com/futo/platformplayer/states/StatePlayer.kt +++ b/app/src/main/java/com/futo/platformplayer/states/StatePlayer.kt @@ -54,6 +54,12 @@ class StatePlayer { var queueShuffle: Boolean = false private set; + val hasQueue: Boolean get() { + synchronized(_queue) { + return _queue.isNotEmpty() + } + } + val queueName: String get() = _queueName ?: _queueType; //Events