From 14efbdd08fcb13fb80d094c3bedb442898d4d8b8 Mon Sep 17 00:00:00 2001 From: Thomas Date: Sat, 21 Nov 2020 18:54:54 +0100 Subject: [PATCH] Some fixes --- .../main/java/app/fedilab/fedilabtube/PeertubeActivity.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/src/main/java/app/fedilab/fedilabtube/PeertubeActivity.java b/app/src/main/java/app/fedilab/fedilabtube/PeertubeActivity.java index c3af373..450be58 100644 --- a/app/src/main/java/app/fedilab/fedilabtube/PeertubeActivity.java +++ b/app/src/main/java/app/fedilab/fedilabtube/PeertubeActivity.java @@ -560,8 +560,8 @@ public class PeertubeActivity extends AppCompatActivity implements CommentListAd userHistory.setCurrentTime(totalSeconds * 1000); peertube.setUserHistory(userHistory); } - SearchVM viewModelSearch = new ViewModelProvider(PeertubeActivity.this).get(SearchVM.class); - viewModelSearch.getVideos("0", peertube.getEmbedUrl()).observe(PeertubeActivity.this, this::manageVIewVideos); + TimelineVM viewModelTimeline = new ViewModelProvider(PeertubeActivity.this).get(TimelineVM.class); + viewModelTimeline.getVideo(peertubeInstance, peertube.getUuid(), false).observe(PeertubeActivity.this, this::manageVIewVideo); } else { Helper.forwardToAnotherApp(PeertubeActivity.this, intent); finish(); @@ -719,7 +719,7 @@ public class PeertubeActivity extends AppCompatActivity implements CommentListAd i++; } nextVideo = apiResponse.getPeertubes().get(i); - if (!playedVideos.contains(nextVideo.getId()) && player != null) { + if (!playedVideos.contains(nextVideo.getId()) && player != null && nextVideo.getFileUrl(null, PeertubeActivity.this) != null) { MediaItem mediaItem = new MediaItem.Builder().setUri(Uri.parse(nextVideo.getFileUrl(null, PeertubeActivity.this))).build(); player.addMediaItem(mediaItem); }