From 7a2f97de6d39b398641ad89fa9f3a9609aceac1b Mon Sep 17 00:00:00 2001 From: Bnyro Date: Tue, 28 Mar 2023 18:17:12 +0200 Subject: [PATCH] Support sharing live links to LibreTube --- app/src/main/AndroidManifest.xml | 1 + .../java/com/github/libretube/ui/activities/RouterActivity.kt | 4 +++- .../java/com/github/libretube/ui/fragments/PlayerFragment.kt | 2 +- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index 90abb0683..f8b8b41fb 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -264,6 +264,7 @@ + diff --git a/app/src/main/java/com/github/libretube/ui/activities/RouterActivity.kt b/app/src/main/java/com/github/libretube/ui/activities/RouterActivity.kt index 4be8801e7..7c77654fb 100644 --- a/app/src/main/java/com/github/libretube/ui/activities/RouterActivity.kt +++ b/app/src/main/java/com/github/libretube/ui/activities/RouterActivity.kt @@ -51,12 +51,14 @@ class RouterActivity : BaseActivity() { } uri.path!!.contains("/shorts/") || uri.path!!.contains("/embed/") || - uri.path!!.contains("/v/") + uri.path!!.contains("/v/") || + uri.path!!.contains("/live/") -> { val videoId = uri.path!! .replace("/shorts/", "") .replace("/v/", "") .replace("/embed/", "") + .replace("/live/", "") intent.putExtra(IntentData.videoId, videoId) } diff --git a/app/src/main/java/com/github/libretube/ui/fragments/PlayerFragment.kt b/app/src/main/java/com/github/libretube/ui/fragments/PlayerFragment.kt index 9911351c0..99d323a6f 100644 --- a/app/src/main/java/com/github/libretube/ui/fragments/PlayerFragment.kt +++ b/app/src/main/java/com/github/libretube/ui/fragments/PlayerFragment.kt @@ -334,7 +334,7 @@ class PlayerFragment : Fragment(), OnlinePlayerOptions { if (PlayerHelper.swipeGestureEnabled) { binding.playerMotionLayout.addSwipeUpListener { - if(this::streams.isInitialized) { + if (this::streams.isInitialized) { binding.player.hideController() setFullscreen() }