diff --git a/.github/ISSUE_TEMPLATE/1_bug_report.md b/.github/ISSUE_TEMPLATE/1_bug_report.md index 0e3d28227..79044deb0 100644 --- a/.github/ISSUE_TEMPLATE/1_bug_report.md +++ b/.github/ISSUE_TEMPLATE/1_bug_report.md @@ -28,7 +28,7 @@ The Android SDK includes a tool named [`logcat`](https://developer.android.com/s You will need a computer to view these logs. Logs pertaining to mpv can be collected like this: - adb logcat -s 'mpv:*' '*:F' + adb logcat -s mpv '*:F' You can attach text files on Github directly or use sites like https://0x0.st/ to upload your logs. Depending on the nature of the bug, a log file might not be required and you can *omit this section*. If in doubt provide one, it will help us find possible issues later. diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 4e20d7cb9..000000000 --- a/.travis.yml +++ /dev/null @@ -1,34 +0,0 @@ -language: generic -os: linux -dist: jammy -notifications: - email: false - -addons: - apt: - packages: - - autoconf - - pkg-config - - libtool - - ninja-build - - python3-pip - - python3-setuptools - - openjdk-17-jdk-headless - -env: - global: - - JAVA_HOME: '/usr/lib/jvm/java-17-openjdk-amd64' - -before_install: - - sudo pip3 install meson - - CACHE_MODE=github buildscripts/.travis.sh install -script: - - buildscripts/.travis.sh build - -before_cache: - - find $HOME/.gradle/caches -maxdepth 3 -name '*.lock' -delete - - rm -rf $HOME/.gradle/caches/journal-1/ -cache: - directories: - - $HOME/.gradle/caches/ - - $HOME/.gradle/wrapper/ diff --git a/README.md b/README.md index 1bff59181..b68e89b73 100644 --- a/README.md +++ b/README.md @@ -12,13 +12,17 @@ mpv-android is a video player for Android based on [libmpv](https://github.com/m * Gesture-based seeking, volume/brightness control and more * libass support for styled subtitles * Secondary (or dual) subtitle support -* Advanced video settings (interpolation, debanding, scalers, ...) +* High-quality rendering with advanced settings (scalers, debanding, interpolation, ...) * Play network streams with the "Open URL" function * Background playback, Picture-in-Picture, keyboard input supported -Note that mpv-android is *not* a library you can embed into your app, but you can look here for inspiration. -The important parts are [`MPVLib`](app/src/main/java/is/xyz/mpv/MPVLib.java), [`MPVView`](app/src/main/java/is/xyz/mpv/MPVView.kt) and the [native code](app/src/main/jni/). -libmpv/ffmpeg is built by [these scripts](buildscripts/). +### Library? + +mpv-android is **not** a library/module (AAR) you can import into your app. + +If you'd like to use libmpv in your app you can use our code as inspiration. +The important parts are [`MPVLib`](app/src/main/java/is/xyz/mpv/MPVLib.java), [`BaseMPVView`](app/src/main/java/is/xyz/mpv/BaseMPVView.kt) and the [native code](app/src/main/jni/). +Native code is built by [these scripts](buildscripts/). ## Downloads @@ -28,6 +32,10 @@ You can download mpv-android from the [Releases section](https://github.com/mpv- [Get it on F-Droid](https://f-droid.org/packages/is.xyz.mpv) +**Note**: Android TV is supported, but only available on F-Droid or by installing the APK manually. + ## Building from source -Take a look at [README.md](buildscripts/README.md) inside the `buildscripts` directory. +Take a look at the [README](buildscripts/README.md) inside the `buildscripts` directory. + +Some other documentation can be found at this [link](http://mpv-android.github.io/mpv-android/). diff --git a/app/build.gradle b/app/build.gradle index 5efd73cf1..8febad07f 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -11,9 +11,9 @@ android { defaultConfig { minSdkVersion 21 - targetSdkVersion 33 - versionCode 35 - versionName "1.15.n" + targetSdkVersion 34 + versionCode 40 + versionName "1.16.n" vectorDrawables.useSupportLibrary = true } @@ -69,13 +69,13 @@ android { dependencies { implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version" - implementation 'androidx.appcompat:appcompat:1.6.1' + implementation 'androidx.appcompat:appcompat:1.7.0' implementation 'androidx.recyclerview:recyclerview:1.3.2' implementation 'androidx.media:media:1.7.0' } def getVersionName = { -> - return "1.15.n" + return "1.16.n" } def getGroupId = { -> diff --git a/app/src/debug/AndroidManifest.xml b/app/src/debug/AndroidManifest.xml new file mode 100644 index 000000000..56ab76932 --- /dev/null +++ b/app/src/debug/AndroidManifest.xml @@ -0,0 +1,9 @@ + + + + + diff --git a/app/src/debug/java/is/xyz/mpv/IntentTestActivity.kt b/app/src/debug/java/is/xyz/mpv/IntentTestActivity.kt new file mode 100644 index 000000000..2d4686c91 --- /dev/null +++ b/app/src/debug/java/is/xyz/mpv/IntentTestActivity.kt @@ -0,0 +1,71 @@ +package `is`.xyz.mpv + +import android.content.Intent +import android.net.Uri +import android.os.Bundle +import android.util.Base64 +import androidx.activity.result.ActivityResult +import androidx.activity.result.contract.ActivityResultContracts +import androidx.appcompat.app.AppCompatActivity +import `is`.xyz.mpv.databinding.ActivityIntentTestBinding + +class IntentTestActivity : AppCompatActivity() { + private lateinit var binding: ActivityIntentTestBinding + + private val callback = registerForActivityResult(ActivityResultContracts.StartActivityForResult()) { + updateText("resultCode: ${ActivityResult.resultCodeToString(it.resultCode)}\n") + val intent = it.data + if (intent != null) { + updateText("action: ${intent.action}\ndata: ${intent.data?.toString()}\n") + val extras = intent.extras + if (extras != null) { + for (key in extras.keySet()) { + val v = extras.get(key) + updateText("extras[$key] = $v\n") + } + } + } + } + + private var text = "" + + private fun updateText(append: String) { + text += append + runOnUiThread { + binding.info.text = this.text + } + } + + override fun onCreate(savedInstanceState: Bundle?) { + super.onCreate(savedInstanceState) + binding = ActivityIntentTestBinding.inflate(layoutInflater) + setContentView(binding.root) + + binding.button.setOnClickListener { + val uri = Uri.parse(binding.editText1.text.toString()) + if (uri.scheme.isNullOrEmpty()) + return@setOnClickListener + + val intent = Intent(Intent.ACTION_VIEW) + intent.setDataAndType(uri, "video/any") + intent.setPackage(packageName) + if (binding.switch1.isChecked) { + val subMime = "application/x-subrip" + val subData = "1\n00:00:00,000 --> 00:00:10,000\nHello World\n\n" + val subUri = Uri.parse("data:${subMime};base64," + Base64.encodeToString(subData.toByteArray(), Base64.NO_WRAP)) + intent.putExtra("subs", arrayOf(subUri)) + intent.putExtra("subs.enable", arrayOf(subUri)) + } + if (binding.switch2.isChecked) + intent.putExtra("decode_mode", 2.toByte()) + if (binding.switch3.isChecked) + intent.putExtra("title", "example text") + if (binding.seekBar2.progress > 0) + intent.putExtra("position", binding.seekBar2.progress * 1000) + callback.launch(intent) + + text = "" + updateText("launched!\n") + } + } +} diff --git a/app/src/debug/res/layout/activity_intent_test.xml b/app/src/debug/res/layout/activity_intent_test.xml new file mode 100644 index 000000000..9b8d1fb2a --- /dev/null +++ b/app/src/debug/res/layout/activity_intent_test.xml @@ -0,0 +1,90 @@ + + + + + + + + + +