mirror of
https://github.com/libre-tube/LibreTube.git
synced 2025-04-29 16:30:31 +05:30
Fix a crash when the queue is empty
This commit is contained in:
parent
fb21dd2543
commit
b5c6a27264
@ -757,15 +757,19 @@ class PlayerFragment : BaseFragment() {
|
|||||||
|
|
||||||
// used for autoplay and skipping to next video
|
// used for autoplay and skipping to next video
|
||||||
private fun playNextVideo() {
|
private fun playNextVideo() {
|
||||||
val nextVideo = PlayingQueue.getNext()
|
val nextVideoId = PlayingQueue.getNext()
|
||||||
// by making sure that the next and the current video aren't the same
|
// by making sure that the next and the current video aren't the same
|
||||||
saveWatchPosition()
|
saveWatchPosition()
|
||||||
// forces the comments to reload for the new video
|
|
||||||
commentsLoaded = false
|
|
||||||
binding.commentsRecView.adapter = null
|
|
||||||
// save the id of the next stream as videoId and load the next video
|
// save the id of the next stream as videoId and load the next video
|
||||||
videoId = nextVideo
|
if (nextVideoId != null) {
|
||||||
playVideo()
|
videoId = nextVideoId
|
||||||
|
|
||||||
|
// forces the comments to reload for the new video
|
||||||
|
commentsLoaded = false
|
||||||
|
binding.commentsRecView.adapter = null
|
||||||
|
playVideo()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun prepareExoPlayerView() {
|
private fun prepareExoPlayerView() {
|
||||||
|
@ -349,6 +349,7 @@
|
|||||||
<string name="time_code">Time code</string>
|
<string name="time_code">Time code</string>
|
||||||
<string name="added_to_playlist">Added to playlist</string>
|
<string name="added_to_playlist">Added to playlist</string>
|
||||||
<string name="playing_queue">Playing queue</string>
|
<string name="playing_queue">Playing queue</string>
|
||||||
|
<string name="queue">Queue</string>
|
||||||
|
|
||||||
<!-- Notification channel strings -->
|
<!-- Notification channel strings -->
|
||||||
<string name="download_channel_name">Download Service</string>
|
<string name="download_channel_name">Download Service</string>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user