diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml
index 39533e909..902c6bbdc 100644
--- a/app/src/main/AndroidManifest.xml
+++ b/app/src/main/AndroidManifest.xml
@@ -36,6 +36,7 @@
+
handleMPVPlayer(resultCode, intent)
Constants.MX_PLAYER_RESULT_ACTION -> handleMXPlayer(resultCode, intent)
Constants.VLC_PLAYER_RESULT_ACTION -> handleVLCPlayer(resultCode, intent)
+ Constants.MPVKT_PLAYER_RESULT_ACTION -> handleMPVKTPlayer(resultCode, intent)
else -> {
if (action != null && resultCode != Activity.RESULT_CANCELED) {
Timber.d("Unknown action $action [resultCode=$resultCode]")
@@ -289,6 +290,29 @@ class ExternalPlayer(
}
}
+ private fun handleMPVKTPlayer(resultCode: Int, data: Intent) {
+ val player = "mpvKt Player"
+ when (resultCode) {
+ Activity.RESULT_OK -> {
+ val position = data.getIntExtra("position", 0)
+ if (position > 0) {
+ Timber.d("Playback stopped [player=$player, position=$position]")
+ notifyEvent(Constants.EVENT_TIME_UPDATE, "$position")
+ notifyEvent(Constants.EVENT_ENDED)
+ } else {
+ Timber.d("Playback completed [player=$player]")
+ notifyEvent(Constants.EVENT_TIME_UPDATE)
+ notifyEvent(Constants.EVENT_ENDED)
+ }
+ }
+ else -> {
+ Timber.d("Invalid state [player=$player, resultCode=$resultCode]")
+ notifyEvent(Constants.EVENT_CANCELED)
+ context.toast(R.string.external_player_unknown_error, Toast.LENGTH_LONG)
+ }
+ }
+ }
+
/**
* To ensure that the correct activity is called.
*/
@@ -303,6 +327,9 @@ class ExternalPlayer(
ExternalPlayerPackage.VLC_PLAYER -> {
ComponentName(packageName, "$packageName.StartActivity")
}
+ ExternalPlayerPackage.MPVKT_PLAYER -> {
+ ComponentName(packageName, "$packageName.ui.player.PlayerActivity")
+ }
else -> null
}
}
diff --git a/app/src/main/java/org/jellyfin/mobile/settings/ExternalPlayerPackage.java b/app/src/main/java/org/jellyfin/mobile/settings/ExternalPlayerPackage.java
index a1c475815..38c16d0c5 100644
--- a/app/src/main/java/org/jellyfin/mobile/settings/ExternalPlayerPackage.java
+++ b/app/src/main/java/org/jellyfin/mobile/settings/ExternalPlayerPackage.java
@@ -8,6 +8,7 @@
ExternalPlayerPackage.MX_PLAYER_FREE,
ExternalPlayerPackage.MX_PLAYER_PRO,
ExternalPlayerPackage.VLC_PLAYER,
+ ExternalPlayerPackage.MPVKT_PLAYER,
ExternalPlayerPackage.SYSTEM_DEFAULT
})
public @interface ExternalPlayerPackage {
@@ -15,5 +16,6 @@
String MX_PLAYER_FREE = "com.mxtech.videoplayer.ad";
String MX_PLAYER_PRO = "com.mxtech.videoplayer.pro";
String VLC_PLAYER = "org.videolan.vlc";
+ String MPVKT_PLAYER = "live.mehiz.mpvkt";
String SYSTEM_DEFAULT = "~system~";
}
diff --git a/app/src/main/java/org/jellyfin/mobile/settings/SettingsFragment.kt b/app/src/main/java/org/jellyfin/mobile/settings/SettingsFragment.kt
index 3df148885..7b4d0b4f4 100644
--- a/app/src/main/java/org/jellyfin/mobile/settings/SettingsFragment.kt
+++ b/app/src/main/java/org/jellyfin/mobile/settings/SettingsFragment.kt
@@ -168,6 +168,11 @@ class SettingsFragment : Fragment(), BackPressInterceptor {
R.string.external_player_vlc_player,
R.string.external_player_vlc_player_description,
),
+ SelectionItem(
+ ExternalPlayerPackage.MPVKT_PLAYER,
+ R.string.external_player_mpvkt,
+ R.string.external_player_mpvkt_description,
+ ),
).filter { item ->
item.key == ExternalPlayerPackage.SYSTEM_DEFAULT || packageManager.isPackageInstalled(item.key)
}
diff --git a/app/src/main/java/org/jellyfin/mobile/utils/Constants.kt b/app/src/main/java/org/jellyfin/mobile/utils/Constants.kt
index 57158181c..599304618 100644
--- a/app/src/main/java/org/jellyfin/mobile/utils/Constants.kt
+++ b/app/src/main/java/org/jellyfin/mobile/utils/Constants.kt
@@ -133,6 +133,7 @@ object Constants {
const val MPV_PLAYER_RESULT_ACTION = "is.xyz.mpv.MPVActivity.result"
const val MX_PLAYER_RESULT_ACTION = "com.mxtech.intent.result.VIEW"
const val VLC_PLAYER_RESULT_ACTION = "org.videolan.vlc.player.result"
+ const val MPVKT_PLAYER_RESULT_ACTION = "live.mehiz.mpvkt.ui.player.PlayerActivity.result"
// External player webapp events
const val EVENT_ENDED = "Ended"
diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml
index 330a048d8..1e4052ccc 100644
--- a/app/src/main/res/values/strings.xml
+++ b/app/src/main/res/values/strings.xml
@@ -111,6 +111,8 @@
The paid version of MX Player which provides an uninterrupted video experience.
VLC Player
Free and open source cross-platform multimedia player that plays most multimedia files.
+ mpvKt Player
+ A media player based on mpv-android aiming to provide a nicer user interface over the original.
System default
Let the system handle the player choice, some players may not be fully compatible.