Skip to content

Commit

Permalink
Merge branch 'upstream/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
jmir1 committed Dec 9, 2024
2 parents 148f8aa + 5dca6eb commit c27fb9c
Show file tree
Hide file tree
Showing 68 changed files with 1,111 additions and 578 deletions.
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/1_bug_report.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ on:

jobs:
build:
runs-on: ubuntu-latest
runs-on: ubuntu-24.04
strategy:
fail-fast: false
matrix:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ on:

jobs:
build:
runs-on: ubuntu-latest
runs-on: ubuntu-24.04

permissions:
contents: write
Expand Down
34 changes: 0 additions & 34 deletions .travis.yml

This file was deleted.

18 changes: 13 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -28,6 +32,10 @@ You can download mpv-android from the [Releases section](https://github.com/mpv-

[<img src="https://fdroid.gitlab.io/artwork/badge/get-it-on.png" alt="Get it on F-Droid" height="80">](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/).
10 changes: 5 additions & 5 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down Expand Up @@ -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 = { ->
Expand Down
9 changes: 9 additions & 0 deletions app/src/debug/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
<application>
<activity
android:name=".IntentTestActivity"
android:exported="false"
android:configChanges="orientation|screenSize"
android:theme="@style/FilePickerTheme" />
</application>
</manifest>
71 changes: 71 additions & 0 deletions app/src/debug/java/is/xyz/mpv/IntentTestActivity.kt
Original file line number Diff line number Diff line change
@@ -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")
}
}
}
90 changes: 90 additions & 0 deletions app/src/debug/res/layout/activity_intent_test.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
tools:ignore="HardcodedText"
android:id="@+id/main"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:padding="24dp">

<androidx.appcompat.widget.SwitchCompat
android:id="@+id/switch1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@id/row1"
android:text="subs data uri" />

<androidx.appcompat.widget.SwitchCompat
android:id="@+id/switch2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@id/switch1"
android:text="no hwdec" />

<androidx.appcompat.widget.SwitchCompat
android:id="@+id/switch3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@id/switch2"
android:text="force title" />

<Button
android:id="@+id/button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@id/row2"
android:text="Launch" />

<TextView
android:id="@+id/info"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@id/button"
android:fontFamily="monospace"
android:scrollbars="vertical"
android:scrollHorizontally="true" />

<LinearLayout
android:id="@+id/row2"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@id/switch3"
android:orientation="horizontal">

<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:labelFor="@id/editText1"
android:text="offset:" />

<SeekBar
android:id="@+id/seekBar2"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:max="30"
android:progress="0" />

</LinearLayout>

<LinearLayout
android:id="@+id/row1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">

<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:labelFor="@id/editText1"
android:text="URL:" />

<EditText
android:id="@+id/editText1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:autofillHints=""
android:inputType="textUri" />

</LinearLayout>

</RelativeLayout>
1 change: 1 addition & 0 deletions app/src/debug/res/values/strings.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<resources></resources>
4 changes: 2 additions & 2 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
android:versionCode="33"
android:versionName="1.15.n" >
android:versionCode="40"
android:versionName="1.16.n" >
<application/>
</manifest>
51 changes: 19 additions & 32 deletions app/src/main/assets/cacert.pem
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
##
## Bundle of CA Root Certificates
##
## Certificate data from Mozilla as of: Mon Mar 11 15:25:27 2024 GMT
## Certificate data from Mozilla as of: Tue Jul 2 03:12:04 2024 GMT
##
## This is a bundle of X.509 certificates of public Certificate Authorities
## (CA). These were automatically extracted from Mozilla's root certificates
Expand All @@ -14,7 +14,7 @@
## Just configure this file as the SSLCACertificateFile.
##
## Conversion done with mk-ca-bundle.pl version 1.29.
## SHA256: 4d96bd539f4719e9ace493757afbe4a23ee8579de1c97fbebc50bba3c12e8c1e
## SHA256: 456ff095dde6dd73354c5c28c73d9c06f53b61a803963414cb91a1d92945cdd3
##


Expand Down Expand Up @@ -2600,36 +2600,6 @@ vLtoURMMA/cVi4RguYv/Uo7njLwcAjA8+RHUjE7AwWHCFUyqqx0LMV87HOIAl0Qx5v5zli/altP+
CAezNIm8BZ/3Hobui3A=
-----END CERTIFICATE-----

