From 1690507a18cec2d63b3cacbb33779020e791e8bf Mon Sep 17 00:00:00 2001 From: Thomas Date: Sat, 5 Dec 2020 18:48:41 +0100 Subject: [PATCH] Issue #123 - a small fix --- .../java/app/fedilab/fedilabtube/PeertubeActivity.java | 8 +++++--- 1 file changed, 5 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 ada390f..38db5e8 100644 --- a/app/src/main/java/app/fedilab/fedilabtube/PeertubeActivity.java +++ b/app/src/main/java/app/fedilab/fedilabtube/PeertubeActivity.java @@ -763,6 +763,11 @@ public class PeertubeActivity extends AppCompatActivity implements CommentListAd binding.doubleTapPlayerView.setVisibility(View.GONE); binding.castController.setVisibility(View.VISIBLE); dialog.dismiss(); + if (chromeCastVideoURL != null) { + if (player != null && player.getCurrentPosition() > 0) { + chromeCastVideoURL += "?start=" + (player.getCurrentPosition() / 1000); + } + } }; mainHandler.post(myRunnable); if (!chromeCast.isConnected()) { @@ -776,9 +781,6 @@ public class PeertubeActivity extends AppCompatActivity implements CommentListAd } if (chromeCastVideoURL != null) { - if (player != null && player.getCurrentPosition() > 0) { - chromeCastVideoURL += "?start=" + (player.getCurrentPosition() / 1000); - } String mime = MimeTypeMap.getFileExtensionFromUrl(chromeCastVideoURL); chromeCast.setRequestTimeout(120000); chromeCast.load(peertube.getTitle(), null, chromeCastVideoURL, mime);