mirror of
https://github.com/jellyfin/jellyfin-android.git
synced 2026-09-03 05:10:27 +03:00
Add selectServer function to native shell (#235)
Fixes server selection in 10.7+
This commit is contained in:
@@ -52,6 +52,10 @@ window.NativeShell = {
|
||||
window.NativeInterface.openClientSettings();
|
||||
},
|
||||
|
||||
selectServer() {
|
||||
window.NativeInterface.openServerSelection();
|
||||
},
|
||||
|
||||
getPlugins() {
|
||||
return ["native/exoplayer", "native/externalplayer"];
|
||||
},
|
||||
|
||||
@@ -10,6 +10,7 @@ import android.webkit.JavascriptInterface
|
||||
import kotlinx.coroutines.Dispatchers
|
||||
import kotlinx.coroutines.runBlocking
|
||||
import org.jellyfin.apiclient.interaction.AndroidDevice
|
||||
import org.jellyfin.mobile.fragment.ConnectFragment
|
||||
import org.jellyfin.mobile.fragment.WebViewFragment
|
||||
import org.jellyfin.mobile.settings.SettingsFragment
|
||||
import org.jellyfin.mobile.utils.*
|
||||
@@ -160,6 +161,11 @@ class NativeInterface(private val fragment: WebViewFragment) : KoinComponent {
|
||||
fragment.parentFragmentManager.addFragment<SettingsFragment>()
|
||||
}
|
||||
|
||||
@JavascriptInterface
|
||||
fun openServerSelection() {
|
||||
fragment.parentFragmentManager.addFragment<ConnectFragment>()
|
||||
}
|
||||
|
||||
@JavascriptInterface
|
||||
fun exitApp() {
|
||||
val activity = fragment.requireMainActivity()
|
||||
|
||||
Reference in New Issue
Block a user