GLOBALTRUST 2020
================
-----BEGIN CERTIFICATE-----
MIIFgjCCA2qgAwIBAgILWku9WvtPilv6ZeUwDQYJKoZIhvcNAQELBQAwTTELMAkGA1UEBhMCQVQx
IzAhBgNVBAoTGmUtY29tbWVyY2UgbW9uaXRvcmluZyBHbWJIMRkwFwYDVQQDExBHTE9CQUxUUlVT
VCAyMDIwMB4XDTIwMDIxMDAwMDAw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OpFaWEhCGVrqXctJUMHytGdUdaG/7FELYjQ7ztdGl4wJCXtzoRlgHNQIw
4Lx0SsFDKv/bGtCwr2zD/cuz9X9tAy5ZVp0tLTWMstZDFyySCstd6IwPS3BD0IL/qMy/pJTAvoe9
iuOTe8aPmxadJ2W8esVCgmxcB9CpwYhgROmYhRZf+I/KARDOJcP5YBugxZfD0yyIMaK9MOzQ0MAS
8cE54+X1+NZK3TTN+2/BT+MAi1bikvcoskJ3ciNnxz8RFbLEAwW+uxF7Cr+obuf/WEPPm2eggAe2
HcqtbepBEX4tdJP7wry+UUTF72glJ4DjyKDUEuzZpTcdN3y0kcra1LGWge9oXHYQSa9+pTeAsRxS
vTOBTI/53WXZFM2KJVj04sWDpQmQ1GwUY7VA3+vA/MRYfg0UFodUJ25W5HCEuGwyEn6CMUO+1918
oa2u1qsgEu8KwxCMSZY13At1XrFP1U80DhEgB3VDRemjEdqso5nCtnkn4rnvyOL2NSl6dPrFf4IF
YqYK6miyeUcGbvJXqBUzxvd4Sj1Ce2t+/vdG6tHrju+IaFvowdlxfv1k7/9nR4hYJS8+hge9+6jl
gqispdNpQ80xiEmEU5LAsTkbOYMBMMTyqfrQA71yN2BWHzZ8vTmR9W0Nv3vXkg==
-----END CERTIFICATE-----

ANF Secure Server Root CA
=========================
-----BEGIN CERTIFICATE-----
Expand Down Expand Up @@ -3579,3 +3549,20 @@ wPfc5+pbrrLMtTWGS9DiP7bY+A4A7l3j941Y/8+LN+ljX273CXE2whJdV/LItM3z7gLfEdxquVeE
HVlNjM7IDiPCtyaaEBRx/pOyiriA8A4QntOoUAw3gi/q4Iqd4Sw5/7W0cwDk90imc6y/st53BIe0
o82bNSQ3+pCTE4FCxpgmdTdmQRCsu/WU48IxK63nI1bMNSWSs1A=
-----END CERTIFICATE-----

FIRMAPROFESIONAL CA ROOT-A WEB
==============================
-----BEGIN CERTIFICATE-----
MIICejCCAgCgAwIBAgIQMZch7a+JQn81QYehZ1ZMbTAKBggqhkjOPQQDAzBuMQswCQYDVQQGEwJF
UzEcMBoGA1UECgwTRmlybWFwcm9mZXNpb25hbCBTQTEYMBYGA1UEYQwPVkFURVMtQTYyNjM0MDY4
MScwJQYDVQQDDB5GSVJNQVBST0ZFU0lPTkFMIENBIFJPT1QtQSBXRUIwHhcNMjIwNDA2MDkwMTM2
WhcNNDcwMzMxMDkwMTM2WjBuMQswCQYDVQQGEwJFUzEcMBoGA1UECgwTRmlybWFwcm9mZXNpb25h
bCBTQTEYMBYGA1UEYQwPVkFURVMtQTYyNjM0MDY4MScwJQYDVQQDDB5GSVJNQVBST0ZFU0lPTkFM
IENBIFJPT1QtQSBXRUIwdjAQBgcqhkjOPQIBBgUrgQQAIgNiAARHU+osEaR3xyrq89Zfe9MEkVz6
iMYiuYMQYneEMy3pA4jU4DP37XcsSmDq5G+tbbT4TIqk5B/K6k84Si6CcyvHZpsKjECcfIr28jlg
st7L7Ljkb+qbXbdTkBgyVcUgt5SjYzBhMA8GA1UdEwEB/wQFMAMBAf8wHwYDVR0jBBgwFoAUk+FD
Y1w8ndYn81LsF7Kpryz3dvgwHQYDVR0OBBYEFJPhQ2NcPJ3WJ/NS7Beyqa8s93b4MA4GA1UdDwEB
/wQEAwIBBjAKBggqhkjOPQQDAwNoADBlAjAdfKR7w4l1M+E7qUW/Runpod3JIha3RxEL2Jq68cgL
cFBTApFwhVmpHqTm6iMxoAACMQD94vizrxa5HnPEluPBMBnYfubDl94cT7iJLzPrSA8Z94dGXSaQ
pYXFuXqUPoeovQA=
-----END CERTIFICATE-----
Binary file modified app/src/main/assets/subfont.ttf
Binary file not shown.
Loading

0 comments on commit c27fb9c

Please sign in to comment.