From 4dc7bb337194863ce7fd067323817d0db2e9ac33 Mon Sep 17 00:00:00 2001 From: rimthekid Date: Sun, 6 Feb 2022 20:21:37 +0400 Subject: [PATCH] Play audio in background --- app/src/main/java/com/github/libretube/PipedApi.kt | 1 - app/src/main/java/com/github/libretube/PlayerFragment.kt | 7 ++++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/com/github/libretube/PipedApi.kt b/app/src/main/java/com/github/libretube/PipedApi.kt index f1503e769..294ca1627 100644 --- a/app/src/main/java/com/github/libretube/PipedApi.kt +++ b/app/src/main/java/com/github/libretube/PipedApi.kt @@ -46,5 +46,4 @@ interface PipedApi { @GET("subscriptions") suspend fun subscriptions(@Header("Authorization") token: String): List - } \ No newline at end of file diff --git a/app/src/main/java/com/github/libretube/PlayerFragment.kt b/app/src/main/java/com/github/libretube/PlayerFragment.kt index 9129d19ca..a5a08f0d6 100644 --- a/app/src/main/java/com/github/libretube/PlayerFragment.kt +++ b/app/src/main/java/com/github/libretube/PlayerFragment.kt @@ -229,10 +229,15 @@ class PlayerFragment : Fragment() { override fun onStop() { super.onStop() + + + } + + override fun onDestroy() { + super.onDestroy() try { exoPlayer.stop() }catch (e: Exception){} - } private fun fetchJson(view: View) {