Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
5267aa35ee | ||
|
|
40792e2779 | ||
|
|
822657972d | ||
|
|
ae71b7bc64 | ||
|
|
e15bbed554 | ||
|
|
65e63c206e | ||
|
|
f104b5ffae | ||
|
|
e4db04fa62 | ||
|
|
e6e7d8cdfd | ||
|
|
c4e9fa1650 | ||
|
|
8210b23d31 | ||
|
|
bd83c10b9b | ||
|
|
e03edad824 | ||
|
|
26d14f7cb0 | ||
|
|
b9f828ae88 | ||
|
|
098a472670 | ||
|
|
780a1ea180 | ||
|
|
917f6a2839 | ||
|
|
2101f1d7f0 | ||
|
|
a561777456 | ||
|
|
b4575c9780 | ||
|
|
0ef1e773bb | ||
|
|
cd88f73f05 | ||
|
|
d1c4ae83eb | ||
|
|
858952929b | ||
|
|
b676ef6c56 | ||
|
|
a9493f4f0e | ||
|
|
fe8d405a56 | ||
|
|
754c54761a | ||
|
|
7ecadffdb1 | ||
|
|
6506f36843 | ||
|
|
97f7508067 | ||
|
|
a481fc1000 | ||
|
|
b7078448ea | ||
|
|
359a6bf02a | ||
|
|
a5449a1430 | ||
|
|
6182c34448 | ||
|
|
699e73bcd5 | ||
|
|
352aa04d3e | ||
|
|
c81a1f9a97 | ||
|
|
34be331024 | ||
|
|
ceae98b75f | ||
|
|
5328865639 | ||
|
|
f78089edf8 | ||
|
|
c0d8951677 | ||
|
|
2e830d3f97 | ||
|
|
649eaa4cce | ||
|
|
80344a630f | ||
|
|
2a128777f1 | ||
|
|
baf3c41a44 | ||
|
|
f7f4e3a992 | ||
|
|
6890cd8690 | ||
|
|
c84b8b4792 | ||
|
|
3d36ecf094 | ||
|
|
eaa60cc2b5 | ||
|
|
de5234b59f | ||
|
|
69cf5fb8a1 | ||
|
|
a0f153e5ab | ||
|
|
0135318ded | ||
|
|
f4ec6ccf20 | ||
|
|
5f8d263d63 | ||
|
|
242cc8616c | ||
|
|
2ebc1e250d | ||
|
|
5876a602c3 | ||
|
|
79dabaf125 | ||
|
|
65d3d8e471 | ||
|
|
aa230983d5 | ||
|
|
1b9ef3b3b6 | ||
|
|
7ed342b345 | ||
|
|
29c029f04a | ||
|
|
777780926c | ||
|
|
f08fceaee0 | ||
|
|
0ddd0a6c25 | ||
|
|
8a8b4f3a61 | ||
|
|
cdec9d1514 | ||
|
|
9da047de70 | ||
|
|
18835d92dd | ||
|
|
967c25b11d | ||
|
|
877e8880cf | ||
|
|
ac9c236b6b | ||
|
|
df7fa08e40 | ||
|
|
c58013b818 | ||
|
|
b925705173 | ||
|
|
7a0e838017 | ||
|
|
bc55aea701 | ||
|
|
dca51a752a | ||
|
|
0db6eb6f2e | ||
|
|
d1a67828b6 | ||
|
|
048fb77c8c | ||
|
|
a63369c247 | ||
|
|
6d94880c2f | ||
|
|
9c6fcbc841 | ||
|
|
a809cbbcef | ||
|
|
e4b0680158 | ||
|
|
64db84c3e2 | ||
|
|
4a81246986 | ||
|
|
a23c7f215c | ||
|
|
5af3a926d7 | ||
|
|
2679745941 | ||
|
|
4443b76145 | ||
|
|
3a982c2a7a | ||
|
|
e07172ade4 | ||
|
|
c86d40f8dd | ||
|
|
d86e328169 | ||
|
|
02a032d287 | ||
|
|
03651d6c73 | ||
|
|
9b6c12d086 | ||
|
|
c5c7dd614f | ||
|
|
f87d6e5a52 | ||
|
|
c885c0c6bc | ||
|
|
3bf72d7237 | ||
|
|
d07d849fe4 | ||
|
|
e6ffc54c56 | ||
|
|
b5d8ff5332 | ||
|
|
7509077d63 | ||
|
|
cbabdf2151 | ||
|
|
1acc83572e | ||
|
|
b46107cb58 | ||
|
|
1261852514 | ||
|
|
04daf89a20 | ||
|
|
f94b8c6586 | ||
|
|
b4943f8c50 | ||
|
|
2aa084287d | ||
|
|
dcdbbc8483 | ||
|
|
4e6ea5b4c5 | ||
|
|
ede80d225f | ||
|
|
397de2698d | ||
|
|
632d2ec16b | ||
|
|
2c13438d71 | ||
|
|
fe5d6d8d96 | ||
|
|
e2ad28ca32 | ||
|
|
ed183a855e | ||
|
|
5867809560 | ||
|
|
a4a2942546 | ||
|
|
71d644c4ae | ||
|
|
574b8d524f | ||
|
|
94852e49cb | ||
|
|
4a3295b7fd | ||
|
|
ef75887504 | ||
|
|
49d4b433a7 | ||
|
|
5bb8b1b9f2 | ||
|
|
04c0714881 | ||
|
|
5f7925f350 | ||
|
|
226be37f85 | ||
|
|
32c4810c21 | ||
|
|
28bc4a5df8 | ||
|
|
73be8ab1c8 | ||
|
|
4de38f4b17 | ||
|
|
adf732a1a1 | ||
|
|
214a7c13dc | ||
|
|
fcdef343eb | ||
|
|
a4d40486c1 | ||
|
|
338a53a036 | ||
|
|
4da489d4dc | ||
|
|
db18ee4b34 | ||
|
|
764345f021 | ||
|
|
7d6a747aa7 | ||
|
|
422db75b5b | ||
|
|
05a631415e | ||
|
|
fff559da06 | ||
|
|
c87a9060f9 | ||
|
|
ee3c75ba9e | ||
|
|
90c4fe5458 | ||
|
|
97901cba87 | ||
|
|
7f81a0d4fd | ||
|
|
173117602a | ||
|
|
d9130cd932 | ||
|
|
be072365fc | ||
|
|
61f7d33fdf | ||
|
|
3766b2c2d3 | ||
|
|
0dfe013928 | ||
|
|
25c7893a8e | ||
|
|
28ec9cacb2 | ||
|
|
aaf27a7f9e | ||
|
|
0fb0c7fb4c | ||
|
|
f97ab03111 | ||
|
|
3981fac0db | ||
|
|
4a43ae2771 | ||
|
|
c4184c6148 | ||
|
|
87eaafe3c4 | ||
|
|
aee48f6956 | ||
|
|
3d5a1ec966 | ||
|
|
2e4ba352f4 | ||
|
|
31e8c2e1e0 | ||
|
|
96510f8aac | ||
|
|
6e83aeda88 | ||
|
|
7b1c150e18 | ||
|
|
cd8212fb53 | ||
|
|
11f7fd766d | ||
|
|
d80a1ed15a | ||
|
|
f1422feff1 | ||
|
|
d7c0af9ad0 | ||
|
|
87aea49ab6 | ||
|
|
c8ca8a7875 | ||
|
|
d9b365b012 | ||
|
|
05e70ab56d | ||
|
|
f9abcd44fe | ||
|
|
3cad91736b | ||
|
|
632d66f6ac | ||
|
|
ed843b4b89 | ||
|
|
27596bb919 | ||
|
|
6b7aac3372 | ||
|
|
6af4289289 | ||
|
|
eb8796fa26 | ||
|
|
8fe66f6e36 | ||
|
|
837fdf4031 | ||
|
|
dd09e421bf | ||
|
|
50261398bf | ||
|
|
7632d4bea7 | ||
|
|
30de8be2cd | ||
|
|
536e8e3d2a | ||
|
|
3f9c25fe5e | ||
|
|
fd4291aafb | ||
|
|
8fa91fe444 | ||
|
|
7972743a2f | ||
|
|
6d95e35448 | ||
|
|
86abf3e9da | ||
|
|
0e3c592205 | ||
|
|
5f49dddb4d | ||
|
|
074f92d144 | ||
|
|
6274facc3c | ||
|
|
b08b3b846a | ||
|
|
1059658515 | ||
|
|
d193633a5d | ||
|
|
2b7142bdcd | ||
|
|
44be03d39c | ||
|
|
f9123eb40f | ||
|
|
2025e1f9fd | ||
|
|
6e8320f782 | ||
|
|
bfcd11538e | ||
|
|
72d37f2362 | ||
|
|
e8a99c1108 | ||
|
|
48568fd412 | ||
|
|
320bde7f33 | ||
|
|
868a1469a3 | ||
|
|
43ab5d3246 | ||
|
|
c38f24aee9 | ||
|
|
a5041cb3db | ||
|
|
7143bb380f | ||
|
|
d5df426ab6 | ||
|
|
1d2dea214c | ||
|
|
e07f54921c | ||
|
|
ba112d7aa6 | ||
|
|
28e6e349b3 | ||
|
|
2d30686857 | ||
|
|
ea86ce5a4b | ||
|
|
4cf94683ae | ||
|
|
6c96830033 | ||
|
|
ec1473af5e | ||
|
|
675886673e |
+120
-225
@@ -373,60 +373,26 @@ jobs:
|
||||
macos-ed-signature.txt
|
||||
macos-dmg-size.txt
|
||||
|
||||
build-windows-x64:
|
||||
build-windows:
|
||||
name: Build Windows (${{ matrix.arch }})
|
||||
if: ${{ inputs.build_windows }}
|
||||
runs-on: windows-latest
|
||||
permissions:
|
||||
contents: read
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: Setup Flutter
|
||||
uses: subosito/flutter-action@v2
|
||||
with:
|
||||
channel: "stable"
|
||||
flutter-version: "3.44.0"
|
||||
cache: true
|
||||
pub-cache: false
|
||||
|
||||
- name: Cache Pub dependencies
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
path: |
|
||||
~\AppData\Local\Pub\Cache
|
||||
key: ${{ runner.os }}-${{ runner.arch }}-pub-v2-${{ hashFiles('pubspec.yaml', 'pubspec.lock') }}
|
||||
|
||||
- name: Cache Windows native dependencies
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
path: build/windows/x64/_deps
|
||||
key: windows-native-x64-${{ hashFiles('windows/CMakeLists.txt') }}
|
||||
|
||||
- name: Install dependencies
|
||||
run: flutter pub get --enforce-lockfile --no-example
|
||||
|
||||
- name: Build Windows x64
|
||||
run: flutter build windows --release --dart-define=ENABLE_UPDATE_CHECK=true ${{ env.SENTRY_DART_DEFINE }} ${{ env.GIT_COMMIT_DART_DEFINE }} ${{ env.SENTRY_ENV_DART_DEFINE }} --dart-define=SENTRY_DIST=github-windows-x64 ${{ env.DONATIONS_DART_DEFINE }} --split-debug-info=debug-info/windows-x64
|
||||
|
||||
- name: Upload symbols to bugs.plezy.app
|
||||
if: github.repository == 'edde746/plezy'
|
||||
shell: pwsh
|
||||
env:
|
||||
BUGS_ADMIN_TOKEN: ${{ secrets.BUGS_ADMIN_TOKEN }}
|
||||
SENTRY_DIST: github-windows-x64
|
||||
run: .\scripts\upload-symbols.ps1 windows-x64
|
||||
|
||||
- name: Upload x64 build
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: windows-x64-build
|
||||
path: build/windows/x64/runner/Release/
|
||||
|
||||
build-windows-arm64:
|
||||
if: ${{ inputs.build_windows }}
|
||||
runs-on: windows-11-arm
|
||||
runs-on: ${{ matrix.runner }}
|
||||
permissions:
|
||||
contents: read
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
include:
|
||||
- arch: x64
|
||||
runner: windows-latest
|
||||
flutter_setup: action
|
||||
native_cache_path: build/windows/x64/_deps
|
||||
- arch: arm64
|
||||
runner: windows-11-arm
|
||||
flutter_setup: git
|
||||
native_cache_path: |
|
||||
build/windows/arm64/_deps
|
||||
build/windows/arm64/mpv-dev-arm64
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
@@ -434,23 +400,37 @@ jobs:
|
||||
id: windows-native-cache
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
path: |
|
||||
build/windows/arm64/_deps
|
||||
build/windows/arm64/mpv-dev-arm64
|
||||
key: windows-native-arm64-${{ hashFiles('windows/CMakeLists.txt') }}
|
||||
path: ${{ matrix.native_cache_path }}
|
||||
key: windows-native-${{ matrix.arch }}-${{ hashFiles('windows/CMakeLists.txt') }}
|
||||
|
||||
- name: Install 7-Zip
|
||||
if: steps.windows-native-cache.outputs.cache-hit != 'true'
|
||||
if: matrix.arch == 'arm64' && steps.windows-native-cache.outputs.cache-hit != 'true'
|
||||
shell: pwsh
|
||||
run: choco install 7zip -y
|
||||
|
||||
- name: Setup Flutter
|
||||
if: matrix.flutter_setup == 'action'
|
||||
uses: subosito/flutter-action@v2
|
||||
with:
|
||||
channel: "master"
|
||||
channel: "stable"
|
||||
flutter-version: "3.44.0"
|
||||
cache: true
|
||||
pub-cache: false
|
||||
|
||||
- name: Set up Flutter 3.44.0 (git tag)
|
||||
if: matrix.flutter_setup == 'git'
|
||||
# Flutter publishes no windows-arm64 SDK archive, so subosito can't
|
||||
# resolve 3.44.0 for arm64: the stable manifest has no arm64 entry, and
|
||||
# `channel: master` would git-clone master HEAD (whose engine != our
|
||||
# patched 3.44.0). Clone the 3.44.0 tag directly to get engine rev
|
||||
# 4c525dac, which install-patched-engine.ps1 asserts before swapping.
|
||||
shell: pwsh
|
||||
run: |
|
||||
$root = "$env:RUNNER_TEMP\flutter"
|
||||
git clone --depth 1 --branch 3.44.0 https://github.com/flutter/flutter.git $root
|
||||
"$root\bin" | Out-File -FilePath $env:GITHUB_PATH -Append -Encoding utf8
|
||||
& "$root\bin\flutter.bat" --version
|
||||
|
||||
- name: Cache Pub dependencies
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
@@ -459,27 +439,35 @@ jobs:
|
||||
key: ${{ runner.os }}-${{ runner.arch }}-pub-v2-${{ hashFiles('pubspec.yaml', 'pubspec.lock') }}
|
||||
|
||||
- name: Install dependencies
|
||||
run: flutter pub get --no-example
|
||||
shell: pwsh
|
||||
run: flutter pub get --enforce-lockfile --no-example
|
||||
|
||||
- name: Build Windows arm64
|
||||
run: flutter build windows --release --dart-define=ENABLE_UPDATE_CHECK=true ${{ env.SENTRY_DART_DEFINE }} ${{ env.GIT_COMMIT_DART_DEFINE }} ${{ env.SENTRY_ENV_DART_DEFINE }} --dart-define=SENTRY_DIST=github-windows-arm64 ${{ env.DONATIONS_DART_DEFINE }} --split-debug-info=debug-info/windows-arm64
|
||||
- name: Install patched Flutter engine (DComp)
|
||||
shell: pwsh
|
||||
run: |
|
||||
flutter precache --windows
|
||||
.\windows\tool\install-patched-engine.ps1
|
||||
|
||||
- name: Build Windows ${{ matrix.arch }}
|
||||
shell: pwsh
|
||||
run: flutter build windows --release --dart-define=ENABLE_UPDATE_CHECK=true ${{ env.SENTRY_DART_DEFINE }} ${{ env.GIT_COMMIT_DART_DEFINE }} ${{ env.SENTRY_ENV_DART_DEFINE }} --dart-define=SENTRY_DIST=github-windows-${{ matrix.arch }} ${{ env.DONATIONS_DART_DEFINE }} --split-debug-info=debug-info/windows-${{ matrix.arch }}
|
||||
|
||||
- name: Upload symbols to bugs.plezy.app
|
||||
if: github.repository == 'edde746/plezy'
|
||||
shell: pwsh
|
||||
env:
|
||||
BUGS_ADMIN_TOKEN: ${{ secrets.BUGS_ADMIN_TOKEN }}
|
||||
SENTRY_DIST: github-windows-arm64
|
||||
run: .\scripts\upload-symbols.ps1 windows-arm64
|
||||
SENTRY_DIST: github-windows-${{ matrix.arch }}
|
||||
run: .\scripts\upload-symbols.ps1 windows-${{ matrix.arch }}
|
||||
|
||||
- name: Upload arm64 build
|
||||
- name: Upload ${{ matrix.arch }} build
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: windows-arm64-build
|
||||
path: build/windows/arm64/runner/Release/
|
||||
name: windows-${{ matrix.arch }}-build
|
||||
path: build/windows/${{ matrix.arch }}/runner/Release/
|
||||
|
||||
package-windows:
|
||||
needs: [build-windows-x64, build-windows-arm64]
|
||||
needs: build-windows
|
||||
if: ${{ inputs.build_windows }}
|
||||
runs-on: windows-latest
|
||||
permissions:
|
||||
@@ -562,20 +550,33 @@ jobs:
|
||||
win-ed-signature.txt
|
||||
win-installer-size.txt
|
||||
|
||||
build-linux-x64:
|
||||
build-linux:
|
||||
name: Build Linux (${{ matrix.arch }})
|
||||
if: ${{ inputs.build_linux }}
|
||||
runs-on: ubuntu-latest
|
||||
runs-on: ${{ matrix.runner }}
|
||||
permissions:
|
||||
id-token: write
|
||||
attestations: write
|
||||
contents: read
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
include:
|
||||
- arch: x64
|
||||
runner: ubuntu-latest
|
||||
flutter_channel: stable
|
||||
pkg_config_arch: x86_64-linux-gnu
|
||||
- arch: arm64
|
||||
runner: ubuntu-24.04-arm
|
||||
flutter_channel: master
|
||||
pkg_config_arch: aarch64-linux-gnu
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: Setup Flutter
|
||||
uses: subosito/flutter-action@v2
|
||||
with:
|
||||
channel: "stable"
|
||||
channel: ${{ matrix.flutter_channel }}
|
||||
flutter-version: "3.44.0"
|
||||
cache: true
|
||||
pub-cache: false
|
||||
@@ -594,6 +595,7 @@ jobs:
|
||||
version: 1.1
|
||||
|
||||
- name: Install Linux dependencies
|
||||
shell: bash
|
||||
run: |
|
||||
read -r -a packages <<< "$LINUX_APT_PACKAGES"
|
||||
|
||||
@@ -618,182 +620,73 @@ jobs:
|
||||
|
||||
- name: Build libmpv
|
||||
if: steps.libmpv-cache.outputs.cache-hit != 'true'
|
||||
shell: bash
|
||||
run: bash linux/packaging/build-libmpv.sh
|
||||
|
||||
- name: Install fpm
|
||||
shell: bash
|
||||
run: sudo gem install fpm
|
||||
|
||||
- name: Install dependencies
|
||||
shell: bash
|
||||
run: flutter pub get --enforce-lockfile --no-example
|
||||
|
||||
- name: Build Linux x64
|
||||
run: flutter build linux --release --dart-define=ENABLE_UPDATE_CHECK=true ${{ env.SENTRY_DART_DEFINE }} ${{ env.GIT_COMMIT_DART_DEFINE }} ${{ env.SENTRY_ENV_DART_DEFINE }} --dart-define=SENTRY_DIST=github-linux-x64 ${{ env.DONATIONS_DART_DEFINE }} --split-debug-info=debug-info/linux-x64
|
||||
- name: Build Linux ${{ matrix.arch }}
|
||||
shell: bash
|
||||
run: flutter build linux --release --dart-define=ENABLE_UPDATE_CHECK=true ${{ env.SENTRY_DART_DEFINE }} ${{ env.GIT_COMMIT_DART_DEFINE }} ${{ env.SENTRY_ENV_DART_DEFINE }} --dart-define=SENTRY_DIST=github-linux-${{ matrix.arch }} ${{ env.DONATIONS_DART_DEFINE }} --split-debug-info=debug-info/linux-${{ matrix.arch }}
|
||||
env:
|
||||
PKG_CONFIG_PATH: ${{ github.workspace }}/libmpv-prefix/lib/pkgconfig:${{ github.workspace }}/libmpv-prefix/lib/x86_64-linux-gnu/pkgconfig
|
||||
PKG_CONFIG_PATH: ${{ github.workspace }}/libmpv-prefix/lib/pkgconfig:${{ github.workspace }}/libmpv-prefix/lib/${{ matrix.pkg_config_arch }}/pkgconfig
|
||||
|
||||
- name: Upload symbols to bugs.plezy.app
|
||||
if: github.repository == 'edde746/plezy'
|
||||
shell: bash
|
||||
env:
|
||||
BUGS_ADMIN_TOKEN: ${{ secrets.BUGS_ADMIN_TOKEN }}
|
||||
SENTRY_DIST: github-linux-x64
|
||||
run: ./scripts/upload-symbols.sh linux-x64
|
||||
SENTRY_DIST: github-linux-${{ matrix.arch }}
|
||||
run: ./scripts/upload-symbols.sh linux-${{ matrix.arch }}
|
||||
|
||||
- name: Build Linux Packages
|
||||
run: ARCH_SUFFIX=x64 OUTPUT_DIR=$GITHUB_WORKSPACE python3 linux/packaging/build-packages.py
|
||||
|
||||
- name: Copy libmpv into bundle
|
||||
- name: Resolve bundle directory
|
||||
shell: bash
|
||||
run: |
|
||||
BUNDLE_LIB=build/linux/x64/release/bundle/lib
|
||||
LIBMPV_DIR=$(dirname "$(find libmpv-prefix -name 'libmpv.so' | head -1)")
|
||||
cp -a "$LIBMPV_DIR"/libmpv.so* "$BUNDLE_LIB/"
|
||||
cp -a libmpv-prefix/lib/libshaderc_shared.so* "$BUNDLE_LIB/"
|
||||
|
||||
- name: Bundle shared libraries for portable tarball
|
||||
run: bash linux/packaging/bundle-libs.sh build/linux/x64/release/bundle
|
||||
|
||||
- name: Copy wrapper script into bundle
|
||||
run: cp linux/packaging/plezy.sh build/linux/x64/release/bundle/plezy.sh
|
||||
|
||||
- name: Verify no missing dependencies
|
||||
run: |
|
||||
cd build/linux/x64/release/bundle
|
||||
MISSING=$(LD_LIBRARY_PATH=lib ldd ./plezy 2>&1 | grep "not found" || true)
|
||||
if [[ -n "$MISSING" ]]; then
|
||||
echo "ERROR: Unresolved dependencies found:" >&2
|
||||
echo "$MISSING" >&2
|
||||
if [[ "${{ matrix.arch }}" == "x64" ]]; then
|
||||
bundle_dir=build/linux/x64/release/bundle
|
||||
else
|
||||
bundle_dir=$(find build/linux -path "*/release/bundle" -type d | head -1)
|
||||
fi
|
||||
if [[ -z "$bundle_dir" || ! -d "$bundle_dir" ]]; then
|
||||
echo "ERROR: Linux bundle directory not found" >&2
|
||||
exit 1
|
||||
fi
|
||||
echo "All dependencies resolved."
|
||||
|
||||
- name: Create tarball
|
||||
run: |
|
||||
cd build/linux/x64/release/bundle
|
||||
tar -czf $GITHUB_WORKSPACE/plezy-linux-x64.tar.gz *
|
||||
|
||||
- name: Attest Linux x64 artifacts
|
||||
uses: actions/attest-build-provenance@v2
|
||||
with:
|
||||
subject-path: |
|
||||
plezy-linux-x64.tar.gz
|
||||
plezy-linux-x64.deb
|
||||
plezy-linux-x64.rpm
|
||||
plezy-linux-x64.pkg.tar.zst
|
||||
|
||||
- name: Upload Linux x64 artifacts
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: linux-x64
|
||||
path: |
|
||||
plezy-linux-x64.tar.gz
|
||||
plezy-linux-x64.deb
|
||||
plezy-linux-x64.rpm
|
||||
plezy-linux-x64.pkg.tar.zst
|
||||
|
||||
build-linux-arm64:
|
||||
if: ${{ inputs.build_linux }}
|
||||
runs-on: ubuntu-24.04-arm
|
||||
permissions:
|
||||
id-token: write
|
||||
attestations: write
|
||||
contents: read
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: Setup Flutter
|
||||
uses: subosito/flutter-action@v2
|
||||
with:
|
||||
channel: "master"
|
||||
flutter-version: "3.44.0"
|
||||
cache: true
|
||||
pub-cache: false
|
||||
|
||||
- name: Cache Pub dependencies
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
path: |
|
||||
~/.pub-cache
|
||||
key: ${{ runner.os }}-${{ runner.arch }}-pub-v2-${{ hashFiles('pubspec.yaml', 'pubspec.lock') }}
|
||||
|
||||
- name: Cache APT packages
|
||||
uses: awalsh128/cache-apt-pkgs-action@latest
|
||||
with:
|
||||
packages: ${{ env.LINUX_APT_PACKAGES }}
|
||||
version: 1.1
|
||||
|
||||
- name: Install Linux dependencies
|
||||
run: |
|
||||
read -r -a packages <<< "$LINUX_APT_PACKAGES"
|
||||
|
||||
for attempt in 1 2 3; do
|
||||
if sudo apt-get update -o Acquire::Retries=3 && sudo apt-get install -y -o Acquire::Retries=3 "${packages[@]}"; then
|
||||
exit 0
|
||||
fi
|
||||
|
||||
sudo apt-get clean
|
||||
sudo rm -rf /var/lib/apt/lists/*
|
||||
sleep $((attempt * 15))
|
||||
done
|
||||
|
||||
exit 1
|
||||
|
||||
- name: Cache libmpv build
|
||||
id: libmpv-cache
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
path: libmpv-prefix
|
||||
key: libmpv-${{ runner.arch }}-${{ hashFiles('linux/packaging/build-libmpv.sh') }}
|
||||
|
||||
- name: Build libmpv
|
||||
if: steps.libmpv-cache.outputs.cache-hit != 'true'
|
||||
run: bash linux/packaging/build-libmpv.sh
|
||||
|
||||
- name: Install fpm
|
||||
run: sudo gem install fpm
|
||||
|
||||
- name: Install dependencies
|
||||
run: flutter pub get --no-example
|
||||
|
||||
- name: Build Linux arm64
|
||||
run: flutter build linux --release --dart-define=ENABLE_UPDATE_CHECK=true ${{ env.SENTRY_DART_DEFINE }} ${{ env.GIT_COMMIT_DART_DEFINE }} ${{ env.SENTRY_ENV_DART_DEFINE }} --dart-define=SENTRY_DIST=github-linux-arm64 ${{ env.DONATIONS_DART_DEFINE }} --split-debug-info=debug-info/linux-arm64
|
||||
env:
|
||||
PKG_CONFIG_PATH: ${{ github.workspace }}/libmpv-prefix/lib/pkgconfig:${{ github.workspace }}/libmpv-prefix/lib/aarch64-linux-gnu/pkgconfig
|
||||
|
||||
- name: Upload symbols to bugs.plezy.app
|
||||
if: github.repository == 'edde746/plezy'
|
||||
env:
|
||||
BUGS_ADMIN_TOKEN: ${{ secrets.BUGS_ADMIN_TOKEN }}
|
||||
SENTRY_DIST: github-linux-arm64
|
||||
run: ./scripts/upload-symbols.sh linux-arm64
|
||||
|
||||
- name: Find bundle directory
|
||||
id: find-bundle
|
||||
run: |
|
||||
BUNDLE_DIR=$(find build/linux -path "*/release/bundle" -type d | head -1)
|
||||
echo "bundle_dir=$BUNDLE_DIR" >> $GITHUB_OUTPUT
|
||||
echo "BUNDLE_DIR=$bundle_dir" >> "$GITHUB_ENV"
|
||||
|
||||
- name: Build Linux Packages
|
||||
shell: bash
|
||||
run: |
|
||||
BUILD_DIR=${{ steps.find-bundle.outputs.bundle_dir }} \
|
||||
ARCH_SUFFIX=arm64 \
|
||||
OUTPUT_DIR=$GITHUB_WORKSPACE \
|
||||
BUILD_DIR="$BUNDLE_DIR" \
|
||||
ARCH_SUFFIX=${{ matrix.arch }} \
|
||||
OUTPUT_DIR="$GITHUB_WORKSPACE" \
|
||||
python3 linux/packaging/build-packages.py
|
||||
|
||||
- name: Copy libmpv into bundle
|
||||
shell: bash
|
||||
run: |
|
||||
BUNDLE_LIB=${{ steps.find-bundle.outputs.bundle_dir }}/lib
|
||||
BUNDLE_LIB="$BUNDLE_DIR/lib"
|
||||
LIBMPV_DIR=$(dirname "$(find libmpv-prefix -name 'libmpv.so' | head -1)")
|
||||
cp -a "$LIBMPV_DIR"/libmpv.so* "$BUNDLE_LIB/"
|
||||
cp -a libmpv-prefix/lib/libshaderc_shared.so* "$BUNDLE_LIB/"
|
||||
|
||||
- name: Bundle shared libraries for portable tarball
|
||||
run: bash linux/packaging/bundle-libs.sh ${{ steps.find-bundle.outputs.bundle_dir }}
|
||||
shell: bash
|
||||
run: bash linux/packaging/bundle-libs.sh "$BUNDLE_DIR"
|
||||
|
||||
- name: Copy wrapper script into bundle
|
||||
run: cp linux/packaging/plezy.sh ${{ steps.find-bundle.outputs.bundle_dir }}/plezy.sh
|
||||
shell: bash
|
||||
run: cp linux/packaging/plezy.sh "$BUNDLE_DIR/plezy.sh"
|
||||
|
||||
- name: Verify no missing dependencies
|
||||
shell: bash
|
||||
run: |
|
||||
cd ${{ steps.find-bundle.outputs.bundle_dir }}
|
||||
cd "$BUNDLE_DIR"
|
||||
MISSING=$(LD_LIBRARY_PATH=lib ldd ./plezy 2>&1 | grep "not found" || true)
|
||||
if [[ -n "$MISSING" ]]; then
|
||||
echo "ERROR: Unresolved dependencies found:" >&2
|
||||
@@ -803,31 +696,32 @@ jobs:
|
||||
echo "All dependencies resolved."
|
||||
|
||||
- name: Create tarball
|
||||
shell: bash
|
||||
run: |
|
||||
cd ${{ steps.find-bundle.outputs.bundle_dir }}
|
||||
tar -czf $GITHUB_WORKSPACE/plezy-linux-arm64.tar.gz *
|
||||
cd "$BUNDLE_DIR"
|
||||
tar -czf "$GITHUB_WORKSPACE/plezy-linux-${{ matrix.arch }}.tar.gz" *
|
||||
|
||||
- name: Attest Linux arm64 artifacts
|
||||
- name: Attest Linux ${{ matrix.arch }} artifacts
|
||||
uses: actions/attest-build-provenance@v2
|
||||
with:
|
||||
subject-path: |
|
||||
plezy-linux-arm64.tar.gz
|
||||
plezy-linux-arm64.deb
|
||||
plezy-linux-arm64.rpm
|
||||
plezy-linux-arm64.pkg.tar.zst
|
||||
plezy-linux-${{ matrix.arch }}.tar.gz
|
||||
plezy-linux-${{ matrix.arch }}.deb
|
||||
plezy-linux-${{ matrix.arch }}.rpm
|
||||
plezy-linux-${{ matrix.arch }}.pkg.tar.zst
|
||||
|
||||
- name: Upload Linux arm64 artifacts
|
||||
- name: Upload Linux ${{ matrix.arch }} artifacts
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: linux-arm64
|
||||
name: linux-${{ matrix.arch }}
|
||||
path: |
|
||||
plezy-linux-arm64.tar.gz
|
||||
plezy-linux-arm64.deb
|
||||
plezy-linux-arm64.rpm
|
||||
plezy-linux-arm64.pkg.tar.zst
|
||||
plezy-linux-${{ matrix.arch }}.tar.gz
|
||||
plezy-linux-${{ matrix.arch }}.deb
|
||||
plezy-linux-${{ matrix.arch }}.rpm
|
||||
plezy-linux-${{ matrix.arch }}.pkg.tar.zst
|
||||
|
||||
create-release:
|
||||
needs: [build-android, build-ios, build-macos, build-windows-x64, build-windows-arm64, package-windows, build-linux-x64, build-linux-arm64]
|
||||
needs: [build-android, build-ios, build-macos, build-windows, package-windows, build-linux]
|
||||
if: ${{ always() && !contains(needs.*.result, 'failure') && !contains(needs.*.result, 'cancelled') && (inputs.build_android || inputs.build_ios || inputs.build_macos || inputs.build_windows || inputs.build_linux) }}
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
@@ -1005,8 +899,9 @@ jobs:
|
||||
} >> "$GITHUB_OUTPUT"
|
||||
|
||||
- name: Create Release
|
||||
uses: softprops/action-gh-release@v1
|
||||
uses: softprops/action-gh-release@v2
|
||||
with:
|
||||
tag_name: ${{ steps.version.outputs.version }}
|
||||
files: ${{ steps.release-files.outputs.files }}
|
||||
draft: true
|
||||
prerelease: false
|
||||
|
||||
+73
-32
@@ -39,44 +39,31 @@ jobs:
|
||||
|
||||
flutter pub get
|
||||
|
||||
- name: Install saf_util development dependencies
|
||||
working-directory: packages/saf_util
|
||||
run: flutter pub get
|
||||
|
||||
- name: Verify generated files committed
|
||||
run: scripts/codegen.sh --check
|
||||
|
||||
- name: Verify translation hygiene
|
||||
run: python3 scripts/clean_translations.py --check --strict
|
||||
|
||||
- name: Verify workflow and script guards
|
||||
run: |
|
||||
scripts/codegen.sh
|
||||
if ! git diff --exit-code lib/; then
|
||||
echo "::error::Generated files (.g.dart / .freezed.dart) are out of date."
|
||||
echo "Run 'scripts/codegen.sh' and commit the result."
|
||||
exit 1
|
||||
fi
|
||||
python3 scripts/check_build_workflow.py
|
||||
python3 scripts/check_update_packages_workflow.py
|
||||
python3 scripts/test_pubspec_version.py
|
||||
python3 scripts/test_clean_translations.py
|
||||
|
||||
- name: Verify formatting
|
||||
run: |
|
||||
# Find all Dart files excluding generated files
|
||||
find lib $([ -d test ] && echo test) -name "*.dart" ! -name "*.g.dart" ! -name "*.freezed.dart" -type f 2>/dev/null | while IFS= read -r file; do
|
||||
files_found=true
|
||||
break
|
||||
done
|
||||
if [ "$files_found" != "true" ]; then
|
||||
echo "No Dart files found to format"
|
||||
exit 0
|
||||
fi
|
||||
find lib $([ -d test ] && echo test) -name "*.dart" ! -name "*.g.dart" ! -name "*.freezed.dart" -type f 2>/dev/null -print0 | xargs -0 dart format --output=none --set-exit-if-changed
|
||||
paths=(lib)
|
||||
[ ! -d test ] || paths+=(test)
|
||||
find "${paths[@]}" -name "*.dart" ! -name "*.g.dart" ! -name "*.freezed.dart" -type f -print0 |
|
||||
xargs -0 -r dart format --output=none --set-exit-if-changed
|
||||
- name: Analyze code
|
||||
run: |
|
||||
# Run flutter analyze
|
||||
# Fails on errors or warnings only (info messages are allowed)
|
||||
flutter analyze 2>&1 | tee analyze_output.txt || true
|
||||
|
||||
# Check output for errors or warnings
|
||||
if grep -q "error •" analyze_output.txt; then
|
||||
echo "❌ Analysis failed with errors"
|
||||
exit 1
|
||||
elif grep -q "warning •" analyze_output.txt; then
|
||||
echo "⚠️ Analysis completed with warnings"
|
||||
exit 1
|
||||
else
|
||||
echo "✅ Analysis passed!"
|
||||
exit 0
|
||||
fi
|
||||
run: dart run scripts/check_analyzer.dart
|
||||
|
||||
- name: Check for unused code
|
||||
run: |
|
||||
@@ -139,6 +126,60 @@ jobs:
|
||||
echo "No tests found, skipping test execution"
|
||||
fi
|
||||
|
||||
android-test:
|
||||
name: Android JVM Unit Tests
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
contents: read
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Setup Java
|
||||
uses: actions/setup-java@v4
|
||||
with:
|
||||
distribution: "temurin"
|
||||
java-version: "17"
|
||||
|
||||
- name: Setup Flutter
|
||||
uses: subosito/flutter-action@v2
|
||||
with:
|
||||
channel: "stable"
|
||||
flutter-version: "3.44.0"
|
||||
cache: true
|
||||
pub-cache: false
|
||||
|
||||
- name: Cache Pub dependencies
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
path: |
|
||||
~/.pub-cache
|
||||
key: ${{ runner.os }}-pub-v3-${{ hashFiles('**/pubspec.yaml', '**/pubspec.lock') }}
|
||||
|
||||
- name: Cache Gradle
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
path: |
|
||||
~/.gradle/caches
|
||||
~/.gradle/wrapper
|
||||
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-gradle-
|
||||
|
||||
- name: Install dependencies
|
||||
run: flutter pub get
|
||||
|
||||
- name: Configure Android local properties
|
||||
run: printf 'flutter.sdk=%s\nsdk.dir=%s\n' "$FLUTTER_ROOT" "$ANDROID_HOME" > android/local.properties
|
||||
|
||||
- name: Run Android JVM unit tests
|
||||
working-directory: android
|
||||
run: ./gradlew :app:testDebugUnitTest :saf_util:testDebugUnitTest :libass:testDebugUnitTest -x :app:compileFlutterBuildDebug --continue
|
||||
|
||||
- name: Check Android API compatibility
|
||||
working-directory: android
|
||||
run: ./gradlew :app:lintDebug
|
||||
|
||||
native-format:
|
||||
name: Native Formatting
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
@@ -32,10 +32,8 @@ jobs:
|
||||
- name: Extract current build number
|
||||
id: get_build
|
||||
run: |
|
||||
# Extract current build number from pubspec.yaml
|
||||
CURRENT_VERSION=$(grep '^version:' pubspec.yaml | sed 's/version: //')
|
||||
CURRENT_BUILD=$(echo "$CURRENT_VERSION" | cut -d'+' -f2)
|
||||
NEW_BUILD=$((CURRENT_BUILD + 1))
|
||||
CURRENT_BUILD=$(python3 scripts/pubspec_version.py --build-number pubspec.yaml)
|
||||
NEW_BUILD=$((10#$CURRENT_BUILD + 1))
|
||||
|
||||
echo "current_build=$CURRENT_BUILD" >> $GITHUB_OUTPUT
|
||||
echo "new_build=$NEW_BUILD" >> $GITHUB_OUTPUT
|
||||
@@ -71,7 +69,7 @@ jobs:
|
||||
|
||||
- name: Trigger build workflow
|
||||
run: |
|
||||
curl -L \
|
||||
curl --fail-with-body -L \
|
||||
-X POST \
|
||||
-H "Accept: application/vnd.github+json" \
|
||||
-H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \
|
||||
|
||||
@@ -4,12 +4,61 @@ on:
|
||||
release:
|
||||
types: [published]
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
release_tag:
|
||||
description: Published release tag to update packages for
|
||||
required: true
|
||||
type: string
|
||||
|
||||
jobs:
|
||||
resolve-release:
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
contents: read
|
||||
outputs:
|
||||
tag: ${{ steps.release.outputs.tag }}
|
||||
steps:
|
||||
- name: Resolve published release tag
|
||||
id: release
|
||||
env:
|
||||
EVENT_TAG: ${{ github.event.release.tag_name }}
|
||||
INPUT_TAG: ${{ inputs.release_tag }}
|
||||
GH_TOKEN: ${{ github.token }}
|
||||
run: |
|
||||
set -euo pipefail
|
||||
|
||||
if [ "$GITHUB_EVENT_NAME" = "release" ]; then
|
||||
REQUESTED_TAG="$EVENT_TAG"
|
||||
else
|
||||
REQUESTED_TAG="$INPUT_TAG"
|
||||
fi
|
||||
|
||||
if [ -z "$REQUESTED_TAG" ]; then
|
||||
echo "A release tag is required." >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
RELEASE=$(gh release view "$REQUESTED_TAG" --repo "$GITHUB_REPOSITORY" \
|
||||
--json tagName,isDraft,publishedAt)
|
||||
RESOLVED_TAG=$(jq -r '.tagName' <<< "$RELEASE")
|
||||
IS_DRAFT=$(jq -r '.isDraft' <<< "$RELEASE")
|
||||
PUBLISHED_AT=$(jq -r '.publishedAt // empty' <<< "$RELEASE")
|
||||
|
||||
if [ "$RESOLVED_TAG" != "$REQUESTED_TAG" ] || \
|
||||
[ "$IS_DRAFT" != "false" ] || [ -z "$PUBLISHED_AT" ]; then
|
||||
echo "Tag '$REQUESTED_TAG' is not an exact published release tag." >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "tag=$RESOLVED_TAG" >> "$GITHUB_OUTPUT"
|
||||
|
||||
update-homebrew:
|
||||
needs: resolve-release
|
||||
runs-on: macos-latest
|
||||
permissions:
|
||||
contents: write
|
||||
env:
|
||||
RELEASE_TAG: ${{ needs.resolve-release.outputs.tag }}
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
@@ -19,16 +68,14 @@ jobs:
|
||||
- name: Download and hash release
|
||||
id: release
|
||||
run: |
|
||||
VERSION="${{ github.event.release.tag_name || github.ref_name }}"
|
||||
curl -L -o plezy-macos.dmg \
|
||||
"https://github.com/edde746/plezy/releases/download/$VERSION/plezy-macos.dmg"
|
||||
curl --fail-with-body -L -o plezy-macos.dmg \
|
||||
"https://github.com/edde746/plezy/releases/download/$RELEASE_TAG/plezy-macos.dmg"
|
||||
SHA256=$(shasum -a 256 plezy-macos.dmg | cut -d' ' -f1)
|
||||
echo "version=$VERSION" >> $GITHUB_OUTPUT
|
||||
echo "sha256=$SHA256" >> $GITHUB_OUTPUT
|
||||
echo "sha256=$SHA256" >> "$GITHUB_OUTPUT"
|
||||
|
||||
- name: Update cask
|
||||
run: |
|
||||
sed -i '' "s/version \".*\"/version \"${{ steps.release.outputs.version }}\"/" Casks/plezy.rb
|
||||
sed -i '' "s/version \".*\"/version \"$RELEASE_TAG\"/" Casks/plezy.rb
|
||||
sed -i '' "s/sha256 \".*\"/sha256 \"${{ steps.release.outputs.sha256 }}\"/" Casks/plezy.rb
|
||||
|
||||
- name: Commit
|
||||
@@ -38,41 +85,45 @@ jobs:
|
||||
git config user.email "github-actions[bot]@users.noreply.github.com"
|
||||
git add Casks/plezy.rb
|
||||
if ! git diff --staged --quiet; then
|
||||
git commit -m "chore: update cask to ${{ steps.release.outputs.version }}"
|
||||
git commit -m "chore: update cask to $RELEASE_TAG"
|
||||
git push origin "HEAD:$BRANCH"
|
||||
else
|
||||
echo "No cask changes to commit."
|
||||
fi
|
||||
|
||||
update-winget:
|
||||
needs: resolve-release
|
||||
runs-on: windows-latest
|
||||
steps:
|
||||
- uses: vedantmgoyal9/winget-releaser@v2
|
||||
with:
|
||||
identifier: edde746.Plezy
|
||||
installers-regex: 'plezy-windows-installer\.exe$'
|
||||
release-tag: ${{ needs.resolve-release.outputs.tag }}
|
||||
token: ${{ secrets.WINGET_TOKEN }}
|
||||
|
||||
update-appcast-branch:
|
||||
needs: resolve-release
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
contents: write
|
||||
env:
|
||||
RELEASE_TAG: ${{ needs.resolve-release.outputs.tag }}
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: Download appcast.xml from release
|
||||
run: |
|
||||
gh release download "${{ github.event.release.tag_name }}" \
|
||||
gh release download "$RELEASE_TAG" \
|
||||
--pattern "appcast.xml"
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
- name: Push to appcast branch
|
||||
run: |
|
||||
VERSION="${{ github.event.release.tag_name }}"
|
||||
git config user.name "github-actions[bot]"
|
||||
git config user.email "github-actions[bot]@users.noreply.github.com"
|
||||
BLOB=$(git hash-object -w appcast.xml)
|
||||
TREE=$(printf "100644 blob %s\tappcast.xml\n" "$BLOB" | git mktree)
|
||||
COMMIT=$(git commit-tree "$TREE" -m "Update appcast for $VERSION")
|
||||
COMMIT=$(git commit-tree "$TREE" -m "Update appcast for $RELEASE_TAG")
|
||||
git push origin "$COMMIT:refs/heads/appcast" --force
|
||||
|
||||
+2
-1
@@ -70,4 +70,5 @@ duplication-report/
|
||||
**/fastlane/report.xml
|
||||
maestro/**/*.png
|
||||
|
||||
server/deploy.sh
|
||||
server/deploy.sh
|
||||
server/Caddyfile
|
||||
|
||||
+5
-2
@@ -4,7 +4,7 @@
|
||||
|
||||
1. Fork and clone the repository
|
||||
2. Run `flutter pub get` to install dependencies
|
||||
3. Run `dart run build_runner build` to generate code
|
||||
3. Run `scripts/codegen.sh` to generate translations and Dart model code
|
||||
4. Start developing!
|
||||
|
||||
## Development
|
||||
@@ -30,7 +30,10 @@ The project includes automated CI checks that run on all pull requests:
|
||||
- Run locally: `flutter analyze`
|
||||
- Note: CI excludes generated files from analysis (configured in `analysis_options.yaml`)
|
||||
|
||||
3. **Tests**: Runs unit and widget tests (when available)
|
||||
3. **Generated Code**: Ensures generated translations and model files are current
|
||||
- Run locally: `scripts/codegen.sh --check`
|
||||
|
||||
4. **Tests**: Runs unit and widget tests (when available)
|
||||
- Run locally: `flutter test`
|
||||
|
||||
All these checks must pass before your changes can be merged.
|
||||
|
||||
+2
-2
@@ -1,6 +1,6 @@
|
||||
cask "plezy" do
|
||||
version "2.7.1"
|
||||
sha256 "b649195b030add21f3901dabfc90e3f893e08171c51928a7327f19b4ac9150c5"
|
||||
version "2.9.0"
|
||||
sha256 "d7f939bdab4421d53f49b5d8b840e5f9d005e1c48269ccc1fa53a350e7d1e65c"
|
||||
|
||||
url "https://github.com/edde746/plezy/releases/download/#{version}/plezy-macos.dmg"
|
||||
name "Plezy"
|
||||
|
||||
@@ -87,15 +87,15 @@ Package managers:
|
||||
- Real-time play / pause / seek sync
|
||||
|
||||
### <img src="assets/readme_icons/integrations.svg" height="20" alt="" align="center" /> Integrations
|
||||
- Discord Rich Presence[^7]
|
||||
- Discord Rich Presence[^6]
|
||||
- Trakt, MyAnimeList, AniList, and Simkl tracking & rating
|
||||
- Plezy Remote — control desktop and TV from mobile
|
||||
- Watch Next row[^6]
|
||||
- Watch Next row
|
||||
|
||||
### <img src="assets/readme_icons/customization.svg" height="20" alt="" align="center" /> Platform & Customization
|
||||
- Desktop, mobile, and TV — full D-pad, keyboard, and gamepad support
|
||||
- Customizable keyboard shortcuts[^7]
|
||||
- Metadata and artwork editing[^2]
|
||||
- Customizable keyboard shortcuts[^6]
|
||||
- Metadata and artwork editing
|
||||
- Settings import/export
|
||||
- Localized in English plus 14 translations
|
||||
|
||||
@@ -104,8 +104,7 @@ Package managers:
|
||||
[^3]: Not available on iOS or tvOS.
|
||||
[^4]: Android, iOS, and macOS.
|
||||
[^5]: Windows, Android, and tvOS.
|
||||
[^6]: Android TV only.
|
||||
[^7]: Desktop only.
|
||||
[^6]: Desktop only.
|
||||
|
||||
## Building from Source
|
||||
|
||||
|
||||
@@ -18,6 +18,11 @@ linter:
|
||||
avoid_print: true
|
||||
|
||||
dart_code_linter:
|
||||
rules-exclude:
|
||||
- "test/**"
|
||||
metrics-exclude:
|
||||
- "test/**"
|
||||
|
||||
extends:
|
||||
- package:dart_code_linter/presets/recommended.yaml
|
||||
|
||||
|
||||
@@ -1,8 +1,5 @@
|
||||
gradle-wrapper.jar
|
||||
/.gradle
|
||||
/captures/
|
||||
/gradlew
|
||||
/gradlew.bat
|
||||
/local.properties
|
||||
GeneratedPluginRegistrant.java
|
||||
.cxx/
|
||||
|
||||
@@ -166,6 +166,12 @@ android {
|
||||
jniLibs.srcDir(File(mpvDir, "libcxx/jni"))
|
||||
}
|
||||
}
|
||||
|
||||
lint {
|
||||
// Enforce the app-owned minSdk boundary without auditing upstream AndroidX.
|
||||
checkDependencies = false
|
||||
checkOnly += setOf("NewApi")
|
||||
}
|
||||
}
|
||||
|
||||
flutter {
|
||||
@@ -210,4 +216,7 @@ dependencies {
|
||||
implementation(project(":libass"))
|
||||
|
||||
testImplementation("junit:junit:4.13.2")
|
||||
// Real android.util.* implementations for tests exercising media3 classes
|
||||
// (MatroskaExtractor uses SparseArray, which is a no-op stub on plain JVM)
|
||||
testImplementation("org.robolectric:robolectric:4.15.1")
|
||||
}
|
||||
|
||||
@@ -49,7 +49,7 @@
|
||||
android:taskAffinity=""
|
||||
android:theme="@style/LaunchTheme"
|
||||
android:supportsPictureInPicture="true"
|
||||
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode"
|
||||
android:configChanges="orientation|keyboardHidden|keyboard|navigation|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode"
|
||||
android:hardwareAccelerated="true"
|
||||
android:windowSoftInputMode="adjustResize">
|
||||
<!-- Specifies an Android theme to apply to this Activity as soon as
|
||||
|
||||
@@ -0,0 +1,46 @@
|
||||
package com.edde746.plezy
|
||||
|
||||
import android.graphics.SurfaceTexture
|
||||
import android.os.Handler
|
||||
import android.os.Looper
|
||||
import android.view.TextureView
|
||||
|
||||
internal class DeferredSurfaceTextureListener(
|
||||
private val delegate: TextureView.SurfaceTextureListener,
|
||||
private val handler: Handler = Handler(Looper.getMainLooper()),
|
||||
private val onSurfaceAvailable: () -> Unit = {},
|
||||
private val isCurrentSurface: (SurfaceTexture) -> Boolean
|
||||
) : TextureView.SurfaceTextureListener {
|
||||
|
||||
private var pendingResize: Runnable? = null
|
||||
|
||||
override fun onSurfaceTextureAvailable(surface: SurfaceTexture, width: Int, height: Int) {
|
||||
delegate.onSurfaceTextureAvailable(surface, width, height)
|
||||
onSurfaceAvailable()
|
||||
}
|
||||
|
||||
override fun onSurfaceTextureSizeChanged(surface: SurfaceTexture, width: Int, height: Int) {
|
||||
pendingResize?.let(handler::removeCallbacks)
|
||||
pendingResize = Runnable {
|
||||
pendingResize = null
|
||||
if (isCurrentSurface(surface)) {
|
||||
delegate.onSurfaceTextureSizeChanged(surface, width, height)
|
||||
}
|
||||
}
|
||||
handler.postDelayed(pendingResize!!, RESIZE_DELAY_MILLIS)
|
||||
}
|
||||
|
||||
override fun onSurfaceTextureUpdated(surface: SurfaceTexture) {
|
||||
delegate.onSurfaceTextureUpdated(surface)
|
||||
}
|
||||
|
||||
override fun onSurfaceTextureDestroyed(surface: SurfaceTexture): Boolean {
|
||||
pendingResize?.let(handler::removeCallbacks)
|
||||
pendingResize = null
|
||||
return delegate.onSurfaceTextureDestroyed(surface)
|
||||
}
|
||||
|
||||
private companion object {
|
||||
const val RESIZE_DELAY_MILLIS = 100L
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,194 @@
|
||||
package com.edde746.plezy
|
||||
|
||||
import android.app.Activity
|
||||
import android.content.ActivityNotFoundException
|
||||
import android.content.Intent
|
||||
import android.net.Uri
|
||||
import android.os.Bundle
|
||||
import androidx.core.content.FileProvider
|
||||
import io.flutter.plugin.common.BinaryMessenger
|
||||
import io.flutter.plugin.common.MethodCall
|
||||
import io.flutter.plugin.common.MethodChannel
|
||||
import java.io.File
|
||||
|
||||
internal class ExternalPlayerChannel(private val activity: Activity) {
|
||||
companion object {
|
||||
private const val CHANNEL = "com.plezy/external_player"
|
||||
const val REQUEST_CODE = 7461
|
||||
|
||||
private const val API_MX_RETURN_RESULT = "return_result"
|
||||
private const val API_MX_RESULT_ID = "com.mxtech.intent.result.VIEW"
|
||||
private const val API_MX_RESULT_POSITION = "position"
|
||||
private const val API_MX_RESULT_DURATION = "duration"
|
||||
private const val API_MX_RESULT_END_BY = "end_by"
|
||||
private const val API_MX_RESULT_END_BY_PLAYBACK_COMPLETION = "playback_completion"
|
||||
private const val API_MX_TITLE = "title"
|
||||
private const val API_MX_FILENAME = "filename"
|
||||
private const val API_MX_SECURE_URI = "secure_uri"
|
||||
private const val API_VLC_RESULT_POSITION = "extra_position"
|
||||
private const val API_VLC_RESULT_DURATION = "extra_duration"
|
||||
|
||||
private const val API_VIMU_TITLE = "forcename"
|
||||
private const val API_VIMU_SEEK_POSITION = "startfrom"
|
||||
private const val API_VIMU_RESUME = "forceresume"
|
||||
private const val API_VIMU_RESULT_ID = "net.gtvbox.videoplayer.result"
|
||||
private const val API_VIMU_RESULT_ERROR = 4
|
||||
private const val API_VIMU_RESULT_PLAYBACK_COMPLETED = 1
|
||||
|
||||
private val positionExtras = arrayOf(API_MX_RESULT_POSITION, API_VLC_RESULT_POSITION)
|
||||
private val durationExtras = arrayOf(API_MX_RESULT_DURATION, API_VLC_RESULT_DURATION)
|
||||
}
|
||||
|
||||
private var pendingResult: MethodChannel.Result? = null
|
||||
|
||||
fun attach(messenger: BinaryMessenger) {
|
||||
MethodChannel(messenger, CHANNEL).setMethodCallHandler(::onMethodCall)
|
||||
}
|
||||
|
||||
fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?): Boolean {
|
||||
if (requestCode != REQUEST_CODE) return false
|
||||
val result = pendingResult
|
||||
pendingResult = null
|
||||
if (result == null) {
|
||||
android.util.Log.w("ExternalPlayerChannel", "Result received without a pending channel call")
|
||||
} else {
|
||||
result.success(buildResult(resultCode, data))
|
||||
}
|
||||
return true
|
||||
}
|
||||
|
||||
fun dispose() {
|
||||
pendingResult?.error("ACTIVITY_DESTROYED", "Activity was destroyed while external player was active", null)
|
||||
pendingResult = null
|
||||
}
|
||||
|
||||
internal fun buildResult(resultCode: Int, data: Intent?): Map<String, Any?> {
|
||||
val extras = data?.extras
|
||||
val endPosition = firstNumberExtra(extras, positionExtras)
|
||||
val duration = firstNumberExtra(extras, durationExtras)
|
||||
val action = data?.action
|
||||
val playbackCompleted = when (action) {
|
||||
API_MX_RESULT_ID -> extras?.getString(API_MX_RESULT_END_BY) == API_MX_RESULT_END_BY_PLAYBACK_COMPLETION
|
||||
API_VIMU_RESULT_ID -> resultCode == API_VIMU_RESULT_PLAYBACK_COMPLETED
|
||||
else -> false
|
||||
}
|
||||
val playbackError = action == API_VIMU_RESULT_ID && resultCode == API_VIMU_RESULT_ERROR
|
||||
|
||||
return mapOf(
|
||||
"launched" to true,
|
||||
"resultCode" to resultCode,
|
||||
"resultOk" to (resultCode == Activity.RESULT_OK),
|
||||
"action" to action,
|
||||
"positionMs" to endPosition,
|
||||
"durationMs" to duration,
|
||||
"playbackCompleted" to playbackCompleted,
|
||||
"playbackError" to playbackError
|
||||
)
|
||||
}
|
||||
|
||||
private fun firstNumberExtra(extras: Bundle?, keys: Array<String>): Long? {
|
||||
if (extras == null) return null
|
||||
for (key in keys) {
|
||||
@Suppress("DEPRECATION")
|
||||
val value = extras.get(key)
|
||||
when (value) {
|
||||
is Number -> return value.toLong()
|
||||
is String -> value.toLongOrNull()?.let { return it }
|
||||
}
|
||||
}
|
||||
return null
|
||||
}
|
||||
|
||||
@Suppress("UNCHECKED_CAST")
|
||||
private fun onMethodCall(call: MethodCall, result: MethodChannel.Result) {
|
||||
if (call.method != "openVideo") {
|
||||
result.notImplemented()
|
||||
return
|
||||
}
|
||||
|
||||
val filePath = call.argument<String>("filePath")
|
||||
val packageNames = call.argument<List<Any?>>("packages")
|
||||
?.mapNotNull { (it as? String)?.trim()?.takeIf(String::isNotEmpty) }
|
||||
?: emptyList()
|
||||
val title = call.argument<String>("title")?.trim()?.takeIf(String::isNotEmpty)
|
||||
val startPositionMs = call.argument<Number>("startPositionMs")?.toLong() ?: 0L
|
||||
|
||||
if (filePath == null) {
|
||||
result.error("INVALID_ARGUMENT", "filePath is required", null)
|
||||
return
|
||||
}
|
||||
if (pendingResult != null) {
|
||||
result.error("ALREADY_ACTIVE", "An external player is already active", null)
|
||||
return
|
||||
}
|
||||
|
||||
try {
|
||||
val source = resolveSource(filePath)
|
||||
val targetPackages = if (packageNames.isEmpty()) listOf<String?>(null) else packageNames
|
||||
for (packageName in targetPackages) {
|
||||
try {
|
||||
pendingResult = result
|
||||
activity.startActivityForResult(
|
||||
buildIntent(source, packageName, startPositionMs, title),
|
||||
REQUEST_CODE
|
||||
)
|
||||
return
|
||||
} catch (_: ActivityNotFoundException) {
|
||||
pendingResult = null
|
||||
}
|
||||
}
|
||||
|
||||
val message = if (packageNames.isEmpty()) {
|
||||
"No app found for video"
|
||||
} else {
|
||||
"No app found for packages: ${packageNames.joinToString(", ")}"
|
||||
}
|
||||
result.error("APP_NOT_FOUND", message, null)
|
||||
} catch (error: Exception) {
|
||||
pendingResult = null
|
||||
result.error("LAUNCH_FAILED", error.message ?: error.javaClass.simpleName, null)
|
||||
}
|
||||
}
|
||||
|
||||
private data class Source(val uri: Uri, val grantRead: Boolean, val fileName: String?)
|
||||
|
||||
private fun resolveSource(filePath: String): Source {
|
||||
if (filePath.startsWith("http://") || filePath.startsWith("https://")) {
|
||||
val uri = Uri.parse(filePath)
|
||||
return Source(uri, grantRead = false, fileName = uri.lastPathSegment)
|
||||
}
|
||||
if (filePath.startsWith("content://")) {
|
||||
val uri = Uri.parse(filePath)
|
||||
return Source(uri, grantRead = true, fileName = uri.lastPathSegment)
|
||||
}
|
||||
|
||||
val path = if (filePath.startsWith("file://")) filePath.removePrefix("file://") else filePath
|
||||
val file = File(path)
|
||||
val uri = FileProvider.getUriForFile(activity, "com.edde746.plezy.fileprovider", file)
|
||||
return Source(uri, grantRead = true, fileName = file.name)
|
||||
}
|
||||
|
||||
private fun buildIntent(
|
||||
source: Source,
|
||||
packageName: String?,
|
||||
startPositionMs: Long,
|
||||
title: String?
|
||||
): Intent = Intent(Intent.ACTION_VIEW).apply {
|
||||
setDataAndType(source.uri, "video/*")
|
||||
if (source.grantRead) addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION)
|
||||
packageName?.let(::setPackage)
|
||||
val startPosition = startPositionMs.coerceAtLeast(0).coerceAtMost(Int.MAX_VALUE.toLong()).toInt()
|
||||
if (startPosition > 0) {
|
||||
putExtra(API_MX_RESULT_POSITION, startPosition)
|
||||
putExtra(API_VIMU_SEEK_POSITION, startPosition)
|
||||
}
|
||||
putExtra(API_MX_RETURN_RESULT, true)
|
||||
putExtra(API_MX_SECURE_URI, true)
|
||||
putExtra(API_VIMU_RESUME, false)
|
||||
title?.let {
|
||||
putExtra(API_MX_TITLE, it)
|
||||
putExtra(API_VIMU_TITLE, it)
|
||||
}
|
||||
source.fileName?.let { putExtra(API_MX_FILENAME, it) }
|
||||
}
|
||||
}
|
||||
@@ -1,35 +1,29 @@
|
||||
package com.edde746.plezy
|
||||
|
||||
import android.app.Activity
|
||||
import android.app.ActivityManager
|
||||
import android.app.AppOpsManager
|
||||
import android.app.PictureInPictureParams
|
||||
import android.content.ActivityNotFoundException
|
||||
import android.content.Context
|
||||
import android.content.Intent
|
||||
import android.content.pm.PackageManager
|
||||
import android.content.res.Configuration
|
||||
import android.graphics.SurfaceTexture
|
||||
import android.media.AudioManager
|
||||
import android.net.Uri
|
||||
import android.os.Build
|
||||
import android.os.Bundle
|
||||
import android.os.Handler
|
||||
import android.os.Looper
|
||||
import android.os.Process
|
||||
import android.provider.Settings
|
||||
import android.util.Log
|
||||
import android.util.Rational
|
||||
import android.view.InputDevice
|
||||
import android.view.KeyEvent
|
||||
import android.view.TextureView
|
||||
import android.view.ViewGroup
|
||||
import android.view.WindowInsets
|
||||
import android.view.WindowManager
|
||||
import android.view.inputmethod.InputMethodManager
|
||||
import android.widget.FrameLayout
|
||||
import androidx.core.content.FileProvider
|
||||
import androidx.annotation.RequiresApi
|
||||
import com.edde746.plezy.exoplayer.ExoPlayerPlugin
|
||||
import com.edde746.plezy.mpv.MpvAudioPlayerPlugin
|
||||
import com.edde746.plezy.mpv.MpvPlayerPlugin
|
||||
import com.edde746.plezy.shared.DeviceQuirks
|
||||
import com.edde746.plezy.shared.ThemeHelper
|
||||
@@ -41,7 +35,6 @@ import io.flutter.embedding.android.TransparencyMode
|
||||
import io.flutter.embedding.engine.FlutterEngine
|
||||
import io.flutter.embedding.engine.FlutterShellArgs
|
||||
import io.flutter.plugin.common.MethodChannel
|
||||
import java.io.File
|
||||
import kotlin.math.roundToInt
|
||||
|
||||
class MainActivity : FlutterActivity() {
|
||||
@@ -49,46 +42,27 @@ class MainActivity : FlutterActivity() {
|
||||
companion object {
|
||||
private const val TAG = "MainActivity"
|
||||
private const val TEXT_INPUT_DIAGNOSTICS_ENABLED = false
|
||||
private const val EXTERNAL_PLAYER_REQUEST_CODE = 7461
|
||||
|
||||
// External player result APIs used by Jellyfin Android TV.
|
||||
private const val API_MX_RETURN_RESULT = "return_result"
|
||||
private const val API_MX_RESULT_ID = "com.mxtech.intent.result.VIEW"
|
||||
private const val API_MX_RESULT_POSITION = "position"
|
||||
private const val API_MX_RESULT_DURATION = "duration"
|
||||
private const val API_MX_RESULT_END_BY = "end_by"
|
||||
private const val API_MX_RESULT_END_BY_PLAYBACK_COMPLETION = "playback_completion"
|
||||
private const val API_MX_TITLE = "title"
|
||||
private const val API_MX_FILENAME = "filename"
|
||||
private const val API_MX_SECURE_URI = "secure_uri"
|
||||
private const val API_VLC_RESULT_POSITION = "extra_position"
|
||||
private const val API_VLC_RESULT_DURATION = "extra_duration"
|
||||
|
||||
private const val API_VIMU_TITLE = "forcename"
|
||||
private const val API_VIMU_SEEK_POSITION = "startfrom"
|
||||
private const val API_VIMU_RESUME = "forceresume"
|
||||
private const val API_VIMU_RESULT_ID = "net.gtvbox.videoplayer.result"
|
||||
private const val API_VIMU_RESULT_ERROR = 4
|
||||
private const val API_VIMU_RESULT_PLAYBACK_COMPLETED = 1
|
||||
|
||||
private val externalPlayerPositionExtras = arrayOf(API_MX_RESULT_POSITION, API_VLC_RESULT_POSITION)
|
||||
private val externalPlayerDurationExtras = arrayOf(API_MX_RESULT_DURATION, API_VLC_RESULT_DURATION)
|
||||
// Mirrors DevicePerformance._lowMemThresholdBytes (2252 MiB): nominal
|
||||
// "2GB" devices report totalMem slightly above 2 GiB after carve-outs.
|
||||
private const val LOW_MEM_THRESHOLD_BYTES = 2252L shl 20
|
||||
|
||||
var usingSkia = false
|
||||
}
|
||||
|
||||
private val PIP_CHANNEL = "com.plezy/pip"
|
||||
private val EXTERNAL_PLAYER_CHANNEL = "com.plezy/external_player"
|
||||
private val THEME_CHANNEL = "com.plezy/theme"
|
||||
private val DEVICE_CHANNEL = "com.plezy/device"
|
||||
private val DEVICE_ADJUSTMENT_CHANNEL = "com.plezy/device_adjustment"
|
||||
private val TEXT_INPUT_CHANNEL = "com.plezy/text_input"
|
||||
private val APP_EXIT_CHANNEL = "com.plezy/app_exit"
|
||||
private val APP_FOREGROUND_CHANNEL = "com.plezy/app_foreground"
|
||||
private var watchNextPlugin: WatchNextPlugin? = null
|
||||
private var nativeTextInputFocused = false
|
||||
private var pendingExternalPlayerResult: MethodChannel.Result? = null
|
||||
private var originalWindowBrightness: Float? = null
|
||||
private var flutterTextureView: FlutterTextureView? = null
|
||||
private var flutterSurfaceReconnectPending = false
|
||||
private var activityStarted = false
|
||||
private val externalPlayerChannel = ExternalPlayerChannel(this)
|
||||
|
||||
private inline fun logTextInputDiag(message: () -> String) {
|
||||
if (TEXT_INPUT_DIAGNOSTICS_ENABLED) {
|
||||
@@ -210,6 +184,18 @@ class MainActivity : FlutterActivity() {
|
||||
)
|
||||
}
|
||||
|
||||
/**
|
||||
* Same triple DevicePerformance uses for the reduced tier on the Dart
|
||||
* side — keep the two in sync. Evaluated here too because engine shell
|
||||
* args must be decided before Dart runs.
|
||||
*/
|
||||
private fun isLowRamClass(): Boolean {
|
||||
val activityManager = getSystemService(Context.ACTIVITY_SERVICE) as ActivityManager
|
||||
val memoryInfo = ActivityManager.MemoryInfo()
|
||||
activityManager.getMemoryInfo(memoryInfo)
|
||||
return !Process.is64Bit() || activityManager.isLowRamDevice || memoryInfo.totalMem <= LOW_MEM_THRESHOLD_BYTES
|
||||
}
|
||||
|
||||
/** User-assigned device name (Settings > About > Device name), or null. */
|
||||
private fun getDeviceName(): String? {
|
||||
// The name the user gave the device; also used by Cast/Nearby.
|
||||
@@ -310,63 +296,16 @@ class MainActivity : FlutterActivity() {
|
||||
}
|
||||
|
||||
override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) {
|
||||
if (requestCode == EXTERNAL_PLAYER_REQUEST_CODE) {
|
||||
val pendingResult = pendingExternalPlayerResult
|
||||
pendingExternalPlayerResult = null
|
||||
if (pendingResult == null) {
|
||||
Log.w(TAG, "External player result received without a pending channel result")
|
||||
} else {
|
||||
pendingResult.success(buildExternalPlayerResult(resultCode, data))
|
||||
}
|
||||
return
|
||||
if (!externalPlayerChannel.onActivityResult(requestCode, resultCode, data)) {
|
||||
super.onActivityResult(requestCode, resultCode, data)
|
||||
}
|
||||
|
||||
super.onActivityResult(requestCode, resultCode, data)
|
||||
}
|
||||
|
||||
private fun buildExternalPlayerResult(resultCode: Int, data: Intent?): Map<String, Any?> {
|
||||
val extras = data?.extras
|
||||
val endPosition = firstNumberExtra(extras, externalPlayerPositionExtras)
|
||||
val duration = firstNumberExtra(extras, externalPlayerDurationExtras)
|
||||
val action = data?.action
|
||||
val playbackCompleted = when (action) {
|
||||
API_MX_RESULT_ID -> extras?.getString(API_MX_RESULT_END_BY) == API_MX_RESULT_END_BY_PLAYBACK_COMPLETION
|
||||
API_VIMU_RESULT_ID -> resultCode == API_VIMU_RESULT_PLAYBACK_COMPLETED
|
||||
else -> false
|
||||
}
|
||||
val playbackError = when (action) {
|
||||
API_VIMU_RESULT_ID -> resultCode == API_VIMU_RESULT_ERROR
|
||||
else -> false
|
||||
}
|
||||
|
||||
return mapOf(
|
||||
"launched" to true,
|
||||
"resultCode" to resultCode,
|
||||
"resultOk" to (resultCode == Activity.RESULT_OK),
|
||||
"action" to action,
|
||||
"positionMs" to endPosition,
|
||||
"durationMs" to duration,
|
||||
"playbackCompleted" to playbackCompleted,
|
||||
"playbackError" to playbackError
|
||||
)
|
||||
}
|
||||
|
||||
private fun firstNumberExtra(extras: Bundle?, keys: Array<String>): Long? {
|
||||
if (extras == null) return null
|
||||
for (key in keys) {
|
||||
@Suppress("DEPRECATION")
|
||||
val value = extras.get(key)
|
||||
when (value) {
|
||||
is Number -> return value.toLong()
|
||||
is String -> value.toLongOrNull()?.let { return it }
|
||||
}
|
||||
}
|
||||
return null
|
||||
}
|
||||
|
||||
override fun onDestroy() {
|
||||
pendingExternalPlayerResult?.error("ACTIVITY_DESTROYED", "Activity was destroyed while external player was active", null)
|
||||
pendingExternalPlayerResult = null
|
||||
externalPlayerChannel.dispose()
|
||||
activityStarted = false
|
||||
flutterSurfaceReconnectPending = false
|
||||
flutterTextureView = null
|
||||
super.onDestroy()
|
||||
}
|
||||
|
||||
@@ -382,12 +321,19 @@ class MainActivity : FlutterActivity() {
|
||||
val args = super.getFlutterShellArgs()
|
||||
usingSkia = shouldDisableImpeller()
|
||||
if (usingSkia) args.add("--enable-impeller=false")
|
||||
if (isLowRamClass()) {
|
||||
// Bound the memory pools Dart can't reach: Skia's GPU resource cache
|
||||
// is sized from the surface area (hundreds of MB on a 4K-composited
|
||||
// TV) and the Dart old gen defaults to a large fraction of physical
|
||||
// RAM. Both drive LMK kills on 2GB boxes (#1349).
|
||||
if (usingSkia) args.add("--resource-cache-max-bytes-threshold=50331648")
|
||||
args.add("--old-gen-heap-size=256")
|
||||
Log.i(TAG, "Low-RAM device: capped engine caches (skia=$usingSkia, oldGen=256MB)")
|
||||
}
|
||||
return args
|
||||
}
|
||||
|
||||
private fun shouldDisableImpeller(): Boolean {
|
||||
// Android TV devices — weaker GPUs, less Impeller testing
|
||||
if (isAndroidTvDevice()) return true
|
||||
if (DeviceQuirks.isEWaste) return true
|
||||
// NVIDIA Tegra (Shield TV)
|
||||
if (Build.MANUFACTURER.equals("NVIDIA", ignoreCase = true)) return true
|
||||
@@ -397,9 +343,21 @@ class MainActivity : FlutterActivity() {
|
||||
) {
|
||||
return true
|
||||
}
|
||||
if (isAndroidTvDevice()) return !tvSupportsImpeller()
|
||||
return false
|
||||
}
|
||||
|
||||
// Impeller froze API 30 Fire TV hardware (#749) and Flutter's Vulkan → GLES
|
||||
// fallback still miscompiles gradients/SVGs, so only TV devices on Android 12+
|
||||
// with a Vulkan 1.1 driver leave the Skia path.
|
||||
private fun tvSupportsImpeller(): Boolean {
|
||||
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.S) return false
|
||||
// Fire OS reports modern API levels on GPUs whose drivers can't back it up
|
||||
if (Build.MANUFACTURER.equals("Amazon", ignoreCase = true)) return false
|
||||
val vulkan11 = 0x401000 // FEATURE_VULKAN_HARDWARE_VERSION encodes 1.1.0 as 0x401000
|
||||
return packageManager.hasSystemFeature(PackageManager.FEATURE_VULKAN_HARDWARE_VERSION, vulkan11)
|
||||
}
|
||||
|
||||
override fun getRenderMode(): RenderMode {
|
||||
// Keep Flutter in the normal View hierarchy so video/subtitle SurfaceViews
|
||||
// remain the only native composition layers. This restores the pre-1.35.0
|
||||
@@ -413,41 +371,49 @@ class MainActivity : FlutterActivity() {
|
||||
}
|
||||
|
||||
override fun onFlutterTextureViewCreated(flutterTextureView: FlutterTextureView) {
|
||||
this.flutterTextureView = flutterTextureView
|
||||
val original = flutterTextureView.surfaceTextureListener ?: return
|
||||
val handler = Handler(Looper.getMainLooper())
|
||||
var pendingResize: Runnable? = null
|
||||
var lastWidth = 0
|
||||
var lastHeight = 0
|
||||
flutterTextureView.surfaceTextureListener =
|
||||
DeferredSurfaceTextureListener(
|
||||
delegate = original,
|
||||
onSurfaceAvailable = ::tryReconnectFlutterSurface
|
||||
) { surface ->
|
||||
flutterTextureView.isAvailable && flutterTextureView.surfaceTexture === surface
|
||||
}
|
||||
}
|
||||
|
||||
flutterTextureView.surfaceTextureListener = object : TextureView.SurfaceTextureListener {
|
||||
override fun onSurfaceTextureAvailable(surface: SurfaceTexture, width: Int, height: Int) {
|
||||
original.onSurfaceTextureAvailable(surface, width, height)
|
||||
override fun onStop() {
|
||||
activityStarted = false
|
||||
if (isAndroidTvDevice()) flutterSurfaceReconnectPending = true
|
||||
super.onStop()
|
||||
}
|
||||
|
||||
override fun onStart() {
|
||||
super.onStart()
|
||||
activityStarted = true
|
||||
tryReconnectFlutterSurface()
|
||||
}
|
||||
|
||||
private fun tryReconnectFlutterSurface() {
|
||||
if (!activityStarted || !flutterSurfaceReconnectPending) return
|
||||
val textureView = flutterTextureView ?: return
|
||||
textureView.post {
|
||||
if (!activityStarted ||
|
||||
!flutterSurfaceReconnectPending ||
|
||||
textureView !== flutterTextureView ||
|
||||
!textureView.isAttachedToWindow ||
|
||||
!textureView.isAvailable
|
||||
) {
|
||||
return@post
|
||||
}
|
||||
|
||||
override fun onSurfaceTextureSizeChanged(surface: SurfaceTexture, width: Int, height: Int) {
|
||||
if (width == lastWidth && height == lastHeight) return
|
||||
lastWidth = width
|
||||
lastHeight = height
|
||||
pendingResize?.let { handler.removeCallbacks(it) }
|
||||
pendingResize = Runnable {
|
||||
if (flutterTextureView.isAvailable) {
|
||||
original.onSurfaceTextureSizeChanged(surface, width, height)
|
||||
}
|
||||
}
|
||||
handler.postDelayed(pendingResize!!, 100)
|
||||
}
|
||||
|
||||
override fun onSurfaceTextureUpdated(surface: SurfaceTexture) {
|
||||
original.onSurfaceTextureUpdated(surface)
|
||||
}
|
||||
|
||||
override fun onSurfaceTextureDestroyed(surface: SurfaceTexture): Boolean {
|
||||
pendingResize?.let { handler.removeCallbacks(it) }
|
||||
pendingResize = null
|
||||
lastWidth = 0
|
||||
lastHeight = 0
|
||||
return original.onSurfaceTextureDestroyed(surface)
|
||||
}
|
||||
// Some TV firmware retains an available TextureView while invalidating
|
||||
// its compositor surface during standby. Force Flutter's supported
|
||||
// surface-swap path so rendering resumes without restarting the engine.
|
||||
Log.i(TAG, "Reconnecting Flutter texture surface after Android TV standby")
|
||||
textureView.pause()
|
||||
textureView.resume()
|
||||
flutterSurfaceReconnectPending = false
|
||||
}
|
||||
}
|
||||
|
||||
@@ -455,6 +421,7 @@ class MainActivity : FlutterActivity() {
|
||||
super.configureFlutterEngine(flutterEngine)
|
||||
flutterEngine.plugins.add(MpvPlayerPlugin())
|
||||
flutterEngine.plugins.add(ExoPlayerPlugin())
|
||||
flutterEngine.plugins.add(MpvAudioPlayerPlugin())
|
||||
|
||||
MethodChannel(flutterEngine.dartExecutor.binaryMessenger, DEVICE_CHANNEL).setMethodCallHandler { call, result ->
|
||||
when (call.method) {
|
||||
@@ -495,101 +462,7 @@ class MainActivity : FlutterActivity() {
|
||||
}
|
||||
}
|
||||
|
||||
MethodChannel(flutterEngine.dartExecutor.binaryMessenger, APP_FOREGROUND_CHANNEL).setMethodCallHandler { call, result ->
|
||||
when (call.method) {
|
||||
"requestForeground" -> result.success(requestForeground())
|
||||
else -> result.notImplemented()
|
||||
}
|
||||
}
|
||||
|
||||
// External player: open local video files with proper content:// URIs
|
||||
MethodChannel(flutterEngine.dartExecutor.binaryMessenger, EXTERNAL_PLAYER_CHANNEL).setMethodCallHandler { call, result ->
|
||||
when (call.method) {
|
||||
"openVideo" -> {
|
||||
val filePath = call.argument<String>("filePath")
|
||||
val packageNames = call.argument<List<Any?>>("packages")
|
||||
?.mapNotNull { (it as? String)?.trim()?.takeIf { value -> value.isNotEmpty() } }
|
||||
?: emptyList()
|
||||
val title = call.argument<String>("title")?.trim()?.takeIf { it.isNotEmpty() }
|
||||
val startPositionMs = call.argument<Number>("startPositionMs")?.toLong() ?: 0L
|
||||
|
||||
if (filePath == null) {
|
||||
result.error("INVALID_ARGUMENT", "filePath is required", null)
|
||||
return@setMethodCallHandler
|
||||
}
|
||||
|
||||
if (pendingExternalPlayerResult != null) {
|
||||
result.error("ALREADY_ACTIVE", "An external player is already active", null)
|
||||
return@setMethodCallHandler
|
||||
}
|
||||
|
||||
try {
|
||||
val uri: Uri
|
||||
val grantRead: Boolean
|
||||
val fileName: String?
|
||||
|
||||
if (filePath.startsWith("http://") || filePath.startsWith("https://")) {
|
||||
uri = Uri.parse(filePath)
|
||||
grantRead = false
|
||||
fileName = uri.lastPathSegment
|
||||
} else if (filePath.startsWith("content://")) {
|
||||
uri = Uri.parse(filePath)
|
||||
grantRead = true
|
||||
fileName = uri.lastPathSegment
|
||||
} else {
|
||||
val path = if (filePath.startsWith("file://")) filePath.removePrefix("file://") else filePath
|
||||
fileName = File(path).name
|
||||
uri = FileProvider.getUriForFile(this, "com.edde746.plezy.fileprovider", File(path))
|
||||
grantRead = true
|
||||
}
|
||||
|
||||
fun buildIntent(packageName: String?): Intent = Intent(Intent.ACTION_VIEW).apply {
|
||||
setDataAndType(uri, "video/*")
|
||||
if (grantRead) {
|
||||
addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION)
|
||||
}
|
||||
packageName?.let { setPackage(it) }
|
||||
val startPosition = startPositionMs.coerceAtLeast(0).coerceAtMost(Int.MAX_VALUE.toLong()).toInt()
|
||||
if (startPosition > 0) {
|
||||
putExtra(API_MX_RESULT_POSITION, startPosition)
|
||||
putExtra(API_VIMU_SEEK_POSITION, startPosition)
|
||||
}
|
||||
putExtra(API_MX_RETURN_RESULT, true)
|
||||
putExtra(API_MX_SECURE_URI, true)
|
||||
putExtra(API_VIMU_RESUME, false)
|
||||
title?.let {
|
||||
putExtra(API_MX_TITLE, it)
|
||||
putExtra(API_VIMU_TITLE, it)
|
||||
}
|
||||
fileName?.let { putExtra(API_MX_FILENAME, it) }
|
||||
}
|
||||
|
||||
val targetPackages = if (packageNames.isEmpty()) listOf<String?>(null) else packageNames
|
||||
for (packageName in targetPackages) {
|
||||
try {
|
||||
pendingExternalPlayerResult = result
|
||||
startActivityForResult(buildIntent(packageName), EXTERNAL_PLAYER_REQUEST_CODE)
|
||||
return@setMethodCallHandler
|
||||
} catch (e: ActivityNotFoundException) {
|
||||
pendingExternalPlayerResult = null
|
||||
}
|
||||
}
|
||||
|
||||
pendingExternalPlayerResult = null
|
||||
val message = if (packageNames.isEmpty()) {
|
||||
"No app found for video"
|
||||
} else {
|
||||
"No app found for packages: ${packageNames.joinToString(", ")}"
|
||||
}
|
||||
result.error("APP_NOT_FOUND", message, null)
|
||||
} catch (e: Exception) {
|
||||
pendingExternalPlayerResult = null
|
||||
result.error("LAUNCH_FAILED", e.message ?: e.javaClass.simpleName, null)
|
||||
}
|
||||
}
|
||||
else -> result.notImplemented()
|
||||
}
|
||||
}
|
||||
externalPlayerChannel.attach(flutterEngine.dartExecutor.binaryMessenger)
|
||||
|
||||
// Splash screen theme: persist user's chosen theme for next launch (API 31+)
|
||||
MethodChannel(flutterEngine.dartExecutor.binaryMessenger, THEME_CHANNEL).setMethodCallHandler { call, result ->
|
||||
@@ -686,31 +559,6 @@ class MainActivity : FlutterActivity() {
|
||||
}
|
||||
}
|
||||
|
||||
private fun requestForeground(): Boolean = try {
|
||||
val activityManager = getSystemService(Context.ACTIVITY_SERVICE) as ActivityManager
|
||||
activityManager.moveTaskToFront(taskId, 0)
|
||||
true
|
||||
} catch (e: Exception) {
|
||||
Log.w(TAG, "Failed to move task to foreground", e)
|
||||
try {
|
||||
val launchIntent = packageManager.getLaunchIntentForPackage(packageName)?.apply {
|
||||
addFlags(Intent.FLAG_ACTIVITY_REORDER_TO_FRONT)
|
||||
addFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP)
|
||||
addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP)
|
||||
addFlags(Intent.FLAG_ACTIVITY_NEW_TASK)
|
||||
}
|
||||
if (launchIntent != null) {
|
||||
startActivity(launchIntent)
|
||||
true
|
||||
} else {
|
||||
false
|
||||
}
|
||||
} catch (launchError: Exception) {
|
||||
Log.w(TAG, "Failed to start foreground activity", launchError)
|
||||
false
|
||||
}
|
||||
}
|
||||
|
||||
private fun handleDeviceAdjustmentCall(method: String, arguments: Any?, result: MethodChannel.Result) {
|
||||
try {
|
||||
when (method) {
|
||||
@@ -829,6 +677,7 @@ class MainActivity : FlutterActivity() {
|
||||
}
|
||||
}
|
||||
|
||||
@RequiresApi(Build.VERSION_CODES.O)
|
||||
private fun isPipPermissionGranted(): Boolean {
|
||||
val appOpsManager = getSystemService(Context.APP_OPS_SERVICE) as AppOpsManager
|
||||
return appOpsManager.checkOpNoThrow(
|
||||
@@ -838,6 +687,7 @@ class MainActivity : FlutterActivity() {
|
||||
) == AppOpsManager.MODE_ALLOWED
|
||||
}
|
||||
|
||||
@RequiresApi(Build.VERSION_CODES.O)
|
||||
private fun buildPipParams(width: Int, height: Int, autoEnterEnabled: Boolean? = null): PictureInPictureParams {
|
||||
val (w, h) = if (width <= 0 || height <= 0) {
|
||||
Pair(16, 9)
|
||||
|
||||
@@ -0,0 +1,24 @@
|
||||
package com.edde746.plezy
|
||||
|
||||
import android.content.Context
|
||||
import android.content.pm.PackageManager
|
||||
import android.content.res.Configuration
|
||||
|
||||
/**
|
||||
* Native mirror of MainActivity.getAndroidTvDetection(): any TV signal counts.
|
||||
* Kept in sync with the Dart-facing detection so native gating matches
|
||||
* PlatformDetector.isTV().
|
||||
*/
|
||||
object TvDetection {
|
||||
fun isTv(context: Context): Boolean {
|
||||
val pm = context.packageManager
|
||||
val uiModeType = context.resources.configuration.uiMode and Configuration.UI_MODE_TYPE_MASK
|
||||
|
||||
@Suppress("DEPRECATION")
|
||||
return uiModeType == Configuration.UI_MODE_TYPE_TELEVISION ||
|
||||
pm.hasSystemFeature(PackageManager.FEATURE_TELEVISION) ||
|
||||
pm.hasSystemFeature(PackageManager.FEATURE_LEANBACK) ||
|
||||
pm.hasSystemFeature("amazon.hardware.fire_tv") ||
|
||||
!pm.hasSystemFeature(PackageManager.FEATURE_TOUCHSCREEN)
|
||||
}
|
||||
}
|
||||
@@ -3,6 +3,7 @@ package com.edde746.plezy.exoplayer
|
||||
import android.os.Build
|
||||
import android.view.SurfaceControl
|
||||
import android.view.SurfaceView
|
||||
import androidx.annotation.RequiresApi
|
||||
import java.util.concurrent.atomic.AtomicBoolean
|
||||
import java.util.concurrent.atomic.AtomicInteger
|
||||
import kotlin.math.abs
|
||||
@@ -101,6 +102,7 @@ internal class AssLatencyCalibrator(
|
||||
|
||||
/** Never called while holding [lock]: applyTransactionToFrame is a binder call and runs on the
|
||||
* GL swap path. The native slot allocation is atomic, so concurrent callers are safe. */
|
||||
@RequiresApi(34)
|
||||
private fun attach(surface: SurfaceView, releaseTimeNs: Long, source: Int) {
|
||||
try {
|
||||
val tx = SurfaceControl.Transaction()
|
||||
|
||||
+95
@@ -0,0 +1,95 @@
|
||||
package com.edde746.plezy.exoplayer
|
||||
|
||||
import androidx.media3.common.C
|
||||
import androidx.media3.common.DataReader
|
||||
import androidx.media3.common.Format
|
||||
import androidx.media3.common.util.ParsableByteArray
|
||||
import androidx.media3.extractor.TrackOutput
|
||||
import java.io.EOFException
|
||||
|
||||
/** Shared whole-sample buffering protocol for TrackOutput transforms. */
|
||||
abstract class BufferedTransformingTrackOutput(
|
||||
protected val delegate: TrackOutput,
|
||||
initialBufferSize: Int,
|
||||
initialReadBufferSize: Int = initialBufferSize
|
||||
) : TrackOutput {
|
||||
protected var inputBuffer = ByteArray(initialBufferSize)
|
||||
private set
|
||||
|
||||
private var inputLength = 0
|
||||
private var buffering = false
|
||||
private var readBuffer = ByteArray(initialReadBufferSize)
|
||||
private val outputParsable = ParsableByteArray()
|
||||
|
||||
protected abstract val transformEnabled: Boolean
|
||||
protected abstract val transformedBuffer: ByteArray
|
||||
|
||||
/** Returns transformed length, or a negative value to drop the sample. */
|
||||
protected abstract fun transformSample(inputLength: Int, flags: Int): Int
|
||||
open override fun format(format: Format) = delegate.format(format)
|
||||
|
||||
override fun sampleData(
|
||||
input: DataReader,
|
||||
length: Int,
|
||||
allowEndOfInput: Boolean,
|
||||
sampleDataPart: Int
|
||||
): Int {
|
||||
if (!transformEnabled) {
|
||||
return delegate.sampleData(input, length, allowEndOfInput, sampleDataPart)
|
||||
}
|
||||
|
||||
buffering = true
|
||||
if (readBuffer.size < length) readBuffer = ByteArray(length)
|
||||
val bytesRead = input.read(readBuffer, 0, length)
|
||||
if (bytesRead == C.RESULT_END_OF_INPUT && !allowEndOfInput) throw EOFException()
|
||||
if (bytesRead > 0) appendInput(readBuffer, bytesRead)
|
||||
return bytesRead
|
||||
}
|
||||
|
||||
override fun sampleData(data: ParsableByteArray, length: Int, sampleDataPart: Int) {
|
||||
if (!transformEnabled) {
|
||||
delegate.sampleData(data, length, sampleDataPart)
|
||||
return
|
||||
}
|
||||
|
||||
buffering = true
|
||||
ensureInputCapacity(inputLength + length)
|
||||
data.readBytes(inputBuffer, inputLength, length)
|
||||
inputLength += length
|
||||
}
|
||||
|
||||
override fun sampleMetadata(
|
||||
timeUs: Long,
|
||||
flags: Int,
|
||||
size: Int,
|
||||
offset: Int,
|
||||
cryptoData: TrackOutput.CryptoData?
|
||||
) {
|
||||
if (!transformEnabled || !buffering) {
|
||||
delegate.sampleMetadata(timeUs, flags, size, offset, cryptoData)
|
||||
return
|
||||
}
|
||||
|
||||
buffering = false
|
||||
val sourceLength = inputLength
|
||||
inputLength = 0
|
||||
val transformedLength = transformSample(sourceLength, flags)
|
||||
if (transformedLength < 0) return
|
||||
|
||||
outputParsable.reset(transformedBuffer, transformedLength)
|
||||
delegate.sampleData(outputParsable, transformedLength, TrackOutput.SAMPLE_DATA_PART_MAIN)
|
||||
delegate.sampleMetadata(timeUs, flags, transformedLength, 0, cryptoData)
|
||||
}
|
||||
|
||||
private fun appendInput(source: ByteArray, length: Int) {
|
||||
ensureInputCapacity(inputLength + length)
|
||||
System.arraycopy(source, 0, inputBuffer, inputLength, length)
|
||||
inputLength += length
|
||||
}
|
||||
|
||||
private fun ensureInputCapacity(needed: Int) {
|
||||
if (inputBuffer.size < needed) {
|
||||
inputBuffer = inputBuffer.copyOf(maxOf(needed, inputBuffer.size * 2))
|
||||
}
|
||||
}
|
||||
}
|
||||
+43
-99
@@ -2,10 +2,8 @@ package com.edde746.plezy.exoplayer
|
||||
|
||||
import android.util.Log
|
||||
import androidx.media3.common.C
|
||||
import androidx.media3.common.DataReader
|
||||
import androidx.media3.common.Format
|
||||
import androidx.media3.common.MimeTypes
|
||||
import androidx.media3.common.util.ParsableByteArray
|
||||
import androidx.media3.extractor.TrackOutput
|
||||
|
||||
/**
|
||||
@@ -28,10 +26,10 @@ import androidx.media3.extractor.TrackOutput
|
||||
* All buffers are reused across samples to minimize GC pressure on the hot path.
|
||||
*/
|
||||
class DoviConvertingTrackOutput(
|
||||
private val delegate: TrackOutput,
|
||||
delegate: TrackOutput,
|
||||
private val dvMode: DvConversionMode = DvConversionMode.HEVC_STRIP,
|
||||
private val emitLog: ((String, String, String) -> Unit)? = null
|
||||
) : TrackOutput {
|
||||
) : BufferedTransformingTrackOutput(delegate, INITIAL_BUFFER_SIZE) {
|
||||
|
||||
companion object {
|
||||
private const val TAG = "DoviConvertTrack"
|
||||
@@ -65,12 +63,8 @@ class DoviConvertingTrackOutput(
|
||||
get() = if (sampleCount > 0) totalSampleProcessingTimeUs / sampleCount else 0L
|
||||
|
||||
// Reusable buffers — grown as needed, never shrunk
|
||||
private var sampleBuf = ByteArray(INITIAL_BUFFER_SIZE)
|
||||
private var sampleLen = 0
|
||||
private var outputBuf = ByteArray(INITIAL_BUFFER_SIZE)
|
||||
private var outputLen = 0
|
||||
private val outputParsable = ParsableByteArray()
|
||||
private var buffering = false
|
||||
|
||||
// Sample counter for periodic logging
|
||||
private var sampleCount = 0L
|
||||
@@ -79,6 +73,7 @@ class DoviConvertingTrackOutput(
|
||||
private var totalSampleProcessingTimeUs = 0L
|
||||
private var loggedSupplementalWrapper = false
|
||||
private var loggedEncryptedSupplementalPassthrough = false
|
||||
private var outputIsProcessed = false
|
||||
|
||||
override fun format(format: Format) {
|
||||
if (!conversionActive) {
|
||||
@@ -135,55 +130,15 @@ class DoviConvertingTrackOutput(
|
||||
delegate.format(format)
|
||||
}
|
||||
|
||||
override fun sampleData(
|
||||
input: DataReader,
|
||||
length: Int,
|
||||
allowEndOfInput: Boolean,
|
||||
sampleDataPart: Int
|
||||
): Int {
|
||||
if (!conversionActive) {
|
||||
return delegate.sampleData(input, length, allowEndOfInput, sampleDataPart)
|
||||
}
|
||||
override val transformEnabled: Boolean
|
||||
get() = conversionActive
|
||||
|
||||
buffering = true
|
||||
ensureSampleCapacity(sampleLen + length)
|
||||
val bytesRead = input.read(sampleBuf, sampleLen, length)
|
||||
if (bytesRead > 0) {
|
||||
sampleLen += bytesRead
|
||||
}
|
||||
return bytesRead
|
||||
}
|
||||
|
||||
override fun sampleData(data: ParsableByteArray, length: Int, sampleDataPart: Int) {
|
||||
if (!conversionActive) {
|
||||
delegate.sampleData(data, length, sampleDataPart)
|
||||
return
|
||||
}
|
||||
|
||||
buffering = true
|
||||
ensureSampleCapacity(sampleLen + length)
|
||||
data.readBytes(sampleBuf, sampleLen, length)
|
||||
sampleLen += length
|
||||
}
|
||||
|
||||
override fun sampleMetadata(
|
||||
timeUs: Long,
|
||||
flags: Int,
|
||||
size: Int,
|
||||
offset: Int,
|
||||
cryptoData: TrackOutput.CryptoData?
|
||||
) {
|
||||
if (!conversionActive || !buffering) {
|
||||
delegate.sampleMetadata(timeUs, flags, size, offset, cryptoData)
|
||||
return
|
||||
}
|
||||
|
||||
buffering = false
|
||||
val srcLen = sampleLen
|
||||
sampleLen = 0
|
||||
override val transformedBuffer: ByteArray
|
||||
get() = if (outputIsProcessed) outputBuf else inputBuffer
|
||||
|
||||
override fun transformSample(inputLength: Int, flags: Int): Int {
|
||||
val processStartNs = System.nanoTime()
|
||||
val success = if ((flags and C.BUFFER_FLAG_ENCRYPTED) != 0) {
|
||||
outputIsProcessed = if ((flags and C.BUFFER_FLAG_ENCRYPTED) != 0) {
|
||||
if (!loggedEncryptedSupplementalPassthrough && (flags and C.BUFFER_FLAG_HAS_SUPPLEMENTAL_DATA) != 0) {
|
||||
loggedEncryptedSupplementalPassthrough = true
|
||||
logWarn("Encrypted supplemental sample encountered, passing raw sample")
|
||||
@@ -191,25 +146,20 @@ class DoviConvertingTrackOutput(
|
||||
false
|
||||
} else {
|
||||
try {
|
||||
processSampleData(flags, srcLen)
|
||||
processSampleData(flags, inputLength)
|
||||
true
|
||||
} catch (e: Exception) {
|
||||
logError("NAL processing failed, passing raw sample", e)
|
||||
false
|
||||
}
|
||||
}
|
||||
val outLen = if (success) outputLen else srcLen
|
||||
val outBuf = if (success) outputBuf else sampleBuf
|
||||
if (success) {
|
||||
val transformedLength = if (outputIsProcessed) outputLen else inputLength
|
||||
if (outputIsProcessed) {
|
||||
recordSampleProcessing((System.nanoTime() - processStartNs) / 1_000L)
|
||||
}
|
||||
|
||||
// Skip empty samples (all NALs were DV layers) — don't confuse the decoder
|
||||
if (outLen == 0) return
|
||||
|
||||
outputParsable.reset(outBuf, outLen)
|
||||
delegate.sampleData(outputParsable, outLen, TrackOutput.SAMPLE_DATA_PART_MAIN)
|
||||
delegate.sampleMetadata(timeUs, flags, outLen, 0, cryptoData)
|
||||
// Skip empty samples (all NALs were DV layers) — don't confuse the decoder.
|
||||
return if (transformedLength == 0) -1 else transformedLength
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -231,7 +181,7 @@ class DoviConvertingTrackOutput(
|
||||
return
|
||||
}
|
||||
|
||||
val mainSampleLen = readInt32BE(sampleBuf, 0)
|
||||
val mainSampleLen = readInt32BE(inputBuffer, 0)
|
||||
if (mainSampleLen < 0 || mainSampleLen > dataLen - 4) {
|
||||
logWarn("Bad supplemental sample: mainLen=$mainSampleLen total=$dataLen")
|
||||
copyRawSample(dataLen)
|
||||
@@ -243,7 +193,7 @@ class DoviConvertingTrackOutput(
|
||||
loggedSupplementalWrapper = true
|
||||
logDebug(
|
||||
"Supplemental wrapper detected: total=${dataLen}B, main=${mainSampleLen}B, " +
|
||||
"supplemental=${supplementalLen}B, innerFirstBytes=${formatBytes(sampleBuf, 4, 8)}"
|
||||
"supplemental=${supplementalLen}B, innerFirstBytes=${formatBytes(inputBuffer, 4, 8)}"
|
||||
)
|
||||
}
|
||||
|
||||
@@ -259,7 +209,7 @@ class DoviConvertingTrackOutput(
|
||||
System.arraycopy(outputBuf, 0, outputBuf, 4, processedMainLen)
|
||||
writeInt32BE(outputBuf, 0, processedMainLen)
|
||||
if (supplementalLen > 0) {
|
||||
System.arraycopy(sampleBuf, 4 + mainSampleLen, outputBuf, 4 + processedMainLen, supplementalLen)
|
||||
System.arraycopy(inputBuffer, 4 + mainSampleLen, outputBuf, 4 + processedMainLen, supplementalLen)
|
||||
}
|
||||
outputLen = 4 + processedMainLen + supplementalLen
|
||||
|
||||
@@ -282,7 +232,7 @@ class DoviConvertingTrackOutput(
|
||||
outputLen = 0
|
||||
if (dataLen < 4) {
|
||||
ensureOutputCapacity(dataLen)
|
||||
System.arraycopy(sampleBuf, dataOffset, outputBuf, 0, dataLen)
|
||||
System.arraycopy(inputBuffer, dataOffset, outputBuf, 0, dataLen)
|
||||
outputLen = dataLen
|
||||
return
|
||||
}
|
||||
@@ -290,22 +240,22 @@ class DoviConvertingTrackOutput(
|
||||
// Auto-detect: Annex B starts with 00 00 00 01 or 00 00 01
|
||||
val isAnnexB = (
|
||||
dataLen >= 4 &&
|
||||
sampleBuf[dataOffset] == 0.toByte() &&
|
||||
sampleBuf[dataOffset + 1] == 0.toByte() &&
|
||||
sampleBuf[dataOffset + 2] == 0.toByte() &&
|
||||
sampleBuf[dataOffset + 3] == 1.toByte()
|
||||
inputBuffer[dataOffset] == 0.toByte() &&
|
||||
inputBuffer[dataOffset + 1] == 0.toByte() &&
|
||||
inputBuffer[dataOffset + 2] == 0.toByte() &&
|
||||
inputBuffer[dataOffset + 3] == 1.toByte()
|
||||
) ||
|
||||
(
|
||||
dataLen >= 3 &&
|
||||
sampleBuf[dataOffset] == 0.toByte() &&
|
||||
sampleBuf[dataOffset + 1] == 0.toByte() &&
|
||||
sampleBuf[dataOffset + 2] == 1.toByte()
|
||||
inputBuffer[dataOffset] == 0.toByte() &&
|
||||
inputBuffer[dataOffset + 1] == 0.toByte() &&
|
||||
inputBuffer[dataOffset + 2] == 1.toByte()
|
||||
)
|
||||
|
||||
if (sampleCount == 0L) {
|
||||
logDebug(
|
||||
"NAL format detected: ${if (isAnnexB) "Annex B" else "length-prefixed"}, " +
|
||||
"first bytes: ${formatBytes(sampleBuf, dataOffset, 8)}"
|
||||
"first bytes: ${formatBytes(inputBuffer, dataOffset, 8)}"
|
||||
)
|
||||
}
|
||||
|
||||
@@ -323,11 +273,11 @@ class DoviConvertingTrackOutput(
|
||||
var scEnd = -1
|
||||
var i = dataOffset
|
||||
while (i < dataEnd - 2) {
|
||||
if (sampleBuf[i] == 0.toByte() && sampleBuf[i + 1] == 0.toByte()) {
|
||||
if (i + 3 < dataEnd && sampleBuf[i + 2] == 0.toByte() && sampleBuf[i + 3] == 1.toByte()) {
|
||||
if (inputBuffer[i] == 0.toByte() && inputBuffer[i + 1] == 0.toByte()) {
|
||||
if (i + 3 < dataEnd && inputBuffer[i + 2] == 0.toByte() && inputBuffer[i + 3] == 1.toByte()) {
|
||||
scEnd = i + 4
|
||||
break
|
||||
} else if (sampleBuf[i + 2] == 1.toByte()) {
|
||||
} else if (inputBuffer[i + 2] == 1.toByte()) {
|
||||
scEnd = i + 3
|
||||
break
|
||||
}
|
||||
@@ -337,7 +287,7 @@ class DoviConvertingTrackOutput(
|
||||
|
||||
if (scEnd < 0) {
|
||||
// No start codes found — pass through
|
||||
System.arraycopy(sampleBuf, dataOffset, outputBuf, 0, dataLen)
|
||||
System.arraycopy(inputBuffer, dataOffset, outputBuf, 0, dataLen)
|
||||
outputLen = dataLen
|
||||
sampleCount++
|
||||
return
|
||||
@@ -350,11 +300,11 @@ class DoviConvertingTrackOutput(
|
||||
var nalEnd = dataEnd
|
||||
i = nalStart
|
||||
while (i < dataEnd - 2) {
|
||||
if (sampleBuf[i] == 0.toByte() && sampleBuf[i + 1] == 0.toByte()) {
|
||||
if (i + 3 < dataEnd && sampleBuf[i + 2] == 0.toByte() && sampleBuf[i + 3] == 1.toByte()) {
|
||||
if (inputBuffer[i] == 0.toByte() && inputBuffer[i + 1] == 0.toByte()) {
|
||||
if (i + 3 < dataEnd && inputBuffer[i + 2] == 0.toByte() && inputBuffer[i + 3] == 1.toByte()) {
|
||||
nalEnd = i
|
||||
break
|
||||
} else if (sampleBuf[i + 2] == 1.toByte()) {
|
||||
} else if (inputBuffer[i + 2] == 1.toByte()) {
|
||||
nalEnd = i
|
||||
break
|
||||
}
|
||||
@@ -369,7 +319,7 @@ class DoviConvertingTrackOutput(
|
||||
ensureOutputCapacity(outputLen + 4 + nalLen)
|
||||
System.arraycopy(ANNEX_B_START_CODE, 0, outputBuf, outputLen, 4)
|
||||
outputLen += 4
|
||||
System.arraycopy(sampleBuf, nalStart, outputBuf, outputLen, nalLen)
|
||||
System.arraycopy(inputBuffer, nalStart, outputBuf, outputLen, nalLen)
|
||||
outputLen += nalLen
|
||||
kept++
|
||||
} else if (action == NalAction.CONVERT) {
|
||||
@@ -392,7 +342,7 @@ class DoviConvertingTrackOutput(
|
||||
|
||||
// Advance past the next start code
|
||||
if (nalEnd >= dataEnd) break
|
||||
nalStart = if (nalEnd + 3 < dataEnd && sampleBuf[nalEnd + 2] == 0.toByte() && sampleBuf[nalEnd + 3] == 1.toByte()) {
|
||||
nalStart = if (nalEnd + 3 < dataEnd && inputBuffer[nalEnd + 2] == 0.toByte() && inputBuffer[nalEnd + 3] == 1.toByte()) {
|
||||
nalEnd + 4
|
||||
} else {
|
||||
nalEnd + 3
|
||||
@@ -417,10 +367,10 @@ class DoviConvertingTrackOutput(
|
||||
var stripped = 0
|
||||
|
||||
while (pos + 4 <= dataEnd) {
|
||||
val nalLen = ((sampleBuf[pos].toInt() and 0xFF) shl 24) or
|
||||
((sampleBuf[pos + 1].toInt() and 0xFF) shl 16) or
|
||||
((sampleBuf[pos + 2].toInt() and 0xFF) shl 8) or
|
||||
(sampleBuf[pos + 3].toInt() and 0xFF)
|
||||
val nalLen = ((inputBuffer[pos].toInt() and 0xFF) shl 24) or
|
||||
((inputBuffer[pos + 1].toInt() and 0xFF) shl 16) or
|
||||
((inputBuffer[pos + 2].toInt() and 0xFF) shl 8) or
|
||||
(inputBuffer[pos + 3].toInt() and 0xFF)
|
||||
|
||||
if (nalLen <= 0 || pos + 4 + nalLen > dataEnd) {
|
||||
if (sampleCount < 5) {
|
||||
@@ -435,7 +385,7 @@ class DoviConvertingTrackOutput(
|
||||
ensureOutputCapacity(outputLen + 4 + nalLen)
|
||||
writeInt32BE(outputBuf, outputLen, nalLen)
|
||||
outputLen += 4
|
||||
System.arraycopy(sampleBuf, nalStart, outputBuf, outputLen, nalLen)
|
||||
System.arraycopy(inputBuffer, nalStart, outputBuf, outputLen, nalLen)
|
||||
outputLen += nalLen
|
||||
kept++
|
||||
} else if (action == NalAction.CONVERT) {
|
||||
@@ -486,7 +436,7 @@ class DoviConvertingTrackOutput(
|
||||
while (true) {
|
||||
val startNs = System.nanoTime()
|
||||
val written = DoviBridge.convertRpuNalu(
|
||||
payload = sampleBuf,
|
||||
payload = inputBuffer,
|
||||
payloadOffset = nalStart,
|
||||
payloadLength = nalLen,
|
||||
output = outputBuf,
|
||||
@@ -630,7 +580,7 @@ class DoviConvertingTrackOutput(
|
||||
}
|
||||
|
||||
/** Classify a NAL at sampleBuf[offset..offset+len) without copying. */
|
||||
private fun processNalInline(offset: Int, len: Int): NalAction = classifyNal(sampleBuf, offset, len, convertRpu = dvMode == DvConversionMode.DV81)
|
||||
private fun processNalInline(offset: Int, len: Int): NalAction = classifyNal(inputBuffer, offset, len, convertRpu = dvMode == DvConversionMode.DV81)
|
||||
|
||||
private fun isDvProfile7Codec(codecs: String?): Boolean {
|
||||
val normalized = codecs?.lowercase() ?: return false
|
||||
@@ -662,7 +612,7 @@ class DoviConvertingTrackOutput(
|
||||
|
||||
private fun copyRawSample(dataLen: Int) {
|
||||
ensureOutputCapacity(dataLen)
|
||||
System.arraycopy(sampleBuf, 0, outputBuf, 0, dataLen)
|
||||
System.arraycopy(inputBuffer, 0, outputBuf, 0, dataLen)
|
||||
outputLen = dataLen
|
||||
}
|
||||
|
||||
@@ -672,12 +622,6 @@ class DoviConvertingTrackOutput(
|
||||
return (offset until end).joinToString(" ") { "%02X".format(data[it]) }
|
||||
}
|
||||
|
||||
private fun ensureSampleCapacity(needed: Int) {
|
||||
if (sampleBuf.size < needed) {
|
||||
sampleBuf = sampleBuf.copyOf(maxOf(needed, sampleBuf.size * 2))
|
||||
}
|
||||
}
|
||||
|
||||
private fun ensureOutputCapacity(needed: Int) {
|
||||
if (outputBuf.size < needed) {
|
||||
outputBuf = outputBuf.copyOf(maxOf(needed, outputBuf.size * 2))
|
||||
|
||||
@@ -0,0 +1,74 @@
|
||||
package com.edde746.plezy.exoplayer
|
||||
|
||||
import kotlin.math.pow
|
||||
|
||||
/**
|
||||
* Stereo downmix coefficient builder (Kodi-style center boost).
|
||||
*
|
||||
* Channel-order assumptions per input count follow the Android channel-mask
|
||||
* bit order that MediaCodec / the FFmpeg extension emit:
|
||||
* 3 = FL FR FC, 4 = FL FR BL BR, 5 = FL FR FC BL BR, 6 = FL FR FC LFE BL BR,
|
||||
* 7 = 6.1 (5.1 + BC), 8 = 7.1 (5.1 + SL SR). LFE is dropped, matching
|
||||
* ffmpeg's default lfe_mix_level=0 (and what the mpv backends produce).
|
||||
*
|
||||
* All coefficients must stay >= 0: ChannelMixingMatrix throws on negatives.
|
||||
*/
|
||||
object DownmixMatrices {
|
||||
const val MIN_DOWNMIX_INPUT_CHANNELS = 3
|
||||
const val MAX_DOWNMIX_INPUT_CHANNELS = 8
|
||||
const val MAX_CENTER_BOOST_DB = 12
|
||||
|
||||
const val SURROUND_GAIN = 0.70710678f // -3 dB
|
||||
private const val BACK_CENTER_GAIN = 0.5f // SURROUND_GAIN split across both outputs
|
||||
|
||||
/** Kodi's mechanism: center coefficient = 10^((-3 + boostDb) / 20); boost 0 is the standard -3 dB. */
|
||||
fun centerGain(centerBoostDb: Int): Float = 10f.pow((-3f + centerBoostDb.coerceIn(0, MAX_CENTER_BOOST_DB)) / 20f)
|
||||
|
||||
/**
|
||||
* Row-major stereo coefficients ([inputChannel * 2 + outputChannel]), or null
|
||||
* when [inputChannels] is not downmixed (mono/stereo pass through; >8ch
|
||||
* unsupported, the caller keeps an identity matrix).
|
||||
*
|
||||
* [normalize] scales the matrix so the loudest output sum is <= 1 (cannot
|
||||
* clip); disabled keeps the original level like Kodi's "maintain original
|
||||
* volume" (the 16-bit mix saturates on clip).
|
||||
*/
|
||||
fun stereoCoefficients(inputChannels: Int, centerBoostDb: Int, normalize: Boolean): FloatArray? {
|
||||
val c = centerGain(centerBoostDb)
|
||||
val s = SURROUND_GAIN
|
||||
val rows: List<FloatArray> = when (inputChannels) {
|
||||
3 -> listOf(fl(), fr(), both(c))
|
||||
4 -> listOf(fl(), fr(), left(s), right(s))
|
||||
5 -> listOf(fl(), fr(), both(c), left(s), right(s))
|
||||
6 -> listOf(fl(), fr(), both(c), lfe(), left(s), right(s))
|
||||
7 -> listOf(fl(), fr(), both(c), lfe(), left(s), right(s), both(BACK_CENTER_GAIN))
|
||||
8 -> listOf(fl(), fr(), both(c), lfe(), left(s), right(s), left(s), right(s))
|
||||
else -> return null
|
||||
}
|
||||
val flat = FloatArray(rows.size * 2)
|
||||
rows.forEachIndexed { i, row ->
|
||||
flat[i * 2] = row[0]
|
||||
flat[i * 2 + 1] = row[1]
|
||||
}
|
||||
if (normalize) {
|
||||
var sumL = 0f
|
||||
var sumR = 0f
|
||||
for (i in rows.indices) {
|
||||
sumL += flat[i * 2]
|
||||
sumR += flat[i * 2 + 1]
|
||||
}
|
||||
val peak = maxOf(sumL, sumR, 1f)
|
||||
if (peak > 1f) {
|
||||
for (i in flat.indices) flat[i] /= peak
|
||||
}
|
||||
}
|
||||
return flat
|
||||
}
|
||||
|
||||
private fun fl() = floatArrayOf(1f, 0f)
|
||||
private fun fr() = floatArrayOf(0f, 1f)
|
||||
private fun left(gain: Float) = floatArrayOf(gain, 0f)
|
||||
private fun right(gain: Float) = floatArrayOf(0f, gain)
|
||||
private fun both(gain: Float) = floatArrayOf(gain, gain)
|
||||
private fun lfe() = floatArrayOf(0f, 0f)
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
@@ -2,14 +2,12 @@ package com.edde746.plezy.exoplayer
|
||||
|
||||
import android.app.Activity
|
||||
import android.app.ActivityManager
|
||||
import android.content.ContentResolver
|
||||
import android.content.Context
|
||||
import android.net.Uri
|
||||
import android.os.Handler
|
||||
import android.os.Looper
|
||||
import android.util.Log
|
||||
import com.edde746.plezy.libass.media.AssHandler
|
||||
import com.edde746.plezy.mpv.MpvPlayerCore
|
||||
import com.edde746.plezy.shared.MpvContentUriResolver
|
||||
import com.edde746.plezy.shared.PlayerChannelBinding
|
||||
import io.flutter.embedding.engine.plugins.FlutterPlugin
|
||||
import io.flutter.embedding.engine.plugins.activity.ActivityAware
|
||||
import io.flutter.embedding.engine.plugins.activity.ActivityPluginBinding
|
||||
@@ -27,12 +25,10 @@ class ExoPlayerPlugin :
|
||||
companion object {
|
||||
private const val TAG = "ExoPlayerPlugin"
|
||||
private const val METHOD_CHANNEL = "com.plezy/exo_player"
|
||||
private const val EVENT_CHANNEL = "com.plezy/exo_player/events"
|
||||
}
|
||||
|
||||
private lateinit var methodChannel: MethodChannel
|
||||
private lateinit var eventChannel: EventChannel
|
||||
private var eventSink: EventChannel.EventSink? = null
|
||||
private val channels = PlayerChannelBinding(METHOD_CHANNEL, this, this, TAG)
|
||||
private val mainHandler get() = channels.mainHandler
|
||||
private var playerCore: ExoPlayerCore? = null
|
||||
private var mpvCore: MpvPlayerCore? = null // MPV fallback player
|
||||
private var usingMpvFallback: Boolean = false
|
||||
@@ -46,7 +42,6 @@ class ExoPlayerPlugin :
|
||||
private data class ObservedProperty(val id: Int, val format: String)
|
||||
private val observedProperties = LinkedHashMap<String, ObservedProperty>()
|
||||
|
||||
private val mainHandler = Handler(Looper.getMainLooper())
|
||||
private var configuredBufferSizeBytes: Int? = null
|
||||
|
||||
private var sessionGeneration = 0
|
||||
@@ -64,19 +59,11 @@ class ExoPlayerPlugin :
|
||||
// FlutterPlugin
|
||||
|
||||
override fun onAttachedToEngine(binding: FlutterPlugin.FlutterPluginBinding) {
|
||||
methodChannel = MethodChannel(binding.binaryMessenger, METHOD_CHANNEL)
|
||||
methodChannel.setMethodCallHandler(this)
|
||||
|
||||
eventChannel = EventChannel(binding.binaryMessenger, EVENT_CHANNEL)
|
||||
eventChannel.setStreamHandler(this)
|
||||
|
||||
Log.d(TAG, "Attached to engine")
|
||||
channels.attach(binding)
|
||||
}
|
||||
|
||||
override fun onDetachedFromEngine(binding: FlutterPlugin.FlutterPluginBinding) {
|
||||
methodChannel.setMethodCallHandler(null)
|
||||
eventChannel.setStreamHandler(null)
|
||||
Log.d(TAG, "Detached from engine")
|
||||
channels.detach()
|
||||
}
|
||||
|
||||
// ActivityAware
|
||||
@@ -119,13 +106,11 @@ class ExoPlayerPlugin :
|
||||
// EventChannel.StreamHandler
|
||||
|
||||
override fun onListen(arguments: Any?, events: EventChannel.EventSink?) {
|
||||
eventSink = events
|
||||
Log.d(TAG, "Event stream connected")
|
||||
channels.listen(events)
|
||||
}
|
||||
|
||||
override fun onCancel(arguments: Any?) {
|
||||
eventSink = null
|
||||
Log.d(TAG, "Event stream disconnected")
|
||||
channels.cancel()
|
||||
}
|
||||
|
||||
// MethodChannel.MethodCallHandler
|
||||
@@ -169,6 +154,7 @@ class ExoPlayerPlugin :
|
||||
"setDvConversionMode" -> handleSetDvConversionMode(call, result)
|
||||
"setAudioNormalization" -> handleSetAudioNormalization(call, result)
|
||||
"setAudioPassthrough" -> handleSetAudioPassthrough(call, result)
|
||||
"setAudioDownmix" -> handleSetAudioDownmix(call, result)
|
||||
"observeProperty" -> handleObserveProperty(call, result)
|
||||
"setMpvProperty" -> handleSetMpvProperty(call, result)
|
||||
"setLogLevel" -> {
|
||||
@@ -223,28 +209,34 @@ class ExoPlayerPlugin :
|
||||
}
|
||||
|
||||
try {
|
||||
playerCore = ExoPlayerCore(currentActivity).apply {
|
||||
val core = ExoPlayerCore(currentActivity).apply {
|
||||
delegate = this@ExoPlayerPlugin
|
||||
this.debugLoggingEnabled = this@ExoPlayerPlugin.debugLoggingEnabled
|
||||
}
|
||||
val success = playerCore?.initialize(
|
||||
playerCore = core
|
||||
val success = core.initialize(
|
||||
bufferSizeBytes = bufferSizeBytes,
|
||||
tunnelingEnabled = tunnelingEnabled,
|
||||
audioPassthroughEnabled = audioPassthroughEnabled
|
||||
) ?: false
|
||||
if (success && playerCore?.setDebugDvConversionMode(dvConversionMode) != true) {
|
||||
)
|
||||
if (!success) {
|
||||
if (playerCore === core) playerCore = null
|
||||
result.success(false)
|
||||
return@runOnUiThread
|
||||
}
|
||||
if (core.setDebugDvConversionMode(dvConversionMode) != true) {
|
||||
Log.w(TAG, "Invalid DV conversion mode during initialize: $dvConversionMode")
|
||||
}
|
||||
// Seed from this device's persisted calibration, falling back to the Dart perf-tier proxy.
|
||||
playerCore?.seedAssVideoLatencyFrames(assVideoLatencyFrames)
|
||||
core.seedAssVideoLatencyFrames(assVideoLatencyFrames)
|
||||
core.setVisible(false)
|
||||
|
||||
// Start hidden
|
||||
playerCore?.setVisible(false)
|
||||
|
||||
Log.d(TAG, "Initialized: $success")
|
||||
result.success(success)
|
||||
Log.d(TAG, "Initialized: true")
|
||||
result.success(true)
|
||||
} catch (e: Exception) {
|
||||
Log.e(TAG, "Failed to initialize: ${e.message}", e)
|
||||
playerCore?.dispose()
|
||||
playerCore = null
|
||||
result.error("INIT_FAILED", e.message, null)
|
||||
}
|
||||
}
|
||||
@@ -280,6 +272,11 @@ class ExoPlayerPlugin :
|
||||
result.error("INVALID_ARGS", "Missing 'uri'", null)
|
||||
return
|
||||
}
|
||||
val currentActivity = activity
|
||||
if (currentActivity == null) {
|
||||
result.error("NO_ACTIVITY", "Activity not available", null)
|
||||
return
|
||||
}
|
||||
val externalSubtitleSnapshot = externalSubtitles?.map { it.toMap() }
|
||||
currentExternalSubtitles = externalSubtitleSnapshot
|
||||
|
||||
@@ -289,34 +286,54 @@ class ExoPlayerPlugin :
|
||||
// potential ExoPlayer→MPV fallback.
|
||||
if (usingMpvFallback) {
|
||||
pendingMpvProperties.clear()
|
||||
val generation = sessionGeneration
|
||||
MpvContentUriResolver.resolve(uri, currentActivity.contentResolver, mainHandler) { source ->
|
||||
if (generation != sessionGeneration || activity !== currentActivity || !usingMpvFallback) {
|
||||
source.closeIfUnused()
|
||||
result.success(null)
|
||||
return@resolve
|
||||
}
|
||||
loadMpvMedia(
|
||||
source.value,
|
||||
headers,
|
||||
startPositionMs,
|
||||
hasStartPosition,
|
||||
autoPlay,
|
||||
externalSubtitleSnapshot
|
||||
)
|
||||
result.success(null)
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
activity?.runOnUiThread {
|
||||
if (usingMpvFallback) {
|
||||
// MPV: Build loadfile command with options
|
||||
val startSeconds = startPositionMs / 1000.0
|
||||
val options = mutableListOf<String>()
|
||||
options.add(if (hasStartPosition && startPositionMs > 0L) "start=$startSeconds" else "start=none")
|
||||
if (!autoPlay) options.add("pause=yes")
|
||||
options.add("sid=no")
|
||||
options.add("secondary-sid=no")
|
||||
appendExternalSubtitleOptions(options, externalSubtitleSnapshot)
|
||||
headers?.forEach { (key, value) ->
|
||||
options.add("http-header-fields-append=$key: $value")
|
||||
}
|
||||
val optionsStr = options.joinToString(",")
|
||||
// Convert content:// URIs to fdclose:// for MPV (SAF SD card downloads)
|
||||
val mpvUri = openContentFd(uri)?.let { "fdclose://$it" } ?: uri
|
||||
mpvCore?.command(arrayOf("loadfile", mpvUri, "replace", "-1", optionsStr)) { success ->
|
||||
if (success && autoPlay) {
|
||||
mpvCore?.setProperty("pause", "no")
|
||||
}
|
||||
}
|
||||
} else {
|
||||
playerCore?.open(uri, headers, startPositionMs, autoPlay, isLive, externalSubtitleSnapshot)
|
||||
}
|
||||
currentActivity.runOnUiThread {
|
||||
playerCore?.open(uri, headers, startPositionMs, autoPlay, isLive, externalSubtitleSnapshot)
|
||||
result.success(null)
|
||||
} ?: result.error("NO_ACTIVITY", "Activity not available", null)
|
||||
}
|
||||
}
|
||||
|
||||
private fun loadMpvMedia(
|
||||
uri: String,
|
||||
headers: Map<String, String>?,
|
||||
startPositionMs: Long,
|
||||
hasStartPosition: Boolean,
|
||||
autoPlay: Boolean,
|
||||
externalSubtitles: List<Map<String, Any?>>?
|
||||
) {
|
||||
val startSeconds = startPositionMs / 1000.0
|
||||
val options = mutableListOf<String>()
|
||||
options.add(if (hasStartPosition && startPositionMs > 0L) "start=$startSeconds" else "start=none")
|
||||
if (!autoPlay) options.add("pause=yes")
|
||||
options.add("sid=no")
|
||||
options.add("secondary-sid=no")
|
||||
appendExternalSubtitleOptions(options, externalSubtitles)
|
||||
appendHttpHeaderOptions(options, headers)
|
||||
val optionsStr = options.joinToString(",")
|
||||
mpvCore?.command(arrayOf("loadfile", uri, "replace", "-1", optionsStr)) { success ->
|
||||
if (success && autoPlay) {
|
||||
mpvCore?.setProperty("pause", "no")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private fun handlePlay(result: MethodChannel.Result) {
|
||||
@@ -659,6 +676,26 @@ class ExoPlayerPlugin :
|
||||
} ?: result.error("NO_ACTIVITY", "Activity not available", null)
|
||||
}
|
||||
|
||||
private fun handleSetAudioDownmix(call: MethodCall, result: MethodChannel.Result) {
|
||||
val enabled = call.argument<Boolean>("enabled")
|
||||
if (enabled == null) {
|
||||
result.error("INVALID_ARGS", "Missing 'enabled'", null)
|
||||
return
|
||||
}
|
||||
val centerBoostDb = call.argument<Int>("centerBoostDb") ?: 0
|
||||
val normalize = call.argument<Boolean>("normalize") ?: true
|
||||
if (usingMpvFallback) {
|
||||
// mpv applies downmix via the audio-channels/audio-swresample-o
|
||||
// properties the Dart layer also sends through setMpvProperty.
|
||||
result.success(true)
|
||||
return
|
||||
}
|
||||
activity?.runOnUiThread {
|
||||
playerCore?.setAudioDownmix(enabled, centerBoostDb, normalize)
|
||||
result.success(true)
|
||||
} ?: result.error("NO_ACTIVITY", "Activity not available", null)
|
||||
}
|
||||
|
||||
private fun handleSetAudioPassthrough(call: MethodCall, result: MethodChannel.Result) {
|
||||
val enabled = call.argument<Boolean>("enabled")
|
||||
if (enabled == null) {
|
||||
@@ -711,8 +748,15 @@ class ExoPlayerPlugin :
|
||||
private fun handleGetStats(result: MethodChannel.Result) {
|
||||
if (usingMpvFallback) {
|
||||
Thread {
|
||||
val stats = getMpvStats()
|
||||
activity?.runOnUiThread { result.success(stats) }
|
||||
val stats = try {
|
||||
getMpvStats()
|
||||
} catch (error: Throwable) {
|
||||
Log.w(TAG, "Failed to collect mpv fallback stats", error)
|
||||
mapOf("playerType" to "mpv")
|
||||
}
|
||||
// Platform-channel replies must return to Android's platform thread.
|
||||
// Do not depend on an Activity: it may detach while this work runs.
|
||||
mainHandler.post { result.success(stats) }
|
||||
}.start()
|
||||
} else {
|
||||
activity?.runOnUiThread {
|
||||
@@ -745,47 +789,15 @@ class ExoPlayerPlugin :
|
||||
|
||||
override fun onPropertyChange(name: String, value: Any?) {
|
||||
val propId = observedProperties[name]?.id ?: return
|
||||
mainHandler.post { eventSink?.success(listOf(propId, value)) }
|
||||
}
|
||||
|
||||
private fun eventPayload(name: String, data: Map<String, Any>? = null): Map<String, Any> {
|
||||
val event = mutableMapOf<String, Any>(
|
||||
"type" to "event",
|
||||
"name" to name
|
||||
)
|
||||
data?.let { event["data"] = it }
|
||||
return event
|
||||
channels.emitProperty(propId, value)
|
||||
}
|
||||
|
||||
override fun onEvent(name: String, data: Map<String, Any>?) {
|
||||
val event = eventPayload(name, data)
|
||||
mainHandler.post { eventSink?.success(event) }
|
||||
channels.emitEvent(name, data)
|
||||
}
|
||||
|
||||
private fun notifyBackendSwitched() {
|
||||
mainHandler.post { eventSink?.success(eventPayload("backend-switched")) }
|
||||
}
|
||||
|
||||
/**
|
||||
* Opens a content:// URI via ContentResolver and returns the raw FD number,
|
||||
* or null if the URI is not a content:// scheme or opening fails.
|
||||
* The returned FD is detached so MPV can own and close it via fdclose://.
|
||||
*/
|
||||
private fun openContentFd(
|
||||
uriString: String,
|
||||
resolver: ContentResolver? = activity?.contentResolver
|
||||
): Int? {
|
||||
if (!uriString.startsWith("content://")) return null
|
||||
return try {
|
||||
val uri = Uri.parse(uriString)
|
||||
val pfd = resolver?.openFileDescriptor(uri, "r") ?: return null
|
||||
val fd = pfd.detachFd()
|
||||
Log.d(TAG, "Opened content FD $fd for $uriString")
|
||||
fd
|
||||
} catch (e: Exception) {
|
||||
Log.e(TAG, "Failed to open content FD: ${e.message}", e)
|
||||
null
|
||||
}
|
||||
channels.emitEvent("backend-switched")
|
||||
}
|
||||
|
||||
private fun appendExternalSubtitleOptions(
|
||||
@@ -806,6 +818,16 @@ class ExoPlayerPlugin :
|
||||
|
||||
private fun escapeMpvPathListEntry(value: String): String = value.replace("\\", "\\\\").replace(":", "\\:")
|
||||
|
||||
private fun appendHttpHeaderOptions(options: MutableList<String>, headers: Map<String, String>?) {
|
||||
if (headers.isNullOrEmpty()) return
|
||||
|
||||
options.add("http-header-fields-clr=")
|
||||
headers.forEach { (key, value) ->
|
||||
val header = "$key: $value"
|
||||
options.add("http-header-fields-append=%${header.toByteArray(Charsets.UTF_8).size}%$header")
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Configure a freshly initialized MPV fallback core: replay the properties
|
||||
* and observers Dart registered against the ExoPlayer session, then resume
|
||||
@@ -818,86 +840,79 @@ class ExoPlayerPlugin :
|
||||
uri: String,
|
||||
headers: Map<String, String>?,
|
||||
positionMs: Long,
|
||||
externalSubtitles: List<Map<String, Any?>>?
|
||||
externalSubtitles: List<Map<String, Any?>>?,
|
||||
playWhenReady: Boolean,
|
||||
generation: Int
|
||||
) {
|
||||
// Snapshot Dart-registered state on main thread before clearing
|
||||
// Snapshot Dart-registered state on main thread before clearing.
|
||||
val pendingProps = pendingMpvProperties.toList()
|
||||
pendingMpvProperties.clear()
|
||||
val observedProps = observedProperties.toList()
|
||||
|
||||
// Compute content FD on main thread (needs contentResolver)
|
||||
val mpvUri = openContentFd(uri, act.contentResolver)
|
||||
?.let { "fdclose://$it" } ?: uri
|
||||
|
||||
// Buffer size for closure
|
||||
val bufferSize = configuredBufferSizeBytes
|
||||
|
||||
if (mpvCore !== core) {
|
||||
core.dispose()
|
||||
fallbackInProgress = false
|
||||
return
|
||||
}
|
||||
// Configure basic MPV properties for Plex playback
|
||||
core.setProperty("hwdec", "mediacodec,mediacodec-copy")
|
||||
core.setProperty("vo", "gpu")
|
||||
core.setProperty("ao", "audiotrack")
|
||||
|
||||
// Forward user's buffer config to MPV fallback
|
||||
if (bufferSize != null && bufferSize > 0) {
|
||||
core.setProperty("demuxer-max-bytes", bufferSize.toString())
|
||||
}
|
||||
|
||||
// Apply pending MPV properties from Dart
|
||||
for ((propName, propValue) in pendingProps) {
|
||||
core.setProperty(propName, propValue)
|
||||
}
|
||||
|
||||
// Re-observe exactly what Dart registered via observeProperty, so the
|
||||
// event stream keeps flowing for every property the Dart side consumes.
|
||||
for ((propName, observed) in observedProps) {
|
||||
core.observeProperty(propName, observed.format)
|
||||
}
|
||||
|
||||
// Show the MPV surface (internally posts to UI)
|
||||
core.setVisible(true)
|
||||
|
||||
// Load media at the same position
|
||||
val startSeconds = positionMs / 1000.0
|
||||
val options = mutableListOf<String>()
|
||||
options.add(if (positionMs > 0L) "start=$startSeconds" else "start=none")
|
||||
options.add("sid=no")
|
||||
options.add("secondary-sid=no")
|
||||
appendExternalSubtitleOptions(options, externalSubtitles)
|
||||
headers?.forEach { (key, value) ->
|
||||
options.add("http-header-fields-append=$key: $value")
|
||||
}
|
||||
val optionsStr = options.joinToString(",")
|
||||
notifyBackendSwitched()
|
||||
core.command(arrayOf("loadfile", mpvUri, "replace", "-1", optionsStr))
|
||||
|
||||
// On GPUs without compute shaders, MPV can't do dynamic peak detection
|
||||
// and spline tone-mapping produces dim/washed-out results with extreme
|
||||
// static HDR peak metadata. Use reinhard which handles this better.
|
||||
Thread {
|
||||
val peakDetection = core.getProperty("hdr-compute-peak")
|
||||
if (peakDetection == "no") {
|
||||
Log.i(TAG, "No compute shaders — overriding tone-mapping to reinhard")
|
||||
core.setProperty("tone-mapping", "reinhard")
|
||||
core.setProperty("tone-mapping-param", "0.7")
|
||||
core.setProperty("tone-mapping-mode", "luma")
|
||||
MpvContentUriResolver.resolve(uri, act.contentResolver, mainHandler) { source ->
|
||||
if (generation != sessionGeneration || mpvCore !== core || activity !== act || !usingMpvFallback) {
|
||||
source.closeIfUnused()
|
||||
core.dispose()
|
||||
return@resolve
|
||||
}
|
||||
}.start()
|
||||
|
||||
// Request audio focus
|
||||
core.requestAudioFocus()
|
||||
// Configure basic MPV properties for Plex playback.
|
||||
core.setProperty("hwdec", "mediacodec,mediacodec-copy")
|
||||
core.setProperty("vo", "gpu")
|
||||
core.setProperty("ao", "audiotrack")
|
||||
|
||||
Log.i(TAG, "Successfully switched to MPV fallback")
|
||||
if (bufferSize != null && bufferSize > 0) {
|
||||
core.setProperty("demuxer-max-bytes", bufferSize.toString())
|
||||
}
|
||||
|
||||
for ((propName, propValue) in pendingProps) {
|
||||
core.setProperty(propName, propValue)
|
||||
}
|
||||
|
||||
// Re-observe exactly what Dart registered via observeProperty, so the
|
||||
// event stream keeps flowing for every property the Dart side consumes.
|
||||
for ((propName, observed) in observedProps) {
|
||||
core.observeProperty(propName, observed.format)
|
||||
}
|
||||
|
||||
core.setVisible(true)
|
||||
|
||||
val startSeconds = positionMs / 1000.0
|
||||
val options = mutableListOf<String>()
|
||||
options.add(if (positionMs > 0L) "start=$startSeconds" else "start=none")
|
||||
if (!playWhenReady) options.add("pause=yes")
|
||||
options.add("sid=no")
|
||||
options.add("secondary-sid=no")
|
||||
appendExternalSubtitleOptions(options, externalSubtitles)
|
||||
appendHttpHeaderOptions(options, headers)
|
||||
val optionsStr = options.joinToString(",")
|
||||
notifyBackendSwitched()
|
||||
core.command(arrayOf("loadfile", source.value, "replace", "-1", optionsStr))
|
||||
|
||||
// On GPUs without compute shaders, MPV can't do dynamic peak detection
|
||||
// and spline tone-mapping produces dim/washed-out results with extreme
|
||||
// static HDR peak metadata. Use reinhard which handles this better.
|
||||
Thread {
|
||||
val peakDetection = core.getProperty("hdr-compute-peak")
|
||||
if (peakDetection == "no") {
|
||||
Log.i(TAG, "No compute shaders — overriding tone-mapping to reinhard")
|
||||
core.setProperty("tone-mapping", "reinhard")
|
||||
core.setProperty("tone-mapping-param", "0.7")
|
||||
core.setProperty("tone-mapping-mode", "luma")
|
||||
}
|
||||
}.start()
|
||||
|
||||
core.requestAudioFocus()
|
||||
Log.i(TAG, "Successfully switched to MPV fallback")
|
||||
}
|
||||
}
|
||||
|
||||
override fun onFormatUnsupported(
|
||||
uri: String,
|
||||
headers: Map<String, String>?,
|
||||
positionMs: Long,
|
||||
playWhenReady: Boolean,
|
||||
errorMessage: String
|
||||
): Boolean {
|
||||
if (usingMpvFallback || fallbackInProgress) {
|
||||
@@ -932,7 +947,7 @@ class ExoPlayerPlugin :
|
||||
|
||||
val generation = sessionGeneration
|
||||
|
||||
Handler(Looper.getMainLooper()).post {
|
||||
mainHandler.post {
|
||||
if (generation != sessionGeneration) {
|
||||
fallbackInProgress = false
|
||||
return@post
|
||||
@@ -972,7 +987,7 @@ class ExoPlayerPlugin :
|
||||
usingMpvFallback = true
|
||||
fallbackInProgress = false
|
||||
|
||||
setupMpvFallback(core, act, uri, headers, positionMs, fallbackExternalSubtitles)
|
||||
setupMpvFallback(core, act, uri, headers, positionMs, fallbackExternalSubtitles, playWhenReady, generation)
|
||||
}
|
||||
} catch (e: Exception) {
|
||||
fallbackInProgress = false
|
||||
|
||||
@@ -0,0 +1,112 @@
|
||||
package com.edde746.plezy.exoplayer
|
||||
|
||||
import android.util.Log
|
||||
import androidx.media3.extractor.ExtractorOutput
|
||||
import androidx.media3.extractor.SeekMap
|
||||
import androidx.media3.extractor.TrackOutput
|
||||
import androidx.media3.extractor.mkv.MatroskaExtractor
|
||||
|
||||
/** MKV CodecID for Microsoft ACM compatibility mode. */
|
||||
private const val CODEC_ID_ACM = "A_MS/ACM"
|
||||
|
||||
/**
|
||||
* MatroskaExtractor.init is final and extractorOutput private; subclasses swap
|
||||
* in wrapping outputs via reflection once the Segment element starts (shared
|
||||
* with ZlibMatroskaExtractor).
|
||||
*/
|
||||
internal val matroskaExtractorOutputField by lazy {
|
||||
MatroskaExtractor::class.java.getDeclaredField("extractorOutput").apply {
|
||||
isAccessible = true
|
||||
}
|
||||
}
|
||||
|
||||
/** WAVEFORMATEX format tag for LOAS/LATM-wrapped AAC (WAVE_FORMAT_MPEG_LOAS). */
|
||||
private const val WAVE_FORMAT_MPEG_LOAS = 0x1602
|
||||
|
||||
/**
|
||||
* Returns whether a track is LOAS/LATM AAC muxed as A_MS/ACM — ffmpeg's (and
|
||||
* therefore Plex's) fallback mapping for aac_latm, which Matroska has no native
|
||||
* codec ID for. The WAVEFORMATEX wFormatTag is the first 2 bytes (LE) of
|
||||
* CodecPrivate.
|
||||
*/
|
||||
fun isLoasAcmTrack(codecId: String?, codecPrivate: ByteArray?): Boolean = codecId == CODEC_ID_ACM &&
|
||||
codecPrivate != null &&
|
||||
codecPrivate.size >= 2 &&
|
||||
((codecPrivate[0].toInt() and 0xFF) or ((codecPrivate[1].toInt() and 0xFF) shl 8)) == WAVE_FORMAT_MPEG_LOAS
|
||||
|
||||
/**
|
||||
* ExtractorOutput wrapper that wraps marked tracks with [LatmTrackOutput].
|
||||
* Call [markNextTrackLatm] before the parent extractor creates the track
|
||||
* (i.e. before super.endMasterElement(ID_TRACK_ENTRY)).
|
||||
*/
|
||||
class LatmExtractorOutputWrapper(
|
||||
private val delegate: ExtractorOutput
|
||||
) : ExtractorOutput {
|
||||
|
||||
private var nextTrackIsLatm = false
|
||||
private val latmOutputs = mutableListOf<LatmTrackOutput>()
|
||||
|
||||
fun markNextTrackLatm() {
|
||||
nextTrackIsLatm = true
|
||||
}
|
||||
|
||||
/** Resets LATM parser state after an extractor seek. */
|
||||
fun resetTracks() {
|
||||
latmOutputs.forEach { it.reset() }
|
||||
}
|
||||
|
||||
override fun track(id: Int, type: Int): TrackOutput {
|
||||
val original = delegate.track(id, type)
|
||||
if (!nextTrackIsLatm) return original
|
||||
nextTrackIsLatm = false
|
||||
return LatmTrackOutput(original, id).also { latmOutputs.add(it) }
|
||||
}
|
||||
|
||||
override fun endTracks() = delegate.endTracks()
|
||||
override fun seekMap(seekMap: SeekMap) = delegate.seekMap(seekMap)
|
||||
}
|
||||
|
||||
/**
|
||||
* MatroskaExtractor with LOAS/LATM AAC support, used for Plex Live TV MKV
|
||||
* streams (which bypass the ASS/DV extractor chain). VOD playback gets the
|
||||
* same LATM handling via ZlibMatroskaExtractor.
|
||||
*/
|
||||
class LatmMatroskaExtractor(flags: Int) : MatroskaExtractor(flags) {
|
||||
|
||||
companion object {
|
||||
private const val TAG = "LatmMkvExtractor"
|
||||
private const val ID_SEGMENT = 0x18538067
|
||||
private const val ID_TRACK_ENTRY = 0xAE
|
||||
}
|
||||
|
||||
private var latmWrapper: LatmExtractorOutputWrapper? = null
|
||||
|
||||
override fun startMasterElement(id: Int, contentPosition: Long, contentSize: Long) {
|
||||
super.startMasterElement(id, contentPosition, contentSize)
|
||||
|
||||
// init() is final, so install the wrapping output when the Segment starts —
|
||||
// before any TrackEntry can create a track through it.
|
||||
if (id == ID_SEGMENT && latmWrapper == null) {
|
||||
val currentOutput = matroskaExtractorOutputField.get(this) as ExtractorOutput
|
||||
val wrapper = LatmExtractorOutputWrapper(currentOutput)
|
||||
latmWrapper = wrapper
|
||||
matroskaExtractorOutputField.set(this, wrapper)
|
||||
}
|
||||
}
|
||||
|
||||
override fun endMasterElement(id: Int) {
|
||||
if (id == ID_TRACK_ENTRY) {
|
||||
val track = getCurrentTrack(id)
|
||||
if (isLoasAcmTrack(track.codecId, track.codecPrivate)) {
|
||||
Log.i(TAG, "Track ${track.number} is LOAS/LATM AAC, unwrapping to raw AAC")
|
||||
latmWrapper?.markNextTrackLatm()
|
||||
}
|
||||
}
|
||||
super.endMasterElement(id)
|
||||
}
|
||||
|
||||
override fun seek(position: Long, timeUs: Long) {
|
||||
latmWrapper?.resetTracks()
|
||||
super.seek(position, timeUs)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,156 @@
|
||||
package com.edde746.plezy.exoplayer
|
||||
|
||||
import android.util.Log
|
||||
import androidx.media3.common.C
|
||||
import androidx.media3.common.DataReader
|
||||
import androidx.media3.common.Format
|
||||
import androidx.media3.common.MimeTypes
|
||||
import androidx.media3.common.util.ParsableByteArray
|
||||
import androidx.media3.extractor.ExtractorOutput
|
||||
import androidx.media3.extractor.SeekMap
|
||||
import androidx.media3.extractor.TrackOutput
|
||||
import androidx.media3.extractor.ts.LatmReader
|
||||
import androidx.media3.extractor.ts.TsPayloadReader
|
||||
import java.io.EOFException
|
||||
|
||||
/**
|
||||
* TrackOutput wrapper that unwraps LOAS/LATM-framed AAC (MKV A_MS/ACM with
|
||||
* WAVEFORMATEX tag 0x1602) into raw AAC access units MediaCodec can decode.
|
||||
*
|
||||
* Each MKV block payload is one or more complete LOAS AudioSyncStream frames.
|
||||
* Blocks are buffered between sampleData() and sampleMetadata(), then fed to
|
||||
* media3's LatmReader, which parses the StreamMuxConfig (emitting a proper AAC
|
||||
* Format with AudioSpecificConfig) and outputs byte-aligned raw AAC samples.
|
||||
*
|
||||
* The parent extractor's audio/x-unknown Format is swallowed; its track-selection
|
||||
* metadata (id, label, language, selection flags) is merged onto the Format
|
||||
* LatmReader derives from the stream.
|
||||
*/
|
||||
class LatmTrackOutput(
|
||||
private val delegate: TrackOutput,
|
||||
private val trackId: Int
|
||||
) : TrackOutput {
|
||||
|
||||
companion object {
|
||||
private const val TAG = "LatmTrackOutput"
|
||||
private const val INITIAL_BUFFER_SIZE = 4 * 1024
|
||||
private const val MAX_LOGGED_ERRORS = 3
|
||||
}
|
||||
|
||||
private var latmReader: LatmReader? = null
|
||||
private var originalFormat: Format? = null
|
||||
private val parsable = ParsableByteArray()
|
||||
|
||||
// Reusable block buffer — grown as needed, never shrunk
|
||||
private var buf = ByteArray(INITIAL_BUFFER_SIZE)
|
||||
private var bufLen = 0
|
||||
private var readBuf = ByteArray(INITIAL_BUFFER_SIZE)
|
||||
private var errorCount = 0
|
||||
|
||||
/** Forwards LatmReader's decoded Format merged with the original track metadata. */
|
||||
private val mergeProxy = object : TrackOutput {
|
||||
override fun format(format: Format) {
|
||||
val original = originalFormat
|
||||
val merged = if (original == null) {
|
||||
format
|
||||
} else {
|
||||
format.buildUpon()
|
||||
.setId(original.id)
|
||||
.setLabel(original.label)
|
||||
.setLanguage(original.language ?: format.language)
|
||||
.setSelectionFlags(original.selectionFlags)
|
||||
.build()
|
||||
}
|
||||
delegate.format(merged)
|
||||
}
|
||||
|
||||
override fun sampleData(input: DataReader, length: Int, allowEndOfInput: Boolean, sampleDataPart: Int): Int = delegate.sampleData(input, length, allowEndOfInput, sampleDataPart)
|
||||
|
||||
override fun sampleData(data: ParsableByteArray, length: Int, sampleDataPart: Int) = delegate.sampleData(data, length, sampleDataPart)
|
||||
|
||||
override fun sampleMetadata(timeUs: Long, flags: Int, size: Int, offset: Int, cryptoData: TrackOutput.CryptoData?) = delegate.sampleMetadata(timeUs, flags, size, offset, cryptoData)
|
||||
}
|
||||
|
||||
private val readerExtractorOutput = object : ExtractorOutput {
|
||||
override fun track(id: Int, type: Int): TrackOutput = mergeProxy
|
||||
override fun endTracks() {}
|
||||
override fun seekMap(seekMap: SeekMap) {}
|
||||
}
|
||||
|
||||
override fun format(format: Format) {
|
||||
originalFormat = format
|
||||
if (latmReader == null) {
|
||||
latmReader = LatmReader(format.language, format.roleFlags, MimeTypes.VIDEO_MATROSKA).also {
|
||||
it.createTracks(readerExtractorOutput, TsPayloadReader.TrackIdGenerator(trackId, 1))
|
||||
}
|
||||
}
|
||||
// Swallow the parent's audio/x-unknown Format; LatmReader emits the real
|
||||
// AAC Format (with AudioSpecificConfig) from the first StreamMuxConfig.
|
||||
}
|
||||
|
||||
override fun sampleData(
|
||||
input: DataReader,
|
||||
length: Int,
|
||||
allowEndOfInput: Boolean,
|
||||
sampleDataPart: Int
|
||||
): Int {
|
||||
if (readBuf.size < length) readBuf = ByteArray(length)
|
||||
val bytesRead = input.read(readBuf, 0, length)
|
||||
if (bytesRead == C.RESULT_END_OF_INPUT && !allowEndOfInput) throw EOFException()
|
||||
if (bytesRead > 0) append(readBuf, bytesRead)
|
||||
return bytesRead
|
||||
}
|
||||
|
||||
override fun sampleData(data: ParsableByteArray, length: Int, sampleDataPart: Int) {
|
||||
ensureCapacity(bufLen + length)
|
||||
data.readBytes(buf, bufLen, length)
|
||||
bufLen += length
|
||||
}
|
||||
|
||||
override fun sampleMetadata(
|
||||
timeUs: Long,
|
||||
flags: Int,
|
||||
size: Int,
|
||||
offset: Int,
|
||||
cryptoData: TrackOutput.CryptoData?
|
||||
) {
|
||||
// offset counts down to 0 across a laced BlockGroup; the buffer holds the
|
||||
// whole block's data, so slice this sample out and clear at the last one.
|
||||
val start = bufLen - offset - size
|
||||
val reader = latmReader
|
||||
if (reader == null || start < 0) {
|
||||
if (errorCount++ < MAX_LOGGED_ERRORS) {
|
||||
Log.e(TAG, "Dropping sample (reader=${reader != null}, start=$start, size=$size, offset=$offset)")
|
||||
}
|
||||
if (offset == 0) bufLen = 0
|
||||
return
|
||||
}
|
||||
try {
|
||||
reader.packetStarted(timeUs, 0)
|
||||
parsable.reset(buf, start + size)
|
||||
parsable.position = start
|
||||
reader.consume(parsable)
|
||||
} catch (e: Exception) {
|
||||
if (errorCount++ < MAX_LOGGED_ERRORS) {
|
||||
Log.e(TAG, "LATM parse failed (${size}B), dropping sample", e)
|
||||
}
|
||||
reader.seek() // resync on the next LOAS syncword
|
||||
}
|
||||
if (offset == 0) bufLen = 0
|
||||
}
|
||||
|
||||
/** Drops buffered MKV data while retaining the LATM StreamMuxConfig. */
|
||||
fun reset() {
|
||||
bufLen = 0
|
||||
}
|
||||
|
||||
private fun append(src: ByteArray, length: Int) {
|
||||
ensureCapacity(bufLen + length)
|
||||
System.arraycopy(src, 0, buf, bufLen, length)
|
||||
bufLen += length
|
||||
}
|
||||
|
||||
private fun ensureCapacity(needed: Int) {
|
||||
if (buf.size < needed) buf = buf.copyOf(maxOf(needed, buf.size * 2))
|
||||
}
|
||||
}
|
||||
@@ -8,6 +8,8 @@ import androidx.annotation.OptIn
|
||||
import androidx.media3.common.Format
|
||||
import androidx.media3.common.MimeTypes
|
||||
import androidx.media3.common.PlaybackParameters
|
||||
import androidx.media3.common.audio.ChannelMixingAudioProcessor
|
||||
import androidx.media3.common.audio.ChannelMixingMatrix
|
||||
import androidx.media3.common.util.Clock
|
||||
import androidx.media3.common.util.UnstableApi
|
||||
import androidx.media3.decoder.DecoderInputBuffer
|
||||
@@ -25,6 +27,7 @@ import androidx.media3.exoplayer.mediacodec.MediaCodecAdapter
|
||||
import androidx.media3.exoplayer.mediacodec.MediaCodecSelector
|
||||
import androidx.media3.exoplayer.video.MediaCodecVideoRenderer
|
||||
import androidx.media3.exoplayer.video.VideoRendererEventListener
|
||||
import com.edde746.plezy.TvDetection
|
||||
import java.nio.ByteBuffer
|
||||
import java.util.concurrent.atomic.AtomicLong
|
||||
import kotlin.math.abs
|
||||
@@ -32,9 +35,26 @@ import kotlin.math.abs
|
||||
@OptIn(UnstableApi::class)
|
||||
class PlezyRenderersFactory(context: Context) : DefaultRenderersFactory(context) {
|
||||
|
||||
/**
|
||||
* Android TV: MediaCodec.setOutputSurface is broken on many TV SoCs (Sony Bravia
|
||||
* MediaTek etc., ExoPlayer #5119/#8329) — force full codec re-init on surface
|
||||
* changes instead (#1481). TV-only: phones keep the fast path for PiP churn.
|
||||
*/
|
||||
private val forceSetOutputSurfaceWorkaround: Boolean = TvDetection.isTv(context)
|
||||
|
||||
/** Audio delay in microseconds. Shared with PositionFixAudioSink for live updates. */
|
||||
val audioDelayUs = AtomicLong(0L)
|
||||
|
||||
/**
|
||||
* Stereo-downmix processor; inactive while every registered matrix is identity.
|
||||
* Pre-populated for counts 1..12 so sink configure can never hit
|
||||
* "No mixing matrix for input channel count". ExoPlayerCore swaps in
|
||||
* downmix matrices via [DownmixMatrices] when the setting is enabled.
|
||||
*/
|
||||
val channelMixProcessor = ChannelMixingAudioProcessor().apply {
|
||||
for (count in 1..12) putChannelMixingMatrix(ChannelMixingMatrix.create(count, count))
|
||||
}
|
||||
|
||||
/** Returns whether direct encoded output should be hidden so decoded PCM output can be selected. */
|
||||
var shouldBlockDirectAudioOutput: ((Format) -> Boolean)? = null
|
||||
|
||||
@@ -79,6 +99,7 @@ class PlezyRenderersFactory(context: Context) : DefaultRenderersFactory(context)
|
||||
.setEventHandler(eventHandler)
|
||||
.setEventListener(eventListener)
|
||||
.setMaxDroppedFramesToNotify(MAX_DROPPED_VIDEO_FRAME_COUNT_TO_NOTIFY),
|
||||
forceSetOutputSurfaceWorkaround,
|
||||
videoDiagnosticsLogger
|
||||
)
|
||||
}
|
||||
@@ -107,6 +128,9 @@ class PlezyRenderersFactory(context: Context) : DefaultRenderersFactory(context)
|
||||
val defaultSink = DefaultAudioSink.Builder(context)
|
||||
.setEnableFloatOutput(enableFloatOutput)
|
||||
.setEnableAudioOutputPlaybackParameters(enableAudioOutputPlaybackParams)
|
||||
// Wraps in DefaultAudioProcessorChain, keeping stock silence-skip +
|
||||
// Sonic; the downmix runs first and only in the decoded-PCM path.
|
||||
.setAudioProcessors(arrayOf(channelMixProcessor))
|
||||
.setAudioOutputProvider(RawPositionOutputProvider(realProvider, rawPositionUs, audioDiagnosticsLogger))
|
||||
.build()
|
||||
|
||||
@@ -341,6 +365,7 @@ internal class SubtitleDelayRenderer(
|
||||
@OptIn(UnstableApi::class)
|
||||
internal class DvSanitizingVideoRenderer(
|
||||
builder: Builder,
|
||||
private val forceSetOutputSurfaceWorkaround: Boolean,
|
||||
private val log: ((String, String, String) -> Unit)?
|
||||
) : MediaCodecVideoRenderer(builder) {
|
||||
|
||||
@@ -348,6 +373,26 @@ internal class DvSanitizingVideoRenderer(
|
||||
|
||||
private var stripHdr10PlusSei = false
|
||||
private var stripDvRpu = false
|
||||
private var loggedSurfaceWorkaround = false
|
||||
|
||||
// On TV SoCs MediaCodec.setOutputSurface() silently yields a black picture after
|
||||
// the screensaver/background destroys and recreates the surface (#1481). Returning
|
||||
// true makes media3 release + re-init the codec instead. media3's built-in device
|
||||
// list doesn't cover 2019+ Bravias; consulted once per codec init.
|
||||
override fun codecNeedsSetOutputSurfaceWorkaround(name: String): Boolean {
|
||||
if (forceSetOutputSurfaceWorkaround) {
|
||||
if (!loggedSurfaceWorkaround) {
|
||||
loggedSurfaceWorkaround = true
|
||||
log?.invoke(
|
||||
"info",
|
||||
"video",
|
||||
"TV setOutputSurface workaround active: codec will fully re-init on surface changes (codec=$name)"
|
||||
)
|
||||
}
|
||||
return true
|
||||
}
|
||||
return super.codecNeedsSetOutputSurfaceWorkaround(name)
|
||||
}
|
||||
|
||||
// Sanitize diagnostics — playback-thread only, cumulative for the renderer's lifetime.
|
||||
private var sanitizedSampleCount = 0L
|
||||
|
||||
@@ -0,0 +1,59 @@
|
||||
package com.edde746.plezy.exoplayer
|
||||
|
||||
import androidx.media3.common.C
|
||||
|
||||
/**
|
||||
* Decision logic for the post-resume video stall watchdog (#1454).
|
||||
*
|
||||
* Some TV SoCs (the Amlogic Mi Box class) stall the MediaCodec output path after a
|
||||
* pause -> resume: the playback clock and audio keep advancing but no new video
|
||||
* frame reaches the screen until the codec is flushed by a seek. The watchdog
|
||||
* snapshots the rendered-frame counter when playback resumes and evaluates it one
|
||||
* check window later; a confirmed stall is recovered with a small backward seek
|
||||
* (ExoPlayer short-circuits a same-position seek without resetting renderers, so
|
||||
* the recovery must move by a nonzero delta to force the codec flush).
|
||||
*/
|
||||
internal object ResumeStallPolicy {
|
||||
/** Floor for the check window; frame-interval scaling only ever raises it. */
|
||||
const val DEFAULT_CHECK_WINDOW_MS = 1000L
|
||||
|
||||
/** Frames that must have been due within the window before calling it a stall. */
|
||||
const val MIN_FRAME_INTERVALS = 4
|
||||
|
||||
/** Assumed fps when neither the format nor timestamp detection knows it. */
|
||||
const val FALLBACK_FPS = 24f
|
||||
|
||||
/** Recovery seek delta. Must stay under the 350ms watch-together drift deadband. */
|
||||
const val SEEK_BACK_MS = 250L
|
||||
|
||||
/** Re-checks allowed while the clock itself is not advancing (generic stall, not this bug). */
|
||||
const val MAX_RECHECKS = 2
|
||||
|
||||
/** Recovery cap per media session; a pathological stream stops arming after this. */
|
||||
const val MAX_RECOVERIES_PER_SESSION = 5
|
||||
|
||||
enum class Verdict { HEALTHY, RECHECK, SKIP_NEAR_EOF, STALLED }
|
||||
|
||||
/** Window sized so even low-fps or slowed-down content has had several frames due. */
|
||||
fun checkWindowMs(formatFps: Float?, detectedFps: Float?, speed: Float): Long {
|
||||
val fps = formatFps?.takeIf { it > 1f } ?: detectedFps?.takeIf { it > 1f } ?: FALLBACK_FPS
|
||||
val frameIntervalMs = (1000f / fps / speed.coerceAtLeast(0.25f)).toLong()
|
||||
return maxOf(DEFAULT_CHECK_WINDOW_MS, MIN_FRAME_INTERVALS * frameIntervalMs)
|
||||
}
|
||||
|
||||
fun evaluate(
|
||||
baselineFrames: Int,
|
||||
currentFrames: Int,
|
||||
baselinePositionMs: Long,
|
||||
currentPositionMs: Long,
|
||||
durationMs: Long,
|
||||
windowMs: Long
|
||||
): Verdict = when {
|
||||
// Any counter movement counts as healthy, including a renderer re-enable
|
||||
// resetting DecoderCounters below the baseline.
|
||||
currentFrames != baselineFrames -> Verdict.HEALTHY
|
||||
currentPositionMs - baselinePositionMs < windowMs / 2 -> Verdict.RECHECK
|
||||
durationMs != C.TIME_UNSET && durationMs - currentPositionMs < 2 * windowMs -> Verdict.SKIP_NEAR_EOF
|
||||
else -> Verdict.STALLED
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,77 @@
|
||||
package com.edde746.plezy.exoplayer
|
||||
|
||||
import androidx.annotation.OptIn
|
||||
import androidx.media3.common.text.Cue
|
||||
import androidx.media3.common.util.UnstableApi
|
||||
|
||||
@OptIn(UnstableApi::class)
|
||||
internal object SubtitleCueLayout {
|
||||
|
||||
fun layout(cues: List<Cue>, positionPercent: Int, fontSize: Float): List<Cue> = applyPosition(stackUnpositioned(cues), positionPercent, fontSize)
|
||||
|
||||
// SRT carries no per-cue positioning, so SubripParser emits cues with
|
||||
// lineType = TYPE_UNSET. SubtitlePainter then renders every such cue at the
|
||||
// same default bottom-anchored position, causing visible overlap when more
|
||||
// than one is active. Reassign line numbers from the bottom up so concurrent
|
||||
// unpositioned cues stack instead. Workaround for
|
||||
// https://github.com/androidx/media/issues/2237; can be removed once
|
||||
// https://github.com/androidx/media/pull/3151 lands and we upgrade Media3.
|
||||
private fun stackUnpositioned(cues: List<Cue>): List<Cue> {
|
||||
if (cues.size < 2) return cues
|
||||
val toStack = cues.indices.filter {
|
||||
cues[it].lineType == Cue.TYPE_UNSET && cues[it].text != null
|
||||
}
|
||||
if (toStack.size < 2) return cues
|
||||
val rebuilt = cues.toMutableList()
|
||||
var nextRow = -1
|
||||
// Reverse so the last cue in the group lands on row -1 (bottom).
|
||||
for (idx in toStack.reversed()) {
|
||||
val cue = cues[idx]
|
||||
rebuilt[idx] = cue.buildUpon()
|
||||
.setLine(nextRow.toFloat(), Cue.LINE_TYPE_NUMBER)
|
||||
.setLineAnchor(Cue.ANCHOR_TYPE_END)
|
||||
.build()
|
||||
val rowsConsumed = (cue.text?.toString()?.count { it == '\n' } ?: 0) + 1
|
||||
nextRow -= rowsConsumed
|
||||
}
|
||||
return rebuilt
|
||||
}
|
||||
|
||||
private fun applyPosition(cues: List<Cue>, positionPercent: Int, fontSize: Float): List<Cue> {
|
||||
val clampedPosition = positionPercent.coerceIn(0, 100)
|
||||
if (clampedPosition == 100 || cues.isEmpty()) return cues
|
||||
|
||||
val baseLine = clampedPosition / 100f
|
||||
val rowHeight = (fontSize / 720f * 1.2f).coerceAtLeast(0.01f)
|
||||
var changed = false
|
||||
|
||||
val rebuilt = cues.map { cue ->
|
||||
if (!usesDefaultVerticalPlacement(cue)) return@map cue
|
||||
|
||||
val rowOffset = if (cue.lineType == Cue.LINE_TYPE_NUMBER && cue.line < 0f) {
|
||||
(-cue.line - 1f).coerceAtLeast(0f)
|
||||
} else {
|
||||
0f
|
||||
}
|
||||
val line = if (clampedPosition == 0) {
|
||||
(rowOffset * rowHeight).coerceAtMost(1f)
|
||||
} else {
|
||||
(baseLine - rowOffset * rowHeight).coerceIn(0f, 1f)
|
||||
}
|
||||
val lineAnchor = if (clampedPosition == 0) Cue.ANCHOR_TYPE_START else Cue.ANCHOR_TYPE_END
|
||||
|
||||
changed = true
|
||||
cue.buildUpon()
|
||||
.setLine(line, Cue.LINE_TYPE_FRACTION)
|
||||
.setLineAnchor(lineAnchor)
|
||||
.build()
|
||||
}
|
||||
|
||||
return if (changed) rebuilt else cues
|
||||
}
|
||||
|
||||
private fun usesDefaultVerticalPlacement(cue: Cue): Boolean {
|
||||
if (cue.text == null || cue.bitmap != null || cue.verticalType != Cue.TYPE_UNSET) return false
|
||||
return cue.line == Cue.DIMEN_UNSET || (cue.lineType == Cue.LINE_TYPE_NUMBER && cue.line < 0f)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,85 @@
|
||||
package com.edde746.plezy.exoplayer
|
||||
|
||||
import androidx.media3.ui.AspectRatioFrameLayout
|
||||
import kotlin.math.roundToInt
|
||||
|
||||
internal data class SubtitleViewDimensions(val width: Int, val height: Int)
|
||||
|
||||
internal object SubtitleViewLayout {
|
||||
fun textDimensions(
|
||||
containerWidth: Int,
|
||||
containerHeight: Int,
|
||||
videoWidth: Int,
|
||||
videoHeight: Int,
|
||||
pixelRatio: Float,
|
||||
resizeMode: Int,
|
||||
zoomScale: Float
|
||||
): SubtitleViewDimensions? {
|
||||
val videoAspect = videoAspect(videoWidth, videoHeight, pixelRatio) ?: return null
|
||||
if (containerWidth <= 0 || containerHeight <= 0) return null
|
||||
|
||||
if (resizeMode != AspectRatioFrameLayout.RESIZE_MODE_FIT) {
|
||||
return SubtitleViewDimensions(containerWidth, containerHeight)
|
||||
}
|
||||
|
||||
val base = fit(containerWidth, containerHeight, videoAspect)
|
||||
return when {
|
||||
zoomScale < 0.999f -> scale(base, zoomScale)
|
||||
zoomScale > 1.001f -> SubtitleViewDimensions(containerWidth, containerHeight)
|
||||
else -> base
|
||||
}
|
||||
}
|
||||
|
||||
fun bitmapDimensions(
|
||||
containerWidth: Int,
|
||||
containerHeight: Int,
|
||||
videoWidth: Int,
|
||||
videoHeight: Int,
|
||||
pixelRatio: Float,
|
||||
resizeMode: Int,
|
||||
zoomScale: Float
|
||||
): SubtitleViewDimensions? {
|
||||
val videoAspect = videoAspect(videoWidth, videoHeight, pixelRatio) ?: return null
|
||||
if (containerWidth <= 0 || containerHeight <= 0) return null
|
||||
|
||||
// PGS/VOB cues are authored in video coordinates, but users expect them to
|
||||
// remain readable and fully visible when the video is cropped or zoomed.
|
||||
// Fit to the visible container instead of following the cropped video rect.
|
||||
return fit(containerWidth, containerHeight, videoAspect)
|
||||
}
|
||||
|
||||
private fun videoAspect(videoWidth: Int, videoHeight: Int, pixelRatio: Float): Float? {
|
||||
if (videoWidth <= 0 || videoHeight <= 0 || pixelRatio <= 0f) return null
|
||||
val aspect = (videoWidth * pixelRatio) / videoHeight
|
||||
return if (aspect.isFinite() && aspect > 0f) aspect else null
|
||||
}
|
||||
|
||||
// Largest [videoAspect] rectangle that fits inside the container, as (width, height)
|
||||
// in float pixels. Shared by the SubtitleView sizing (rounded to ints in [fit]) and
|
||||
// the libass FIT-mode margins in updateAssMargins() (kept as floats for the zoom
|
||||
// multiply) so both agree on the video dst rect.
|
||||
fun letterbox(containerWidth: Int, containerHeight: Int, videoAspect: Float): Pair<Float, Float> {
|
||||
val containerAspect = containerWidth.toFloat() / containerHeight
|
||||
return if (videoAspect > containerAspect) {
|
||||
containerWidth.toFloat() to containerWidth / videoAspect
|
||||
} else {
|
||||
containerHeight * videoAspect to containerHeight.toFloat()
|
||||
}
|
||||
}
|
||||
|
||||
private fun fit(containerWidth: Int, containerHeight: Int, videoAspect: Float): SubtitleViewDimensions {
|
||||
val (width, height) = letterbox(containerWidth, containerHeight, videoAspect)
|
||||
return SubtitleViewDimensions(
|
||||
width.roundToInt().coerceAtLeast(1),
|
||||
height.roundToInt().coerceAtLeast(1)
|
||||
)
|
||||
}
|
||||
|
||||
private fun scale(dimensions: SubtitleViewDimensions, scale: Float): SubtitleViewDimensions {
|
||||
val safeScale = scale.coerceAtLeast(0.001f)
|
||||
return SubtitleViewDimensions(
|
||||
(dimensions.width * safeScale).roundToInt().coerceAtLeast(1),
|
||||
(dimensions.height * safeScale).roundToInt().coerceAtLeast(1)
|
||||
)
|
||||
}
|
||||
}
|
||||
+21
-88
@@ -1,9 +1,6 @@
|
||||
package com.edde746.plezy.exoplayer
|
||||
|
||||
import android.util.Log
|
||||
import androidx.media3.common.DataReader
|
||||
import androidx.media3.common.Format
|
||||
import androidx.media3.common.util.ParsableByteArray
|
||||
import androidx.media3.extractor.TrackOutput
|
||||
import java.util.zip.DataFormatException
|
||||
import java.util.zip.Inflater
|
||||
@@ -16,8 +13,8 @@ import java.util.zip.Inflater
|
||||
* All buffers are reused across samples to minimize GC pressure on the hot path.
|
||||
*/
|
||||
class ZlibInflatingTrackOutput(
|
||||
private val delegate: TrackOutput
|
||||
) : TrackOutput {
|
||||
delegate: TrackOutput
|
||||
) : BufferedTransformingTrackOutput(delegate, INITIAL_BUFFER_SIZE, INFLATE_CHUNK) {
|
||||
|
||||
companion object {
|
||||
private const val TAG = "ZlibTrackOutput"
|
||||
@@ -28,94 +25,30 @@ class ZlibInflatingTrackOutput(
|
||||
var active = false
|
||||
|
||||
private val inflater = Inflater()
|
||||
|
||||
// Reusable buffers — grown as needed, never shrunk
|
||||
private var compressedBuf = ByteArray(INITIAL_BUFFER_SIZE)
|
||||
private var compressedLen = 0
|
||||
private var inflateBuf = ByteArray(INITIAL_BUFFER_SIZE)
|
||||
private var readBuf = ByteArray(INFLATE_CHUNK)
|
||||
private val outputParsable = ParsableByteArray()
|
||||
private var buffering = false
|
||||
|
||||
override fun format(format: Format) = delegate.format(format)
|
||||
override val transformEnabled: Boolean
|
||||
get() = active
|
||||
|
||||
override fun sampleData(
|
||||
input: DataReader,
|
||||
length: Int,
|
||||
allowEndOfInput: Boolean,
|
||||
sampleDataPart: Int
|
||||
): Int {
|
||||
if (!active) return delegate.sampleData(input, length, allowEndOfInput, sampleDataPart)
|
||||
override val transformedBuffer: ByteArray
|
||||
get() = inflateBuf
|
||||
|
||||
buffering = true
|
||||
if (readBuf.size < length) readBuf = ByteArray(length)
|
||||
val bytesRead = input.read(readBuf, 0, length)
|
||||
if (bytesRead > 0) appendCompressed(readBuf, 0, bytesRead)
|
||||
return bytesRead
|
||||
}
|
||||
|
||||
override fun sampleData(data: ParsableByteArray, length: Int, sampleDataPart: Int) {
|
||||
if (!active) {
|
||||
delegate.sampleData(data, length, sampleDataPart)
|
||||
return
|
||||
}
|
||||
|
||||
buffering = true
|
||||
ensureCompressedCapacity(compressedLen + length)
|
||||
data.readBytes(compressedBuf, compressedLen, length)
|
||||
compressedLen += length
|
||||
}
|
||||
|
||||
override fun sampleMetadata(
|
||||
timeUs: Long,
|
||||
flags: Int,
|
||||
size: Int,
|
||||
offset: Int,
|
||||
cryptoData: TrackOutput.CryptoData?
|
||||
) {
|
||||
if (!active || !buffering) {
|
||||
delegate.sampleMetadata(timeUs, flags, size, offset, cryptoData)
|
||||
return
|
||||
}
|
||||
|
||||
buffering = false
|
||||
val srcLen = compressedLen
|
||||
compressedLen = 0
|
||||
|
||||
val inflatedLen = try {
|
||||
inflater.reset()
|
||||
inflater.setInput(compressedBuf, 0, srcLen)
|
||||
var written = 0
|
||||
while (!inflater.finished()) {
|
||||
if (written == inflateBuf.size) growInflateBuf()
|
||||
val count = inflater.inflate(inflateBuf, written, inflateBuf.size - written)
|
||||
if (count == 0 && !inflater.finished()) break
|
||||
written += count
|
||||
}
|
||||
written
|
||||
} catch (e: DataFormatException) {
|
||||
Log.e(TAG, "Zlib inflate failed (${srcLen}B), passing raw", e)
|
||||
// Fall back to raw compressed data
|
||||
ensureInflateCapacity(srcLen)
|
||||
System.arraycopy(compressedBuf, 0, inflateBuf, 0, srcLen)
|
||||
srcLen
|
||||
}
|
||||
|
||||
outputParsable.reset(inflateBuf, inflatedLen)
|
||||
delegate.sampleData(outputParsable, inflatedLen, TrackOutput.SAMPLE_DATA_PART_MAIN)
|
||||
delegate.sampleMetadata(timeUs, flags, inflatedLen, 0, cryptoData)
|
||||
}
|
||||
|
||||
private fun appendCompressed(src: ByteArray, offset: Int, length: Int) {
|
||||
ensureCompressedCapacity(compressedLen + length)
|
||||
System.arraycopy(src, offset, compressedBuf, compressedLen, length)
|
||||
compressedLen += length
|
||||
}
|
||||
|
||||
private fun ensureCompressedCapacity(needed: Int) {
|
||||
if (compressedBuf.size < needed) {
|
||||
compressedBuf = compressedBuf.copyOf(maxOf(needed, compressedBuf.size * 2))
|
||||
override fun transformSample(inputLength: Int, flags: Int): Int = try {
|
||||
inflater.reset()
|
||||
inflater.setInput(inputBuffer, 0, inputLength)
|
||||
var written = 0
|
||||
while (!inflater.finished()) {
|
||||
if (written == inflateBuf.size) growInflateBuf()
|
||||
val count = inflater.inflate(inflateBuf, written, inflateBuf.size - written)
|
||||
if (count == 0 && !inflater.finished()) break
|
||||
written += count
|
||||
}
|
||||
written
|
||||
} catch (e: DataFormatException) {
|
||||
Log.e(TAG, "Zlib inflate failed (${inputLength}B), passing raw", e)
|
||||
ensureInflateCapacity(inputLength)
|
||||
System.arraycopy(inputBuffer, 0, inflateBuf, 0, inputLength)
|
||||
inputLength
|
||||
}
|
||||
|
||||
private fun ensureInflateCapacity(needed: Int) {
|
||||
|
||||
@@ -5,19 +5,24 @@ import androidx.media3.extractor.ExtractorInput
|
||||
import androidx.media3.extractor.ExtractorOutput
|
||||
import androidx.media3.extractor.SeekMap
|
||||
import androidx.media3.extractor.TrackOutput
|
||||
import androidx.media3.extractor.mkv.MatroskaExtractor
|
||||
import androidx.media3.extractor.text.SubtitleParser
|
||||
import com.edde746.plezy.libass.media.AssHandler
|
||||
import com.edde746.plezy.libass.media.extractor.AssMatroskaExtractor
|
||||
|
||||
/**
|
||||
* Extends AssMatroskaExtractor to add support for MKV ContentCompAlgo 0 (zlib).
|
||||
* Extends AssMatroskaExtractor to add support for MKV quirks media3 rejects:
|
||||
*
|
||||
* Media3's MatroskaExtractor only supports ContentCompAlgo 3 (header stripping).
|
||||
* This subclass intercepts the compression algorithm during track header parsing:
|
||||
* ContentCompAlgo 0 (zlib) — media3 only supports ContentCompAlgo 3 (header
|
||||
* stripping). This subclass intercepts the compression algorithm during track
|
||||
* header parsing:
|
||||
* - Tells the parent it's header stripping (algo 3) to avoid the ParserException
|
||||
* - Wraps TrackOutputs with ZlibInflatingTrackOutput to decompress per-sample data
|
||||
* - Skips ContentCompSettings for zlib tracks (not applicable)
|
||||
*
|
||||
* LOAS/LATM AAC as A_MS/ACM — media3 sets audio/x-unknown for non-PCM ACM
|
||||
* tracks (silent playback). Detected tracks are wrapped with LatmTrackOutput,
|
||||
* which unwraps LOAS frames to raw AAC (see LatmMatroskaExtractor for the
|
||||
* Live TV counterpart).
|
||||
*/
|
||||
class ZlibMatroskaExtractor(
|
||||
subtitleParserFactory: SubtitleParser.Factory,
|
||||
@@ -32,27 +37,25 @@ class ZlibMatroskaExtractor(
|
||||
private const val ID_TRACK_ENTRY = 0xAE
|
||||
private const val ID_CONTENT_COMPRESSION_ALGORITHM = 0x4254
|
||||
private const val ID_CONTENT_COMPRESSION_SETTINGS = 0x4255
|
||||
|
||||
private val extractorOutputField by lazy {
|
||||
MatroskaExtractor::class.java.getDeclaredField("extractorOutput").apply {
|
||||
isAccessible = true
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private var zlibOutput: ZlibExtractorOutputWrapper? = null
|
||||
private var latmOutput: LatmExtractorOutputWrapper? = null
|
||||
private var currentTrackUsesZlib = false
|
||||
|
||||
override fun startMasterElement(id: Int, contentPosition: Long, contentSize: Long) {
|
||||
super.startMasterElement(id, contentPosition, contentSize)
|
||||
|
||||
// After super installs AssSubtitleExtractorOutput, wrap it with our zlib layer
|
||||
// After super installs AssSubtitleExtractorOutput, wrap it with our zlib +
|
||||
// LATM layers (zlib outermost so inflation runs before LATM parsing).
|
||||
if (id == ID_SEGMENT && zlibOutput == null) {
|
||||
val currentOutput = extractorOutputField.get(this) as ExtractorOutput
|
||||
val wrapper = ZlibExtractorOutputWrapper(currentOutput)
|
||||
val currentOutput = matroskaExtractorOutputField.get(this) as ExtractorOutput
|
||||
val latmWrapper = LatmExtractorOutputWrapper(currentOutput)
|
||||
latmOutput = latmWrapper
|
||||
val wrapper = ZlibExtractorOutputWrapper(latmWrapper)
|
||||
zlibOutput = wrapper
|
||||
extractorOutputField.set(this, wrapper)
|
||||
Log.d(TAG, "Installed zlib ExtractorOutput wrapper")
|
||||
matroskaExtractorOutputField.set(this, wrapper)
|
||||
Log.d(TAG, "Installed zlib+LATM ExtractorOutput wrapper")
|
||||
}
|
||||
}
|
||||
|
||||
@@ -78,6 +81,16 @@ class ZlibMatroskaExtractor(
|
||||
}
|
||||
|
||||
override fun endMasterElement(id: Int) {
|
||||
if (id == ID_TRACK_ENTRY) {
|
||||
// Must mark before super — the track output is created inside super's
|
||||
// endMasterElement, and the x-unknown format must never reach the queue.
|
||||
val track = getCurrentTrack(id)
|
||||
if (isLoasAcmTrack(track.codecId, track.codecPrivate)) {
|
||||
Log.i(TAG, "Track ${track.number} is LOAS/LATM AAC, unwrapping to raw AAC")
|
||||
latmOutput?.markNextTrackLatm()
|
||||
}
|
||||
}
|
||||
|
||||
val wasZlib = currentTrackUsesZlib
|
||||
super.endMasterElement(id)
|
||||
|
||||
@@ -88,6 +101,11 @@ class ZlibMatroskaExtractor(
|
||||
}
|
||||
}
|
||||
|
||||
override fun seek(position: Long, timeUs: Long) {
|
||||
latmOutput?.resetTracks()
|
||||
super.seek(position, timeUs)
|
||||
}
|
||||
|
||||
/**
|
||||
* ExtractorOutput wrapper that wraps all TrackOutputs with ZlibInflatingTrackOutput.
|
||||
* Tracks are created inactive; activateLast() enables inflation for the most recently
|
||||
|
||||
@@ -0,0 +1,35 @@
|
||||
package com.edde746.plezy.mpv
|
||||
|
||||
import dev.jdtech.mpv.EndFileReason
|
||||
import dev.jdtech.mpv.LogLevel
|
||||
import dev.jdtech.mpv.LogMessage
|
||||
import dev.jdtech.mpv.MpvEvent
|
||||
|
||||
/** Adds the native diagnostic that libmpv-android exposes separately via logFlow. */
|
||||
internal class MpvEndFileDiagnostics {
|
||||
private var errorMessage: String? = null
|
||||
|
||||
fun onStartFile() {
|
||||
errorMessage = null
|
||||
}
|
||||
|
||||
fun onLogMessage(message: LogMessage) {
|
||||
if (message.level == LogLevel.Fatal || message.level == LogLevel.Error) {
|
||||
errorMessage = message.text.takeIf { it.isNotBlank() }
|
||||
}
|
||||
}
|
||||
|
||||
fun onEndFile(event: MpvEvent.EndFile): Map<String, Any>? {
|
||||
val reason = event.reason
|
||||
if (reason == null) {
|
||||
errorMessage = null
|
||||
return null
|
||||
}
|
||||
val data = mutableMapOf<String, Any>("reason" to reason.id)
|
||||
if (reason == EndFileReason.Error) {
|
||||
errorMessage?.let { data["message"] = it }
|
||||
}
|
||||
errorMessage = null
|
||||
return data
|
||||
}
|
||||
}
|
||||
@@ -1,9 +1,11 @@
|
||||
package com.edde746.plezy.mpv
|
||||
|
||||
import android.app.Activity
|
||||
import android.graphics.Color
|
||||
import android.content.Context
|
||||
import android.graphics.PixelFormat
|
||||
import android.media.AudioAttributes
|
||||
import android.media.ImageReader
|
||||
import android.os.Build
|
||||
import android.os.Handler
|
||||
import android.os.Looper
|
||||
import android.util.Log
|
||||
@@ -14,20 +16,39 @@ import android.view.View
|
||||
import android.view.ViewGroup
|
||||
import android.view.ViewTreeObserver
|
||||
import com.edde746.plezy.shared.AudioFocusManager
|
||||
import com.edde746.plezy.shared.FlutterOverlayHelper
|
||||
import com.edde746.plezy.shared.FrameRateManager
|
||||
import com.edde746.plezy.shared.PlayerDelegate
|
||||
import com.edde746.plezy.shared.PlayerSurfaceHost
|
||||
import dev.jdtech.mpv.*
|
||||
import kotlinx.coroutines.*
|
||||
import kotlinx.coroutines.sync.Mutex
|
||||
import kotlinx.coroutines.sync.withLock
|
||||
|
||||
class MpvPlayerCore(private val activity: Activity) : SurfaceHolder.Callback {
|
||||
/**
|
||||
* mpv playback core. Two modes:
|
||||
* - Video (default): [context] is the host Activity, which is needed for the
|
||||
* SurfaceView/window hierarchy, display refresh-rate reads and frame-rate
|
||||
* matching.
|
||||
* - Audio-only ([audioOnly]): the music core. Built on the application
|
||||
* context (no Activity dependency, so it survives activity teardown);
|
||||
* never creates a surface, view, or frame-rate manager, and mpv is
|
||||
* configured before init to never open a video output (`vid=no`,
|
||||
* `force-window=no`, `audio-display=no`, plus `gapless-audio=weak`).
|
||||
*/
|
||||
class MpvPlayerCore(
|
||||
private val context: Context,
|
||||
private val audioOnly: Boolean = false
|
||||
) : SurfaceHolder.Callback {
|
||||
|
||||
companion object {
|
||||
private const val TAG = "MpvPlayerCore"
|
||||
}
|
||||
|
||||
/** Video-only paths. The plugin always constructs video cores with the
|
||||
* host Activity, and audio-only mode never touches these paths. */
|
||||
private val activity: Activity
|
||||
get() = context as Activity
|
||||
|
||||
private var surfaceView: SurfaceView? = null
|
||||
private var surfaceContainer: android.widget.FrameLayout? = null
|
||||
private var overlayLayoutListener: ViewTreeObserver.OnGlobalLayoutListener? = null
|
||||
@@ -52,11 +73,28 @@ class MpvPlayerCore(private val activity: Activity) : SurfaceHolder.Callback {
|
||||
|
||||
@Volatile private var player: MpvPlayer? = null
|
||||
private var scope = CoroutineScope(SupervisorJob() + Dispatchers.Main)
|
||||
private val endFileDiagnostics = MpvEndFileDiagnostics()
|
||||
|
||||
// mpv writes must stay off the main thread but run in submission order:
|
||||
// setupMpvFallback sets vo/ao/hwdec immediately before the loadfile command,
|
||||
// and an unordered pool can run loadfile first, leaving mpv with no video
|
||||
// output (#1482).
|
||||
private val mpvWriteDispatcher = Dispatchers.IO.limitedParallelism(1)
|
||||
|
||||
// Frame rate matching
|
||||
private var frameRateManager: FrameRateManager? = null
|
||||
private val handler = Handler(Looper.getMainLooper())
|
||||
|
||||
// Result-callback marshaling. Separate from [handler], whose queued
|
||||
// messages dispose() clears — pending method-channel results must still
|
||||
// complete after dispose.
|
||||
private val mainHandler = Handler(Looper.getMainLooper())
|
||||
|
||||
/** Same semantics as Activity.runOnUiThread, without needing an Activity. */
|
||||
private fun runOnMain(block: () -> Unit) {
|
||||
if (Looper.myLooper() == Looper.getMainLooper()) block() else mainHandler.post(block)
|
||||
}
|
||||
|
||||
// Audio focus
|
||||
private var audioFocusManager: AudioFocusManager? = null
|
||||
|
||||
@@ -76,25 +114,17 @@ class MpvPlayerCore(private val activity: Activity) : SurfaceHolder.Callback {
|
||||
|
||||
@Volatile private var videoOutputEpoch: Long = 0L
|
||||
private val videoOutputMutex = Mutex()
|
||||
private val commandMutex = Mutex()
|
||||
private var pendingVideoOutputDisableJob: Job? = null
|
||||
private var pendingVideoOutputRefreshJob: Job? = null
|
||||
|
||||
private var flutterOverlayApplied = false
|
||||
|
||||
private fun ensureFlutterOverlayOnTop() {
|
||||
if (disposing || flutterOverlayApplied) return
|
||||
if (audioOnly || disposing || flutterOverlayApplied) return
|
||||
val contentView = activity.findViewById<ViewGroup>(android.R.id.content)
|
||||
contentView.post {
|
||||
if (disposing || !isInitialized) return@post
|
||||
val container = FlutterOverlayHelper.findFlutterContainer(contentView, surfaceContainer)
|
||||
?: return@post
|
||||
if (contentView.getChildAt(contentView.childCount - 1) == container) {
|
||||
flutterOverlayApplied = true
|
||||
return@post
|
||||
}
|
||||
FlutterOverlayHelper.configureFlutterZOrder(contentView, container, compositionOrder = 1)
|
||||
flutterOverlayApplied = true
|
||||
flutterOverlayApplied = PlayerSurfaceHost.ensureFlutterOverlayOnTop(contentView, surfaceContainer)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -106,8 +136,15 @@ class MpvPlayerCore(private val activity: Activity) : SurfaceHolder.Callback {
|
||||
Log.d(TAG, "Created MPV placeholder surface")
|
||||
}
|
||||
|
||||
@Suppress("DEPRECATION")
|
||||
private fun currentDisplayFpsOverride(): String? {
|
||||
val refreshRate = activity.display?.mode?.refreshRate ?: return null
|
||||
if (audioOnly) return null
|
||||
val display = if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.R) {
|
||||
activity.display
|
||||
} else {
|
||||
activity.windowManager.defaultDisplay
|
||||
}
|
||||
val refreshRate = display?.mode?.refreshRate ?: return null
|
||||
if (refreshRate <= 0f) return null
|
||||
return refreshRate.toString()
|
||||
}
|
||||
@@ -124,7 +161,7 @@ class MpvPlayerCore(private val activity: Activity) : SurfaceHolder.Callback {
|
||||
return
|
||||
}
|
||||
|
||||
scope.launch(Dispatchers.IO) {
|
||||
scope.launch(mpvWriteDispatcher) {
|
||||
try {
|
||||
p.setProperty("display-fps-override", fps)
|
||||
Log.d(TAG, "Updated display-fps-override=$fps ($reason)")
|
||||
@@ -147,6 +184,7 @@ class MpvPlayerCore(private val activity: Activity) : SurfaceHolder.Callback {
|
||||
|
||||
try {
|
||||
disposing = false
|
||||
endFileDiagnostics.onStartFile()
|
||||
cachedPaused = true
|
||||
pausedForSurfaceLoss = false
|
||||
pendingSurface = null
|
||||
@@ -162,12 +200,15 @@ class MpvPlayerCore(private val activity: Activity) : SurfaceHolder.Callback {
|
||||
lastAppliedSurfaceSize = null
|
||||
lastKnownSurfaceWidth = 0
|
||||
lastKnownSurfaceHeight = 0
|
||||
ensurePlaceholderSurface()
|
||||
if (!audioOnly) ensurePlaceholderSurface()
|
||||
|
||||
// Initialize audio focus handling
|
||||
// Initialize audio focus handling. mpv has none built in, so both modes
|
||||
// use the shared manager: pause on (transient) loss, auto-resume on
|
||||
// regain when the loss interrupted active playback.
|
||||
audioFocusManager = AudioFocusManager(
|
||||
context = activity,
|
||||
context = context,
|
||||
handler = handler,
|
||||
contentType = if (audioOnly) AudioAttributes.CONTENT_TYPE_MUSIC else AudioAttributes.CONTENT_TYPE_MOVIE,
|
||||
onPause = {
|
||||
scope.launch {
|
||||
try {
|
||||
@@ -182,57 +223,29 @@ class MpvPlayerCore(private val activity: Activity) : SurfaceHolder.Callback {
|
||||
},
|
||||
isPaused = { cachedPaused }
|
||||
)
|
||||
frameRateManager = FrameRateManager(
|
||||
activity = activity,
|
||||
handler = handler,
|
||||
log = { emitLog("info", "framerate", it) }
|
||||
)
|
||||
|
||||
// Create FrameLayout container for video
|
||||
surfaceContainer = android.widget.FrameLayout(activity).apply {
|
||||
layoutParams = ViewGroup.LayoutParams(
|
||||
ViewGroup.LayoutParams.MATCH_PARENT,
|
||||
ViewGroup.LayoutParams.MATCH_PARENT
|
||||
if (!audioOnly) {
|
||||
frameRateManager = FrameRateManager(
|
||||
activity = activity,
|
||||
handler = handler,
|
||||
log = { emitLog("info", "framerate", it) }
|
||||
)
|
||||
setBackgroundColor(Color.BLACK)
|
||||
}
|
||||
|
||||
// Create SurfaceView for video rendering
|
||||
surfaceView = SurfaceView(activity).apply {
|
||||
layoutParams = android.widget.FrameLayout.LayoutParams(
|
||||
android.widget.FrameLayout.LayoutParams.MATCH_PARENT,
|
||||
android.widget.FrameLayout.LayoutParams.MATCH_PARENT
|
||||
)
|
||||
holder.addCallback(this@MpvPlayerCore)
|
||||
setZOrderOnTop(false)
|
||||
setZOrderMediaOverlay(false)
|
||||
FlutterOverlayHelper.applyCompositionOrder(this, -2)
|
||||
}
|
||||
surfaceContainer = PlayerSurfaceHost.createContainer(activity)
|
||||
surfaceView = PlayerSurfaceHost.createVideoSurface(activity, this@MpvPlayerCore)
|
||||
surfaceContainer!!.addView(surfaceView)
|
||||
|
||||
// Add SurfaceView to container
|
||||
surfaceContainer!!.addView(surfaceView)
|
||||
|
||||
// Insert container at bottom of view hierarchy (behind Flutter)
|
||||
val contentView = activity.findViewById<ViewGroup>(android.R.id.content)
|
||||
contentView.addView(surfaceContainer, 0)
|
||||
|
||||
// Find FlutterView and set it on top of our video surface.
|
||||
// compositionOrder maps directly to SurfaceView mSubLayer on API 36+:
|
||||
// negative is hole-punched behind the parent canvas, non-negative is above.
|
||||
// Stack (back → front): video (-2, hole-punched) → parent canvas → Flutter UI (+1).
|
||||
FlutterOverlayHelper.findFlutterContainer(contentView, surfaceContainer)?.let { container ->
|
||||
FlutterOverlayHelper.configureFlutterZOrder(contentView, container, compositionOrder = 1)
|
||||
flutterOverlayApplied = true
|
||||
}
|
||||
ensureFlutterOverlayOnTop()
|
||||
overlayLayoutListener = ViewTreeObserver.OnGlobalLayoutListener {
|
||||
val contentView = PlayerSurfaceHost.attachToContent(activity, surfaceContainer!!)
|
||||
flutterOverlayApplied = PlayerSurfaceHost.ensureFlutterOverlayOnTop(contentView, surfaceContainer)
|
||||
ensureFlutterOverlayOnTop()
|
||||
val sv = surfaceView
|
||||
if (sv != null) applySurfaceSize(sv.width, sv.height)
|
||||
}
|
||||
contentView.viewTreeObserver.addOnGlobalLayoutListener(overlayLayoutListener)
|
||||
overlayLayoutListener = ViewTreeObserver.OnGlobalLayoutListener {
|
||||
ensureFlutterOverlayOnTop()
|
||||
val sv = surfaceView
|
||||
if (sv != null) applySurfaceSize(sv.width, sv.height)
|
||||
}
|
||||
contentView.viewTreeObserver.addOnGlobalLayoutListener(overlayLayoutListener)
|
||||
|
||||
Log.d(TAG, "SurfaceView added to content view")
|
||||
Log.d(TAG, "SurfaceView added to content view")
|
||||
}
|
||||
|
||||
// Create MpvPlayer on background thread via coroutine
|
||||
scope.launch {
|
||||
@@ -242,18 +255,31 @@ class MpvPlayerCore(private val activity: Activity) : SurfaceHolder.Callback {
|
||||
return@launch
|
||||
}
|
||||
val displayFpsOverride = currentDisplayFpsOverride()
|
||||
val p = MpvPlayer.create(activity.applicationContext) {
|
||||
setOption("vo", "gpu")
|
||||
setOption("gpu-context", "android")
|
||||
setOption("opengl-es", "yes")
|
||||
setOption("vd-lavc-film-grain", "cpu")
|
||||
val p = MpvPlayer.create(context.applicationContext) {
|
||||
if (audioOnly) {
|
||||
// Pure audio core (all set before mpv_initialize, mirroring the
|
||||
// Windows/Linux audio instances): vid=no keeps embedded cover
|
||||
// art from ever becoming a video track, force-window and
|
||||
// audio-display make sure mpv never opens a video output for
|
||||
// it, and gapless-audio splices the pre-armed next playlist
|
||||
// entry into the running audio stream.
|
||||
setOption("vid", "no")
|
||||
setOption("force-window", "no")
|
||||
setOption("audio-display", "no")
|
||||
setOption("gapless-audio", "weak")
|
||||
} else {
|
||||
setOption("vo", "gpu")
|
||||
setOption("gpu-context", "android")
|
||||
setOption("opengl-es", "yes")
|
||||
setOption("vd-lavc-film-grain", "cpu")
|
||||
if (displayFpsOverride != null) {
|
||||
setOption("display-fps-override", displayFpsOverride)
|
||||
}
|
||||
}
|
||||
setOption("ao", "audiotrack,opensles")
|
||||
// Pause on the last frame at EOF instead of unloading the file, so a
|
||||
// seek after the video ends still works (matches Linux/Windows).
|
||||
setOption("keep-open", "yes")
|
||||
if (displayFpsOverride != null) {
|
||||
setOption("display-fps-override", displayFpsOverride)
|
||||
}
|
||||
}
|
||||
if (displayFpsOverride != null) {
|
||||
Log.d(TAG, "Initial display-fps-override=$displayFpsOverride")
|
||||
@@ -268,7 +294,7 @@ class MpvPlayerCore(private val activity: Activity) : SurfaceHolder.Callback {
|
||||
player = p
|
||||
isInitialized = true
|
||||
|
||||
refreshVideoOutput("initialize")
|
||||
if (!audioOnly) refreshVideoOutput("initialize")
|
||||
|
||||
// Start collecting events/properties/logs
|
||||
collectEvents(p)
|
||||
@@ -306,9 +332,9 @@ class MpvPlayerCore(private val activity: Activity) : SurfaceHolder.Callback {
|
||||
p.eventFlow.collect { event ->
|
||||
when (event) {
|
||||
is MpvEvent.EndFile -> {
|
||||
val data = event.reason?.let { mapOf("reason" to it.id) }
|
||||
delegate?.onEvent("end-file", data)
|
||||
delegate?.onEvent("end-file", endFileDiagnostics.onEndFile(event))
|
||||
}
|
||||
is MpvEvent.StartFile -> endFileDiagnostics.onStartFile()
|
||||
is MpvEvent.FileLoaded -> delegate?.onEvent("file-loaded", null)
|
||||
is MpvEvent.PlaybackRestart -> delegate?.onEvent("playback-restart", null)
|
||||
else -> {}
|
||||
@@ -342,6 +368,7 @@ class MpvPlayerCore(private val activity: Activity) : SurfaceHolder.Callback {
|
||||
private fun collectLogMessages(p: MpvPlayer) {
|
||||
scope.launch(start = CoroutineStart.UNDISPATCHED) {
|
||||
p.logFlow.collect { msg ->
|
||||
endFileDiagnostics.onLogMessage(msg)
|
||||
emitLog(msg.level.name.lowercase(), msg.prefix, msg.text)
|
||||
}
|
||||
}
|
||||
@@ -403,7 +430,9 @@ class MpvPlayerCore(private val activity: Activity) : SurfaceHolder.Callback {
|
||||
|
||||
private fun hasAttachedRealSurface(): Boolean = hasAttachedSurface && !attachedToPlaceholder && (attachedSurface?.isValid == true)
|
||||
|
||||
private fun hasReadyVideoOutput(): Boolean = hasAttachedRealSurface() && !videoOutputRestoring
|
||||
// Audio-only mode has no video output to wait for — playback and resume
|
||||
// paths gated on output readiness must always proceed there.
|
||||
private fun hasReadyVideoOutput(): Boolean = audioOnly || (hasAttachedRealSurface() && !videoOutputRestoring)
|
||||
|
||||
private fun isCurrentVideoOutputEpoch(epoch: Long): Boolean = !disposing && epoch == videoOutputEpoch
|
||||
|
||||
@@ -414,7 +443,7 @@ class MpvPlayerCore(private val activity: Activity) : SurfaceHolder.Callback {
|
||||
}
|
||||
|
||||
private fun refreshVideoOutput(reason: String) {
|
||||
if (disposing) return
|
||||
if (audioOnly || disposing) return
|
||||
|
||||
rememberCurrentSurfaceSize()
|
||||
val p = player
|
||||
@@ -685,7 +714,7 @@ class MpvPlayerCore(private val activity: Activity) : SurfaceHolder.Callback {
|
||||
Log.d(TAG, "Public pause state updated: paused=false")
|
||||
}
|
||||
}
|
||||
scope.launch(Dispatchers.IO) {
|
||||
scope.launch(mpvWriteDispatcher) {
|
||||
var success = false
|
||||
try {
|
||||
player?.setProperty(name, value)
|
||||
@@ -725,7 +754,7 @@ class MpvPlayerCore(private val activity: Activity) : SurfaceHolder.Callback {
|
||||
|
||||
Thread {
|
||||
val value = getPropertyBlocking(name)
|
||||
activity.runOnUiThread {
|
||||
runOnMain {
|
||||
onResult(if (!disposing && isInitialized) value else null)
|
||||
}
|
||||
}.start()
|
||||
@@ -803,13 +832,11 @@ class MpvPlayerCore(private val activity: Activity) : SurfaceHolder.Callback {
|
||||
onComplete?.invoke(false)
|
||||
return
|
||||
}
|
||||
scope.launch(Dispatchers.IO) {
|
||||
scope.launch(mpvWriteDispatcher) {
|
||||
var success = false
|
||||
try {
|
||||
commandMutex.withLock {
|
||||
player?.command(*args)
|
||||
success = true
|
||||
}
|
||||
player?.command(*args)
|
||||
success = true
|
||||
} catch (e: Exception) {
|
||||
Log.w(TAG, "command failed", e)
|
||||
} finally {
|
||||
@@ -821,9 +848,10 @@ class MpvPlayerCore(private val activity: Activity) : SurfaceHolder.Callback {
|
||||
}
|
||||
|
||||
fun setVisible(visible: Boolean) {
|
||||
if (disposing) return
|
||||
activity.runOnUiThread {
|
||||
if (disposing) return@runOnUiThread
|
||||
// Audio-only: no render layer to show or hide — tolerated no-op.
|
||||
if (audioOnly || disposing) return
|
||||
runOnMain {
|
||||
if (disposing) return@runOnMain
|
||||
surfaceContainer?.visibility = if (visible) View.VISIBLE else View.INVISIBLE
|
||||
if (visible) {
|
||||
flutterOverlayApplied = false
|
||||
@@ -849,16 +877,17 @@ class MpvPlayerCore(private val activity: Activity) : SurfaceHolder.Callback {
|
||||
}
|
||||
|
||||
fun updateFrame() {
|
||||
if (disposing) return
|
||||
activity.runOnUiThread {
|
||||
if (disposing) return@runOnUiThread
|
||||
// Audio-only: no surface to refresh — tolerated no-op.
|
||||
if (audioOnly || disposing) return
|
||||
runOnMain {
|
||||
if (disposing) return@runOnMain
|
||||
flutterOverlayApplied = false
|
||||
ensureFlutterOverlayOnTop()
|
||||
rememberCurrentSurfaceSize()
|
||||
val p = player
|
||||
if (p == null) {
|
||||
Log.d(TAG, "updateFrame(): skipping Android MPV surface refresh because player is not ready")
|
||||
return@runOnUiThread
|
||||
return@runOnMain
|
||||
}
|
||||
if (!hasReadyVideoOutput()) {
|
||||
val surface = currentCandidateSurface()
|
||||
@@ -868,7 +897,7 @@ class MpvPlayerCore(private val activity: Activity) : SurfaceHolder.Callback {
|
||||
} else {
|
||||
Log.d(TAG, "updateFrame(): skipping Android MPV surface refresh because no surface is attached")
|
||||
}
|
||||
return@runOnUiThread
|
||||
return@runOnMain
|
||||
}
|
||||
scope.launch {
|
||||
try {
|
||||
@@ -954,17 +983,17 @@ class MpvPlayerCore(private val activity: Activity) : SurfaceHolder.Callback {
|
||||
videoOutputEpoch += 1L
|
||||
}
|
||||
|
||||
// Capture locals for deferred cleanup
|
||||
// Capture locals for deferred cleanup (audio-only has no views)
|
||||
val sv = surfaceView
|
||||
val container = surfaceContainer
|
||||
val contentView = activity.findViewById<ViewGroup>(android.R.id.content)
|
||||
val contentView = if (audioOnly) null else activity.findViewById<ViewGroup>(android.R.id.content)
|
||||
|
||||
surfaceContainer = null
|
||||
surfaceView = null
|
||||
|
||||
// Remove layout listener synchronously
|
||||
overlayLayoutListener?.let { listener ->
|
||||
contentView.viewTreeObserver.removeOnGlobalLayoutListener(listener)
|
||||
contentView?.viewTreeObserver?.removeOnGlobalLayoutListener(listener)
|
||||
}
|
||||
overlayLayoutListener = null
|
||||
|
||||
@@ -986,15 +1015,18 @@ class MpvPlayerCore(private val activity: Activity) : SurfaceHolder.Callback {
|
||||
if (p != null) {
|
||||
Thread {
|
||||
try {
|
||||
// Detach surface BEFORE close to prevent GPU mutex contention with view removal
|
||||
try {
|
||||
runBlocking {
|
||||
p.setProperty("force-window", "no")
|
||||
p.setProperty("vo", "null")
|
||||
// Detach surface BEFORE close to prevent GPU mutex contention with
|
||||
// view removal (audio-only never attached one)
|
||||
if (!audioOnly) {
|
||||
try {
|
||||
runBlocking {
|
||||
p.setProperty("force-window", "no")
|
||||
p.setProperty("vo", "null")
|
||||
}
|
||||
p.detachSurface()
|
||||
} catch (e: Exception) {
|
||||
Log.w(TAG, "Failed to detach surface during dispose", e)
|
||||
}
|
||||
p.detachSurface()
|
||||
} catch (e: Exception) {
|
||||
Log.w(TAG, "Failed to detach surface during dispose", e)
|
||||
}
|
||||
p.close()
|
||||
} catch (e: Exception) {
|
||||
@@ -1005,7 +1037,7 @@ class MpvPlayerCore(private val activity: Activity) : SurfaceHolder.Callback {
|
||||
Handler(Looper.getMainLooper()).post {
|
||||
sv?.holder?.removeCallback(this)
|
||||
if (container?.parent != null) {
|
||||
contentView.removeView(container)
|
||||
contentView?.removeView(container)
|
||||
}
|
||||
onComplete?.invoke()
|
||||
}
|
||||
@@ -1015,7 +1047,7 @@ class MpvPlayerCore(private val activity: Activity) : SurfaceHolder.Callback {
|
||||
Handler(Looper.getMainLooper()).postAtFrontOfQueue {
|
||||
sv?.holder?.removeCallback(this)
|
||||
if (container?.parent != null) {
|
||||
contentView.removeView(container)
|
||||
contentView?.removeView(container)
|
||||
}
|
||||
}
|
||||
onComplete?.invoke()
|
||||
|
||||
@@ -1,8 +1,11 @@
|
||||
package com.edde746.plezy.mpv
|
||||
|
||||
import android.app.Activity
|
||||
import android.content.Context
|
||||
import android.net.Uri
|
||||
import android.os.ParcelFileDescriptor
|
||||
import android.util.Log
|
||||
import com.edde746.plezy.shared.PlayerChannelBinding
|
||||
import io.flutter.embedding.engine.plugins.FlutterPlugin
|
||||
import io.flutter.embedding.engine.plugins.activity.ActivityAware
|
||||
import io.flutter.embedding.engine.plugins.activity.ActivityPluginBinding
|
||||
@@ -10,28 +13,39 @@ import io.flutter.plugin.common.EventChannel
|
||||
import io.flutter.plugin.common.MethodCall
|
||||
import io.flutter.plugin.common.MethodChannel
|
||||
|
||||
class MpvPlayerPlugin :
|
||||
FlutterPlugin,
|
||||
/**
|
||||
* Channel plumbing for [MpvPlayerCore]. The default instance is the video
|
||||
* player; the [audioOnly] instance (see [MpvAudioPlayerPlugin]) drives the
|
||||
* dedicated music core on its own channel pair with two lifecycle
|
||||
* differences:
|
||||
* - the core is built on the application context, not the Activity, so
|
||||
* background music playback survives activity teardown — it is only
|
||||
* disposed on explicit Dart `dispose` or engine detach, never in
|
||||
* [onDetachedFromActivity];
|
||||
* - all video-only surface work is skipped inside the core.
|
||||
*/
|
||||
open class MpvPlayerPlugin(
|
||||
private val channelBase: String = "com.plezy/mpv_player",
|
||||
private val audioOnly: Boolean = false
|
||||
) : FlutterPlugin,
|
||||
MethodChannel.MethodCallHandler,
|
||||
EventChannel.StreamHandler,
|
||||
ActivityAware,
|
||||
com.edde746.plezy.shared.PlayerDelegate {
|
||||
|
||||
companion object {
|
||||
private const val TAG = "MpvPlayerPlugin"
|
||||
private const val METHOD_CHANNEL = "com.plezy/mpv_player"
|
||||
private const val EVENT_CHANNEL = "com.plezy/mpv_player/events"
|
||||
}
|
||||
private val tag = if (audioOnly) "MpvAudioPlayerPlugin" else "MpvPlayerPlugin"
|
||||
|
||||
private lateinit var methodChannel: MethodChannel
|
||||
private lateinit var eventChannel: EventChannel
|
||||
private var eventSink: EventChannel.EventSink? = null
|
||||
private val channels = PlayerChannelBinding(channelBase, this, this, tag)
|
||||
private var playerCore: MpvPlayerCore? = null
|
||||
private var activity: Activity? = null
|
||||
private var activityBinding: ActivityPluginBinding? = null
|
||||
private var applicationContext: Context? = null
|
||||
private val nameToId = mutableMapOf<String, Int>()
|
||||
private var sessionGeneration = 0
|
||||
|
||||
/** Same semantics as Activity.runOnUiThread, without needing an Activity. */
|
||||
private fun runOnMain(block: () -> Unit) = channels.runOnMain(block)
|
||||
|
||||
// Pending `MethodChannel.Result`s for an init that is currently in flight.
|
||||
// Concurrent `invoke('initialize')` calls share the same outcome instead
|
||||
// of each tearing down the in-flight core and starting their own — which
|
||||
@@ -43,19 +57,27 @@ class MpvPlayerPlugin :
|
||||
// FlutterPlugin
|
||||
|
||||
override fun onAttachedToEngine(binding: FlutterPlugin.FlutterPluginBinding) {
|
||||
methodChannel = MethodChannel(binding.binaryMessenger, METHOD_CHANNEL)
|
||||
methodChannel.setMethodCallHandler(this)
|
||||
|
||||
eventChannel = EventChannel(binding.binaryMessenger, EVENT_CHANNEL)
|
||||
eventChannel.setStreamHandler(this)
|
||||
|
||||
Log.d(TAG, "Attached to engine")
|
||||
applicationContext = binding.applicationContext
|
||||
channels.attach(binding)
|
||||
}
|
||||
|
||||
override fun onDetachedFromEngine(binding: FlutterPlugin.FlutterPluginBinding) {
|
||||
methodChannel.setMethodCallHandler(null)
|
||||
eventChannel.setStreamHandler(null)
|
||||
Log.d(TAG, "Detached from engine")
|
||||
channels.detach()
|
||||
if (audioOnly) {
|
||||
// The audio core is not activity-bound; engine detach is its terminal
|
||||
// native lifecycle event (mirrors the video core's activity detach).
|
||||
disposeCoreForTeardown()
|
||||
}
|
||||
applicationContext = null
|
||||
}
|
||||
|
||||
private fun disposeCoreForTeardown() {
|
||||
++sessionGeneration
|
||||
playerCore?.dispose()
|
||||
playerCore = null
|
||||
// Any in-flight init callback would never fire (its scope is cancelled
|
||||
// by dispose), so close out queued callers explicitly.
|
||||
completePendingInits(success = false)
|
||||
}
|
||||
|
||||
// ActivityAware
|
||||
@@ -63,43 +85,40 @@ class MpvPlayerPlugin :
|
||||
override fun onAttachedToActivity(binding: ActivityPluginBinding) {
|
||||
activity = binding.activity
|
||||
activityBinding = binding
|
||||
Log.d(TAG, "Attached to activity")
|
||||
Log.d(tag, "Attached to activity")
|
||||
}
|
||||
|
||||
override fun onDetachedFromActivity() {
|
||||
++sessionGeneration
|
||||
playerCore?.dispose()
|
||||
playerCore = null
|
||||
// Any in-flight init callback would never fire (its scope is cancelled
|
||||
// by dispose), so close out queued callers explicitly.
|
||||
completePendingInits(success = false)
|
||||
// The audio-only core deliberately outlives the activity (background
|
||||
// music); it is torn down on engine detach / Dart dispose instead.
|
||||
if (!audioOnly) {
|
||||
disposeCoreForTeardown()
|
||||
}
|
||||
activity = null
|
||||
activityBinding = null
|
||||
Log.d(TAG, "Detached from activity")
|
||||
Log.d(tag, "Detached from activity")
|
||||
}
|
||||
|
||||
override fun onReattachedToActivityForConfigChanges(binding: ActivityPluginBinding) {
|
||||
activity = binding.activity
|
||||
activityBinding = binding
|
||||
Log.d(TAG, "Reattached to activity for config changes")
|
||||
Log.d(tag, "Reattached to activity for config changes")
|
||||
}
|
||||
|
||||
override fun onDetachedFromActivityForConfigChanges() {
|
||||
activity = null
|
||||
activityBinding = null
|
||||
Log.d(TAG, "Detached from activity for config changes")
|
||||
Log.d(tag, "Detached from activity for config changes")
|
||||
}
|
||||
|
||||
// EventChannel.StreamHandler
|
||||
|
||||
override fun onListen(arguments: Any?, events: EventChannel.EventSink?) {
|
||||
eventSink = events
|
||||
Log.d(TAG, "Event stream connected")
|
||||
channels.listen(events)
|
||||
}
|
||||
|
||||
override fun onCancel(arguments: Any?) {
|
||||
eventSink = null
|
||||
Log.d(TAG, "Event stream disconnected")
|
||||
channels.cancel()
|
||||
}
|
||||
|
||||
// MethodChannel.MethodCallHandler
|
||||
@@ -120,21 +139,28 @@ class MpvPlayerPlugin :
|
||||
"requestAudioFocus" -> handleRequestAudioFocus(result)
|
||||
"abandonAudioFocus" -> handleAbandonAudioFocus(result)
|
||||
"openContentFd" -> handleOpenContentFd(call, result)
|
||||
"closeContentFd" -> handleCloseContentFd(call, result)
|
||||
"isInitialized" -> result.success(playerCore?.isInitialized ?: false)
|
||||
"setLogLevel" -> result.success(null)
|
||||
"setLogLevel" -> handleSetLogLevel(call, result)
|
||||
else -> result.notImplemented()
|
||||
}
|
||||
}
|
||||
|
||||
private fun handleInitialize(result: MethodChannel.Result) {
|
||||
val currentActivity = activity
|
||||
if (currentActivity == null) {
|
||||
result.error("NO_ACTIVITY", "Activity not available", null)
|
||||
// Video cores need the Activity (surface/view hierarchy); the audio-only
|
||||
// core is built on the application context so it can outlive it.
|
||||
val coreContext: Context? = if (audioOnly) applicationContext else activity
|
||||
if (coreContext == null) {
|
||||
if (audioOnly) {
|
||||
result.error("NO_CONTEXT", "Application context not available", null)
|
||||
} else {
|
||||
result.error("NO_ACTIVITY", "Activity not available", null)
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
if (playerCore?.isInitialized == true) {
|
||||
Log.d(TAG, "Already initialized")
|
||||
Log.d(tag, "Already initialized")
|
||||
result.success(true)
|
||||
return
|
||||
}
|
||||
@@ -146,13 +172,13 @@ class MpvPlayerPlugin :
|
||||
synchronized(pendingInitResults) {
|
||||
pendingInitResults += result
|
||||
if (isInitializing) {
|
||||
Log.d(TAG, "Init already in flight, queuing caller")
|
||||
Log.d(tag, "Init already in flight, queuing caller")
|
||||
return
|
||||
}
|
||||
isInitializing = true
|
||||
}
|
||||
|
||||
currentActivity.runOnUiThread {
|
||||
runOnMain {
|
||||
val gen: Int
|
||||
val core: MpvPlayerCore
|
||||
try {
|
||||
@@ -160,31 +186,32 @@ class MpvPlayerPlugin :
|
||||
// OR `playerCore?.isInitialized == true` and we early-exited
|
||||
// above. We never tear down a core that's mid-initialization.
|
||||
if (playerCore != null && playerCore?.isInitialized != true) {
|
||||
Log.w(TAG, "Discarding stale uninitialized core before re-init")
|
||||
Log.w(tag, "Discarding stale uninitialized core before re-init")
|
||||
playerCore?.dispose()
|
||||
playerCore = null
|
||||
}
|
||||
|
||||
gen = ++sessionGeneration
|
||||
core = MpvPlayerCore(currentActivity).apply {
|
||||
core = MpvPlayerCore(coreContext, audioOnly).apply {
|
||||
delegate = this@MpvPlayerPlugin
|
||||
}
|
||||
playerCore = core
|
||||
} catch (e: Exception) {
|
||||
Log.e(TAG, "Failed to initialize: ${e.message}", e)
|
||||
Log.e(tag, "Failed to initialize: ${e.message}", e)
|
||||
completePendingInits(success = false, errorMessage = e.message)
|
||||
return@runOnUiThread
|
||||
return@runOnMain
|
||||
}
|
||||
|
||||
core.initialize { success ->
|
||||
val stale = gen != sessionGeneration || playerCore !== core
|
||||
if (stale) {
|
||||
Log.d(TAG, "Stale init callback (gen=$gen, current=$sessionGeneration)")
|
||||
Log.d(tag, "Stale init callback (gen=$gen, current=$sessionGeneration)")
|
||||
} else {
|
||||
// Start hidden - now safe because setVisible operates on the container,
|
||||
// not the SurfaceView directly (matching ExoPlayer's approach)
|
||||
// not the SurfaceView directly (matching ExoPlayer's approach).
|
||||
// No-op on the audio-only core, which has no render layer.
|
||||
core.setVisible(false)
|
||||
Log.d(TAG, "Initialized: $success")
|
||||
Log.d(tag, "Initialized: $success")
|
||||
}
|
||||
completePendingInits(success = !stale && success)
|
||||
}
|
||||
@@ -208,7 +235,7 @@ class MpvPlayerPlugin :
|
||||
}
|
||||
|
||||
private fun handleDispose(result: MethodChannel.Result) {
|
||||
activity?.runOnUiThread {
|
||||
runOnMain {
|
||||
val core = playerCore
|
||||
++sessionGeneration
|
||||
playerCore = null
|
||||
@@ -218,10 +245,10 @@ class MpvPlayerPlugin :
|
||||
completePendingInits(success = false)
|
||||
|
||||
core?.dispose {
|
||||
Log.d(TAG, "Disposed")
|
||||
Log.d(tag, "Disposed")
|
||||
result.success(null)
|
||||
} ?: result.success(null)
|
||||
} ?: result.success(null)
|
||||
}
|
||||
}
|
||||
|
||||
private fun handleSetProperty(call: MethodCall, result: MethodChannel.Result) {
|
||||
@@ -269,9 +296,8 @@ class MpvPlayerPlugin :
|
||||
}
|
||||
|
||||
private fun handleGetStats(result: MethodChannel.Result) {
|
||||
val currentActivity = activity
|
||||
val core = playerCore
|
||||
if (currentActivity == null || core == null) {
|
||||
if (core == null) {
|
||||
result.success(mapOf("playerType" to "mpv"))
|
||||
return
|
||||
}
|
||||
@@ -279,7 +305,7 @@ class MpvPlayerPlugin :
|
||||
val gen = sessionGeneration
|
||||
Thread {
|
||||
val stats = core.getStats()
|
||||
currentActivity.runOnUiThread {
|
||||
runOnMain {
|
||||
if (gen != sessionGeneration || playerCore !== core) {
|
||||
result.success(mapOf("playerType" to "mpv"))
|
||||
} else {
|
||||
@@ -314,14 +340,30 @@ class MpvPlayerPlugin :
|
||||
|
||||
val core = playerCore
|
||||
if (core == null) {
|
||||
result.success(null)
|
||||
result.error("NOT_INITIALIZED", "Player not initialized", null)
|
||||
return
|
||||
}
|
||||
core.command(args.toTypedArray()) {
|
||||
result.success(null)
|
||||
core.command(args.toTypedArray()) { success ->
|
||||
if (success) {
|
||||
result.success(null)
|
||||
} else {
|
||||
result.error("COMMAND_FAILED", "mpv command failed", args)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private fun handleSetLogLevel(call: MethodCall, result: MethodChannel.Result) {
|
||||
if (call.argument<String>("level") == null) {
|
||||
result.error("INVALID_ARGS", "Missing 'level'", null)
|
||||
return
|
||||
}
|
||||
result.error(
|
||||
"UNSUPPORTED",
|
||||
"Runtime mpv log level changes are not supported on Android",
|
||||
null
|
||||
)
|
||||
}
|
||||
|
||||
private fun handleSetVisible(call: MethodCall, result: MethodChannel.Result) {
|
||||
val visible = call.argument<Boolean>("visible")
|
||||
|
||||
@@ -346,7 +388,7 @@ class MpvPlayerPlugin :
|
||||
val videoWidth = call.argument<Number>("videoWidth")?.toInt() ?: 0
|
||||
val videoHeight = call.argument<Number>("videoHeight")?.toInt() ?: 0
|
||||
|
||||
Log.d(TAG, "setVideoFrameRate: fps=$fps, duration=$duration, extraDelayMs=$extraDelayMs, video=${videoWidth}x$videoHeight")
|
||||
Log.d(tag, "setVideoFrameRate: fps=$fps, duration=$duration, extraDelayMs=$extraDelayMs, video=${videoWidth}x$videoHeight")
|
||||
val core = playerCore
|
||||
if (core == null) {
|
||||
result.success(false)
|
||||
@@ -358,19 +400,19 @@ class MpvPlayerPlugin :
|
||||
}
|
||||
|
||||
private fun handleClearVideoFrameRate(result: MethodChannel.Result) {
|
||||
Log.d(TAG, "clearVideoFrameRate")
|
||||
Log.d(tag, "clearVideoFrameRate")
|
||||
playerCore?.clearVideoFrameRate()
|
||||
result.success(null)
|
||||
}
|
||||
|
||||
private fun handleRequestAudioFocus(result: MethodChannel.Result) {
|
||||
Log.d(TAG, "requestAudioFocus")
|
||||
Log.d(tag, "requestAudioFocus")
|
||||
val granted = playerCore?.requestAudioFocus() ?: false
|
||||
result.success(granted)
|
||||
}
|
||||
|
||||
private fun handleAbandonAudioFocus(result: MethodChannel.Result) {
|
||||
Log.d(TAG, "abandonAudioFocus")
|
||||
Log.d(tag, "abandonAudioFocus")
|
||||
playerCore?.abandonAudioFocus()
|
||||
result.success(null)
|
||||
}
|
||||
@@ -382,9 +424,11 @@ class MpvPlayerPlugin :
|
||||
return
|
||||
}
|
||||
|
||||
val contentResolver = activity?.contentResolver
|
||||
// The audio instance may run without an Activity (background music), so
|
||||
// resolve SAF content URIs through the application context there.
|
||||
val contentResolver = (if (audioOnly) applicationContext else activity)?.contentResolver
|
||||
if (contentResolver == null) {
|
||||
result.error("NO_ACTIVITY", "Activity not available", null)
|
||||
result.error(if (audioOnly) "NO_CONTEXT" else "NO_ACTIVITY", "Context not available", null)
|
||||
return
|
||||
}
|
||||
|
||||
@@ -394,35 +438,58 @@ class MpvPlayerPlugin :
|
||||
val uri = Uri.parse(uriString)
|
||||
val pfd = contentResolver.openFileDescriptor(uri, "r")
|
||||
if (pfd == null) {
|
||||
activity?.runOnUiThread {
|
||||
runOnMain {
|
||||
result.error("OPEN_FAILED", "Failed to open file descriptor for $uriString", null)
|
||||
}
|
||||
return@Thread
|
||||
}
|
||||
|
||||
val fd = pfd.detachFd()
|
||||
Log.d(TAG, "Opened content FD $fd for $uriString")
|
||||
activity?.runOnUiThread { result.success(fd) }
|
||||
Log.d(tag, "Opened content FD $fd for $uriString")
|
||||
runOnMain { result.success(fd) }
|
||||
} catch (e: Exception) {
|
||||
Log.e(TAG, "Failed to open content FD: ${e.message}", e)
|
||||
activity?.runOnUiThread { result.error("OPEN_FAILED", e.message, null) }
|
||||
Log.e(tag, "Failed to open content FD: ${e.message}", e)
|
||||
runOnMain { result.error("OPEN_FAILED", e.message, null) }
|
||||
}
|
||||
}.start()
|
||||
}
|
||||
|
||||
// Reclaims a detached fd from handleOpenContentFd that mpv will never
|
||||
// consume (a gapless-armed entry dropped before mpv opened it). The Dart
|
||||
// side guarantees single-close and only calls this when the entry provably
|
||||
// never played.
|
||||
private fun handleCloseContentFd(call: MethodCall, result: MethodChannel.Result) {
|
||||
val fd = call.argument<Int>("fd")
|
||||
if (fd == null || fd < 0) {
|
||||
result.error("INVALID_ARGS", "Missing 'fd'", null)
|
||||
return
|
||||
}
|
||||
try {
|
||||
ParcelFileDescriptor.adoptFd(fd).close()
|
||||
Log.d(tag, "Closed content FD $fd")
|
||||
result.success(null)
|
||||
} catch (e: Exception) {
|
||||
Log.e(tag, "Failed to close content FD $fd: ${e.message}", e)
|
||||
result.error("CLOSE_FAILED", e.message, null)
|
||||
}
|
||||
}
|
||||
|
||||
// PlayerDelegate
|
||||
|
||||
override fun onPropertyChange(name: String, value: Any?) {
|
||||
val propId = nameToId[name] ?: return
|
||||
eventSink?.success(listOf(propId, value))
|
||||
channels.emitProperty(propId, value)
|
||||
}
|
||||
|
||||
override fun onEvent(name: String, data: Map<String, Any>?) {
|
||||
val event = mutableMapOf<String, Any>(
|
||||
"type" to "event",
|
||||
"name" to name
|
||||
)
|
||||
data?.let { event["data"] = it }
|
||||
eventSink?.success(event)
|
||||
channels.emitEvent(name, data)
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* The audio-only music instance on `com.plezy/mpv_audio_player[/events]`.
|
||||
* A distinct class (not just a configured [MpvPlayerPlugin]) because
|
||||
* FlutterEngine's plugin registry keys plugins by class and would silently
|
||||
* drop a second [MpvPlayerPlugin] registration.
|
||||
*/
|
||||
class MpvAudioPlayerPlugin : MpvPlayerPlugin(channelBase = "com.plezy/mpv_audio_player", audioOnly = true)
|
||||
|
||||
@@ -14,7 +14,8 @@ class AudioFocusManager(
|
||||
private val onPause: () -> Unit,
|
||||
private val onResume: () -> Unit,
|
||||
private val isPaused: () -> Boolean,
|
||||
private val log: (String) -> Unit = { Log.d(TAG, it) }
|
||||
private val log: (String) -> Unit = { Log.d(TAG, it) },
|
||||
private val contentType: Int = AudioAttributes.CONTENT_TYPE_MOVIE
|
||||
) {
|
||||
companion object {
|
||||
private const val TAG = "AudioFocusManager"
|
||||
@@ -62,7 +63,7 @@ class AudioFocusManager(
|
||||
.setAudioAttributes(
|
||||
AudioAttributes.Builder()
|
||||
.setUsage(AudioAttributes.USAGE_MEDIA)
|
||||
.setContentType(AudioAttributes.CONTENT_TYPE_MOVIE)
|
||||
.setContentType(contentType)
|
||||
.build()
|
||||
)
|
||||
.setOnAudioFocusChangeListener(audioFocusChangeListener, handler)
|
||||
|
||||
@@ -0,0 +1,62 @@
|
||||
package com.edde746.plezy.shared
|
||||
|
||||
import android.media.MediaCodecInfo
|
||||
import android.media.MediaCodecList
|
||||
import android.os.Build
|
||||
import java.util.Locale
|
||||
|
||||
/** Canonical decoder lookup and hardware classification for native playback. */
|
||||
internal object MediaCodecQuery {
|
||||
fun findHardwareDecoder(
|
||||
mimeType: String,
|
||||
codecKind: Int = MediaCodecList.REGULAR_CODECS,
|
||||
predicate: (MediaCodecInfo, String) -> Boolean = { _, _ -> true }
|
||||
): MediaCodecInfo? {
|
||||
for (info in MediaCodecList(codecKind).codecInfos) {
|
||||
if (info.isEncoder || !isHardwareAccelerated(info)) continue
|
||||
for (type in info.supportedTypes) {
|
||||
if (type.equals(mimeType, ignoreCase = true) && predicate(info, type)) {
|
||||
return info
|
||||
}
|
||||
}
|
||||
}
|
||||
return null
|
||||
}
|
||||
|
||||
fun isHardwareAccelerated(info: MediaCodecInfo): Boolean {
|
||||
val name = info.name
|
||||
return if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q) {
|
||||
isHardwareAccelerated(Build.VERSION.SDK_INT, info.isHardwareAccelerated, name)
|
||||
} else {
|
||||
// MediaCodecInfo.isHardwareAccelerated() does not exist before API 29.
|
||||
// Keep the call inside the version gate so older Fire OS releases do not
|
||||
// fail with NoSuchMethodError while initializing playback.
|
||||
isHardwareAccelerated(Build.VERSION.SDK_INT, false, name)
|
||||
}
|
||||
}
|
||||
|
||||
internal fun isHardwareAccelerated(
|
||||
sdkInt: Int,
|
||||
platformReportsHardware: Boolean,
|
||||
name: String
|
||||
): Boolean {
|
||||
// API 29 added manufacturer-provided classification, but some Codec2
|
||||
// builders still flag known software components as hardware. Require both
|
||||
// signals there; older releases expose only component names.
|
||||
return if (sdkInt >= Build.VERSION_CODES.Q) {
|
||||
platformReportsHardware && !isSoftwareCodecName(name)
|
||||
} else {
|
||||
!isSoftwareCodecName(name)
|
||||
}
|
||||
}
|
||||
|
||||
internal fun isSoftwareCodecName(name: String): Boolean {
|
||||
val normalized = name.lowercase(Locale.ROOT)
|
||||
return normalized.startsWith("omx.google.") ||
|
||||
normalized.startsWith("omx.ffmpeg.") ||
|
||||
normalized.startsWith("c2.android.") ||
|
||||
normalized.startsWith("c2.google.") ||
|
||||
normalized.startsWith("c2.ffmpeg.") ||
|
||||
normalized.contains(".sw.")
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,69 @@
|
||||
package com.edde746.plezy.shared
|
||||
|
||||
import android.content.ContentResolver
|
||||
import android.net.Uri
|
||||
import android.os.Handler
|
||||
import android.os.Looper
|
||||
import android.os.ParcelFileDescriptor
|
||||
import android.util.Log
|
||||
|
||||
internal data class ResolvedMpvUri(
|
||||
val value: String,
|
||||
private val ownedFd: Int? = null
|
||||
) {
|
||||
fun closeIfUnused() {
|
||||
val fd = ownedFd ?: return
|
||||
try {
|
||||
ParcelFileDescriptor.adoptFd(fd).close()
|
||||
} catch (error: Exception) {
|
||||
Log.w("MpvContentUriResolver", "Failed to close unused content FD $fd", error)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
internal object MpvContentUriResolver {
|
||||
private const val TAG = "MpvContentUriResolver"
|
||||
|
||||
fun resolve(
|
||||
uriString: String,
|
||||
resolver: ContentResolver,
|
||||
mainHandler: Handler,
|
||||
onResolved: (ResolvedMpvUri) -> Unit
|
||||
) {
|
||||
resolve(uriString, mainHandler, opener = {
|
||||
val descriptor = resolver.openFileDescriptor(Uri.parse(uriString), "r") ?: return@resolve null
|
||||
descriptor.detachFd()
|
||||
}, onResolved = onResolved)
|
||||
}
|
||||
|
||||
internal fun resolve(
|
||||
uriString: String,
|
||||
mainHandler: Handler,
|
||||
opener: () -> Int?,
|
||||
onResolved: (ResolvedMpvUri) -> Unit
|
||||
) {
|
||||
if (!uriString.startsWith("content://")) {
|
||||
onResolved(ResolvedMpvUri(uriString))
|
||||
return
|
||||
}
|
||||
|
||||
Thread {
|
||||
check(Looper.myLooper() != Looper.getMainLooper()) {
|
||||
"Content file descriptors must not be opened on the main thread"
|
||||
}
|
||||
val fd = try {
|
||||
opener()
|
||||
} catch (error: Exception) {
|
||||
Log.e(TAG, "Failed to open content FD for $uriString", error)
|
||||
null
|
||||
}
|
||||
val resolved = if (fd == null) {
|
||||
ResolvedMpvUri(uriString)
|
||||
} else {
|
||||
Log.d(TAG, "Opened content FD $fd for $uriString")
|
||||
ResolvedMpvUri("fdclose://$fd", fd)
|
||||
}
|
||||
mainHandler.post { onResolved(resolved) }
|
||||
}.start()
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,70 @@
|
||||
package com.edde746.plezy.shared
|
||||
|
||||
import android.os.Handler
|
||||
import android.os.Looper
|
||||
import android.util.Log
|
||||
import io.flutter.embedding.engine.plugins.FlutterPlugin
|
||||
import io.flutter.plugin.common.EventChannel
|
||||
import io.flutter.plugin.common.MethodChannel
|
||||
|
||||
/** Owns the identical MethodChannel/EventChannel lifecycle for native players. */
|
||||
internal class PlayerChannelBinding(
|
||||
private val channelBase: String,
|
||||
private val methodCallHandler: MethodChannel.MethodCallHandler,
|
||||
private val streamHandler: EventChannel.StreamHandler,
|
||||
private val logTag: String
|
||||
) {
|
||||
private lateinit var methodChannel: MethodChannel
|
||||
private lateinit var eventChannel: EventChannel
|
||||
private var eventSink: EventChannel.EventSink? = null
|
||||
|
||||
val mainHandler = Handler(Looper.getMainLooper())
|
||||
|
||||
fun attach(binding: FlutterPlugin.FlutterPluginBinding) {
|
||||
methodChannel = MethodChannel(binding.binaryMessenger, channelBase)
|
||||
methodChannel.setMethodCallHandler(methodCallHandler)
|
||||
|
||||
eventChannel = EventChannel(binding.binaryMessenger, "$channelBase/events")
|
||||
eventChannel.setStreamHandler(streamHandler)
|
||||
|
||||
Log.d(logTag, "Attached to engine")
|
||||
}
|
||||
|
||||
fun detach() {
|
||||
methodChannel.setMethodCallHandler(null)
|
||||
eventChannel.setStreamHandler(null)
|
||||
eventSink = null
|
||||
Log.d(logTag, "Detached from engine")
|
||||
}
|
||||
|
||||
fun listen(events: EventChannel.EventSink?) {
|
||||
eventSink = events
|
||||
Log.d(logTag, "Event stream connected")
|
||||
}
|
||||
|
||||
fun cancel() {
|
||||
eventSink = null
|
||||
Log.d(logTag, "Event stream disconnected")
|
||||
}
|
||||
|
||||
fun runOnMain(block: () -> Unit) {
|
||||
if (Looper.myLooper() == Looper.getMainLooper()) {
|
||||
block()
|
||||
} else {
|
||||
mainHandler.post(block)
|
||||
}
|
||||
}
|
||||
|
||||
fun emitProperty(id: Int, value: Any?) {
|
||||
runOnMain { eventSink?.success(listOf(id, value)) }
|
||||
}
|
||||
|
||||
fun emitEvent(name: String, data: Map<String, Any>? = null) {
|
||||
val event = mutableMapOf<String, Any>(
|
||||
"type" to "event",
|
||||
"name" to name
|
||||
)
|
||||
data?.let { event["data"] = it }
|
||||
runOnMain { eventSink?.success(event) }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,47 @@
|
||||
package com.edde746.plezy.shared
|
||||
|
||||
import android.app.Activity
|
||||
import android.graphics.Color
|
||||
import android.view.SurfaceHolder
|
||||
import android.view.SurfaceView
|
||||
import android.view.ViewGroup
|
||||
import android.widget.FrameLayout
|
||||
|
||||
/** Shared Android view scaffold beneath the ExoPlayer and mpv cores. */
|
||||
internal object PlayerSurfaceHost {
|
||||
fun createContainer(activity: Activity, clipChildren: Boolean = false): FrameLayout = FrameLayout(activity).apply {
|
||||
layoutParams = ViewGroup.LayoutParams(
|
||||
ViewGroup.LayoutParams.MATCH_PARENT,
|
||||
ViewGroup.LayoutParams.MATCH_PARENT
|
||||
)
|
||||
setBackgroundColor(Color.BLACK)
|
||||
this.clipChildren = clipChildren
|
||||
}
|
||||
|
||||
fun createVideoSurface(activity: Activity, callback: SurfaceHolder.Callback): SurfaceView = SurfaceView(activity).apply {
|
||||
layoutParams = FrameLayout.LayoutParams(
|
||||
FrameLayout.LayoutParams.MATCH_PARENT,
|
||||
FrameLayout.LayoutParams.MATCH_PARENT
|
||||
)
|
||||
holder.addCallback(callback)
|
||||
setZOrderOnTop(false)
|
||||
setZOrderMediaOverlay(false)
|
||||
FlutterOverlayHelper.applyCompositionOrder(this, -2)
|
||||
}
|
||||
|
||||
fun attachToContent(activity: Activity, container: FrameLayout): ViewGroup {
|
||||
val contentView = activity.findViewById<ViewGroup>(android.R.id.content)
|
||||
contentView.addView(container, 0)
|
||||
ensureFlutterOverlayOnTop(contentView, container)
|
||||
return contentView
|
||||
}
|
||||
|
||||
fun ensureFlutterOverlayOnTop(contentView: ViewGroup, surfaceContainer: ViewGroup?): Boolean {
|
||||
val flutterContainer = FlutterOverlayHelper.findFlutterContainer(contentView, surfaceContainer)
|
||||
?: return false
|
||||
if (contentView.getChildAt(contentView.childCount - 1) !== flutterContainer) {
|
||||
FlutterOverlayHelper.configureFlutterZOrder(contentView, flutterContainer, compositionOrder = 1)
|
||||
}
|
||||
return true
|
||||
}
|
||||
}
|
||||
@@ -3,8 +3,6 @@
|
||||
<!-- Theme applied to the Android Window while the process is starting when the OS's Dark Mode setting is on -->
|
||||
<style name="LaunchTheme" parent="@android:style/Theme.Black.NoTitleBar">
|
||||
<item name="android:windowBackground">@color/splash_background</item>
|
||||
<!-- Disable Android's default green focus highlight that appears during d-pad/keyboard navigation -->
|
||||
<item name="android:defaultFocusHighlightEnabled">false</item>
|
||||
<item name="android:colorControlHighlight">@android:color/transparent</item>
|
||||
</style>
|
||||
<!-- Theme applied to the Android Window as soon as the process has started.
|
||||
@@ -15,30 +13,24 @@
|
||||
This Theme is only used starting with V2 of Flutter's Android embedding. -->
|
||||
<style name="NormalTheme" parent="@android:style/Theme.Black.NoTitleBar">
|
||||
<item name="android:windowBackground">@color/splash_background</item>
|
||||
<!-- Disable Android's default green focus highlight that appears during d-pad/keyboard navigation -->
|
||||
<item name="android:defaultFocusHighlightEnabled">false</item>
|
||||
<item name="android:colorControlHighlight">@android:color/transparent</item>
|
||||
</style>
|
||||
|
||||
<!-- Splash theme variants for setSplashScreenTheme -->
|
||||
<style name="SplashTheme.Dark" parent="@android:style/Theme.Black.NoTitleBar">
|
||||
<item name="android:windowBackground">@color/splash_dark</item>
|
||||
<item name="android:defaultFocusHighlightEnabled">false</item>
|
||||
<item name="android:colorControlHighlight">@android:color/transparent</item>
|
||||
</style>
|
||||
<style name="SplashTheme.Oled" parent="@android:style/Theme.Black.NoTitleBar">
|
||||
<item name="android:windowBackground">@color/splash_oled</item>
|
||||
<item name="android:defaultFocusHighlightEnabled">false</item>
|
||||
<item name="android:colorControlHighlight">@android:color/transparent</item>
|
||||
</style>
|
||||
<style name="SplashTheme.Light" parent="@android:style/Theme.Black.NoTitleBar">
|
||||
<item name="android:windowBackground">@color/splash_light</item>
|
||||
<item name="android:defaultFocusHighlightEnabled">false</item>
|
||||
<item name="android:colorControlHighlight">@android:color/transparent</item>
|
||||
</style>
|
||||
<style name="SplashTheme.System" parent="@android:style/Theme.Black.NoTitleBar">
|
||||
<item name="android:windowBackground">@color/splash_background</item>
|
||||
<item name="android:defaultFocusHighlightEnabled">false</item>
|
||||
<item name="android:colorControlHighlight">@android:color/transparent</item>
|
||||
</style>
|
||||
</resources>
|
||||
|
||||
@@ -3,8 +3,6 @@
|
||||
<!-- Theme applied to the Android Window while the process is starting when the OS's Dark Mode setting is off -->
|
||||
<style name="LaunchTheme" parent="@android:style/Theme.Light.NoTitleBar">
|
||||
<item name="android:windowBackground">@color/splash_background</item>
|
||||
<!-- Disable Android's default green focus highlight that appears during d-pad/keyboard navigation -->
|
||||
<item name="android:defaultFocusHighlightEnabled">false</item>
|
||||
<item name="android:colorControlHighlight">@android:color/transparent</item>
|
||||
</style>
|
||||
<!-- Theme applied to the Android Window as soon as the process has started.
|
||||
@@ -15,30 +13,24 @@
|
||||
This Theme is only used starting with V2 of Flutter's Android embedding. -->
|
||||
<style name="NormalTheme" parent="@android:style/Theme.Light.NoTitleBar">
|
||||
<item name="android:windowBackground">@color/splash_background</item>
|
||||
<!-- Disable Android's default green focus highlight that appears during d-pad/keyboard navigation -->
|
||||
<item name="android:defaultFocusHighlightEnabled">false</item>
|
||||
<item name="android:colorControlHighlight">@android:color/transparent</item>
|
||||
</style>
|
||||
|
||||
<!-- Splash theme variants for setSplashScreenTheme -->
|
||||
<style name="SplashTheme.Dark" parent="@android:style/Theme.Light.NoTitleBar">
|
||||
<item name="android:windowBackground">@color/splash_dark</item>
|
||||
<item name="android:defaultFocusHighlightEnabled">false</item>
|
||||
<item name="android:colorControlHighlight">@android:color/transparent</item>
|
||||
</style>
|
||||
<style name="SplashTheme.Oled" parent="@android:style/Theme.Light.NoTitleBar">
|
||||
<item name="android:windowBackground">@color/splash_oled</item>
|
||||
<item name="android:defaultFocusHighlightEnabled">false</item>
|
||||
<item name="android:colorControlHighlight">@android:color/transparent</item>
|
||||
</style>
|
||||
<style name="SplashTheme.Light" parent="@android:style/Theme.Light.NoTitleBar">
|
||||
<item name="android:windowBackground">@color/splash_light</item>
|
||||
<item name="android:defaultFocusHighlightEnabled">false</item>
|
||||
<item name="android:colorControlHighlight">@android:color/transparent</item>
|
||||
</style>
|
||||
<style name="SplashTheme.System" parent="@android:style/Theme.Light.NoTitleBar">
|
||||
<item name="android:windowBackground">@color/splash_background</item>
|
||||
<item name="android:defaultFocusHighlightEnabled">false</item>
|
||||
<item name="android:colorControlHighlight">@android:color/transparent</item>
|
||||
</style>
|
||||
</resources>
|
||||
|
||||
@@ -0,0 +1,102 @@
|
||||
package com.edde746.plezy
|
||||
|
||||
import android.graphics.SurfaceTexture
|
||||
import android.os.Looper
|
||||
import android.view.TextureView
|
||||
import java.time.Duration
|
||||
import org.junit.After
|
||||
import org.junit.Assert.assertEquals
|
||||
import org.junit.Before
|
||||
import org.junit.Test
|
||||
import org.junit.runner.RunWith
|
||||
import org.robolectric.RobolectricTestRunner
|
||||
import org.robolectric.Shadows.shadowOf
|
||||
import org.robolectric.annotation.LooperMode
|
||||
|
||||
@RunWith(RobolectricTestRunner::class)
|
||||
@LooperMode(LooperMode.Mode.PAUSED)
|
||||
class DeferredSurfaceTextureListenerTest {
|
||||
|
||||
private lateinit var surface: SurfaceTexture
|
||||
private lateinit var delegate: RecordingListener
|
||||
private lateinit var listener: DeferredSurfaceTextureListener
|
||||
private var currentSurface: SurfaceTexture? = null
|
||||
|
||||
@Before
|
||||
fun setUp() {
|
||||
surface = SurfaceTexture(0)
|
||||
currentSurface = surface
|
||||
delegate = RecordingListener()
|
||||
listener = DeferredSurfaceTextureListener(delegate) { candidate -> candidate === currentSurface }
|
||||
}
|
||||
|
||||
@After
|
||||
fun tearDown() {
|
||||
surface.release()
|
||||
}
|
||||
|
||||
@Test
|
||||
fun forwardsRepeatedSameSizeCallbacks() {
|
||||
listener.onSurfaceTextureSizeChanged(surface, 1920, 1080)
|
||||
idlePastResizeDelay()
|
||||
listener.onSurfaceTextureSizeChanged(surface, 1920, 1080)
|
||||
idlePastResizeDelay()
|
||||
|
||||
assertEquals(listOf(1920 to 1080, 1920 to 1080), delegate.sizes)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun coalescesPendingCallbacksToLatestSize() {
|
||||
listener.onSurfaceTextureSizeChanged(surface, 1280, 720)
|
||||
listener.onSurfaceTextureSizeChanged(surface, 1920, 1080)
|
||||
idlePastResizeDelay()
|
||||
|
||||
assertEquals(listOf(1920 to 1080), delegate.sizes)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun ignoresCallbackForObsoleteSurface() {
|
||||
val replacement = SurfaceTexture(0)
|
||||
try {
|
||||
listener.onSurfaceTextureSizeChanged(surface, 1920, 1080)
|
||||
currentSurface = replacement
|
||||
idlePastResizeDelay()
|
||||
|
||||
assertEquals(emptyList<Pair<Int, Int>>(), delegate.sizes)
|
||||
} finally {
|
||||
replacement.release()
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
fun destroyingSurfaceCancelsPendingCallback() {
|
||||
listener.onSurfaceTextureSizeChanged(surface, 1920, 1080)
|
||||
listener.onSurfaceTextureDestroyed(surface)
|
||||
idlePastResizeDelay()
|
||||
|
||||
assertEquals(emptyList<Pair<Int, Int>>(), delegate.sizes)
|
||||
assertEquals(1, delegate.destroyedCount)
|
||||
}
|
||||
|
||||
private fun idlePastResizeDelay() {
|
||||
shadowOf(Looper.getMainLooper()).idleFor(Duration.ofMillis(101))
|
||||
}
|
||||
|
||||
private class RecordingListener : TextureView.SurfaceTextureListener {
|
||||
val sizes = mutableListOf<Pair<Int, Int>>()
|
||||
var destroyedCount = 0
|
||||
|
||||
override fun onSurfaceTextureAvailable(surface: SurfaceTexture, width: Int, height: Int) = Unit
|
||||
|
||||
override fun onSurfaceTextureSizeChanged(surface: SurfaceTexture, width: Int, height: Int) {
|
||||
sizes += width to height
|
||||
}
|
||||
|
||||
override fun onSurfaceTextureUpdated(surface: SurfaceTexture) = Unit
|
||||
|
||||
override fun onSurfaceTextureDestroyed(surface: SurfaceTexture): Boolean {
|
||||
destroyedCount++
|
||||
return true
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,66 @@
|
||||
package com.edde746.plezy
|
||||
|
||||
import android.app.Activity
|
||||
import android.content.Intent
|
||||
import io.flutter.plugin.common.MethodChannel
|
||||
import org.junit.Assert.assertEquals
|
||||
import org.junit.Assert.assertTrue
|
||||
import org.junit.Test
|
||||
import org.junit.runner.RunWith
|
||||
import org.robolectric.Robolectric
|
||||
import org.robolectric.RobolectricTestRunner
|
||||
|
||||
@RunWith(RobolectricTestRunner::class)
|
||||
class ExternalPlayerChannelTest {
|
||||
|
||||
@Test
|
||||
fun mxPlayerResultPreservesPositionDurationAndCompletion() {
|
||||
val activity = Robolectric.buildActivity(Activity::class.java).get()
|
||||
val channel = ExternalPlayerChannel(activity)
|
||||
val data = Intent("com.mxtech.intent.result.VIEW")
|
||||
.putExtra("position", 123)
|
||||
.putExtra("duration", "456")
|
||||
.putExtra("end_by", "playback_completion")
|
||||
|
||||
val result = channel.buildResult(Activity.RESULT_OK, data)
|
||||
|
||||
assertEquals(123L, result["positionMs"])
|
||||
assertEquals(456L, result["durationMs"])
|
||||
assertEquals(true, result["playbackCompleted"])
|
||||
assertEquals(false, result["playbackError"])
|
||||
}
|
||||
|
||||
@Test
|
||||
fun activityDestroyCompletesPendingChannelCall() {
|
||||
val activity = Robolectric.buildActivity(Activity::class.java).get()
|
||||
val channel = ExternalPlayerChannel(activity)
|
||||
val result = RecordingResult()
|
||||
channel.javaClass.getDeclaredField("pendingResult").apply {
|
||||
isAccessible = true
|
||||
set(channel, result)
|
||||
}
|
||||
|
||||
channel.dispose()
|
||||
|
||||
assertTrue(result.completed)
|
||||
assertEquals("ACTIVITY_DESTROYED", result.errorCode)
|
||||
}
|
||||
|
||||
private class RecordingResult : MethodChannel.Result {
|
||||
var completed = false
|
||||
var errorCode: String? = null
|
||||
|
||||
override fun success(result: Any?) {
|
||||
completed = true
|
||||
}
|
||||
|
||||
override fun error(errorCode: String, errorMessage: String?, errorDetails: Any?) {
|
||||
completed = true
|
||||
this.errorCode = errorCode
|
||||
}
|
||||
|
||||
override fun notImplemented() {
|
||||
completed = true
|
||||
}
|
||||
}
|
||||
}
|
||||
+100
@@ -0,0 +1,100 @@
|
||||
package com.edde746.plezy.exoplayer
|
||||
|
||||
import androidx.media3.common.C
|
||||
import androidx.media3.common.DataReader
|
||||
import androidx.media3.common.Format
|
||||
import androidx.media3.common.util.ParsableByteArray
|
||||
import androidx.media3.extractor.TrackOutput
|
||||
import java.io.ByteArrayOutputStream
|
||||
import java.io.EOFException
|
||||
import org.junit.Assert.assertArrayEquals
|
||||
import org.junit.Assert.assertEquals
|
||||
import org.junit.Assert.assertThrows
|
||||
import org.junit.Test
|
||||
|
||||
class BufferedTransformingTrackOutputTest {
|
||||
|
||||
@Test
|
||||
fun activeTransformBuffersChunksAndEmitsOneNormalizedSample() {
|
||||
val delegate = RecordingTrackOutput()
|
||||
val output = IncrementingTrackOutput(delegate)
|
||||
|
||||
output.sampleData(ParsableByteArray(byteArrayOf(1, 2)), 2, TrackOutput.SAMPLE_DATA_PART_MAIN)
|
||||
output.sampleData(ParsableByteArray(byteArrayOf(3)), 1, TrackOutput.SAMPLE_DATA_PART_MAIN)
|
||||
output.sampleMetadata(42, C.BUFFER_FLAG_KEY_FRAME, 3, 7, null)
|
||||
|
||||
assertArrayEquals(byteArrayOf(2, 3, 4), delegate.bytes.toByteArray())
|
||||
assertEquals(42, delegate.timeUs)
|
||||
assertEquals(3, delegate.sampleSize)
|
||||
assertEquals(0, delegate.sampleOffset)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun activeTransformHonorsDataReaderEndOfInputContract() {
|
||||
val output = IncrementingTrackOutput(RecordingTrackOutput())
|
||||
val exhausted = DataReader { _, _, _ -> C.RESULT_END_OF_INPUT }
|
||||
|
||||
assertThrows(EOFException::class.java) {
|
||||
output.sampleData(exhausted, 1, false, TrackOutput.SAMPLE_DATA_PART_MAIN)
|
||||
}
|
||||
assertEquals(
|
||||
C.RESULT_END_OF_INPUT,
|
||||
output.sampleData(exhausted, 1, true, TrackOutput.SAMPLE_DATA_PART_MAIN)
|
||||
)
|
||||
}
|
||||
|
||||
private class IncrementingTrackOutput(delegate: TrackOutput) : BufferedTransformingTrackOutput(delegate, initialBufferSize = 2) {
|
||||
private var transformed = ByteArray(2)
|
||||
|
||||
override val transformEnabled = true
|
||||
override val transformedBuffer: ByteArray
|
||||
get() = transformed
|
||||
|
||||
override fun transformSample(inputLength: Int, flags: Int): Int {
|
||||
if (transformed.size < inputLength) transformed = ByteArray(inputLength)
|
||||
for (index in 0 until inputLength) {
|
||||
transformed[index] = (inputBuffer[index] + 1).toByte()
|
||||
}
|
||||
return inputLength
|
||||
}
|
||||
}
|
||||
|
||||
private class RecordingTrackOutput : TrackOutput {
|
||||
val bytes = ByteArrayOutputStream()
|
||||
var timeUs = C.TIME_UNSET
|
||||
var sampleSize = -1
|
||||
var sampleOffset = -1
|
||||
|
||||
override fun format(format: Format) = Unit
|
||||
|
||||
override fun sampleData(
|
||||
input: DataReader,
|
||||
length: Int,
|
||||
allowEndOfInput: Boolean,
|
||||
sampleDataPart: Int
|
||||
): Int {
|
||||
val buffer = ByteArray(length)
|
||||
val read = input.read(buffer, 0, length)
|
||||
if (read > 0) bytes.write(buffer, 0, read)
|
||||
return read
|
||||
}
|
||||
|
||||
override fun sampleData(data: ParsableByteArray, length: Int, sampleDataPart: Int) {
|
||||
val buffer = ByteArray(length)
|
||||
data.readBytes(buffer, 0, length)
|
||||
bytes.write(buffer)
|
||||
}
|
||||
|
||||
override fun sampleMetadata(
|
||||
timeUs: Long,
|
||||
flags: Int,
|
||||
size: Int,
|
||||
offset: Int,
|
||||
cryptoData: TrackOutput.CryptoData?
|
||||
) {
|
||||
this.timeUs = timeUs
|
||||
sampleSize = size
|
||||
sampleOffset = offset
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,117 @@
|
||||
package com.edde746.plezy.exoplayer
|
||||
|
||||
import kotlin.math.pow
|
||||
import org.junit.Assert.assertEquals
|
||||
import org.junit.Assert.assertNotNull
|
||||
import org.junit.Assert.assertNull
|
||||
import org.junit.Assert.assertTrue
|
||||
import org.junit.Test
|
||||
|
||||
class DownmixMatricesTest {
|
||||
|
||||
private fun coeff(matrix: FloatArray, input: Int, output: Int) = matrix[input * 2 + output]
|
||||
|
||||
private fun columnSum(matrix: FloatArray, output: Int): Float {
|
||||
var sum = 0f
|
||||
for (input in 0 until matrix.size / 2) sum += coeff(matrix, input, output)
|
||||
return sum
|
||||
}
|
||||
|
||||
@Test
|
||||
fun centerGainMatchesKodiFormula() {
|
||||
// Kodi: center_mix_level = 10^((-3 + boost) / 20)
|
||||
assertEquals(0.70795f, DownmixMatrices.centerGain(0), 1e-3f)
|
||||
assertEquals(1.0f, DownmixMatrices.centerGain(3), 1e-3f)
|
||||
assertEquals(2.81838f, DownmixMatrices.centerGain(12), 1e-3f)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun centerGainClampsBoost() {
|
||||
assertEquals(DownmixMatrices.centerGain(12), DownmixMatrices.centerGain(20), 0f)
|
||||
assertEquals(DownmixMatrices.centerGain(0), DownmixMatrices.centerGain(-5), 0f)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun fivePointOneLayoutUnnormalized() {
|
||||
val m = DownmixMatrices.stereoCoefficients(6, centerBoostDb = 0, normalize = false)!!
|
||||
val c = DownmixMatrices.centerGain(0)
|
||||
val s = DownmixMatrices.SURROUND_GAIN
|
||||
// FL FR FC LFE BL BR
|
||||
assertEquals(1f, coeff(m, 0, 0), 0f)
|
||||
assertEquals(0f, coeff(m, 0, 1), 0f)
|
||||
assertEquals(0f, coeff(m, 1, 0), 0f)
|
||||
assertEquals(1f, coeff(m, 1, 1), 0f)
|
||||
assertEquals(c, coeff(m, 2, 0), 0f)
|
||||
assertEquals(c, coeff(m, 2, 1), 0f)
|
||||
assertEquals(0f, coeff(m, 3, 0), 0f) // LFE dropped
|
||||
assertEquals(0f, coeff(m, 3, 1), 0f)
|
||||
assertEquals(s, coeff(m, 4, 0), 0f)
|
||||
assertEquals(0f, coeff(m, 4, 1), 0f)
|
||||
assertEquals(0f, coeff(m, 5, 0), 0f)
|
||||
assertEquals(s, coeff(m, 5, 1), 0f)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun sixPointOneBackCenterMixesHalfToEachSide() {
|
||||
val m = DownmixMatrices.stereoCoefficients(7, centerBoostDb = 0, normalize = false)!!
|
||||
assertEquals(0.5f, coeff(m, 6, 0), 0f)
|
||||
assertEquals(0.5f, coeff(m, 6, 1), 0f)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun normalizeScalesMaxColumnSumToOne() {
|
||||
for (channels in intArrayOf(6, 8)) {
|
||||
val m = DownmixMatrices.stereoCoefficients(channels, centerBoostDb = 6, normalize = true)!!
|
||||
assertEquals("channels=$channels L", 1f, columnSum(m, 0), 1e-4f)
|
||||
assertEquals("channels=$channels R", 1f, columnSum(m, 1), 1e-4f)
|
||||
// Relative balance is preserved: FC/FL ratio equals the raw center gain.
|
||||
assertEquals(DownmixMatrices.centerGain(6), coeff(m, 2, 0) / coeff(m, 0, 0), 1e-4f)
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
fun normalizeNeverAmplifies() {
|
||||
for (channels in DownmixMatrices.MIN_DOWNMIX_INPUT_CHANNELS..DownmixMatrices.MAX_DOWNMIX_INPUT_CHANNELS) {
|
||||
val raw = DownmixMatrices.stereoCoefficients(channels, centerBoostDb = 6, normalize = false)!!
|
||||
val normalized = DownmixMatrices.stereoCoefficients(channels, centerBoostDb = 6, normalize = true)!!
|
||||
for (i in raw.indices) {
|
||||
assertTrue("channels=$channels i=$i", normalized[i] <= raw[i] + 1e-6f)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
fun boostRaisesOnlyTheCenterChannel() {
|
||||
val base = DownmixMatrices.stereoCoefficients(6, centerBoostDb = 0, normalize = false)!!
|
||||
val boosted = DownmixMatrices.stereoCoefficients(6, centerBoostDb = 6, normalize = false)!!
|
||||
val expectedRatio = 10f.pow(6f / 20f)
|
||||
assertEquals(expectedRatio, coeff(boosted, 2, 0) / coeff(base, 2, 0), 1e-4f)
|
||||
for (input in intArrayOf(0, 1, 3, 4, 5)) {
|
||||
assertEquals("input=$input L", coeff(base, input, 0), coeff(boosted, input, 0), 0f)
|
||||
assertEquals("input=$input R", coeff(base, input, 1), coeff(boosted, input, 1), 0f)
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
fun passThroughCountsReturnNull() {
|
||||
for (channels in intArrayOf(1, 2, 9, 12)) {
|
||||
assertNull("channels=$channels", DownmixMatrices.stereoCoefficients(channels, 0, true))
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
fun allCoefficientsNonNegative() {
|
||||
// ChannelMixingMatrix throws on negative coefficients; guard every combination.
|
||||
for (channels in DownmixMatrices.MIN_DOWNMIX_INPUT_CHANNELS..DownmixMatrices.MAX_DOWNMIX_INPUT_CHANNELS) {
|
||||
for (boost in intArrayOf(0, 6, 12)) {
|
||||
for (normalize in booleanArrayOf(true, false)) {
|
||||
val m = DownmixMatrices.stereoCoefficients(channels, boost, normalize)
|
||||
assertNotNull(m)
|
||||
for (value in m!!) {
|
||||
assertTrue("channels=$channels boost=$boost normalize=$normalize", value >= 0f)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -26,17 +26,6 @@ class DvBitstreamSanitizerTest {
|
||||
assertEquals(0, buffer.position())
|
||||
}
|
||||
|
||||
@Test
|
||||
fun stripsSuffixSei() {
|
||||
val vcl = annexBNal(1, byteArrayOf(0x01))
|
||||
val suffixSei = annexBNal(40, hdr10PlusSeiPayload())
|
||||
val buffer = bufferOf(vcl, suffixSei)
|
||||
|
||||
sanitizer.sanitize(buffer, stripHdr10PlusSei = true, stripDvRpu = false)
|
||||
|
||||
assertArrayEquals(vcl, remainingBytes(buffer))
|
||||
}
|
||||
|
||||
@Test
|
||||
fun handles3ByteStartCodes() {
|
||||
val vcl1 = annexBNal(1, byteArrayOf(0x01, 0x02), startCodeLen = 3)
|
||||
@@ -141,16 +130,6 @@ class DvBitstreamSanitizerTest {
|
||||
assertEquals(0xBB.toByte(), buffer.get(1))
|
||||
}
|
||||
|
||||
@Test
|
||||
fun worksOnDirectBuffers() {
|
||||
val vcl = annexBNal(1, byteArrayOf(0x01, 0x02))
|
||||
val buffer = directBufferOf(vcl, hdr10PlusSei())
|
||||
|
||||
sanitizer.sanitize(buffer, stripHdr10PlusSei = true, stripDvRpu = false)
|
||||
|
||||
assertArrayEquals(vcl, remainingBytes(buffer))
|
||||
}
|
||||
|
||||
@Test
|
||||
fun emptyBufferIsNoOp() {
|
||||
val buffer = ByteBuffer.allocate(0)
|
||||
|
||||
+51
@@ -0,0 +1,51 @@
|
||||
package com.edde746.plezy.exoplayer
|
||||
|
||||
import android.app.Activity
|
||||
import android.os.Looper
|
||||
import android.view.ViewGroup
|
||||
import android.view.ViewTreeObserver
|
||||
import android.widget.FrameLayout
|
||||
import org.junit.Assert.assertEquals
|
||||
import org.junit.Assert.assertNull
|
||||
import org.junit.Test
|
||||
import org.junit.runner.RunWith
|
||||
import org.robolectric.Robolectric
|
||||
import org.robolectric.RobolectricTestRunner
|
||||
import org.robolectric.Shadows.shadowOf
|
||||
|
||||
@RunWith(RobolectricTestRunner::class)
|
||||
class ExoPlayerInitializationCleanupTest {
|
||||
|
||||
@Test
|
||||
fun disposeRemovesPartiallyAttachedViewAndLayoutListener() {
|
||||
val activity = Robolectric.buildActivity(Activity::class.java).setup().get()
|
||||
activity.setContentView(FrameLayout(activity))
|
||||
val content = activity.findViewById<ViewGroup>(android.R.id.content)
|
||||
val container = FrameLayout(activity)
|
||||
content.addView(container)
|
||||
var layoutCallbacks = 0
|
||||
val listener = ViewTreeObserver.OnGlobalLayoutListener { layoutCallbacks++ }
|
||||
content.viewTreeObserver.addOnGlobalLayoutListener(listener)
|
||||
|
||||
val core = ExoPlayerCore(activity)
|
||||
core.setPrivateField("surfaceContainer", container)
|
||||
core.setPrivateField("overlayLayoutListener", listener)
|
||||
|
||||
core.dispose()
|
||||
content.viewTreeObserver.dispatchOnGlobalLayout()
|
||||
shadowOf(Looper.getMainLooper()).idle()
|
||||
|
||||
assertEquals(0, layoutCallbacks)
|
||||
assertNull(container.parent)
|
||||
assertNull(core.getPrivateField("overlayLayoutListener"))
|
||||
}
|
||||
|
||||
private fun Any.setPrivateField(name: String, value: Any?) {
|
||||
javaClass.getDeclaredField(name).apply {
|
||||
isAccessible = true
|
||||
set(this@setPrivateField, value)
|
||||
}
|
||||
}
|
||||
|
||||
private fun Any.getPrivateField(name: String): Any? = javaClass.getDeclaredField(name).apply { isAccessible = true }.get(this)
|
||||
}
|
||||
@@ -0,0 +1,90 @@
|
||||
package com.edde746.plezy.exoplayer
|
||||
|
||||
import android.os.Looper
|
||||
import io.flutter.plugin.common.EventChannel
|
||||
import io.flutter.plugin.common.MethodCall
|
||||
import io.flutter.plugin.common.MethodChannel
|
||||
import java.util.concurrent.CountDownLatch
|
||||
import java.util.concurrent.TimeUnit
|
||||
import org.junit.Assert.assertEquals
|
||||
import org.junit.Assert.assertTrue
|
||||
import org.junit.Test
|
||||
import org.junit.runner.RunWith
|
||||
import org.robolectric.RobolectricTestRunner
|
||||
import org.robolectric.Shadows.shadowOf
|
||||
|
||||
@RunWith(RobolectricTestRunner::class)
|
||||
class ExoPlayerPluginTest {
|
||||
|
||||
@Test
|
||||
fun fallbackGetStatsCompletesAfterActivityDetach() {
|
||||
val plugin = ExoPlayerPlugin()
|
||||
plugin.javaClass.getDeclaredField("usingMpvFallback").apply {
|
||||
isAccessible = true
|
||||
setBoolean(plugin, true)
|
||||
}
|
||||
val result = RecordingResult()
|
||||
|
||||
plugin.onMethodCall(MethodCall("getStats", null), result)
|
||||
|
||||
var completed = false
|
||||
repeat(100) {
|
||||
shadowOf(Looper.getMainLooper()).idle()
|
||||
if (result.completed.await(10, TimeUnit.MILLISECONDS)) {
|
||||
completed = true
|
||||
return@repeat
|
||||
}
|
||||
}
|
||||
|
||||
assertTrue("fallback getStats never completed", completed)
|
||||
assertEquals(mapOf("playerType" to "mpv"), result.successValue)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun eventCallbacksKeepTheSharedPlayerEnvelope() {
|
||||
val plugin = ExoPlayerPlugin()
|
||||
val sink = RecordingEventSink()
|
||||
plugin.onListen(null, sink)
|
||||
|
||||
plugin.onEvent("ready", mapOf("position" to 42))
|
||||
|
||||
assertEquals(
|
||||
mapOf(
|
||||
"type" to "event",
|
||||
"name" to "ready",
|
||||
"data" to mapOf("position" to 42)
|
||||
),
|
||||
sink.successValue
|
||||
)
|
||||
}
|
||||
|
||||
private class RecordingResult : MethodChannel.Result {
|
||||
val completed = CountDownLatch(1)
|
||||
var successValue: Any? = null
|
||||
|
||||
override fun success(result: Any?) {
|
||||
successValue = result
|
||||
completed.countDown()
|
||||
}
|
||||
|
||||
override fun error(errorCode: String, errorMessage: String?, errorDetails: Any?) {
|
||||
completed.countDown()
|
||||
}
|
||||
|
||||
override fun notImplemented() {
|
||||
completed.countDown()
|
||||
}
|
||||
}
|
||||
|
||||
private class RecordingEventSink : EventChannel.EventSink {
|
||||
var successValue: Any? = null
|
||||
|
||||
override fun success(event: Any?) {
|
||||
successValue = event
|
||||
}
|
||||
|
||||
override fun error(errorCode: String, errorMessage: String?, errorDetails: Any?) = Unit
|
||||
|
||||
override fun endOfStream() = Unit
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,230 @@
|
||||
package com.edde746.plezy.exoplayer
|
||||
|
||||
import androidx.media3.common.C
|
||||
import androidx.media3.common.DataReader
|
||||
import androidx.media3.common.Format
|
||||
import androidx.media3.common.MimeTypes
|
||||
import androidx.media3.common.util.ParsableByteArray
|
||||
import androidx.media3.extractor.DefaultExtractorInput
|
||||
import androidx.media3.extractor.Extractor
|
||||
import androidx.media3.extractor.ExtractorOutput
|
||||
import androidx.media3.extractor.PositionHolder
|
||||
import androidx.media3.extractor.SeekMap
|
||||
import androidx.media3.extractor.TrackOutput
|
||||
import androidx.media3.extractor.mkv.MatroskaExtractor
|
||||
import java.io.EOFException
|
||||
import org.junit.Assert.assertEquals
|
||||
import org.junit.Assert.assertFalse
|
||||
import org.junit.Assert.assertThrows
|
||||
import org.junit.Assert.assertTrue
|
||||
import org.junit.Test
|
||||
import org.junit.runner.RunWith
|
||||
import org.robolectric.RobolectricTestRunner
|
||||
import org.robolectric.annotation.Config
|
||||
|
||||
/**
|
||||
* Extracts the committed fixture (1s 440Hz sine, AAC-LC 48kHz stereo, LATM/LOAS
|
||||
* muxed into MKV as A_MS/ACM tag 0x1602 — the layout Plex produces when
|
||||
* Direct-Streaming HDHomeRun aac_latm audio) and verifies LOAS frames are
|
||||
* unwrapped to raw AAC with a synthesized AudioSpecificConfig.
|
||||
*
|
||||
* Robolectric provides real android.util.* implementations — MatroskaExtractor
|
||||
* stores tracks in a SparseArray, which is a no-op stub on plain JVM.
|
||||
*/
|
||||
@RunWith(RobolectricTestRunner::class)
|
||||
@Config(sdk = [34])
|
||||
class LatmMatroskaExtractorTest {
|
||||
|
||||
private class CapturedSample(val timeUs: Long, val flags: Int, val data: ByteArray)
|
||||
|
||||
private class FakeTrackOutput : TrackOutput {
|
||||
val formats = mutableListOf<Format>()
|
||||
val samples = mutableListOf<CapturedSample>()
|
||||
private var buf = ByteArray(64 * 1024)
|
||||
private var bufLen = 0
|
||||
|
||||
override fun format(format: Format) {
|
||||
formats.add(format)
|
||||
}
|
||||
|
||||
override fun sampleData(input: DataReader, length: Int, allowEndOfInput: Boolean, sampleDataPart: Int): Int {
|
||||
ensureCapacity(bufLen + length)
|
||||
val read = input.read(buf, bufLen, length)
|
||||
if (read > 0) bufLen += read
|
||||
return read
|
||||
}
|
||||
|
||||
override fun sampleData(data: ParsableByteArray, length: Int, sampleDataPart: Int) {
|
||||
ensureCapacity(bufLen + length)
|
||||
data.readBytes(buf, bufLen, length)
|
||||
bufLen += length
|
||||
}
|
||||
|
||||
override fun sampleMetadata(timeUs: Long, flags: Int, size: Int, offset: Int, cryptoData: TrackOutput.CryptoData?) {
|
||||
val start = bufLen - offset - size
|
||||
samples.add(CapturedSample(timeUs, flags, buf.copyOfRange(start, start + size)))
|
||||
if (offset == 0) bufLen = 0
|
||||
}
|
||||
|
||||
private fun ensureCapacity(needed: Int) {
|
||||
if (buf.size < needed) buf = buf.copyOf(maxOf(needed, buf.size * 2))
|
||||
}
|
||||
}
|
||||
|
||||
private class FakeExtractorOutput : ExtractorOutput {
|
||||
val tracks = mutableMapOf<Int, FakeTrackOutput>()
|
||||
|
||||
override fun track(id: Int, type: Int): TrackOutput = tracks.getOrPut(id) { FakeTrackOutput() }
|
||||
override fun endTracks() {}
|
||||
override fun seekMap(seekMap: SeekMap) {}
|
||||
}
|
||||
|
||||
private class ByteArrayDataReader(private val data: ByteArray) : DataReader {
|
||||
var position = 0L
|
||||
|
||||
override fun read(buffer: ByteArray, offset: Int, length: Int): Int {
|
||||
if (position >= data.size) return C.RESULT_END_OF_INPUT
|
||||
val toRead = minOf(length, data.size - position.toInt())
|
||||
System.arraycopy(data, position.toInt(), buffer, offset, toRead)
|
||||
position += toRead
|
||||
return toRead
|
||||
}
|
||||
}
|
||||
|
||||
private fun fixtureData(): ByteArray = checkNotNull(javaClass.getResourceAsStream("/latm_loas.mkv")) {
|
||||
"fixture latm_loas.mkv missing from test resources"
|
||||
}.use { it.readBytes() }
|
||||
|
||||
private fun loasFrames(count: Int): List<ByteArray> {
|
||||
val data = fixtureData()
|
||||
val frames = mutableListOf<ByteArray>()
|
||||
var position = 0
|
||||
while (position <= data.size - 3 && frames.size < count) {
|
||||
val isSyncWord = (data[position].toInt() and 0xFF) == 0x56 &&
|
||||
(data[position + 1].toInt() and 0xE0) == 0xE0
|
||||
if (isSyncWord) {
|
||||
val payloadSize = ((data[position + 1].toInt() and 0x1F) shl 8) or
|
||||
(data[position + 2].toInt() and 0xFF)
|
||||
val end = position + 3 + payloadSize
|
||||
if (payloadSize > 0 && end <= data.size) {
|
||||
frames.add(data.copyOfRange(position, end))
|
||||
position = end
|
||||
continue
|
||||
}
|
||||
}
|
||||
position++
|
||||
}
|
||||
check(frames.size == count) { "expected $count LOAS frames, found ${frames.size}" }
|
||||
return frames
|
||||
}
|
||||
|
||||
private fun extractFixture(): FakeExtractorOutput {
|
||||
val data = fixtureData()
|
||||
|
||||
val extractor = LatmMatroskaExtractor(MatroskaExtractor.FLAG_DISABLE_SEEK_FOR_CUES)
|
||||
val output = FakeExtractorOutput()
|
||||
extractor.init(output)
|
||||
|
||||
val reader = ByteArrayDataReader(data)
|
||||
var input = DefaultExtractorInput(reader, 0, data.size.toLong())
|
||||
val seekPosition = PositionHolder()
|
||||
while (true) {
|
||||
when (extractor.read(input, seekPosition)) {
|
||||
Extractor.RESULT_END_OF_INPUT -> return output
|
||||
Extractor.RESULT_SEEK -> {
|
||||
reader.position = seekPosition.position
|
||||
input = DefaultExtractorInput(reader, seekPosition.position, data.size.toLong())
|
||||
}
|
||||
else -> {}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
fun unwrapsLoasAcmTrackToRawAac() {
|
||||
val output = extractFixture()
|
||||
|
||||
assertEquals(1, output.tracks.size)
|
||||
val track = output.tracks.values.first()
|
||||
|
||||
// No audio/x-unknown format may reach the queue; the LATM-derived AAC
|
||||
// format must carry the AudioSpecificConfig for MediaCodec.
|
||||
assertFalse(track.formats.any { it.sampleMimeType == MimeTypes.AUDIO_UNKNOWN })
|
||||
val format = track.formats.last()
|
||||
assertEquals(MimeTypes.AUDIO_AAC, format.sampleMimeType)
|
||||
assertEquals(48000, format.sampleRate)
|
||||
assertEquals(2, format.channelCount)
|
||||
assertTrue(format.initializationData.isNotEmpty())
|
||||
assertTrue(format.initializationData[0].isNotEmpty())
|
||||
|
||||
// 1s at 48kHz / 1024 samples per AAC frame ≈ 47 frames
|
||||
assertTrue("expected ~47 samples, got ${track.samples.size}", track.samples.size in 40..55)
|
||||
|
||||
// Raw AAC payloads: smaller than the LOAS wrapping, no LOAS syncword,
|
||||
// keyframe-flagged, monotonic timestamps spanning ~1s.
|
||||
var prevTimeUs = Long.MIN_VALUE
|
||||
for (sample in track.samples) {
|
||||
assertTrue(sample.data.isNotEmpty())
|
||||
val isLoasSync = sample.data.size >= 2 &&
|
||||
(sample.data[0].toInt() and 0xFF) == 0x56 &&
|
||||
(sample.data[1].toInt() and 0xE0) == 0xE0
|
||||
assertFalse("sample still LOAS-framed", isLoasSync)
|
||||
assertEquals(C.BUFFER_FLAG_KEY_FRAME, sample.flags and C.BUFFER_FLAG_KEY_FRAME)
|
||||
assertTrue(sample.timeUs >= prevTimeUs)
|
||||
prevTimeUs = sample.timeUs
|
||||
}
|
||||
val spanUs = track.samples.last().timeUs - track.samples.first().timeUs
|
||||
assertTrue("expected ~1s span, got ${spanUs}us", spanUs in 800_000..1_200_000)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun detectsLoasAcmCodecPrivate() {
|
||||
val loas = byteArrayOf(0x02, 0x16, 0, 0, 0, 0)
|
||||
assertTrue(isLoasAcmTrack("A_MS/ACM", loas))
|
||||
// Wrong tag (PCM), wrong codec, or missing private data must not match
|
||||
assertFalse(isLoasAcmTrack("A_MS/ACM", byteArrayOf(0x01, 0x00, 0, 0)))
|
||||
assertFalse(isLoasAcmTrack("A_AAC", loas))
|
||||
assertFalse(isLoasAcmTrack("A_MS/ACM", null))
|
||||
assertFalse(isLoasAcmTrack("A_MS/ACM", byteArrayOf(0x02)))
|
||||
assertFalse(isLoasAcmTrack(null, loas))
|
||||
}
|
||||
|
||||
@Test
|
||||
fun rejectsUnexpectedEndOfInput() {
|
||||
val output = LatmTrackOutput(FakeTrackOutput(), 1)
|
||||
val reader = ByteArrayDataReader(ByteArray(0))
|
||||
|
||||
assertThrows(EOFException::class.java) {
|
||||
output.sampleData(reader, 1, false, TrackOutput.SAMPLE_DATA_PART_MAIN)
|
||||
}
|
||||
assertEquals(
|
||||
C.RESULT_END_OF_INPUT,
|
||||
output.sampleData(reader, 1, true, TrackOutput.SAMPLE_DATA_PART_MAIN)
|
||||
)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun preservesStreamMuxConfigAcrossExtractorSeek() {
|
||||
val frames = loasFrames(2)
|
||||
assertEquals(0, frames[0][3].toInt() and 0x80)
|
||||
assertEquals(0x80, frames[1][3].toInt() and 0x80)
|
||||
|
||||
val delegate = FakeTrackOutput()
|
||||
val output = LatmTrackOutput(delegate, 1)
|
||||
output.format(
|
||||
Format.Builder()
|
||||
.setId("1")
|
||||
.setSampleMimeType(MimeTypes.AUDIO_UNKNOWN)
|
||||
.build()
|
||||
)
|
||||
|
||||
output.sampleData(ParsableByteArray(frames[0]), frames[0].size, TrackOutput.SAMPLE_DATA_PART_MAIN)
|
||||
output.sampleMetadata(0, C.BUFFER_FLAG_KEY_FRAME, frames[0].size, 0, null)
|
||||
assertEquals(1, delegate.samples.size)
|
||||
|
||||
output.reset()
|
||||
output.sampleData(ParsableByteArray(frames[1]), frames[1].size, TrackOutput.SAMPLE_DATA_PART_MAIN)
|
||||
output.sampleMetadata(21_000, C.BUFFER_FLAG_KEY_FRAME, frames[1].size, 0, null)
|
||||
assertEquals(2, delegate.samples.size)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,138 @@
|
||||
package com.edde746.plezy.exoplayer
|
||||
|
||||
import androidx.media3.common.C
|
||||
import com.edde746.plezy.exoplayer.ResumeStallPolicy.Verdict
|
||||
import org.junit.Assert.assertEquals
|
||||
import org.junit.Test
|
||||
|
||||
class ResumeStallPolicyTest {
|
||||
|
||||
// checkWindowMs
|
||||
|
||||
@Test
|
||||
fun windowFloorsAtDefaultForNormalFrameRates() {
|
||||
// 24fps → 4 × 42ms = 168ms, floored to 1000ms
|
||||
assertEquals(1000L, ResumeStallPolicy.checkWindowMs(formatFps = 24f, detectedFps = -1f, speed = 1f))
|
||||
assertEquals(1000L, ResumeStallPolicy.checkWindowMs(formatFps = 60f, detectedFps = -1f, speed = 1f))
|
||||
}
|
||||
|
||||
@Test
|
||||
fun windowScalesUpForLowFrameRates() {
|
||||
// 2fps → 4 × 500ms = 2000ms
|
||||
assertEquals(2000L, ResumeStallPolicy.checkWindowMs(formatFps = 2f, detectedFps = -1f, speed = 1f))
|
||||
}
|
||||
|
||||
@Test
|
||||
fun windowScalesUpForSlowedPlayback() {
|
||||
// 8fps at 0.25× speed → effective 2fps → 2000ms
|
||||
assertEquals(2000L, ResumeStallPolicy.checkWindowMs(formatFps = 8f, detectedFps = -1f, speed = 0.25f))
|
||||
// fast playback shrinks the interval; still floored
|
||||
assertEquals(1000L, ResumeStallPolicy.checkWindowMs(formatFps = 24f, detectedFps = -1f, speed = 2f))
|
||||
}
|
||||
|
||||
@Test
|
||||
fun windowFallsBackThroughDetectedFpsToDefault() {
|
||||
// Format fps unknown (NO_VALUE = -1) → detected fps wins
|
||||
assertEquals(2000L, ResumeStallPolicy.checkWindowMs(formatFps = -1f, detectedFps = 2f, speed = 1f))
|
||||
// Neither known → 24fps assumption → floor
|
||||
assertEquals(1000L, ResumeStallPolicy.checkWindowMs(formatFps = -1f, detectedFps = -1f, speed = 1f))
|
||||
assertEquals(1000L, ResumeStallPolicy.checkWindowMs(formatFps = null, detectedFps = null, speed = 1f))
|
||||
}
|
||||
|
||||
// evaluate
|
||||
|
||||
@Test
|
||||
fun advancingFramesAreHealthy() {
|
||||
assertEquals(
|
||||
Verdict.HEALTHY,
|
||||
ResumeStallPolicy.evaluate(
|
||||
baselineFrames = 100,
|
||||
currentFrames = 124,
|
||||
baselinePositionMs = 60_000,
|
||||
currentPositionMs = 61_000,
|
||||
durationMs = 3_600_000,
|
||||
windowMs = 1000
|
||||
)
|
||||
)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun counterResetCountsAsHealthy() {
|
||||
// Renderer re-enable resets DecoderCounters below the baseline — not a stall.
|
||||
assertEquals(
|
||||
Verdict.HEALTHY,
|
||||
ResumeStallPolicy.evaluate(
|
||||
baselineFrames = 100,
|
||||
currentFrames = 3,
|
||||
baselinePositionMs = 60_000,
|
||||
currentPositionMs = 61_000,
|
||||
durationMs = 3_600_000,
|
||||
windowMs = 1000
|
||||
)
|
||||
)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun stalledClockRequestsRecheck() {
|
||||
// Frames frozen but the position isn't advancing either: generic buffering
|
||||
// stall, not the decoder freeze this watchdog targets.
|
||||
assertEquals(
|
||||
Verdict.RECHECK,
|
||||
ResumeStallPolicy.evaluate(
|
||||
baselineFrames = 100,
|
||||
currentFrames = 100,
|
||||
baselinePositionMs = 60_000,
|
||||
currentPositionMs = 60_200,
|
||||
durationMs = 3_600_000,
|
||||
windowMs = 1000
|
||||
)
|
||||
)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun nearEndOfStreamIsSkipped() {
|
||||
// Video track ending before audio is legitimate near EOF.
|
||||
assertEquals(
|
||||
Verdict.SKIP_NEAR_EOF,
|
||||
ResumeStallPolicy.evaluate(
|
||||
baselineFrames = 100,
|
||||
currentFrames = 100,
|
||||
baselinePositionMs = 3_598_000,
|
||||
currentPositionMs = 3_599_000,
|
||||
durationMs = 3_600_000,
|
||||
windowMs = 1000
|
||||
)
|
||||
)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun frozenFramesWithAdvancingClockMidFileIsStalled() {
|
||||
assertEquals(
|
||||
Verdict.STALLED,
|
||||
ResumeStallPolicy.evaluate(
|
||||
baselineFrames = 100,
|
||||
currentFrames = 100,
|
||||
baselinePositionMs = 60_000,
|
||||
currentPositionMs = 61_000,
|
||||
durationMs = 3_600_000,
|
||||
windowMs = 1000
|
||||
)
|
||||
)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun unknownDurationSkipsEofGuardAndStalls() {
|
||||
// Live/unknown duration (C.TIME_UNSET) must not suppress detection.
|
||||
assertEquals(
|
||||
Verdict.STALLED,
|
||||
ResumeStallPolicy.evaluate(
|
||||
baselineFrames = 100,
|
||||
currentFrames = 100,
|
||||
baselinePositionMs = 60_000,
|
||||
currentPositionMs = 61_000,
|
||||
durationMs = C.TIME_UNSET,
|
||||
windowMs = 1000
|
||||
)
|
||||
)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,49 @@
|
||||
package com.edde746.plezy.exoplayer
|
||||
|
||||
import androidx.media3.common.text.Cue
|
||||
import org.junit.Assert.assertEquals
|
||||
import org.junit.Assert.assertSame
|
||||
import org.junit.Test
|
||||
|
||||
class SubtitleCueLayoutTest {
|
||||
|
||||
@Test
|
||||
fun concurrentUnpositionedCuesStackFromBottom() {
|
||||
val first = Cue.Builder().setText("first").build()
|
||||
val second = Cue.Builder().setText("second").build()
|
||||
|
||||
val laidOut = SubtitleCueLayout.layout(listOf(first, second), positionPercent = 100, fontSize = 36f)
|
||||
|
||||
assertEquals(Cue.LINE_TYPE_NUMBER, laidOut[0].lineType)
|
||||
assertEquals(-2f, laidOut[0].line)
|
||||
assertEquals(Cue.ANCHOR_TYPE_END, laidOut[0].lineAnchor)
|
||||
assertEquals(-1f, laidOut[1].line)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun userPositionPreservesStackSpacing() {
|
||||
val first = Cue.Builder().setText("first").build()
|
||||
val second = Cue.Builder().setText("second").build()
|
||||
|
||||
val laidOut = SubtitleCueLayout.layout(listOf(first, second), positionPercent = 50, fontSize = 36f)
|
||||
|
||||
assertEquals(Cue.LINE_TYPE_FRACTION, laidOut[0].lineType)
|
||||
assertEquals(0.44f, laidOut[0].line, 0.0001f)
|
||||
assertEquals(0.5f, laidOut[1].line, 0.0001f)
|
||||
assertEquals(Cue.ANCHOR_TYPE_END, laidOut[0].lineAnchor)
|
||||
assertEquals(Cue.ANCHOR_TYPE_END, laidOut[1].lineAnchor)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun explicitCuePositionIsNotOverridden() {
|
||||
val positioned = Cue.Builder()
|
||||
.setText("positioned")
|
||||
.setLine(0.25f, Cue.LINE_TYPE_FRACTION)
|
||||
.setLineAnchor(Cue.ANCHOR_TYPE_START)
|
||||
.build()
|
||||
|
||||
val laidOut = SubtitleCueLayout.layout(listOf(positioned), positionPercent = 50, fontSize = 36f)
|
||||
|
||||
assertSame(positioned, laidOut.single())
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,78 @@
|
||||
package com.edde746.plezy.exoplayer
|
||||
|
||||
import androidx.media3.ui.AspectRatioFrameLayout
|
||||
import org.junit.Assert.assertEquals
|
||||
import org.junit.Test
|
||||
|
||||
class SubtitleViewLayoutTest {
|
||||
|
||||
@Test
|
||||
fun letterboxUsesVisibleVideoRectForTextAndBitmapSubtitles() {
|
||||
val text = textDimensions(resizeMode = AspectRatioFrameLayout.RESIZE_MODE_FIT)
|
||||
val bitmap = bitmapDimensions(resizeMode = AspectRatioFrameLayout.RESIZE_MODE_FIT)
|
||||
|
||||
assertEquals(SubtitleViewDimensions(1920, 1080), text)
|
||||
assertEquals(SubtitleViewDimensions(1920, 1080), bitmap)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun coverKeepsTextOnScreenAndBitmapSubtitlesFullyVisible() {
|
||||
val text = textDimensions(resizeMode = AspectRatioFrameLayout.RESIZE_MODE_ZOOM)
|
||||
val bitmap = bitmapDimensions(resizeMode = AspectRatioFrameLayout.RESIZE_MODE_ZOOM)
|
||||
|
||||
assertEquals(SubtitleViewDimensions(2424, 1080), text)
|
||||
assertEquals(SubtitleViewDimensions(1920, 1080), bitmap)
|
||||
assertAspectCloseTo16By9(bitmap!!)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun manualZoomKeepsBitmapSubtitlesFullyVisible() {
|
||||
val text = textDimensions(resizeMode = AspectRatioFrameLayout.RESIZE_MODE_FIT, zoomScale = 1.5f)
|
||||
val bitmap = bitmapDimensions(resizeMode = AspectRatioFrameLayout.RESIZE_MODE_FIT, zoomScale = 1.5f)
|
||||
|
||||
assertEquals(SubtitleViewDimensions(2424, 1080), text)
|
||||
assertEquals(SubtitleViewDimensions(1920, 1080), bitmap)
|
||||
assertAspectCloseTo16By9(bitmap!!)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun stretchDoesNotStretchBitmapSubtitlesToScreenAspect() {
|
||||
val text = textDimensions(resizeMode = AspectRatioFrameLayout.RESIZE_MODE_FILL)
|
||||
val bitmap = bitmapDimensions(resizeMode = AspectRatioFrameLayout.RESIZE_MODE_FILL)
|
||||
|
||||
assertEquals(SubtitleViewDimensions(2424, 1080), text)
|
||||
assertEquals(SubtitleViewDimensions(1920, 1080), bitmap)
|
||||
assertAspectCloseTo16By9(bitmap!!)
|
||||
}
|
||||
|
||||
private fun textDimensions(
|
||||
resizeMode: Int,
|
||||
zoomScale: Float = 1f
|
||||
): SubtitleViewDimensions? = SubtitleViewLayout.textDimensions(
|
||||
containerWidth = 2424,
|
||||
containerHeight = 1080,
|
||||
videoWidth = 1920,
|
||||
videoHeight = 1080,
|
||||
pixelRatio = 1f,
|
||||
resizeMode = resizeMode,
|
||||
zoomScale = zoomScale
|
||||
)
|
||||
|
||||
private fun bitmapDimensions(
|
||||
resizeMode: Int,
|
||||
zoomScale: Float = 1f
|
||||
): SubtitleViewDimensions? = SubtitleViewLayout.bitmapDimensions(
|
||||
containerWidth = 2424,
|
||||
containerHeight = 1080,
|
||||
videoWidth = 1920,
|
||||
videoHeight = 1080,
|
||||
pixelRatio = 1f,
|
||||
resizeMode = resizeMode,
|
||||
zoomScale = zoomScale
|
||||
)
|
||||
|
||||
private fun assertAspectCloseTo16By9(dimensions: SubtitleViewDimensions) {
|
||||
val aspect = dimensions.width.toDouble() / dimensions.height
|
||||
assertEquals(16.0 / 9.0, aspect, 0.001)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,157 @@
|
||||
package com.edde746.plezy.mpv
|
||||
|
||||
import dev.jdtech.mpv.EndFileReason
|
||||
import dev.jdtech.mpv.LogLevel
|
||||
import dev.jdtech.mpv.LogMessage
|
||||
import dev.jdtech.mpv.MpvEvent
|
||||
import io.flutter.plugin.common.EventChannel
|
||||
import io.flutter.plugin.common.MethodCall
|
||||
import io.flutter.plugin.common.MethodChannel
|
||||
import org.junit.Assert.assertEquals
|
||||
import org.junit.Assert.assertNull
|
||||
import org.junit.Assert.assertTrue
|
||||
import org.junit.Test
|
||||
import org.junit.runner.RunWith
|
||||
import org.robolectric.RobolectricTestRunner
|
||||
|
||||
@RunWith(RobolectricTestRunner::class)
|
||||
class MpvPlayerPluginTest {
|
||||
|
||||
@Test
|
||||
fun commandWithoutCoreReportsNotInitialized() {
|
||||
val result = RecordingResult()
|
||||
|
||||
MpvPlayerPlugin().onMethodCall(
|
||||
MethodCall("command", mapOf("args" to listOf("seek", "1", "absolute"))),
|
||||
result
|
||||
)
|
||||
|
||||
assertEquals("NOT_INITIALIZED", result.errorCode)
|
||||
assertNull(result.successValue)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun disposeCompletesEveryPendingInitialization() {
|
||||
val plugin = MpvPlayerPlugin()
|
||||
val first = RecordingResult()
|
||||
val second = RecordingResult()
|
||||
|
||||
@Suppress("UNCHECKED_CAST")
|
||||
val pending = plugin.javaClass.getDeclaredField("pendingInitResults").apply {
|
||||
isAccessible = true
|
||||
}.get(plugin) as MutableList<MethodChannel.Result>
|
||||
pending += first
|
||||
pending += second
|
||||
plugin.javaClass.getDeclaredField("isInitializing").apply {
|
||||
isAccessible = true
|
||||
setBoolean(plugin, true)
|
||||
}
|
||||
val dispose = RecordingResult()
|
||||
|
||||
plugin.onMethodCall(MethodCall("dispose", null), dispose)
|
||||
|
||||
assertEquals(false, first.successValue)
|
||||
assertEquals(false, second.successValue)
|
||||
assertNull(dispose.successValue)
|
||||
assertTrue(first.completed)
|
||||
assertTrue(second.completed)
|
||||
assertTrue(dispose.completed)
|
||||
assertEquals(0, pending.size)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun setLogLevelReportsUnsupported() {
|
||||
val result = RecordingResult()
|
||||
|
||||
MpvPlayerPlugin().onMethodCall(
|
||||
MethodCall("setLogLevel", mapOf("level" to "warn")),
|
||||
result
|
||||
)
|
||||
|
||||
assertEquals("UNSUPPORTED", result.errorCode)
|
||||
assertNull(result.successValue)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun endFileDiagnosticsPreserveReasonIdAndExposeDependencyErrorLog() {
|
||||
val diagnostics = MpvEndFileDiagnostics()
|
||||
diagnostics.onStartFile()
|
||||
diagnostics.onLogMessage(LogMessage("ffmpeg", LogLevel.Error, "Invalid data found when processing input"))
|
||||
|
||||
assertEquals(
|
||||
mapOf(
|
||||
"reason" to 4,
|
||||
"message" to "Invalid data found when processing input"
|
||||
),
|
||||
diagnostics.onEndFile(MpvEvent.EndFile(EndFileReason.Error))
|
||||
)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun endFileDiagnosticsDoNotAttachStaleOrInventedDetails() {
|
||||
val diagnostics = MpvEndFileDiagnostics()
|
||||
diagnostics.onLogMessage(LogMessage("ffmpeg", LogLevel.Error, "old failure"))
|
||||
diagnostics.onStartFile()
|
||||
|
||||
assertEquals(mapOf("reason" to 0), diagnostics.onEndFile(MpvEvent.EndFile(EndFileReason.Eof)))
|
||||
assertEquals(mapOf("reason" to 4), diagnostics.onEndFile(MpvEvent.EndFile(EndFileReason.Error)))
|
||||
assertNull(diagnostics.onEndFile(MpvEvent.EndFile(null)))
|
||||
}
|
||||
|
||||
@Test
|
||||
fun endFileEventChannelPayloadKeepsExistingEnvelopeAndAddsMessage() {
|
||||
val sink = RecordingEventSink()
|
||||
val plugin = MpvPlayerPlugin()
|
||||
plugin.onListen(null, sink)
|
||||
|
||||
plugin.onEvent(
|
||||
"end-file",
|
||||
mapOf(
|
||||
"reason" to 4,
|
||||
"message" to "Failed to open stream"
|
||||
)
|
||||
)
|
||||
|
||||
assertEquals(
|
||||
mapOf(
|
||||
"type" to "event",
|
||||
"name" to "end-file",
|
||||
"data" to mapOf(
|
||||
"reason" to 4,
|
||||
"message" to "Failed to open stream"
|
||||
)
|
||||
),
|
||||
sink.successValue
|
||||
)
|
||||
}
|
||||
|
||||
private class RecordingResult : MethodChannel.Result {
|
||||
var successValue: Any? = null
|
||||
var errorCode: String? = null
|
||||
var completed: Boolean = false
|
||||
|
||||
override fun success(result: Any?) {
|
||||
completed = true
|
||||
successValue = result
|
||||
}
|
||||
|
||||
override fun error(errorCode: String, errorMessage: String?, errorDetails: Any?) {
|
||||
completed = true
|
||||
this.errorCode = errorCode
|
||||
}
|
||||
|
||||
override fun notImplemented() = Unit
|
||||
}
|
||||
|
||||
private class RecordingEventSink : EventChannel.EventSink {
|
||||
var successValue: Any? = null
|
||||
|
||||
override fun success(event: Any?) {
|
||||
successValue = event
|
||||
}
|
||||
|
||||
override fun error(errorCode: String, errorMessage: String?, errorDetails: Any?) = Unit
|
||||
|
||||
override fun endOfStream() = Unit
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,63 @@
|
||||
package com.edde746.plezy.shared
|
||||
|
||||
import org.junit.Assert.assertFalse
|
||||
import org.junit.Assert.assertTrue
|
||||
import org.junit.Test
|
||||
import org.junit.runner.RunWith
|
||||
import org.robolectric.RobolectricTestRunner
|
||||
import org.robolectric.annotation.Config
|
||||
import org.robolectric.shadows.MediaCodecInfoBuilder
|
||||
|
||||
@RunWith(RobolectricTestRunner::class)
|
||||
@Config(sdk = [25, 28])
|
||||
class MediaCodecQueryTest {
|
||||
|
||||
@Test
|
||||
fun preApi29CodecQueryDoesNotInvokeApi29HardwareFlag() {
|
||||
val codecInfo = MediaCodecInfoBuilder.newBuilder()
|
||||
.setName("OMX.qcom.video.decoder.avc")
|
||||
.setIsHardwareAccelerated(false)
|
||||
.build()
|
||||
|
||||
assertTrue(MediaCodecQuery.isHardwareAccelerated(codecInfo))
|
||||
}
|
||||
|
||||
@Test
|
||||
fun recognizesKnownPlatformAndFfmpegSoftwareCodecNames() {
|
||||
listOf(
|
||||
"OMX.google.h264.decoder",
|
||||
"OMX.FFMPEG.VIDEO.DECODER",
|
||||
"c2.android.avc.decoder",
|
||||
"c2.google.av1.decoder",
|
||||
"c2.ffmpeg.vp9.decoder",
|
||||
"vendor.video.sw.decoder"
|
||||
).forEach { name ->
|
||||
assertTrue("expected software codec: $name", MediaCodecQuery.isSoftwareCodecName(name))
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
fun doesNotMisclassifyVendorHardwareCodecNames() {
|
||||
listOf(
|
||||
"OMX.qcom.video.decoder.avc",
|
||||
"OMX.MTK.VIDEO.DECODER.HEVC",
|
||||
"c2.qti.avc.decoder",
|
||||
"c2.exynos.hevc.decoder"
|
||||
).forEach { name ->
|
||||
assertFalse("expected hardware codec: $name", MediaCodecQuery.isSoftwareCodecName(name))
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
fun api29RequiresPlatformHardwareFlagAndNonSoftwareComponentName() {
|
||||
assertFalse(MediaCodecQuery.isHardwareAccelerated(29, true, "c2.ffmpeg.aac.decoder"))
|
||||
assertFalse(MediaCodecQuery.isHardwareAccelerated(29, false, "c2.qti.avc.decoder"))
|
||||
assertTrue(MediaCodecQuery.isHardwareAccelerated(29, true, "c2.qti.avc.decoder"))
|
||||
}
|
||||
|
||||
@Test
|
||||
fun preApi29RetainsNameBasedFallback() {
|
||||
assertFalse(MediaCodecQuery.isHardwareAccelerated(28, true, "OMX.google.h264.decoder"))
|
||||
assertTrue(MediaCodecQuery.isHardwareAccelerated(28, false, "OMX.qcom.video.decoder.avc"))
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,51 @@
|
||||
package com.edde746.plezy.shared
|
||||
|
||||
import android.os.Handler
|
||||
import android.os.Looper
|
||||
import java.util.concurrent.CountDownLatch
|
||||
import java.util.concurrent.TimeUnit
|
||||
import java.util.concurrent.atomic.AtomicBoolean
|
||||
import org.junit.Assert.assertFalse
|
||||
import org.junit.Assert.assertTrue
|
||||
import org.junit.Test
|
||||
import org.junit.runner.RunWith
|
||||
import org.robolectric.RobolectricTestRunner
|
||||
import org.robolectric.Shadows.shadowOf
|
||||
|
||||
@RunWith(RobolectricTestRunner::class)
|
||||
class MpvContentUriResolverTest {
|
||||
|
||||
@Test
|
||||
fun contentDescriptorOpensOffMainAndCompletesOnMain() {
|
||||
val mainLooper = Looper.getMainLooper()
|
||||
val openedOnMain = AtomicBoolean(true)
|
||||
val completedOnMain = AtomicBoolean(false)
|
||||
val completed = CountDownLatch(1)
|
||||
|
||||
MpvContentUriResolver.resolve(
|
||||
uriString = "content://downloads/video.mkv",
|
||||
mainHandler = Handler(mainLooper),
|
||||
opener = {
|
||||
openedOnMain.set(Looper.myLooper() == mainLooper)
|
||||
null
|
||||
},
|
||||
onResolved = {
|
||||
completedOnMain.set(Looper.myLooper() == mainLooper)
|
||||
completed.countDown()
|
||||
}
|
||||
)
|
||||
|
||||
var didComplete = false
|
||||
repeat(100) {
|
||||
shadowOf(mainLooper).idle()
|
||||
if (completed.await(10, TimeUnit.MILLISECONDS)) {
|
||||
didComplete = true
|
||||
return@repeat
|
||||
}
|
||||
}
|
||||
|
||||
assertTrue("content URI resolution never completed", didComplete)
|
||||
assertFalse("content descriptor opened on the main thread", openedOnMain.get())
|
||||
assertTrue("resolved URI callback did not return on the main thread", completedOnMain.get())
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,44 @@
|
||||
package com.edde746.plezy.shared
|
||||
|
||||
import android.app.Activity
|
||||
import android.graphics.Color
|
||||
import android.graphics.drawable.ColorDrawable
|
||||
import android.view.SurfaceHolder
|
||||
import android.view.ViewGroup
|
||||
import android.widget.FrameLayout
|
||||
import org.junit.Assert.assertEquals
|
||||
import org.junit.Assert.assertSame
|
||||
import org.junit.Assert.assertTrue
|
||||
import org.junit.Test
|
||||
import org.junit.runner.RunWith
|
||||
import org.robolectric.Robolectric
|
||||
import org.robolectric.RobolectricTestRunner
|
||||
|
||||
@RunWith(RobolectricTestRunner::class)
|
||||
class PlayerSurfaceHostTest {
|
||||
|
||||
@Test
|
||||
fun scaffoldCreatesFullScreenBlackVideoLayerBehindFlutterContent() {
|
||||
val activity = Robolectric.buildActivity(Activity::class.java).setup().get()
|
||||
activity.setContentView(FrameLayout(activity))
|
||||
val callback = object : SurfaceHolder.Callback {
|
||||
override fun surfaceCreated(holder: SurfaceHolder) = Unit
|
||||
override fun surfaceChanged(holder: SurfaceHolder, format: Int, width: Int, height: Int) = Unit
|
||||
override fun surfaceDestroyed(holder: SurfaceHolder) = Unit
|
||||
}
|
||||
|
||||
val container = PlayerSurfaceHost.createContainer(activity, clipChildren = true)
|
||||
val surface = PlayerSurfaceHost.createVideoSurface(activity, callback)
|
||||
container.addView(surface)
|
||||
val content = PlayerSurfaceHost.attachToContent(activity, container)
|
||||
|
||||
assertSame(content, container.parent)
|
||||
assertEquals(0, content.indexOfChild(container))
|
||||
assertEquals(ViewGroup.LayoutParams.MATCH_PARENT, container.layoutParams.width)
|
||||
assertEquals(ViewGroup.LayoutParams.MATCH_PARENT, container.layoutParams.height)
|
||||
assertEquals(Color.BLACK, (container.background as ColorDrawable).color)
|
||||
assertTrue(container.clipChildren)
|
||||
assertEquals(FrameLayout.LayoutParams.MATCH_PARENT, surface.layoutParams.width)
|
||||
assertEquals(FrameLayout.LayoutParams.MATCH_PARENT, surface.layoutParams.height)
|
||||
}
|
||||
}
|
||||
Binary file not shown.
@@ -1,6 +1,8 @@
|
||||
org.gradle.jvmargs=-Xmx8G -XX:MaxMetaspaceSize=4G -XX:ReservedCodeCacheSize=512m -XX:+HeapDumpOnOutOfMemoryError
|
||||
android.useAndroidX=true
|
||||
android.enableJetifier=true
|
||||
# All bundled dependencies use AndroidX. Jetifier also cannot process modern
|
||||
# JVM-only test artifacts when Android lint builds dependency models.
|
||||
android.enableJetifier=false
|
||||
# This builtInKotlin flag was added automatically by Flutter migrator
|
||||
android.builtInKotlin=false
|
||||
# This newDsl flag was added automatically by Flutter migrator
|
||||
|
||||
BIN
Binary file not shown.
+160
@@ -0,0 +1,160 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
##############################################################################
|
||||
##
|
||||
## Gradle start up script for UN*X
|
||||
##
|
||||
##############################################################################
|
||||
|
||||
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
|
||||
DEFAULT_JVM_OPTS=""
|
||||
|
||||
APP_NAME="Gradle"
|
||||
APP_BASE_NAME=`basename "$0"`
|
||||
|
||||
# Use the maximum available, or set MAX_FD != -1 to use that value.
|
||||
MAX_FD="maximum"
|
||||
|
||||
warn ( ) {
|
||||
echo "$*"
|
||||
}
|
||||
|
||||
die ( ) {
|
||||
echo
|
||||
echo "$*"
|
||||
echo
|
||||
exit 1
|
||||
}
|
||||
|
||||
# OS specific support (must be 'true' or 'false').
|
||||
cygwin=false
|
||||
msys=false
|
||||
darwin=false
|
||||
case "`uname`" in
|
||||
CYGWIN* )
|
||||
cygwin=true
|
||||
;;
|
||||
Darwin* )
|
||||
darwin=true
|
||||
;;
|
||||
MINGW* )
|
||||
msys=true
|
||||
;;
|
||||
esac
|
||||
|
||||
# Attempt to set APP_HOME
|
||||
# Resolve links: $0 may be a link
|
||||
PRG="$0"
|
||||
# Need this for relative symlinks.
|
||||
while [ -h "$PRG" ] ; do
|
||||
ls=`ls -ld "$PRG"`
|
||||
link=`expr "$ls" : '.*-> \(.*\)$'`
|
||||
if expr "$link" : '/.*' > /dev/null; then
|
||||
PRG="$link"
|
||||
else
|
||||
PRG=`dirname "$PRG"`"/$link"
|
||||
fi
|
||||
done
|
||||
SAVED="`pwd`"
|
||||
cd "`dirname \"$PRG\"`/" >/dev/null
|
||||
APP_HOME="`pwd -P`"
|
||||
cd "$SAVED" >/dev/null
|
||||
|
||||
CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
|
||||
|
||||
# Determine the Java command to use to start the JVM.
|
||||
if [ -n "$JAVA_HOME" ] ; then
|
||||
if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
|
||||
# IBM's JDK on AIX uses strange locations for the executables
|
||||
JAVACMD="$JAVA_HOME/jre/sh/java"
|
||||
else
|
||||
JAVACMD="$JAVA_HOME/bin/java"
|
||||
fi
|
||||
if [ ! -x "$JAVACMD" ] ; then
|
||||
die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
|
||||
|
||||
Please set the JAVA_HOME variable in your environment to match the
|
||||
location of your Java installation."
|
||||
fi
|
||||
else
|
||||
JAVACMD="java"
|
||||
which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
|
||||
|
||||
Please set the JAVA_HOME variable in your environment to match the
|
||||
location of your Java installation."
|
||||
fi
|
||||
|
||||
# Increase the maximum file descriptors if we can.
|
||||
if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then
|
||||
MAX_FD_LIMIT=`ulimit -H -n`
|
||||
if [ $? -eq 0 ] ; then
|
||||
if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
|
||||
MAX_FD="$MAX_FD_LIMIT"
|
||||
fi
|
||||
ulimit -n $MAX_FD
|
||||
if [ $? -ne 0 ] ; then
|
||||
warn "Could not set maximum file descriptor limit: $MAX_FD"
|
||||
fi
|
||||
else
|
||||
warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
|
||||
fi
|
||||
fi
|
||||
|
||||
# For Darwin, add options to specify how the application appears in the dock
|
||||
if $darwin; then
|
||||
GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
|
||||
fi
|
||||
|
||||
# For Cygwin, switch paths to Windows format before running java
|
||||
if $cygwin ; then
|
||||
APP_HOME=`cygpath --path --mixed "$APP_HOME"`
|
||||
CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
|
||||
JAVACMD=`cygpath --unix "$JAVACMD"`
|
||||
|
||||
# We build the pattern for arguments to be converted via cygpath
|
||||
ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
|
||||
SEP=""
|
||||
for dir in $ROOTDIRSRAW ; do
|
||||
ROOTDIRS="$ROOTDIRS$SEP$dir"
|
||||
SEP="|"
|
||||
done
|
||||
OURCYGPATTERN="(^($ROOTDIRS))"
|
||||
# Add a user-defined pattern to the cygpath arguments
|
||||
if [ "$GRADLE_CYGPATTERN" != "" ] ; then
|
||||
OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
|
||||
fi
|
||||
# Now convert the arguments - kludge to limit ourselves to /bin/sh
|
||||
i=0
|
||||
for arg in "$@" ; do
|
||||
CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
|
||||
CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
|
||||
|
||||
if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
|
||||
eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
|
||||
else
|
||||
eval `echo args$i`="\"$arg\""
|
||||
fi
|
||||
i=$((i+1))
|
||||
done
|
||||
case $i in
|
||||
(0) set -- ;;
|
||||
(1) set -- "$args0" ;;
|
||||
(2) set -- "$args0" "$args1" ;;
|
||||
(3) set -- "$args0" "$args1" "$args2" ;;
|
||||
(4) set -- "$args0" "$args1" "$args2" "$args3" ;;
|
||||
(5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
|
||||
(6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
|
||||
(7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
|
||||
(8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
|
||||
(9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
|
||||
esac
|
||||
fi
|
||||
|
||||
# Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules
|
||||
function splitJvmOpts() {
|
||||
JVM_OPTS=("$@")
|
||||
}
|
||||
eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS
|
||||
JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME"
|
||||
|
||||
exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@"
|
||||
Vendored
+90
@@ -0,0 +1,90 @@
|
||||
@if "%DEBUG%" == "" @echo off
|
||||
@rem ##########################################################################
|
||||
@rem
|
||||
@rem Gradle startup script for Windows
|
||||
@rem
|
||||
@rem ##########################################################################
|
||||
|
||||
@rem Set local scope for the variables with windows NT shell
|
||||
if "%OS%"=="Windows_NT" setlocal
|
||||
|
||||
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
|
||||
set DEFAULT_JVM_OPTS=
|
||||
|
||||
set DIRNAME=%~dp0
|
||||
if "%DIRNAME%" == "" set DIRNAME=.
|
||||
set APP_BASE_NAME=%~n0
|
||||
set APP_HOME=%DIRNAME%
|
||||
|
||||
@rem Find java.exe
|
||||
if defined JAVA_HOME goto findJavaFromJavaHome
|
||||
|
||||
set JAVA_EXE=java.exe
|
||||
%JAVA_EXE% -version >NUL 2>&1
|
||||
if "%ERRORLEVEL%" == "0" goto init
|
||||
|
||||
echo.
|
||||
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
|
||||
echo.
|
||||
echo Please set the JAVA_HOME variable in your environment to match the
|
||||
echo location of your Java installation.
|
||||
|
||||
goto fail
|
||||
|
||||
:findJavaFromJavaHome
|
||||
set JAVA_HOME=%JAVA_HOME:"=%
|
||||
set JAVA_EXE=%JAVA_HOME%/bin/java.exe
|
||||
|
||||
if exist "%JAVA_EXE%" goto init
|
||||
|
||||
echo.
|
||||
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
|
||||
echo.
|
||||
echo Please set the JAVA_HOME variable in your environment to match the
|
||||
echo location of your Java installation.
|
||||
|
||||
goto fail
|
||||
|
||||
:init
|
||||
@rem Get command-line arguments, handling Windowz variants
|
||||
|
||||
if not "%OS%" == "Windows_NT" goto win9xME_args
|
||||
if "%@eval[2+2]" == "4" goto 4NT_args
|
||||
|
||||
:win9xME_args
|
||||
@rem Slurp the command line arguments.
|
||||
set CMD_LINE_ARGS=
|
||||
set _SKIP=2
|
||||
|
||||
:win9xME_args_slurp
|
||||
if "x%~1" == "x" goto execute
|
||||
|
||||
set CMD_LINE_ARGS=%*
|
||||
goto execute
|
||||
|
||||
:4NT_args
|
||||
@rem Get arguments from the 4NT Shell from JP Software
|
||||
set CMD_LINE_ARGS=%$
|
||||
|
||||
:execute
|
||||
@rem Setup the command line
|
||||
|
||||
set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
|
||||
|
||||
@rem Execute Gradle
|
||||
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
|
||||
|
||||
:end
|
||||
@rem End local scope for the variables with windows NT shell
|
||||
if "%ERRORLEVEL%"=="0" goto mainEnd
|
||||
|
||||
:fail
|
||||
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
|
||||
rem the _cmd.exe /c_ return code!
|
||||
if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
|
||||
exit /b 1
|
||||
|
||||
:mainEnd
|
||||
if "%OS%"=="Windows_NT" endlocal
|
||||
|
||||
:omega
|
||||
@@ -1,5 +1,3 @@
|
||||
# Constructed from JNI via FindClass/NewObject (AssKt.c).
|
||||
-keep class com.edde746.plezy.libass.AssAtlasFrame { *; }
|
||||
# JNI exports bind by name (Java_com_edde746_plezy_libass_*); keep the names stable.
|
||||
-keepclasseswithmembernames class com.edde746.plezy.libass.* {
|
||||
native <methods>;
|
||||
|
||||
+234
-117
@@ -237,17 +237,34 @@ Java_com_edde746_plezy_libass_AssRender_nativeAssRenderDeinit(JNIEnv* env, jclas
|
||||
}
|
||||
}
|
||||
|
||||
// (image, original-list index) pair so packing can run in height-sorted order
|
||||
// while slots stay keyed by list position (= blend order) for pass 2.
|
||||
typedef struct {
|
||||
ASS_Image* img;
|
||||
int idx;
|
||||
} PackItem;
|
||||
// Hard cap on atlas pages (see the packing comment below). 4 pages of a GL-max
|
||||
// texture is far above the worst real frame measured (a 4K-rendered full-screen
|
||||
// typeset letter needs 3); beyond it tiles are dropped and counted in truncated.
|
||||
#define MAX_ATLAS_PAGES 4
|
||||
|
||||
static int comparePackItemsByHeightDesc(const void* a, const void* b) {
|
||||
const PackItem* ia = (const PackItem*)a;
|
||||
const PackItem* ib = (const PackItem*)b;
|
||||
return ib->img->h - ia->img->h;
|
||||
// A tile is a <= atlasMaxW x atlasMaxH sub-rect of an ASS_Image. A single image
|
||||
// can exceed one atlas page only when the render frame is larger than a page
|
||||
// (>4K, or a GPU whose max texture is below the frame) — multi-page can't split
|
||||
// one image across pages (a quad samples one texture), so tiling does, keeping
|
||||
// the never-drop guarantee. (#1436 itself was atlas-AREA overflow, fixed by the
|
||||
// multi-page pack below, not oversized single images.) Tiles are built in list
|
||||
// order (= libass blend/painter order, preserved for emission); the single-page
|
||||
// pack runs height-sorted via a separate key array so emission order is untouched.
|
||||
typedef struct {
|
||||
ASS_Image* img; // source image (for bitmap/stride/color/dst_x/dst_y)
|
||||
int ox, oy; // tile offset within the source bitmap
|
||||
int tw, th; // tile size (<= atlasMaxW x atlasMaxH)
|
||||
int page; // atlas page the tile is packed into; -1 if dropped for capacity
|
||||
int sx, sy; // packed slot within the page; valid when page >= 0
|
||||
} PackTile;
|
||||
|
||||
typedef struct {
|
||||
int th; // tile height (the sort key)
|
||||
int idx; // index into the build-order tiles[] array
|
||||
} TileSortKey;
|
||||
|
||||
static int compareTileKeysByHeightDesc(const void* a, const void* b) {
|
||||
return ((const TileSortKey*)b)->th - ((const TileSortKey*)a)->th;
|
||||
}
|
||||
|
||||
static int imageListHasOutput(ASS_Image* image) {
|
||||
@@ -260,34 +277,69 @@ static int imageListHasOutput(ASS_Image* image) {
|
||||
// Throttle for truncation warnings (shared across renderers; logging only).
|
||||
static int truncationLogCounter = 0;
|
||||
|
||||
// Frame metadata crosses to Kotlin through a fixed-layout int[] header (filled here,
|
||||
// read + turned into an AssAtlasFrame by AssRender.kt) instead of constructing the
|
||||
// object in JNI. A NewObject on an overloaded constructor is fragile under R8: the
|
||||
// minified release build stripped/rewrote the (I[I[IIIIZ)V ctor the lookup bound by,
|
||||
// crashing with NoSuchMethodError (#1436 follow-up). Binding a native method by name
|
||||
// + populating a primitive array has no such reflective dependency. Layout:
|
||||
// [0]=atlasWidth [1]=quadCount [2]=changed [3]=truncated [4]=requiredPages
|
||||
// [5]=hasOutput [6]=pageCount
|
||||
// [7 .. 7+MAX-1] = pageHeights[pageCount]
|
||||
// [7+MAX .. 7+2*MAX-1] = pageQuadCounts[pageCount]
|
||||
#define ASS_HEADER_INTS (7 + 2 * MAX_ATLAS_PAGES)
|
||||
|
||||
static jint writeAtlasHeader(
|
||||
JNIEnv* env, jintArray headerBuf, int atlasWidth, int quadCount, int changed, int truncated, int requiredPages,
|
||||
int hasOutput, int pageCount, const int* pageHeights, const int* pageQuads) {
|
||||
int hdr[ASS_HEADER_INTS];
|
||||
memset(hdr, 0, sizeof(hdr));
|
||||
hdr[0] = atlasWidth;
|
||||
hdr[1] = quadCount;
|
||||
hdr[2] = changed;
|
||||
hdr[3] = truncated;
|
||||
hdr[4] = requiredPages;
|
||||
hdr[5] = hasOutput;
|
||||
hdr[6] = pageCount;
|
||||
for (int i = 0; i < pageCount && i < MAX_ATLAS_PAGES; i++) {
|
||||
hdr[7 + i] = pageHeights ? pageHeights[i] : 0;
|
||||
hdr[7 + MAX_ATLAS_PAGES + i] = pageQuads ? pageQuads[i] : 0;
|
||||
}
|
||||
(*env)->SetIntArrayRegion(env, headerBuf, 0, ASS_HEADER_INTS, hdr);
|
||||
return 1;
|
||||
}
|
||||
|
||||
// Renders a frame into the provided atlas + vertex direct ByteBuffers.
|
||||
//
|
||||
// - atlasBuf holds packed ALPHA_8 pixels with row stride atlasMaxW. Only the first
|
||||
// atlasHeight rows are written; the caller uploads that region to a texture
|
||||
// allocated once at atlasMaxW × atlasMaxH.
|
||||
// - atlasBuf holds one or more vertically-stacked ALPHA_8 *pages*, each atlasMaxW ×
|
||||
// atlasMaxH (row stride atlasMaxW); page p starts at byte offset p*atlasMaxW*atlasMaxH.
|
||||
// The buffer's capacity bounds how many pages this render may fill; AssAtlasFrame
|
||||
// reports pageHeights (rows worth uploading per page) and requiredPages.
|
||||
// - vertexBuf holds a per-quad vertex stream (6 vertices × (2 pos + 2 uv + 4 color)
|
||||
// floats = 48 floats = 192 bytes per quad). Must match BYTES_PER_QUAD/VERTEX in
|
||||
// AssSubtitleAtlasPipeline.kt. Ready for a single glDrawArrays(GL_TRIANGLES, 0, N * 6).
|
||||
// - UVs are normalized against atlasMaxW × atlasMaxH (the allocated texture dims),
|
||||
// not the packed region, so the texture never needs reallocation.
|
||||
// - Images are packed in height-sorted rows (minimizes packed height) but vertices
|
||||
// are emitted in original list order — the list order is libass's painter order.
|
||||
// AssSubtitleAtlasPipeline.kt. UVs are page-local, normalized against atlasMaxW ×
|
||||
// atlasMaxH (the per-page texture dims).
|
||||
// - The common case packs everything into a single height-sorted page (minimizes
|
||||
// packed height, byte-identical to the prior single-page packer). When that
|
||||
// overflows (a 4K full-screen sign can exceed one GL-max texture), the packer
|
||||
// spills into additional pages in list order: page assignment is monotonic in
|
||||
// libass's painter order, so each page's quads are one contiguous run in the
|
||||
// vertex stream and drawing the pages in turn reproduces the blend order.
|
||||
// - Vertices are always emitted in original list order (= libass's painter order).
|
||||
//
|
||||
// Never fails on content size: images that don't fit the remaining atlas/vertex
|
||||
// capacity are dropped and counted in AssAtlasFrame.truncated, so a heavy frame
|
||||
// degrades instead of going stale. Returns NULL only for missing buffers/handles.
|
||||
// On changed == 0, returns (0, 0, 0, changed, 0, hasOutput) without touching the
|
||||
// buffers. hasOutput lets Kotlin distinguish "reuse the previous atlas" from
|
||||
// "the current frame is blank and the GL surface must be cleared."
|
||||
JNIEXPORT jobject JNICALL Java_com_edde746_plezy_libass_AssRender_nativeAssRenderFrameAtlas(
|
||||
// Never fails on content size: when the frame needs more pages than the buffer holds
|
||||
// (requiredPages > pageHeights.size) the caller grows the buffer and re-renders; any
|
||||
// genuinely undrawable tiles (past MAX_ATLAS_PAGES / the vertex budget) are dropped
|
||||
// and counted in truncated.
|
||||
//
|
||||
// Returns 0 for missing buffers/handles (the caller maps that to a null frame); 1 when
|
||||
// the header was written. On changed == 0 the header carries (atlasWidth=0, quadCount=0,
|
||||
// changed, hasOutput) without touching the atlas/vertex buffers — hasOutput lets Kotlin
|
||||
// distinguish "reuse the previous atlas" from "blank, clear the GL surface."
|
||||
JNIEXPORT jint JNICALL Java_com_edde746_plezy_libass_AssRender_nativeAssRenderFrameAtlas(
|
||||
JNIEnv* env, jclass clazz, jlong render, jlong track, jlong time, jobject atlasBuf, jint atlasMaxW, jint atlasMaxH,
|
||||
jobject vertexBuf) {
|
||||
if (!render || !track || !atlasBuf || !vertexBuf || atlasMaxW <= 0 || atlasMaxH <= 0) return NULL;
|
||||
|
||||
jclass atlasFrameClass = (*env)->FindClass(env, "com/edde746/plezy/libass/AssAtlasFrame");
|
||||
if (!atlasFrameClass) return NULL;
|
||||
jmethodID ctor = (*env)->GetMethodID(env, atlasFrameClass, "<init>", "(IIIIIZ)V");
|
||||
if (!ctor) return NULL;
|
||||
jobject vertexBuf, jintArray headerBuf) {
|
||||
if (!render || !track || !atlasBuf || !vertexBuf || !headerBuf || atlasMaxW <= 0 || atlasMaxH <= 0) return 0;
|
||||
|
||||
const long long t0 = nowMs();
|
||||
int changed;
|
||||
@@ -295,13 +347,13 @@ JNIEXPORT jobject JNICALL Java_com_edde746_plezy_libass_AssRender_nativeAssRende
|
||||
const long long tAss = nowMs();
|
||||
|
||||
if (changed == 0) {
|
||||
const jboolean hasOutput = imageListHasOutput(image) ? JNI_TRUE : JNI_FALSE;
|
||||
const int hasOutput = imageListHasOutput(image) ? 1 : 0;
|
||||
if (tAss - t0 > 40) {
|
||||
__android_log_print(
|
||||
ANDROID_LOG_WARN, LOG_TAG, "slow render t=%lldms: ass=%lldms (changed=%d, hasOutput=%d)", (long long)time,
|
||||
tAss - t0, changed, hasOutput == JNI_TRUE);
|
||||
tAss - t0, changed, hasOutput);
|
||||
}
|
||||
return (*env)->NewObject(env, atlasFrameClass, ctor, 0, 0, 0, changed, 0, hasOutput);
|
||||
return writeAtlasHeader(env, headerBuf, 0, 0, changed, 0, 1, hasOutput, 1, NULL, NULL);
|
||||
}
|
||||
|
||||
if (image == NULL) {
|
||||
@@ -310,123 +362,187 @@ JNIEXPORT jobject JNICALL Java_com_edde746_plezy_libass_AssRender_nativeAssRende
|
||||
ANDROID_LOG_WARN, LOG_TAG, "slow render t=%lldms: ass=%lldms (changed=%d, no output)", (long long)time,
|
||||
tAss - t0, changed);
|
||||
}
|
||||
return (*env)->NewObject(env, atlasFrameClass, ctor, 0, 0, 0, changed, 0, JNI_FALSE);
|
||||
return writeAtlasHeader(env, headerBuf, 0, 0, changed, 0, 1, 0, 1, NULL, NULL);
|
||||
}
|
||||
|
||||
uint8_t* atlasPixels = (uint8_t*)(*env)->GetDirectBufferAddress(env, atlasBuf);
|
||||
jlong atlasCap = (*env)->GetDirectBufferCapacity(env, atlasBuf);
|
||||
float* vertices = (float*)(*env)->GetDirectBufferAddress(env, vertexBuf);
|
||||
jlong vertexCap = (*env)->GetDirectBufferCapacity(env, vertexBuf);
|
||||
if (!atlasPixels || !vertices) return NULL;
|
||||
if (!atlasPixels || !vertices) return 0;
|
||||
if ((jlong)atlasMaxW * atlasMaxH > atlasCap) {
|
||||
__android_log_print(
|
||||
ANDROID_LOG_ERROR, LOG_TAG, "atlas buffer smaller than %dx%d (capacity %lld bytes)", atlasMaxW, atlasMaxH,
|
||||
(long long)atlasCap);
|
||||
return NULL;
|
||||
return 0;
|
||||
}
|
||||
// 48 floats per quad × 4 bytes = 192 bytes/quad
|
||||
const int maxQuads = (int)(vertexCap / 192);
|
||||
const size_t pageBytes = (size_t)atlasMaxW * atlasMaxH;
|
||||
int providedPages = (int)(atlasCap / (jlong)pageBytes);
|
||||
if (providedPages < 1) return 0; // one page is guaranteed above; keep the page math safe
|
||||
if (providedPages > MAX_ATLAS_PAGES) providedPages = MAX_ATLAS_PAGES;
|
||||
|
||||
// Split every image into <= atlasMaxW x atlasMaxH tiles, then pack the tiles.
|
||||
// tiles[] stays in list order (= blend/painter order for emission); keys[] is
|
||||
// sorted by height for the single-page pack so it produces tight rows.
|
||||
int total = 0;
|
||||
for (ASS_Image* img = image; img != NULL; img = img->next) {
|
||||
if (img->w > 0 && img->h > 0) total++;
|
||||
}
|
||||
if (total == 0) {
|
||||
return (*env)->NewObject(env, atlasFrameClass, ctor, 0, 0, 0, changed, 0, JNI_FALSE);
|
||||
}
|
||||
|
||||
// Pass 1: assign packing slots in height-sorted order so mixed-size frames pack
|
||||
// tight rows. slotX/slotY are keyed by the image's position in the original
|
||||
// list; -1 marks images dropped for capacity.
|
||||
PackItem* items = (PackItem*)malloc(sizeof(PackItem) * (size_t)total);
|
||||
int* slotX = (int*)malloc(sizeof(int) * (size_t)total);
|
||||
int* slotY = (int*)malloc(sizeof(int) * (size_t)total);
|
||||
if (!items || !slotX || !slotY) {
|
||||
free(items);
|
||||
free(slotX);
|
||||
free(slotY);
|
||||
return NULL;
|
||||
}
|
||||
int n = 0;
|
||||
for (ASS_Image* img = image; img != NULL; img = img->next) {
|
||||
if (img->w > 0 && img->h > 0) {
|
||||
items[n].img = img;
|
||||
items[n].idx = n;
|
||||
n++;
|
||||
int cols = (img->w + atlasMaxW - 1) / atlasMaxW;
|
||||
int rows = (img->h + atlasMaxH - 1) / atlasMaxH;
|
||||
total += cols * rows;
|
||||
}
|
||||
}
|
||||
qsort(items, (size_t)n, sizeof(PackItem), comparePackItemsByHeightDesc);
|
||||
if (total == 0) {
|
||||
return writeAtlasHeader(env, headerBuf, 0, 0, changed, 0, 1, 0, 1, NULL, NULL);
|
||||
}
|
||||
|
||||
int cursorX = 0, cursorY = 0, rowH = 0;
|
||||
int truncated = 0;
|
||||
int packedH = 0;
|
||||
int accepted = 0;
|
||||
PackTile* tiles = (PackTile*)malloc(sizeof(PackTile) * (size_t)total);
|
||||
TileSortKey* keys = (TileSortKey*)malloc(sizeof(TileSortKey) * (size_t)total);
|
||||
if (!tiles || !keys) {
|
||||
free(tiles);
|
||||
free(keys);
|
||||
return 0;
|
||||
}
|
||||
int n = 0;
|
||||
long long srcPixels = 0;
|
||||
for (int i = 0; i < n; i++) {
|
||||
ASS_Image* img = items[i].img;
|
||||
for (ASS_Image* img = image; img != NULL; img = img->next) {
|
||||
if (img->w <= 0 || img->h <= 0) continue;
|
||||
srcPixels += (long long)img->w * img->h;
|
||||
int sx = -1, sy = -1;
|
||||
if (img->w <= atlasMaxW && accepted < maxQuads) {
|
||||
int cx = cursorX, cy = cursorY, rh = rowH;
|
||||
if (cx + img->w > atlasMaxW) {
|
||||
for (int oy = 0; oy < img->h; oy += atlasMaxH) {
|
||||
int th = img->h - oy;
|
||||
if (th > atlasMaxH) th = atlasMaxH;
|
||||
for (int ox = 0; ox < img->w; ox += atlasMaxW) {
|
||||
int tw = img->w - ox;
|
||||
if (tw > atlasMaxW) tw = atlasMaxW;
|
||||
tiles[n] = (PackTile){.img = img, .ox = ox, .oy = oy, .tw = tw, .th = th, .page = -1, .sx = -1, .sy = -1};
|
||||
keys[n] = (TileSortKey){.th = th, .idx = n};
|
||||
n++;
|
||||
}
|
||||
}
|
||||
}
|
||||
int pageHeights[MAX_ATLAS_PAGES] = {0};
|
||||
int pageQuads[MAX_ATLAS_PAGES] = {0};
|
||||
int pageCount = 1;
|
||||
int requiredPages = 1;
|
||||
int truncated = 0;
|
||||
|
||||
// Pass 1a: height-sorted single page — the common case, minimal packed height
|
||||
// (byte-identical to the prior single-page packer when the frame fits one page).
|
||||
qsort(keys, (size_t)n, sizeof(TileSortKey), compareTileKeysByHeightDesc);
|
||||
int cursorX = 0, cursorY = 0, rowH = 0, packedH = 0, accepted = 0;
|
||||
for (int i = 0; i < n; i++) {
|
||||
PackTile* t = &tiles[keys[i].idx];
|
||||
if (accepted >= maxQuads) break;
|
||||
int cx = cursorX, cy = cursorY, rh = rowH;
|
||||
if (cx + t->tw > atlasMaxW) {
|
||||
cy += rh;
|
||||
cx = 0;
|
||||
rh = 0;
|
||||
}
|
||||
if (cy + t->th > atlasMaxH) continue; // doesn't fit a single page
|
||||
t->page = 0;
|
||||
t->sx = cx;
|
||||
t->sy = cy;
|
||||
cursorX = cx + t->tw;
|
||||
cursorY = cy;
|
||||
rowH = (t->th > rh) ? t->th : rh;
|
||||
if (cy + t->th > packedH) packedH = cy + t->th;
|
||||
accepted++;
|
||||
}
|
||||
|
||||
if (accepted == n) {
|
||||
pageHeights[0] = packedH;
|
||||
pageQuads[0] = accepted;
|
||||
} else {
|
||||
// Pass 1b: the frame overflows one page. Re-pack in list order, starting a new
|
||||
// page whenever a tile won't fit the current one. List order keeps the page
|
||||
// index monotonic in painter order, so each page's quads stay one contiguous run.
|
||||
for (int i = 0; i < n; i++) {
|
||||
tiles[i].page = -1;
|
||||
tiles[i].sx = -1;
|
||||
tiles[i].sy = -1;
|
||||
}
|
||||
int page = 0, cx = 0, cy = 0, rh = 0, placed = 0;
|
||||
for (int i = 0; i < n; i++) {
|
||||
PackTile* t = &tiles[i];
|
||||
if (cx + t->tw > atlasMaxW) {
|
||||
cy += rh;
|
||||
cx = 0;
|
||||
rh = 0;
|
||||
}
|
||||
if (cy + img->h <= atlasMaxH) {
|
||||
sx = cx;
|
||||
sy = cy;
|
||||
cursorX = cx + img->w;
|
||||
cursorY = cy;
|
||||
rowH = (img->h > rh) ? img->h : rh;
|
||||
if (cy + img->h > packedH) packedH = cy + img->h;
|
||||
accepted++;
|
||||
if (cy + t->th > atlasMaxH) {
|
||||
page++;
|
||||
cx = 0;
|
||||
cy = 0;
|
||||
rh = 0;
|
||||
}
|
||||
if (page + 1 > requiredPages) requiredPages = page + 1;
|
||||
if (page < providedPages && placed < maxQuads) {
|
||||
t->page = page;
|
||||
t->sx = cx;
|
||||
t->sy = cy;
|
||||
if (cy + t->th > pageHeights[page]) pageHeights[page] = cy + t->th;
|
||||
pageQuads[page]++;
|
||||
placed++;
|
||||
}
|
||||
cx += t->tw;
|
||||
rh = (t->th > rh) ? t->th : rh;
|
||||
}
|
||||
if (sx < 0) truncated++;
|
||||
slotX[items[i].idx] = sx;
|
||||
slotY[items[i].idx] = sy;
|
||||
pageCount = (requiredPages < providedPages) ? requiredPages : providedPages;
|
||||
accepted = placed;
|
||||
truncated = n - placed;
|
||||
}
|
||||
|
||||
if (truncated > 0 && (truncationLogCounter++ & 63) == 0) {
|
||||
// Warn only for genuinely-unrecoverable loss. A frame that needs more pages than
|
||||
// the buffer currently holds, yet fits within MAX_ATLAS_PAGES and the vertex
|
||||
// budget, is recoverable: the caller grows the buffer and re-renders, so the
|
||||
// first (discarded) render's truncated > 0 is a false alarm, not data loss. Tiles
|
||||
// are only truly lost past the page cap or the vertex budget.
|
||||
const int recoverableGrow = requiredPages <= MAX_ATLAS_PAGES && n <= maxQuads;
|
||||
if (truncated > 0 && !recoverableGrow && (truncationLogCounter++ & 63) == 0) {
|
||||
__android_log_print(
|
||||
ANDROID_LOG_WARN, LOG_TAG, "atlas truncation: %d of %d images dropped (atlas %dx%d, %d quads max)", truncated,
|
||||
n, atlasMaxW, atlasMaxH, maxQuads);
|
||||
ANDROID_LOG_WARN, LOG_TAG, "atlas truncation: %d of %d tiles dropped (atlas %dx%d, need %d pages have %d)",
|
||||
truncated, n, atlasMaxW, atlasMaxH, requiredPages, providedPages);
|
||||
}
|
||||
if (accepted == 0) {
|
||||
free(items);
|
||||
free(slotX);
|
||||
free(slotY);
|
||||
return (*env)->NewObject(env, atlasFrameClass, ctor, 0, 0, 0, changed, truncated, JNI_TRUE);
|
||||
free(tiles);
|
||||
free(keys);
|
||||
return writeAtlasHeader(env, headerBuf, 0, 0, changed, truncated, requiredPages, 1, 1, NULL, NULL);
|
||||
}
|
||||
|
||||
memset(atlasPixels, 0, (size_t)atlasMaxW * packedH);
|
||||
// Clear only the packed rows of each written page.
|
||||
for (int p = 0; p < pageCount; p++) {
|
||||
memset(atlasPixels + (size_t)p * pageBytes, 0, (size_t)atlasMaxW * pageHeights[p]);
|
||||
}
|
||||
|
||||
// Pass 2: walk the original list (= libass's painter/blend order), copying each
|
||||
// accepted image into its assigned slot and emitting its quad.
|
||||
// Emit tiles in list order (= libass's painter/blend order), copying each placed
|
||||
// tile into its page slot and emitting its quad. Monotonic page assignment makes
|
||||
// each page's quads a contiguous run, matching pageQuads[] for the per-page draw.
|
||||
int qi = 0;
|
||||
int k = 0;
|
||||
for (ASS_Image* img = image; img != NULL; img = img->next) {
|
||||
if (img->w <= 0 || img->h <= 0) continue;
|
||||
const int px = slotX[k];
|
||||
const int py = slotY[k];
|
||||
k++;
|
||||
if (px < 0) continue;
|
||||
for (int i = 0; i < n; i++) {
|
||||
PackTile* t = &tiles[i];
|
||||
if (t->page < 0) continue;
|
||||
ASS_Image* img = t->img;
|
||||
const int px = t->sx;
|
||||
const int py = t->sy;
|
||||
uint8_t* pageBase = atlasPixels + (size_t)t->page * pageBytes;
|
||||
|
||||
for (int y = 0; y < img->h; y++) {
|
||||
uint8_t* dst = atlasPixels + (size_t)(py + y) * atlasMaxW + px;
|
||||
const uint8_t* src = img->bitmap + (size_t)y * img->stride;
|
||||
memcpy(dst, src, (size_t)img->w);
|
||||
for (int y = 0; y < t->th; y++) {
|
||||
uint8_t* dst = pageBase + (size_t)(py + y) * atlasMaxW + px;
|
||||
const uint8_t* src = img->bitmap + (size_t)(t->oy + y) * img->stride + t->ox;
|
||||
memcpy(dst, src, (size_t)t->tw);
|
||||
}
|
||||
|
||||
const float x0 = (float)img->dst_x;
|
||||
const float y0 = (float)img->dst_y;
|
||||
const float x1 = x0 + (float)img->w;
|
||||
const float y1 = y0 + (float)img->h;
|
||||
const float x0 = (float)(img->dst_x + t->ox);
|
||||
const float y0 = (float)(img->dst_y + t->oy);
|
||||
const float x1 = x0 + (float)t->tw;
|
||||
const float y1 = y0 + (float)t->th;
|
||||
const float u0 = (float)px / (float)atlasMaxW;
|
||||
const float v0 = (float)py / (float)atlasMaxH;
|
||||
const float u1 = (float)(px + img->w) / (float)atlasMaxW;
|
||||
const float v1 = (float)(py + img->h) / (float)atlasMaxH;
|
||||
const float u1 = (float)(px + t->tw) / (float)atlasMaxW;
|
||||
const float v1 = (float)(py + t->th) / (float)atlasMaxH;
|
||||
const unsigned int c = img->color;
|
||||
const float r = (float)((c >> 24) & 0xFFu) / 255.0f;
|
||||
const float g = (float)((c >> 16) & 0xFFu) / 255.0f;
|
||||
@@ -489,9 +605,8 @@ JNIEXPORT jobject JNICALL Java_com_edde746_plezy_libass_AssRender_nativeAssRende
|
||||
qi++;
|
||||
}
|
||||
|
||||
free(items);
|
||||
free(slotX);
|
||||
free(slotY);
|
||||
free(tiles);
|
||||
free(keys);
|
||||
|
||||
// Slow-render breakdown: separates libass's own cost (rasterize/blur/shape)
|
||||
// from this function's packing + memcpy, so device logs attribute the time.
|
||||
@@ -499,13 +614,15 @@ JNIEXPORT jobject JNICALL Java_com_edde746_plezy_libass_AssRender_nativeAssRende
|
||||
if (tEnd - t0 > 40) {
|
||||
__android_log_print(
|
||||
ANDROID_LOG_WARN, LOG_TAG,
|
||||
"slow render t=%lldms: total=%lldms ass=%lldms pack+copy=%lldms images=%d srcPx=%lldk atlas=%dx%d quads=%d",
|
||||
(long long)time, tEnd - t0, tAss - t0, tEnd - tAss, n, srcPixels / 1000, atlasMaxW, packedH, qi);
|
||||
"slow render t=%lldms: total=%lldms ass=%lldms pack+copy=%lldms images=%d srcPx=%lldk "
|
||||
"atlas=%dx%d pages=%d quads=%d",
|
||||
(long long)time, tEnd - t0, tAss - t0, tEnd - tAss, n, srcPixels / 1000, atlasMaxW, atlasMaxH, pageCount, qi);
|
||||
}
|
||||
|
||||
// atlasWidth is the full row stride (GLES2 can't upload with stride ≠ width);
|
||||
// atlasHeight is the packed height — the only rows worth uploading.
|
||||
return (*env)->NewObject(env, atlasFrameClass, ctor, atlasMaxW, packedH, qi, changed, truncated, JNI_TRUE);
|
||||
// pageHeights/pageQuadCounts describe the per-page upload + draw ranges.
|
||||
return writeAtlasHeader(
|
||||
env, headerBuf, atlasMaxW, qi, changed, truncated, requiredPages, 1, pageCount, pageHeights, pageQuads);
|
||||
}
|
||||
|
||||
// --- AssFrameTimestamps (EGL_ANDROID_get_frame_timestamps) ---
|
||||
|
||||
@@ -4,8 +4,8 @@ project("asskt")
|
||||
|
||||
# Fetching the fork release at configure time keeps per-ABI static archives out
|
||||
# of git; the pinned hash makes that network step reproducible.
|
||||
set(LIBASS_VERSION "0.18.1")
|
||||
set(LIBASS_SHA256 "56088619d3907fabbede978d053eca842c1acdda2fea8f11a1e4e1c5722f0624")
|
||||
set(LIBASS_VERSION "0.18.3")
|
||||
set(LIBASS_SHA256 "fc98637752695d7cf9e26b02befaa634dd4cad25a2f38fba80de814bfd310a17")
|
||||
set(LIBASS_ZIP_URL "https://github.com/edde746/libass/releases/download/${LIBASS_VERSION}/libass-android-${LIBASS_VERSION}.zip")
|
||||
|
||||
# Gradle passes one cache root so per-ABI CMake builds share the download.
|
||||
|
||||
@@ -4,25 +4,60 @@ package com.edde746.plezy.libass
|
||||
* Result of a packed-atlas render. The atlas pixel data is stored in the direct ByteBuffer
|
||||
* that was passed into [AssRender.renderFrameAtlas]; the vertex stream is in the other.
|
||||
*
|
||||
* @param atlasWidth atlas row stride in pixels (= the allocated width; 0 when [changed] == 0)
|
||||
* @param atlasHeight packed atlas height in pixels — the rows worth uploading
|
||||
* @param quadCount number of quads; the vertex buffer holds [quadCount] * 6 vertices
|
||||
* @param changed libass change flag (0 = no change, 1 = positions, 2 = content)
|
||||
* @param truncated images dropped because they exceeded the atlas/vertex capacity;
|
||||
* the frame is incomplete but never stale (> 0 should be rare —
|
||||
* it means even the GL-max-sized atlas couldn't fit the frame)
|
||||
* @param hasOutput true when libass reported at least one visible image for this
|
||||
* timestamp, even when [changed] is 0 and the buffers were not
|
||||
* rewritten. false means this timestamp should be blank.
|
||||
* The atlas may span more than one *page* — a heavy full-screen sign can produce more
|
||||
* sub-pixels than a single GL-max texture holds. Pages are vertically stacked in the
|
||||
* atlas ByteBuffer (page `p` at byte offset `p * atlasWidth * atlasMaxHeight`), each its
|
||||
* own texture, and are drawn in turn. Quads are emitted in libass painter order and page
|
||||
* assignment is monotonic in that order, so each page's quads form one contiguous run in
|
||||
* the vertex stream ([pageQuadCounts]); the runner uploads page `p`, then draws its run.
|
||||
*
|
||||
* Built in Kotlin by [AssRender.renderFrameAtlas] from the int[] header the native
|
||||
* renderer fills (see `writeAtlasHeader` in AssKt.c) — never constructed from JNI, so
|
||||
* the minifier may obfuscate it freely without breaking the native boundary.
|
||||
*
|
||||
* @param atlasWidth atlas row stride in pixels (= the allocated width; same for every
|
||||
* page; 0 when [changed] == 0)
|
||||
* @param pageHeights packed height (rows worth uploading) of each page; `size` = page count
|
||||
* @param pageQuadCounts quads on each page, contiguous in the vertex stream in this order;
|
||||
* `size` = page count, `sum` = [quadCount]
|
||||
* @param quadCount total quads; the vertex buffer holds [quadCount] * 6 vertices
|
||||
* @param changed libass change flag (0 = no change, 1 = positions, 2 = content)
|
||||
* @param truncated images dropped because the frame needed more than [requiredPages]
|
||||
* pages of capacity or exceeded the vertex budget; the frame is
|
||||
* incomplete but never stale (should be unreachable for real content)
|
||||
* @param requiredPages pages this frame needs to render completely. When it exceeds
|
||||
* [pageHeights].size the caller must grow the atlas buffer and
|
||||
* re-render; the rendered pages are still valid in the meantime.
|
||||
* @param hasOutput true when libass reported at least one visible image for this
|
||||
* timestamp, even when [changed] is 0 and the buffers were not
|
||||
* rewritten. false means this timestamp should be blank.
|
||||
*/
|
||||
class AssAtlasFrame(
|
||||
val atlasWidth: Int,
|
||||
val atlasHeight: Int,
|
||||
val pageHeights: IntArray,
|
||||
val pageQuadCounts: IntArray,
|
||||
val quadCount: Int,
|
||||
val changed: Int,
|
||||
val truncated: Int,
|
||||
val requiredPages: Int,
|
||||
val hasOutput: Boolean
|
||||
) {
|
||||
/** Number of atlas pages this frame occupies. */
|
||||
val pageCount: Int get() = pageHeights.size
|
||||
|
||||
/** Packed height of the first page; the only page in the common single-page case. */
|
||||
val atlasHeight: Int get() = if (pageHeights.isNotEmpty()) pageHeights[0] else 0
|
||||
|
||||
/** Single-page convenience: blank/unchanged frames and tests. */
|
||||
constructor(
|
||||
atlasWidth: Int,
|
||||
atlasHeight: Int,
|
||||
quadCount: Int,
|
||||
changed: Int,
|
||||
truncated: Int,
|
||||
hasOutput: Boolean
|
||||
) : this(atlasWidth, intArrayOf(atlasHeight), intArrayOf(quadCount), quadCount, changed, truncated, 1, hasOutput)
|
||||
|
||||
constructor(
|
||||
atlasWidth: Int,
|
||||
atlasHeight: Int,
|
||||
|
||||
@@ -8,6 +8,10 @@ class AssRender(nativeAss: Long, private val lock: ReentrantLock) {
|
||||
|
||||
companion object {
|
||||
|
||||
/** Must match MAX_ATLAS_PAGES + the header layout in AssKt.c (`writeAtlasHeader`). */
|
||||
private const val MAX_ATLAS_PAGES = 4
|
||||
private const val HEADER_INTS = 7 + 2 * MAX_ATLAS_PAGES
|
||||
|
||||
@JvmStatic
|
||||
external fun nativeAssRenderInit(ass: Long): Long
|
||||
|
||||
@@ -29,6 +33,12 @@ class AssRender(nativeAss: Long, private val lock: ReentrantLock) {
|
||||
@JvmStatic
|
||||
external fun nativeAssRenderSetUseMargins(render: Long, use: Boolean)
|
||||
|
||||
/**
|
||||
* Renders into [atlasBuf]/[vertexBuf] and writes frame metadata into [header]
|
||||
* (layout per `writeAtlasHeader` in AssKt.c). Returns 1 when the header was written,
|
||||
* 0 for missing buffers/handles. The frame object is built on the Kotlin side from
|
||||
* the header so the JNI boundary never constructs it (R8-safe; see [renderFrameAtlas]).
|
||||
*/
|
||||
@JvmStatic
|
||||
external fun nativeAssRenderFrameAtlas(
|
||||
render: Long,
|
||||
@@ -37,8 +47,9 @@ class AssRender(nativeAss: Long, private val lock: ReentrantLock) {
|
||||
atlasBuf: ByteBuffer,
|
||||
atlasMaxWidth: Int,
|
||||
atlasMaxHeight: Int,
|
||||
vertexBuf: ByteBuffer
|
||||
): AssAtlasFrame?
|
||||
vertexBuf: ByteBuffer,
|
||||
header: IntArray
|
||||
): Int
|
||||
|
||||
@JvmStatic
|
||||
external fun nativeAssRenderDeinit(render: Long)
|
||||
@@ -46,6 +57,10 @@ class AssRender(nativeAss: Long, private val lock: ReentrantLock) {
|
||||
|
||||
private var nativeRender: Long = nativeAssRenderInit(nativeAss)
|
||||
|
||||
/** Reusable JNI frame-metadata header (see `writeAtlasHeader` in AssKt.c). Calls to
|
||||
* [renderFrameAtlas] are serialized by [lock], so one buffer is safe to reuse. */
|
||||
private val frameHeader = IntArray(HEADER_INTS)
|
||||
|
||||
@Volatile
|
||||
var released = false
|
||||
private set
|
||||
@@ -109,26 +124,31 @@ class AssRender(nativeAss: Long, private val lock: ReentrantLock) {
|
||||
withNative { nativeAssRenderSetUseMargins(it, use) }
|
||||
}
|
||||
|
||||
/**
|
||||
* Renders a frame into a packed ALPHA_8 texture atlas plus a single vertex stream
|
||||
* ready for `glDrawArrays(GL_TRIANGLES, 0, quadCount * 6)`.
|
||||
*
|
||||
* UVs are normalized against ([atlasMaxW], [atlasMaxH]) — the allocated texture
|
||||
* dims — so the caller can allocate the texture once and `glTexSubImage2D` only
|
||||
* the packed rows. Images that exceed the capacity are dropped and counted in
|
||||
* [AssAtlasFrame.truncated]; the render never fails on content size.
|
||||
*
|
||||
* @param atlasBuf direct ByteBuffer receiving the packed pixels (≥ atlasMaxW × atlasMaxH)
|
||||
* @param atlasMaxW atlas row stride in pixels (bound by `GL_MAX_TEXTURE_SIZE`)
|
||||
* @param atlasMaxH atlas height in pixels (bound by `GL_MAX_TEXTURE_SIZE`)
|
||||
* @param vertexBuf direct ByteBuffer receiving the vertex stream (192 bytes per quad)
|
||||
*/
|
||||
/** How long the most recent [renderFrameAtlas] waited to acquire the shared
|
||||
* libass lock (contended by track dialogue/font feeding), in milliseconds. */
|
||||
@Volatile
|
||||
var lastLockWaitMs: Long = 0
|
||||
private set
|
||||
|
||||
/**
|
||||
* Renders a frame into a packed ALPHA_8 texture atlas plus a vertex stream.
|
||||
*
|
||||
* The atlas may span one or more vertically-stacked pages (a dense full-screen
|
||||
* sign can exceed a single GL-max texture); vertices stay in libass painter order,
|
||||
* grouped per page ([AssAtlasFrame.pageQuadCounts]). The caller uploads each page
|
||||
* to its own texture and draws it with its own `glDrawArrays`, reproducing the
|
||||
* blend order. UVs are page-local, normalized against ([atlasMaxW], [atlasMaxH]).
|
||||
*
|
||||
* Never fails on content size: when the frame needs more pages than [atlasBuf]
|
||||
* holds, [AssAtlasFrame.requiredPages] signals the caller to grow the buffer and
|
||||
* re-render; only tiles past `MAX_ATLAS_PAGES` or the vertex budget are dropped
|
||||
* and counted in [AssAtlasFrame.truncated].
|
||||
*
|
||||
* @param atlasBuf direct ByteBuffer receiving the stacked pages (≥ atlasMaxW × atlasMaxH per page)
|
||||
* @param atlasMaxW per-page atlas row stride in pixels (bound by `GL_MAX_TEXTURE_SIZE`)
|
||||
* @param atlasMaxH per-page atlas height in pixels (bound by `GL_MAX_TEXTURE_SIZE`)
|
||||
* @param vertexBuf direct ByteBuffer receiving the vertex stream (192 bytes per quad)
|
||||
*/
|
||||
fun renderFrameAtlas(
|
||||
time: Long,
|
||||
atlasBuf: ByteBuffer,
|
||||
@@ -142,7 +162,21 @@ class AssRender(nativeAss: Long, private val lock: ReentrantLock) {
|
||||
if (released || nativeRender == 0L) return null
|
||||
val t = track ?: return null
|
||||
if (t.released || t.nativeAssTrack == 0L) return null
|
||||
return nativeAssRenderFrameAtlas(nativeRender, t.nativeAssTrack, time, atlasBuf, atlasMaxW, atlasMaxH, vertexBuf)
|
||||
val header = frameHeader
|
||||
val status =
|
||||
nativeAssRenderFrameAtlas(nativeRender, t.nativeAssTrack, time, atlasBuf, atlasMaxW, atlasMaxH, vertexBuf, header)
|
||||
if (status == 0) return null
|
||||
val pageCount = header[6]
|
||||
return AssAtlasFrame(
|
||||
atlasWidth = header[0],
|
||||
pageHeights = IntArray(pageCount) { header[7 + it] },
|
||||
pageQuadCounts = IntArray(pageCount) { header[7 + MAX_ATLAS_PAGES + it] },
|
||||
quadCount = header[1],
|
||||
changed = header[2],
|
||||
truncated = header[3],
|
||||
requiredPages = header[4],
|
||||
hasOutput = header[5] != 0
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+120
-58
@@ -28,10 +28,10 @@ import java.util.concurrent.locks.LockSupport
|
||||
|
||||
/**
|
||||
* Atlas-rendering pipeline behind [AssSubtitleSurfaceView].
|
||||
* Runs libass on its own [HandlerThread] into a packed
|
||||
* ALPHA_8 texture atlas plus a single vertex stream, and a GL thread that uploads
|
||||
* both and issues one `glDrawArrays` per frame. Each timed swap is pinned to the
|
||||
* corresponding video frame via [EGLExt.eglPresentationTimeANDROID].
|
||||
* Runs libass on its own [HandlerThread] into a packed ALPHA_8 atlas of one or more
|
||||
* pages plus a vertex stream, and a GL thread that uploads both and issues one
|
||||
* `glDrawArrays` per atlas page. Each timed swap is pinned to the corresponding
|
||||
* video frame via [EGLExt.eglPresentationTimeANDROID].
|
||||
*/
|
||||
@UnstableApi
|
||||
internal object AssAtlasPipelineConfig {
|
||||
@@ -54,6 +54,16 @@ internal object AssAtlasPipelineConfig {
|
||||
/** Preallocated vertex-stream capacity (192 bytes × 16384 = 3 MB per buffer). */
|
||||
internal const val MAX_QUADS = 16384
|
||||
|
||||
/**
|
||||
* Hard cap on vertically-stacked atlas pages per slot. A frame whose packed
|
||||
* sub-pixels exceed one [ATLAS_PIXEL_BUDGET] texture (a 4K-rendered full-screen
|
||||
* typeset sign) spills into extra pages so nothing is dropped (#1436); the atlas
|
||||
* buffer grows on demand toward this cap. 4 covers the worst frame measured (a 4K
|
||||
* letter needs 3); past it tiles are dropped and counted in `truncated`. Must match
|
||||
* MAX_ATLAS_PAGES in AssKt.c.
|
||||
*/
|
||||
internal const val MAX_ATLAS_PAGES = 4
|
||||
|
||||
/** Must match the byte layout produced by `nativeAssRenderFrameAtlas` in AssKt.c. */
|
||||
internal const val BYTES_PER_VERTEX = 32
|
||||
internal const val BYTES_PER_QUAD = BYTES_PER_VERTEX * 6
|
||||
@@ -98,8 +108,12 @@ internal object AssAtlasPipelineConfig {
|
||||
|
||||
internal class AtlasPayload(
|
||||
val slotIndex: Int,
|
||||
val atlasBuf: ByteBuffer,
|
||||
/** Vertically-stacked atlas pages (page p at byte offset p·atlasW·atlasH). Starts
|
||||
* one page; [growAtlas] reallocates it larger when a dense frame needs more. */
|
||||
var atlasBuf: ByteBuffer,
|
||||
val vertexBuf: ByteBuffer,
|
||||
/** How many pages [atlasBuf] currently holds — the high-water mark for this slot. */
|
||||
var pageCapacity: Int,
|
||||
var frame: AssAtlasFrame,
|
||||
var presentationTimeUs: Long,
|
||||
var releaseTimeNs: Long,
|
||||
@@ -109,7 +123,14 @@ internal class AtlasPayload(
|
||||
var contentSeq: Long = 0L,
|
||||
var requestSeq: Long = 0L,
|
||||
var stateGeneration: Long = 0L
|
||||
)
|
||||
) {
|
||||
/** Reallocates [atlasBuf] to hold [pages] stacked atlasW×atlasH pages. Runs on the
|
||||
* libass thread before hand-off, so no GL reader can be looking at the old buffer. */
|
||||
fun growAtlas(pages: Int, atlasW: Int, atlasH: Int) {
|
||||
atlasBuf = ByteBuffer.allocateDirect(atlasW * atlasH * pages).order(ByteOrder.nativeOrder())
|
||||
pageCapacity = pages
|
||||
}
|
||||
}
|
||||
|
||||
private class AtlasDrawSnapshot(
|
||||
val atlasBuf: ByteBuffer,
|
||||
@@ -181,7 +202,7 @@ internal class AssAtlasPipeline(
|
||||
// GL_MAX_TEXTURE_SIZE right after EGL init; by the libass thread's 1 s fallback
|
||||
// if GL never comes up. Both threads then agree on the dims, which matters
|
||||
// because the C side bakes UV denominators = these dims into the vertex stream
|
||||
// and the GL side allocates the texture once at these dims.
|
||||
// and the GL side allocates each atlas-page texture at these dims.
|
||||
private val dimsResolved = java.util.concurrent.atomic.AtomicBoolean(false)
|
||||
private val dimsLatch = java.util.concurrent.CountDownLatch(1)
|
||||
|
||||
@@ -227,10 +248,12 @@ internal class AssAtlasPipeline(
|
||||
val payloads = Array(slotCount) { index ->
|
||||
AtlasPayload(
|
||||
slotIndex = index,
|
||||
// One page up front (the common case); grows on demand for dense frames.
|
||||
atlasBuf = ByteBuffer.allocateDirect(w * h).order(ByteOrder.nativeOrder()),
|
||||
vertexBuf = ByteBuffer.allocateDirect(
|
||||
AssAtlasPipelineConfig.MAX_QUADS * AssAtlasPipelineConfig.BYTES_PER_QUAD
|
||||
).order(ByteOrder.nativeOrder()),
|
||||
pageCapacity = 1,
|
||||
frame = AssAtlasFrame(0, 0, 0, 0, 0),
|
||||
presentationTimeUs = 0L,
|
||||
releaseTimeNs = C.TIME_UNSET
|
||||
@@ -692,8 +715,21 @@ private class AtlasLibassThread(
|
||||
val render = assHandler.render ?: return null
|
||||
val payload = slots.payloads[slot]
|
||||
val t0 = System.nanoTime()
|
||||
val frame = render.renderFrameAtlas(timeMs, payload.atlasBuf, slots.atlasW, slots.atlasH, payload.vertexBuf)
|
||||
var frame = render.renderFrameAtlas(timeMs, payload.atlasBuf, slots.atlasW, slots.atlasH, payload.vertexBuf)
|
||||
?: return null
|
||||
// A frame overflows one atlas page only on dense full-screen typesetting. When it
|
||||
// does, grow this slot's buffer to the pages it needs (capped) and render once more
|
||||
// — libass's caches make the re-render cheap, and the slot keeps the larger buffer
|
||||
// so the same density never re-grows. The truncated first result is never handed off.
|
||||
if (frame.requiredPages > payload.pageCapacity && payload.pageCapacity < AssAtlasPipelineConfig.MAX_ATLAS_PAGES) {
|
||||
payload.growAtlas(
|
||||
minOf(frame.requiredPages, AssAtlasPipelineConfig.MAX_ATLAS_PAGES),
|
||||
slots.atlasW,
|
||||
slots.atlasH
|
||||
)
|
||||
frame = render.renderFrameAtlas(timeMs, payload.atlasBuf, slots.atlasW, slots.atlasH, payload.vertexBuf)
|
||||
?: return null
|
||||
}
|
||||
val libassMs = (System.nanoTime() - t0) / 1_000_000
|
||||
renderCount++
|
||||
lastLibassMs = libassMs
|
||||
@@ -1083,8 +1119,8 @@ private class AtlasGlThread(
|
||||
EGL14.eglMakeCurrent(eglDisplay, eglSurface, eglSurface, eglContext)
|
||||
renderer.onSurfaceCreated()
|
||||
// Resolve atlas dims from real GL caps (first-wins against the libass
|
||||
// thread's fallback) and allocate the texture once at those dims — uploads
|
||||
// are glTexSubImage2D of the packed rows from then on.
|
||||
// thread's fallback) and allocate the page-0 texture at those dims (extra
|
||||
// pages lazily) — uploads are glTexSubImage2D of the packed rows from then on.
|
||||
val maxTexture = IntArray(1)
|
||||
GLES20.glGetIntegerv(GLES20.GL_MAX_TEXTURE_SIZE, maxTexture, 0)
|
||||
val (atlasW, atlasH) = resolveAtlasDims(maxTexture[0])
|
||||
@@ -1342,9 +1378,11 @@ private class AtlasGlThread(
|
||||
}
|
||||
|
||||
/**
|
||||
* GL-side work for the atlas-based path. Maintains a single atlas texture and a
|
||||
* single vertex buffer; uploads them per frame (unless the payload identity
|
||||
* matches the last upload) and issues one `glDrawArrays` for the whole frame.
|
||||
* GL-side work for the atlas-based path. Maintains one ALPHA_8 atlas texture per
|
||||
* page (allocated lazily, up to MAX_ATLAS_PAGES) plus a single vertex buffer;
|
||||
* uploads them per frame (unless the payload identity matches the last upload) and
|
||||
* issues one `glDrawArrays` per page, drawing pages in turn to reproduce libass's
|
||||
* blend order.
|
||||
*/
|
||||
@UnstableApi
|
||||
private class AtlasRenderer(private val assHandler: AssHandler) {
|
||||
@@ -1380,7 +1418,9 @@ private class AtlasRenderer(private val assHandler: AssHandler) {
|
||||
private var surfaceSize = Size.ZERO
|
||||
private lateinit var glProgram: GlProgram
|
||||
|
||||
private var atlasTexId = 0
|
||||
// One texture per atlas page; allocated lazily as the page count grows.
|
||||
private val atlasTexIds = IntArray(AssAtlasPipelineConfig.MAX_ATLAS_PAGES)
|
||||
private var allocatedPages = 0
|
||||
private var vertexBufferId = 0
|
||||
|
||||
private var aPosition = 0
|
||||
@@ -1393,20 +1433,38 @@ private class AtlasRenderer(private val assHandler: AssHandler) {
|
||||
private var atlasAllocatedH = 0
|
||||
|
||||
/**
|
||||
* Allocates the atlas texture once at the resolved dims. The C side bakes UV
|
||||
* denominators = these dims into the vertex stream, so per-frame uploads can be
|
||||
* partial ([uploadAtlas]) without ever reallocating — drivers keep one stable
|
||||
* texture allocation instead of churning on packed-height changes.
|
||||
* Records the per-page texture dims and allocates the first page's texture. The C
|
||||
* side bakes UV denominators = these dims into the vertex stream and stacks pages
|
||||
* at byte multiples of width×height, so per-frame uploads stay partial
|
||||
* ([uploadPage]) — drivers keep stable texture allocations instead of churning on
|
||||
* packed-height changes — and extra pages allocate lazily ([ensurePageTexture]).
|
||||
*/
|
||||
fun allocateAtlasTexture(width: Int, height: Int) {
|
||||
GLES20.glBindTexture(GLES20.GL_TEXTURE_2D, atlasTexId)
|
||||
GLES20.glTexImage2D(
|
||||
GLES20.GL_TEXTURE_2D, 0, GLES20.GL_ALPHA,
|
||||
width, height, 0,
|
||||
GLES20.GL_ALPHA, GLES20.GL_UNSIGNED_BYTE, null
|
||||
)
|
||||
atlasAllocatedW = width
|
||||
atlasAllocatedH = height
|
||||
allocatedPages = 0
|
||||
ensurePageTexture(0)
|
||||
}
|
||||
|
||||
/** Lazily allocates atlas-page textures through [page] at the recorded dims. */
|
||||
private fun ensurePageTexture(page: Int) {
|
||||
while (allocatedPages <= page && allocatedPages < atlasTexIds.size) {
|
||||
val p = allocatedPages
|
||||
val tex = IntArray(1)
|
||||
GLES20.glGenTextures(1, tex, 0)
|
||||
atlasTexIds[p] = tex[0]
|
||||
GLES20.glBindTexture(GLES20.GL_TEXTURE_2D, atlasTexIds[p])
|
||||
GLES20.glTexParameteri(GLES20.GL_TEXTURE_2D, GLES20.GL_TEXTURE_WRAP_S, GLES20.GL_CLAMP_TO_EDGE)
|
||||
GLES20.glTexParameteri(GLES20.GL_TEXTURE_2D, GLES20.GL_TEXTURE_WRAP_T, GLES20.GL_CLAMP_TO_EDGE)
|
||||
GLES20.glTexParameteri(GLES20.GL_TEXTURE_2D, GLES20.GL_TEXTURE_MIN_FILTER, GLES20.GL_LINEAR)
|
||||
GLES20.glTexParameteri(GLES20.GL_TEXTURE_2D, GLES20.GL_TEXTURE_MAG_FILTER, GLES20.GL_LINEAR)
|
||||
GLES20.glTexImage2D(
|
||||
GLES20.GL_TEXTURE_2D, 0, GLES20.GL_ALPHA,
|
||||
atlasAllocatedW, atlasAllocatedH, 0,
|
||||
GLES20.GL_ALPHA, GLES20.GL_UNSIGNED_BYTE, null
|
||||
)
|
||||
allocatedPages = p + 1
|
||||
}
|
||||
}
|
||||
|
||||
fun onSurfaceCreated() {
|
||||
@@ -1420,16 +1478,9 @@ private class AtlasRenderer(private val assHandler: AssHandler) {
|
||||
uTexture = glProgram.getUniformLocation("u_Texture")
|
||||
uSurfaceSize = glProgram.getUniformLocation("u_SurfaceSize")
|
||||
|
||||
val tex = IntArray(1)
|
||||
GLES20.glGenTextures(1, tex, 0)
|
||||
atlasTexId = tex[0]
|
||||
GLES20.glActiveTexture(GLES20.GL_TEXTURE0)
|
||||
GLES20.glBindTexture(GLES20.GL_TEXTURE_2D, atlasTexId)
|
||||
GLES20.glTexParameteri(GLES20.GL_TEXTURE_2D, GLES20.GL_TEXTURE_WRAP_S, GLES20.GL_CLAMP_TO_EDGE)
|
||||
GLES20.glTexParameteri(GLES20.GL_TEXTURE_2D, GLES20.GL_TEXTURE_WRAP_T, GLES20.GL_CLAMP_TO_EDGE)
|
||||
GLES20.glTexParameteri(GLES20.GL_TEXTURE_2D, GLES20.GL_TEXTURE_MIN_FILTER, GLES20.GL_LINEAR)
|
||||
GLES20.glTexParameteri(GLES20.GL_TEXTURE_2D, GLES20.GL_TEXTURE_MAG_FILTER, GLES20.GL_LINEAR)
|
||||
GLES20.glUniform1i(uTexture, 0)
|
||||
// Atlas-page textures are generated lazily in allocateAtlasTexture/ensurePageTexture.
|
||||
|
||||
val buf = IntArray(1)
|
||||
GLES20.glGenBuffers(1, buf, 0)
|
||||
@@ -1468,7 +1519,6 @@ private class AtlasRenderer(private val assHandler: AssHandler) {
|
||||
if (quadCount == 0) return
|
||||
|
||||
if (!reuseUploads) {
|
||||
uploadAtlas(payload.atlasBuf, frame.atlasWidth, frame.atlasHeight)
|
||||
uploadVertices(payload.vertexBuf, quadCount)
|
||||
}
|
||||
|
||||
@@ -1477,30 +1527,42 @@ private class AtlasRenderer(private val assHandler: AssHandler) {
|
||||
GLES20.glVertexAttribPointer(aPosition, 2, GLES20.GL_FLOAT, false, stride, 0)
|
||||
GLES20.glVertexAttribPointer(aTexCoord, 2, GLES20.GL_FLOAT, false, stride, 8)
|
||||
GLES20.glVertexAttribPointer(aColor, 4, GLES20.GL_FLOAT, false, stride, 16)
|
||||
GLES20.glDrawArrays(GLES20.GL_TRIANGLES, 0, quadCount * 6)
|
||||
|
||||
// Each atlas page is its own texture; its quads are one contiguous run in the
|
||||
// stream (page assignment is monotonic in painter order). Upload + draw each in
|
||||
// turn, which reproduces the libass blend order across pages.
|
||||
GLES20.glActiveTexture(GLES20.GL_TEXTURE0)
|
||||
var quadOffset = 0
|
||||
for (p in 0 until frame.pageCount) {
|
||||
val pageQuads = frame.pageQuadCounts[p]
|
||||
if (pageQuads > 0) {
|
||||
ensurePageTexture(p)
|
||||
GLES20.glBindTexture(GLES20.GL_TEXTURE_2D, atlasTexIds[p])
|
||||
if (!reuseUploads) uploadPage(payload.atlasBuf, p, frame.atlasWidth, frame.pageHeights[p])
|
||||
GLES20.glDrawArrays(GLES20.GL_TRIANGLES, quadOffset * 6, pageQuads * 6)
|
||||
}
|
||||
quadOffset += pageQuads
|
||||
}
|
||||
}
|
||||
|
||||
private fun uploadAtlas(atlasBuf: ByteBuffer, atlasW: Int, atlasH: Int) {
|
||||
atlasBuf.position(0).limit(atlasW * atlasH)
|
||||
GLES20.glBindTexture(GLES20.GL_TEXTURE_2D, atlasTexId)
|
||||
if (atlasW == atlasAllocatedW && atlasH <= atlasAllocatedH) {
|
||||
// Steady state: packed rows into the once-allocated texture.
|
||||
GLES20.glTexSubImage2D(
|
||||
GLES20.GL_TEXTURE_2D, 0, 0, 0, atlasW, atlasH,
|
||||
GLES20.GL_ALPHA, GLES20.GL_UNSIGNED_BYTE, atlasBuf
|
||||
)
|
||||
} else {
|
||||
// Defensive: dims disagree with the allocation (shouldn't happen — both
|
||||
// sides resolve dims through the same first-wins gate).
|
||||
Log.w("AssAtlasRenderer", "atlas upload ${atlasW}x$atlasH outside allocation ${atlasAllocatedW}x$atlasAllocatedH")
|
||||
GLES20.glTexImage2D(
|
||||
GLES20.GL_TEXTURE_2D, 0, GLES20.GL_ALPHA,
|
||||
atlasW, atlasH, 0,
|
||||
GLES20.GL_ALPHA, GLES20.GL_UNSIGNED_BYTE, atlasBuf
|
||||
)
|
||||
atlasAllocatedW = atlasW
|
||||
atlasAllocatedH = atlasH
|
||||
/** Uploads page [page]'s packed rows from the stacked atlas buffer into the
|
||||
* currently-bound page texture. */
|
||||
private fun uploadPage(atlasBuf: ByteBuffer, page: Int, atlasW: Int, pageH: Int) {
|
||||
if (pageH <= 0) return
|
||||
if (atlasW != atlasAllocatedW || pageH > atlasAllocatedH) {
|
||||
// Defensive: dims disagree with the allocation (shouldn't happen — both sides
|
||||
// resolve dims through the same first-wins gate).
|
||||
Log.w("AssAtlasRenderer", "page upload ${atlasW}x$pageH outside allocation ${atlasAllocatedW}x$atlasAllocatedH")
|
||||
return
|
||||
}
|
||||
val start = page * atlasW * atlasAllocatedH
|
||||
atlasBuf.clear()
|
||||
atlasBuf.limit(start + atlasW * pageH)
|
||||
atlasBuf.position(start)
|
||||
GLES20.glTexSubImage2D(
|
||||
GLES20.GL_TEXTURE_2D, 0, 0, 0, atlasW, pageH,
|
||||
GLES20.GL_ALPHA, GLES20.GL_UNSIGNED_BYTE, atlasBuf
|
||||
)
|
||||
}
|
||||
|
||||
private fun uploadVertices(vertexBuf: ByteBuffer, quadCount: Int) {
|
||||
@@ -1511,10 +1573,10 @@ private class AtlasRenderer(private val assHandler: AssHandler) {
|
||||
}
|
||||
|
||||
fun onSurfaceDestroyed() {
|
||||
if (atlasTexId != 0) {
|
||||
val tex = intArrayOf(atlasTexId)
|
||||
GLES20.glDeleteTextures(1, tex, 0)
|
||||
atlasTexId = 0
|
||||
if (allocatedPages > 0) {
|
||||
GLES20.glDeleteTextures(allocatedPages, atlasTexIds, 0)
|
||||
atlasTexIds.fill(0)
|
||||
allocatedPages = 0
|
||||
}
|
||||
if (vertexBufferId != 0) {
|
||||
val buf = intArrayOf(vertexBufferId)
|
||||
|
||||
+1
-2
@@ -272,7 +272,7 @@ class SpecRenderEngineTest {
|
||||
// last-rendered slot so GL skips the upload entirely.
|
||||
val h = Harness()
|
||||
h.script.add(changed())
|
||||
val first = h.engine.service(0, pinned = true) as SpecRenderEngine.Outcome.Post
|
||||
h.engine.service(0, pinned = true)
|
||||
var pts = 0L
|
||||
repeat(4) {
|
||||
// build cadence; renders return changed for simplicity
|
||||
@@ -287,7 +287,6 @@ class SpecRenderEngineTest {
|
||||
assertTrue(outcome.specHit)
|
||||
assertFalse(outcome.newContent)
|
||||
assertEquals(before, h.calls.size)
|
||||
assertNotNull(first) // first slot existed; hit reposts whichever slot was last rendered
|
||||
}
|
||||
|
||||
@Test
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 96 96"><path fill="currentColor" fill-rule="evenodd" d="M48 96C74.5097 96 96 74.5097 96 48C96 21.4903 74.5097 0 48 0C21.4903 0 0 21.4903 0 48C0 74.5097 21.4903 96 48 96ZM80.0001 52C80.0001 67.464 67.4641 80 52.0001 80C36.5361 80 24.0001 67.464 24.0001 52C24.0001 49.1303 24.4318 46.3615 25.2338 43.7548C27.4288 48.6165 32.3194 52 38.0001 52C45.7321 52 52.0001 45.732 52.0001 38C52.0001 32.3192 48.6166 27.4287 43.755 25.2337C46.3616 24.4317 49.1304 24 52.0001 24C67.4641 24 80.0001 36.536 80.0001 52Z" clip-rule="evenodd"/></svg>
|
||||
|
After Width: | Height: | Size: 583 B |
@@ -22,6 +22,9 @@
|
||||
97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */; };
|
||||
B1D51A6A2F00110000000001 /* MpvPlayerCoreBase.swift in Sources */ = {isa = PBXBuildFile; fileRef = B1D51A6A2F00110000000002 /* MpvPlayerCoreBase.swift */; };
|
||||
B1D51A6A2F00110000000005 /* MpvPlayerPluginShared.swift in Sources */ = {isa = PBXBuildFile; fileRef = B1D51A6A2F00110000000006 /* MpvPlayerPluginShared.swift */; };
|
||||
B1D51A6A2F0011000000000C /* MpvAudioPlayerCore.swift in Sources */ = {isa = PBXBuildFile; fileRef = B1D51A6A2F0011000000000D /* MpvAudioPlayerCore.swift */; };
|
||||
B1D51A6A2F0011000000000E /* MpvAudioPlayerPlugin.swift in Sources */ = {isa = PBXBuildFile; fileRef = B1D51A6A2F0011000000000F /* MpvAudioPlayerPlugin.swift */; };
|
||||
B1D51A6A2F0011000000000A /* AtmosProbePlugin.swift in Sources */ = {isa = PBXBuildFile; fileRef = B1D51A6A2F0011000000000B /* AtmosProbePlugin.swift */; };
|
||||
B1D51A6A2F00110000000008 /* ExternalDisplayManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = B1D51A6A2F00110000000007 /* ExternalDisplayManager.swift */; };
|
||||
78A318202AECB46A00862997 /* FlutterGeneratedPluginSwiftPackage in Frameworks */ = {isa = PBXBuildFile; productRef = 78A3181F2AECB46A00862997 /* FlutterGeneratedPluginSwiftPackage */; };
|
||||
/* End PBXBuildFile section */
|
||||
@@ -75,6 +78,9 @@
|
||||
97C147021CF9000F007C117D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
|
||||
B1D51A6A2F00110000000002 /* MpvPlayerCoreBase.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; name = MpvPlayerCoreBase.swift; path = ../shared/apple/MpvPlayer/MpvPlayerCoreBase.swift; sourceTree = SOURCE_ROOT; };
|
||||
B1D51A6A2F00110000000006 /* MpvPlayerPluginShared.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; name = MpvPlayerPluginShared.swift; path = ../shared/apple/MpvPlayer/MpvPlayerPluginShared.swift; sourceTree = SOURCE_ROOT; };
|
||||
B1D51A6A2F0011000000000D /* MpvAudioPlayerCore.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; name = MpvAudioPlayerCore.swift; path = ../shared/apple/MpvPlayer/MpvAudioPlayerCore.swift; sourceTree = SOURCE_ROOT; };
|
||||
B1D51A6A2F0011000000000F /* MpvAudioPlayerPlugin.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; name = MpvAudioPlayerPlugin.swift; path = ../shared/apple/MpvPlayer/MpvAudioPlayerPlugin.swift; sourceTree = SOURCE_ROOT; };
|
||||
B1D51A6A2F0011000000000B /* AtmosProbePlugin.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; name = AtmosProbePlugin.swift; path = ../shared/apple/AtmosProbe/AtmosProbePlugin.swift; sourceTree = SOURCE_ROOT; };
|
||||
B1D51A6A2F00110000000007 /* ExternalDisplayManager.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ExternalDisplayManager.swift; sourceTree = "<group>"; };
|
||||
BB346A1D0705AB171F80B11B /* Pods_Runner.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Runner.framework; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
DE48FF2E074644167608B23D /* Pods-Runner.profile.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.profile.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.profile.xcconfig"; sourceTree = "<group>"; };
|
||||
@@ -126,6 +132,9 @@
|
||||
children = (
|
||||
B1D51A6A2F00110000000002 /* MpvPlayerCoreBase.swift */,
|
||||
B1D51A6A2F00110000000006 /* MpvPlayerPluginShared.swift */,
|
||||
B1D51A6A2F0011000000000D /* MpvAudioPlayerCore.swift */,
|
||||
B1D51A6A2F0011000000000F /* MpvAudioPlayerPlugin.swift */,
|
||||
B1D51A6A2F0011000000000B /* AtmosProbePlugin.swift */,
|
||||
B1D51A6A2F00110000000007 /* ExternalDisplayManager.swift */,
|
||||
6A8A46222EDB370C0057B88C /* MpvPlayerCore.swift */,
|
||||
6A8A46232EDB370C0057B88C /* MpvPlayerPlugin.swift */,
|
||||
@@ -417,6 +426,9 @@
|
||||
files = (
|
||||
B1D51A6A2F00110000000001 /* MpvPlayerCoreBase.swift in Sources */,
|
||||
B1D51A6A2F00110000000005 /* MpvPlayerPluginShared.swift in Sources */,
|
||||
B1D51A6A2F0011000000000C /* MpvAudioPlayerCore.swift in Sources */,
|
||||
B1D51A6A2F0011000000000E /* MpvAudioPlayerPlugin.swift in Sources */,
|
||||
B1D51A6A2F0011000000000A /* AtmosProbePlugin.swift in Sources */,
|
||||
B1D51A6A2F00110000000008 /* ExternalDisplayManager.swift in Sources */,
|
||||
6A8A46252EDB370C0057B88C /* MpvPlayerPlugin.swift in Sources */,
|
||||
6A8A46262EDB370C0057B88C /* MpvPlayerCore.swift in Sources */,
|
||||
@@ -715,6 +727,7 @@
|
||||
MARKETING_VERSION = 1.0.0;
|
||||
PRODUCT_BUNDLE_IDENTIFIER = com.edde746.plezy;
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG;
|
||||
SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
|
||||
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
|
||||
SWIFT_VERSION = 5.0;
|
||||
@@ -789,7 +802,7 @@
|
||||
repositoryURL = "https://github.com/edde746/MPVKit";
|
||||
requirement = {
|
||||
kind = exactVersion;
|
||||
version = 1.0.6;
|
||||
version = 1.0.12;
|
||||
};
|
||||
};
|
||||
/* End XCRemoteSwiftPackageReference section */
|
||||
|
||||
@@ -40,8 +40,8 @@
|
||||
"kind" : "remoteSourceControl",
|
||||
"location" : "https://github.com/edde746/MPVKit",
|
||||
"state" : {
|
||||
"revision" : "bed69a1cd381934c987376db1ed30b8c4725ae0c",
|
||||
"version" : "1.0.6"
|
||||
"revision" : "a453d675493a8abe26dc90f9dc484bc582628358",
|
||||
"version" : "1.0.12"
|
||||
}
|
||||
},
|
||||
{
|
||||
@@ -58,8 +58,8 @@
|
||||
"kind" : "remoteSourceControl",
|
||||
"location" : "https://github.com/getsentry/sentry-cocoa",
|
||||
"state" : {
|
||||
"revision" : "16cd512711375fa73f25ae5e373f596bdf4251ae",
|
||||
"version" : "8.58.0"
|
||||
"revision" : "dad229c665bfd043c5d80ac7aa77717cbd19a1c3",
|
||||
"version" : "8.58.3"
|
||||
}
|
||||
},
|
||||
{
|
||||
|
||||
@@ -40,8 +40,8 @@
|
||||
"kind" : "remoteSourceControl",
|
||||
"location" : "https://github.com/edde746/MPVKit",
|
||||
"state" : {
|
||||
"revision" : "bed69a1cd381934c987376db1ed30b8c4725ae0c",
|
||||
"version" : "1.0.6"
|
||||
"revision" : "a453d675493a8abe26dc90f9dc484bc582628358",
|
||||
"version" : "1.0.12"
|
||||
}
|
||||
},
|
||||
{
|
||||
|
||||
@@ -14,11 +14,12 @@ import MediaPlayer
|
||||
_ application: UIApplication,
|
||||
didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?
|
||||
) -> Bool {
|
||||
// Configure audio session for media playback
|
||||
// Configure audio session for media playback. Not activated here: the
|
||||
// session is non-mixing, so activation stops other apps' audio — it is
|
||||
// claimed when playback actually starts.
|
||||
do {
|
||||
let session = AVAudioSession.sharedInstance()
|
||||
try session.setCategory(.playback, mode: .default)
|
||||
try session.setActive(true)
|
||||
} catch {
|
||||
print("Failed to configure audio session: \(error)")
|
||||
}
|
||||
@@ -36,6 +37,15 @@ import MediaPlayer
|
||||
MpvPlayerPlugin.register(with: registrar)
|
||||
}
|
||||
|
||||
// Register the audio-only MPV player plugin (music playback)
|
||||
if let registrar = engineBridge.pluginRegistry.registrar(forPlugin: "MpvAudioPlayerPlugin") {
|
||||
MpvAudioPlayerPlugin.register(with: registrar)
|
||||
}
|
||||
|
||||
if let registrar = engineBridge.pluginRegistry.registrar(forPlugin: "AtmosProbePlugin") {
|
||||
AtmosProbePlugin.register(with: registrar)
|
||||
}
|
||||
|
||||
if let registrar = engineBridge.pluginRegistry.registrar(forPlugin: "DeviceAdjustmentChannel") {
|
||||
registerDeviceAdjustmentChannel(messenger: registrar.messenger())
|
||||
}
|
||||
|
||||
@@ -1,12 +0,0 @@
|
||||
import Flutter
|
||||
import UIKit
|
||||
import XCTest
|
||||
|
||||
class RunnerTests: XCTestCase {
|
||||
|
||||
func testExample() {
|
||||
// If you add code to the Runner application, consider adding tests here.
|
||||
// See https://developer.apple.com/documentation/xctest for more information about using XCTest.
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import '../media/media_backend.dart';
|
||||
import '../models/plex/plex_home_user.dart';
|
||||
import '../services/plex_auth_service.dart';
|
||||
import '../utils/url_utils.dart';
|
||||
|
||||
/// Identifier of a backend kind a [Connection] points at. Lighter-weight than
|
||||
/// [MediaBackend] for places that only care about persistence/auth shape
|
||||
@@ -233,7 +234,7 @@ class JellyfinConnection extends Connection {
|
||||
|
||||
JellyfinConnection({
|
||||
required this.id,
|
||||
required this.baseUrl,
|
||||
required String baseUrl,
|
||||
List<String>? baseUrls,
|
||||
required this.serverName,
|
||||
required this.serverMachineId,
|
||||
@@ -245,7 +246,8 @@ class JellyfinConnection extends Connection {
|
||||
this.status = ConnectionStatus.unknown,
|
||||
required this.createdAt,
|
||||
this.lastAuthenticatedAt,
|
||||
}) : baseUrls = _normalizeBaseUrls(baseUrl, baseUrls);
|
||||
}) : baseUrl = canonicalizeBaseUrl(baseUrl),
|
||||
baseUrls = _normalizeBaseUrls(baseUrl, baseUrls);
|
||||
|
||||
@override
|
||||
ConnectionKind get kind => ConnectionKind.jellyfin;
|
||||
@@ -273,9 +275,9 @@ class JellyfinConnection extends Connection {
|
||||
final seen = <String>{};
|
||||
|
||||
void add(String url) {
|
||||
final trimmed = url.trim();
|
||||
if (trimmed.isEmpty || !seen.add(trimmed)) return;
|
||||
result.add(trimmed);
|
||||
final normalized = canonicalizeBaseUrl(url);
|
||||
if (normalized.isEmpty || !seen.add(normalized)) return;
|
||||
result.add(normalized);
|
||||
}
|
||||
|
||||
add(activeBaseUrl);
|
||||
|
||||
@@ -3,6 +3,7 @@ import 'dart:convert';
|
||||
import '../models/plex/plex_home.dart';
|
||||
import '../models/plex/plex_home_user.dart';
|
||||
import '../profiles/profile.dart';
|
||||
import '../profiles/plex_home_cache_codec.dart';
|
||||
import '../profiles/profile_registry.dart';
|
||||
import '../services/plex_auth_service.dart';
|
||||
import '../services/server_registry.dart';
|
||||
@@ -225,9 +226,7 @@ class ConnectionBootstrap {
|
||||
final raw = storage.getPlexHomeUsersCacheJson(connectionId);
|
||||
if (raw == null || raw.isEmpty) return null;
|
||||
try {
|
||||
final decoded = jsonDecode(raw);
|
||||
if (decoded is! List) return null;
|
||||
return decoded.whereType<Map<String, dynamic>>().map(PlexHomeUser.fromJson).toList();
|
||||
return decodePlexHomeUsersCache(raw);
|
||||
} catch (e, st) {
|
||||
appLogger.w('Migration: failed to read Plex Home cache for $connectionId', error: e, stackTrace: st);
|
||||
return null;
|
||||
@@ -238,7 +237,7 @@ class ConnectionBootstrap {
|
||||
try {
|
||||
final users = await _plexHomeUserFetcher(account.accountToken);
|
||||
if (users.isNotEmpty) {
|
||||
await storage.savePlexHomeUsersCache(account.id, users.map((u) => u.toJson()).toList());
|
||||
await storage.savePlexHomeUsersCache(account.id, encodePlexHomeUsersCache(users));
|
||||
appLogger.i('Migration: fetched ${users.length} Plex Home users for ${account.id}');
|
||||
}
|
||||
return users;
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
import 'dart:async';
|
||||
import 'dart:convert';
|
||||
|
||||
import 'package:collection/collection.dart';
|
||||
import 'package:drift/drift.dart';
|
||||
|
||||
import '../database/app_database.dart';
|
||||
@@ -41,17 +40,6 @@ class ConnectionRegistry {
|
||||
return _rowToConnection(row);
|
||||
}
|
||||
|
||||
/// Returns the user's preferred connection — either the row marked
|
||||
/// [Connections.isDefault], or the only row if exactly one exists, or
|
||||
/// null when no connections are stored.
|
||||
Future<Connection?> getDefault() async {
|
||||
final rows = await _db.select(_db.connections).get();
|
||||
if (rows.isEmpty) return null;
|
||||
final flagged = rows.firstWhereOrNull((r) => r.isDefault);
|
||||
final picked = flagged ?? (rows.length == 1 ? rows.single : null);
|
||||
return picked == null ? null : _rowToConnection(picked);
|
||||
}
|
||||
|
||||
/// Insert or replace [connection]. If this is the first stored connection
|
||||
/// it is automatically marked default; re-upserting an existing row keeps
|
||||
/// the row's current `isDefault` (so token/metadata refreshes don't clear
|
||||
@@ -130,13 +118,6 @@ class ConnectionRegistry {
|
||||
return all.whereType<PlexAccountConnection>().toList();
|
||||
}
|
||||
|
||||
/// All Jellyfin connections in insertion order. Symmetric helper to
|
||||
/// [listPlexAccounts].
|
||||
Future<List<JellyfinConnection>> listJellyfin() async {
|
||||
final all = await list();
|
||||
return all.whereType<JellyfinConnection>().toList();
|
||||
}
|
||||
|
||||
/// Lookup a [PlexAccountConnection] by id. Returns `null` if no row
|
||||
/// matches OR the row exists but isn't a Plex account.
|
||||
Future<PlexAccountConnection?> getPlexAccount(String id) async {
|
||||
@@ -144,13 +125,6 @@ class ConnectionRegistry {
|
||||
return c is PlexAccountConnection ? c : null;
|
||||
}
|
||||
|
||||
/// Lookup a [JellyfinConnection] by id. Returns `null` if no row matches
|
||||
/// OR the row exists but isn't a Jellyfin connection.
|
||||
Future<JellyfinConnection?> getJellyfin(String id) async {
|
||||
final c = await get(id);
|
||||
return c is JellyfinConnection ? c : null;
|
||||
}
|
||||
|
||||
Future<Connection?> _rowToConnection(ConnectionRow row) async {
|
||||
try {
|
||||
final json = jsonDecode(row.configJson) as Map<String, dynamic>;
|
||||
|
||||
@@ -0,0 +1,124 @@
|
||||
import '../profiles/plex_home_service.dart';
|
||||
import '../profiles/profile_connection_registry.dart';
|
||||
import '../services/plex_auth_service.dart';
|
||||
import '../services/storage_service.dart';
|
||||
import '../utils/app_logger.dart';
|
||||
import 'connection.dart';
|
||||
import 'connection_registry.dart';
|
||||
|
||||
/// Outcome of [registerPlexAccountFromToken]. [homeUsersFetched] is false
|
||||
/// when the `/home/users` fetch failed — first-sign-in flows can't build
|
||||
/// any profile without it and must not conflate that with "no users".
|
||||
/// [existedBefore] tells add-flows whether a cancelled attach should
|
||||
/// remove the account again (it was created solely for the attach).
|
||||
typedef PlexAccountRegistration = ({
|
||||
PlexAccountConnection connection,
|
||||
bool homeUsersFetched,
|
||||
bool existedBefore,
|
||||
String username,
|
||||
String email,
|
||||
});
|
||||
|
||||
/// Shared post-auth pipeline for a fresh plex.tv [token]: resolve the
|
||||
/// account identity, persist the [PlexAccountConnection] (folding in a
|
||||
/// legacy client-id-keyed row from an earlier failed identity lookup), and
|
||||
/// refresh its Plex Home users. Used by the first-sign-in AuthScreen and
|
||||
/// the add-account settings flow so identity/dedup policy can't drift.
|
||||
Future<PlexAccountRegistration> registerPlexAccountFromToken({
|
||||
required String token,
|
||||
required ConnectionRegistry connections,
|
||||
required ProfileConnectionRegistry profileConnections,
|
||||
required StorageService storage,
|
||||
required PlexHomeService plexHome,
|
||||
}) async {
|
||||
final auth = await PlexAuthService.create();
|
||||
try {
|
||||
// Account identity from plex.tv — the uuid is what makes multi-account
|
||||
// work (the clientIdentifier is per-device and identical for every Plex
|
||||
// account on this install). Falls back to the client identifier only
|
||||
// when the user-info call fails outright; a later successful sign-in
|
||||
// migrates that legacy row below.
|
||||
String username = '';
|
||||
String email = '';
|
||||
String accountUuid = '';
|
||||
try {
|
||||
final info = await auth.getUserInfo(token);
|
||||
username = (info['username'] as String?) ?? '';
|
||||
email = (info['email'] as String?) ?? '';
|
||||
accountUuid = (info['uuid'] as String?)?.trim() ?? '';
|
||||
} catch (e) {
|
||||
appLogger.d('getUserInfo after Plex sign-in failed (using fallback identity): $e');
|
||||
}
|
||||
|
||||
final servers = await auth.fetchServers(token);
|
||||
final connection = PlexAccountConnection(
|
||||
id: 'plex.${accountUuid.isNotEmpty ? accountUuid : auth.clientIdentifier}',
|
||||
accountToken: token,
|
||||
clientIdentifier: auth.clientIdentifier,
|
||||
accountLabel: username.isNotEmpty ? username : (email.isNotEmpty ? email : 'Plex'),
|
||||
servers: servers,
|
||||
createdAt: DateTime.now(),
|
||||
lastAuthenticatedAt: DateTime.now(),
|
||||
);
|
||||
final legacyId = 'plex.${auth.clientIdentifier}';
|
||||
final existedBefore =
|
||||
await connections.get(connection.id) != null ||
|
||||
(accountUuid.isNotEmpty &&
|
||||
legacyId != connection.id &&
|
||||
await connections.get(legacyId) is PlexAccountConnection);
|
||||
await connections.upsert(connection);
|
||||
|
||||
if (accountUuid.isNotEmpty) {
|
||||
await _migrateLegacyClientIdRow(
|
||||
replacement: connection,
|
||||
clientIdentifier: auth.clientIdentifier,
|
||||
connections: connections,
|
||||
profileConnections: profileConnections,
|
||||
storage: storage,
|
||||
);
|
||||
}
|
||||
|
||||
// Fetch home users now so pickers surface the account's virtual
|
||||
// profiles immediately.
|
||||
final homeUsersFetched = await plexHome.refresh(connection);
|
||||
return (
|
||||
connection: connection,
|
||||
homeUsersFetched: homeUsersFetched,
|
||||
existedBefore: existedBefore,
|
||||
username: username,
|
||||
email: email,
|
||||
);
|
||||
} finally {
|
||||
auth.dispose();
|
||||
}
|
||||
}
|
||||
|
||||
/// A row keyed by the per-device client identifier (created when an earlier
|
||||
/// sign-in couldn't resolve the account uuid) would duplicate the account —
|
||||
/// and collides with every other account on this device. Fold it into the
|
||||
/// uuid-keyed [replacement]: re-point its join rows, then remove it.
|
||||
///
|
||||
/// Virtual profile ids that embedded the legacy account id are not
|
||||
/// rewritten; their (rare) borrowed rows become orphans that the startup
|
||||
/// prune and post-removal settle already clean up.
|
||||
Future<void> _migrateLegacyClientIdRow({
|
||||
required PlexAccountConnection replacement,
|
||||
required String clientIdentifier,
|
||||
required ConnectionRegistry connections,
|
||||
required ProfileConnectionRegistry profileConnections,
|
||||
required StorageService storage,
|
||||
}) async {
|
||||
final legacyId = 'plex.$clientIdentifier';
|
||||
if (legacyId == replacement.id) return;
|
||||
final legacy = await connections.get(legacyId);
|
||||
if (legacy is! PlexAccountConnection) return;
|
||||
|
||||
final rows = await profileConnections.listForConnection(legacyId);
|
||||
for (final row in rows) {
|
||||
await profileConnections.upsert(row.copyWith(connectionId: replacement.id));
|
||||
}
|
||||
await storage.clearPlexHomeUsersCache(legacyId);
|
||||
// The FK cascade drops the legacy rows we just re-pointed copies of.
|
||||
await connections.remove(legacyId);
|
||||
appLogger.i('Migrated legacy Plex account row $legacyId → ${replacement.id}');
|
||||
}
|
||||
@@ -277,6 +277,23 @@ class AppDatabase extends _$AppDatabase {
|
||||
.get();
|
||||
}
|
||||
|
||||
SimpleSelectStatement<$OfflineWatchProgressTable, OfflineWatchProgressItem> _watchActionsQuery(
|
||||
Expression<bool> Function($OfflineWatchProgressTable table) matchesKey, {
|
||||
String? profileId,
|
||||
bool filterProfile = false,
|
||||
String? clientScopeId,
|
||||
bool filterClientScope = false,
|
||||
}) {
|
||||
return select(offlineWatchProgress)
|
||||
..where(
|
||||
(t) =>
|
||||
matchesKey(t) &
|
||||
(filterProfile ? _nullableTextPredicate(t.profileId, profileId) : const Constant(true)) &
|
||||
(filterClientScope ? _clientScopePredicate(t.clientScopeId, clientScopeId) : const Constant(true)),
|
||||
)
|
||||
..orderBy([(t) => OrderingTerm.desc(t.updatedAt), (t) => OrderingTerm.desc(t.id)]);
|
||||
}
|
||||
|
||||
/// Get the latest action for a specific item
|
||||
Future<OfflineWatchProgressItem?> getLatestWatchAction(
|
||||
String globalKey, {
|
||||
@@ -285,16 +302,13 @@ class AppDatabase extends _$AppDatabase {
|
||||
String? clientScopeId,
|
||||
bool filterClientScope = false,
|
||||
}) {
|
||||
return (select(offlineWatchProgress)
|
||||
..where(
|
||||
(t) =>
|
||||
t.globalKey.equals(globalKey) &
|
||||
(filterProfile ? _nullableTextPredicate(t.profileId, profileId) : const Constant(true)) &
|
||||
(filterClientScope ? _clientScopePredicate(t.clientScopeId, clientScopeId) : const Constant(true)),
|
||||
)
|
||||
..orderBy([(t) => OrderingTerm.desc(t.updatedAt), (t) => OrderingTerm.desc(t.id)])
|
||||
..limit(1))
|
||||
.getSingleOrNull();
|
||||
return (_watchActionsQuery(
|
||||
(t) => t.globalKey.equals(globalKey),
|
||||
profileId: profileId,
|
||||
filterProfile: filterProfile,
|
||||
clientScopeId: clientScopeId,
|
||||
filterClientScope: filterClientScope,
|
||||
)..limit(1)).getSingleOrNull();
|
||||
}
|
||||
|
||||
Future<List<OfflineWatchProgressItem>> getWatchActionsForKey(
|
||||
@@ -304,15 +318,13 @@ class AppDatabase extends _$AppDatabase {
|
||||
String? clientScopeId,
|
||||
bool filterClientScope = false,
|
||||
}) {
|
||||
return (select(offlineWatchProgress)
|
||||
..where(
|
||||
(t) =>
|
||||
t.globalKey.equals(globalKey) &
|
||||
(filterProfile ? _nullableTextPredicate(t.profileId, profileId) : const Constant(true)) &
|
||||
(filterClientScope ? _clientScopePredicate(t.clientScopeId, clientScopeId) : const Constant(true)),
|
||||
)
|
||||
..orderBy([(t) => OrderingTerm.desc(t.updatedAt), (t) => OrderingTerm.desc(t.id)]))
|
||||
.get();
|
||||
return _watchActionsQuery(
|
||||
(t) => t.globalKey.equals(globalKey),
|
||||
profileId: profileId,
|
||||
filterProfile: filterProfile,
|
||||
clientScopeId: clientScopeId,
|
||||
filterClientScope: filterClientScope,
|
||||
).get();
|
||||
}
|
||||
|
||||
Future<Map<String, List<OfflineWatchProgressItem>>> getWatchActionsForKeys(
|
||||
@@ -322,15 +334,11 @@ class AppDatabase extends _$AppDatabase {
|
||||
Map<String, String?>? clientScopeIdsByGlobalKey,
|
||||
}) async {
|
||||
if (globalKeys.isEmpty) return const {};
|
||||
final rows =
|
||||
await (select(offlineWatchProgress)
|
||||
..where(
|
||||
(t) =>
|
||||
t.globalKey.isIn(globalKeys) &
|
||||
(filterProfile ? _nullableTextPredicate(t.profileId, profileId) : const Constant(true)),
|
||||
)
|
||||
..orderBy([(t) => OrderingTerm.desc(t.updatedAt), (t) => OrderingTerm.desc(t.id)]))
|
||||
.get();
|
||||
final rows = await _watchActionsQuery(
|
||||
(t) => t.globalKey.isIn(globalKeys),
|
||||
profileId: profileId,
|
||||
filterProfile: filterProfile,
|
||||
).get();
|
||||
|
||||
final result = <String, List<OfflineWatchProgressItem>>{};
|
||||
for (final action in rows) {
|
||||
@@ -353,31 +361,13 @@ class AppDatabase extends _$AppDatabase {
|
||||
bool filterProfile = false,
|
||||
Map<String, String?>? clientScopeIdsByGlobalKey,
|
||||
}) async {
|
||||
if (globalKeys.isEmpty) return {};
|
||||
|
||||
// Query all actions for the given keys
|
||||
final allActions =
|
||||
await (select(offlineWatchProgress)
|
||||
..where(
|
||||
(t) =>
|
||||
t.globalKey.isIn(globalKeys) &
|
||||
(filterProfile ? _nullableTextPredicate(t.profileId, profileId) : const Constant(true)),
|
||||
)
|
||||
..orderBy([(t) => OrderingTerm.desc(t.updatedAt), (t) => OrderingTerm.desc(t.id)]))
|
||||
.get();
|
||||
|
||||
// Group by globalKey and take the latest (first due to ordering)
|
||||
final result = <String, OfflineWatchProgressItem>{};
|
||||
for (final action in allActions) {
|
||||
if (clientScopeIdsByGlobalKey != null && clientScopeIdsByGlobalKey.containsKey(action.globalKey)) {
|
||||
final expectedScope = clientScopeIdsByGlobalKey[action.globalKey];
|
||||
if (!_clientScopeValuesMatch(action.clientScopeId, expectedScope)) continue;
|
||||
}
|
||||
// Only keep the first (latest) action for each key
|
||||
result.putIfAbsent(action.globalKey, () => action);
|
||||
}
|
||||
|
||||
return result;
|
||||
final actionsByKey = await getWatchActionsForKeys(
|
||||
globalKeys,
|
||||
profileId: profileId,
|
||||
filterProfile: filterProfile,
|
||||
clientScopeIdsByGlobalKey: clientScopeIdsByGlobalKey,
|
||||
);
|
||||
return {for (final entry in actionsByKey.entries) entry.key: entry.value.first};
|
||||
}
|
||||
|
||||
bool _clientScopeValuesMatch(String? actual, String? expected) {
|
||||
@@ -518,6 +508,11 @@ class AppDatabase extends _$AppDatabase {
|
||||
return delete(offlineWatchProgress).go();
|
||||
}
|
||||
|
||||
/// Drop a removed profile's queued watch actions (profile teardown).
|
||||
Future<void> deleteWatchActionsForProfile(String profileId) async {
|
||||
await (delete(offlineWatchProgress)..where((t) => t.profileId.equals(profileId))).go();
|
||||
}
|
||||
|
||||
Future<List<SyncRuleItem>> getSyncRules({String? profileId}) {
|
||||
final query = select(syncRules);
|
||||
if (profileId != null) {
|
||||
@@ -621,6 +616,16 @@ class AppDatabase extends _$AppDatabase {
|
||||
await (delete(syncRules)..where((t) => t.globalKey.equals(globalKey))).go();
|
||||
}
|
||||
|
||||
/// Drop a removed profile's sync rules (profile teardown).
|
||||
Future<void> deleteSyncRulesForProfile(String profileId) async {
|
||||
await (delete(syncRules)..where((t) => t.profileId.equals(profileId))).go();
|
||||
}
|
||||
|
||||
/// Drop every sync rule (full logout).
|
||||
Future<void> clearAllSyncRules() async {
|
||||
await delete(syncRules).go();
|
||||
}
|
||||
|
||||
/// Get all downloaded media items (for syncing watch states)
|
||||
Future<List<DownloadedMediaItem>> getAllDownloadedMetadata() {
|
||||
return (select(downloadedMedia)..where((t) => t.status.equals(DownloadStatus.completed.index))).get();
|
||||
|
||||
@@ -22,9 +22,8 @@ extension DownloadDatabaseOperations on AppDatabase {
|
||||
await (delete(downloadOwners)..where((t) => t.profileId.equals(profileId) & t.globalKey.equals(globalKey))).go();
|
||||
}
|
||||
|
||||
Future<void> removeDownloadOwnersForProfile(String profileId) async {
|
||||
if (profileId.isEmpty) return;
|
||||
await (delete(downloadOwners)..where((t) => t.profileId.equals(profileId))).go();
|
||||
Future<void> clearAllDownloadOwners() async {
|
||||
await delete(downloadOwners).go();
|
||||
}
|
||||
|
||||
Future<Set<String>> getDownloadOwnerKeysForProfile(String profileId) async {
|
||||
@@ -55,22 +54,32 @@ extension DownloadDatabaseOperations on AppDatabase {
|
||||
final connectionRows = await select(connections).get();
|
||||
final connectionIds = connectionRows.map((row) => row.id).toSet();
|
||||
return candidates
|
||||
.where((row) {
|
||||
if (localProfileIds.contains(row.profileId)) return true;
|
||||
final plexHome = parsePlexHomeProfileId(row.profileId);
|
||||
if (plexHome != null) return connectionIds.contains(plexHome.accountConnectionId);
|
||||
return localProfileIds.isEmpty;
|
||||
})
|
||||
.where((row) => _isValidDownloadOwner(row, localProfileIds: localProfileIds, connectionIds: connectionIds))
|
||||
.toList(growable: false);
|
||||
}
|
||||
|
||||
/// Claim pre-v17 shared download rows for [profileId]. Rows that already
|
||||
/// have any owner are left untouched so later profiles do not inherit them.
|
||||
/// have any valid owner are left untouched so later profiles do not
|
||||
/// inherit them.
|
||||
///
|
||||
/// Runs on every profile switch — validity context is computed once and
|
||||
/// applied in memory instead of the per-download full-table rescan
|
||||
/// `getDownloadOwnerCount` would do.
|
||||
Future<void> adoptLegacyDownloadsForProfile(String profileId) async {
|
||||
if (profileId.isEmpty) return;
|
||||
final rows = await select(downloadedMedia).get();
|
||||
if (rows.isEmpty) return;
|
||||
|
||||
final owners = await select(downloadOwners).get();
|
||||
final localProfileIds = (await select(profiles).get()).map((row) => row.id).toSet();
|
||||
final connectionIds = (await select(connections).get()).map((row) => row.id).toSet();
|
||||
final ownedKeys = <String>{
|
||||
for (final owner in owners)
|
||||
if (_isValidDownloadOwner(owner, localProfileIds: localProfileIds, connectionIds: connectionIds))
|
||||
owner.globalKey,
|
||||
};
|
||||
for (final row in rows) {
|
||||
if (await getDownloadOwnerCount(row.globalKey) == 0) {
|
||||
if (!ownedKeys.contains(row.globalKey)) {
|
||||
await addDownloadOwner(profileId: profileId, globalKey: row.globalKey);
|
||||
}
|
||||
}
|
||||
@@ -238,6 +247,43 @@ extension DownloadDatabaseOperations on AppDatabase {
|
||||
.get();
|
||||
}
|
||||
|
||||
/// Downloaded tracks belonging to an album (parentRatingKey). Mirrors
|
||||
/// [getEpisodesBySeason] but filters on type so an id collision with a
|
||||
/// season key can never mix media kinds.
|
||||
Future<List<DownloadedMediaItem>> getTracksByAlbum(
|
||||
String albumKey, {
|
||||
ServerId? serverId,
|
||||
String? clientScopeId,
|
||||
bool filterClientScope = false,
|
||||
}) {
|
||||
return (select(downloadedMedia)..where(
|
||||
(t) =>
|
||||
t.type.equals('track') &
|
||||
t.parentRatingKey.equals(albumKey) &
|
||||
_optionalServerPredicate(t.serverId, serverIdOrNull(serverId)) &
|
||||
_optionalClientScopePredicate(t.clientScopeId, clientScopeId, filterClientScope: filterClientScope),
|
||||
))
|
||||
.get();
|
||||
}
|
||||
|
||||
/// Downloaded tracks belonging to an artist (grandparentRatingKey). Mirrors
|
||||
/// [getEpisodesByShow] with the same type filter as [getTracksByAlbum].
|
||||
Future<List<DownloadedMediaItem>> getTracksByArtist(
|
||||
String artistKey, {
|
||||
ServerId? serverId,
|
||||
String? clientScopeId,
|
||||
bool filterClientScope = false,
|
||||
}) {
|
||||
return (select(downloadedMedia)..where(
|
||||
(t) =>
|
||||
t.type.equals('track') &
|
||||
t.grandparentRatingKey.equals(artistKey) &
|
||||
_optionalServerPredicate(t.serverId, serverIdOrNull(serverId)) &
|
||||
_optionalClientScopePredicate(t.clientScopeId, clientScopeId, filterClientScope: filterClientScope),
|
||||
))
|
||||
.get();
|
||||
}
|
||||
|
||||
Future<List<DownloadedMediaItem>> getDownloadsByServerId(ServerId serverId) {
|
||||
return (select(downloadedMedia)..where((t) => t.serverId.equals(serverId))).get();
|
||||
}
|
||||
@@ -271,3 +317,14 @@ extension DownloadDatabaseOperations on AppDatabase {
|
||||
return item?.bgTaskId;
|
||||
}
|
||||
}
|
||||
|
||||
bool _isValidDownloadOwner(
|
||||
DownloadOwnerItem owner, {
|
||||
required Set<String> localProfileIds,
|
||||
required Set<String> connectionIds,
|
||||
}) {
|
||||
if (localProfileIds.contains(owner.profileId)) return true;
|
||||
final plexHome = parsePlexHomeProfileId(owner.profileId);
|
||||
if (plexHome != null) return connectionIds.contains(plexHome.accountConnectionId);
|
||||
return localProfileIds.isEmpty;
|
||||
}
|
||||
|
||||
@@ -193,9 +193,9 @@ class ProfileConnections extends Table {
|
||||
// No FK on profile_id: Plex Home profiles are virtual (built by
|
||||
// Profile.virtualPlexHome from PlexHomeService's live cache, never
|
||||
// persisted in `profiles`), so an FK here would reject every join row
|
||||
// they need. The two profile-delete sites clean up join rows manually
|
||||
// via ProfileConnectionRegistry.removeAllForProfile before calling
|
||||
// ProfileRegistry.remove.
|
||||
// they need. Profile deletion instead cleans up join rows explicitly
|
||||
// (removeAllProfileConnectionsAndCleanup in profile_connection_cleanup)
|
||||
// before calling ProfileRegistry.remove.
|
||||
TextColumn get profileId => text()();
|
||||
TextColumn get connectionId => text().references(Connections, #id, onDelete: KeyAction.cascade)();
|
||||
TextColumn get userToken => text().withDefault(const Constant(''))();
|
||||
|
||||
@@ -92,6 +92,12 @@ class MediaServerHttpException extends MediaServerException {
|
||||
type == MediaServerHttpErrorType.connectionError ||
|
||||
type == MediaServerHttpErrorType.receiveTimeout;
|
||||
|
||||
/// Whether the request was aborted client-side (client teardown or an
|
||||
/// explicit abort), as opposed to failing against the server. A cancelled
|
||||
/// fetch says nothing about the server's actual content — callers must not
|
||||
/// treat it as an empty result.
|
||||
bool get isCancellation => type == MediaServerHttpErrorType.cancelled;
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
final parts = <String>[type.name];
|
||||
|
||||
@@ -37,12 +37,17 @@ class CardFocusScope extends InheritedWidget {
|
||||
class CardFocusBorder extends StatelessWidget {
|
||||
const CardFocusBorder({
|
||||
super.key,
|
||||
required this.borderRadius,
|
||||
this.borderRadius = FocusTheme.defaultBorderRadius,
|
||||
this.borderRadii,
|
||||
this.strokeAlign = BorderSide.strokeAlignOutside,
|
||||
required this.child,
|
||||
});
|
||||
|
||||
final double borderRadius;
|
||||
|
||||
/// Per-corner radii; overrides [borderRadius] when set (M3E grouped cards).
|
||||
final BorderRadius? borderRadii;
|
||||
|
||||
final double strokeAlign;
|
||||
final Widget child;
|
||||
|
||||
@@ -58,6 +63,7 @@ class CardFocusBorder extends StatelessWidget {
|
||||
context,
|
||||
isFocused: showFocus,
|
||||
borderRadius: borderRadius,
|
||||
radii: borderRadii,
|
||||
borderStrokeAlign: strokeAlign,
|
||||
),
|
||||
child: child,
|
||||
|
||||
@@ -0,0 +1,61 @@
|
||||
import 'dart:async';
|
||||
|
||||
import 'package:flutter/services.dart';
|
||||
import 'package:flutter/widgets.dart' show KeyEventResult, VoidCallback;
|
||||
|
||||
import 'dpad_navigator.dart';
|
||||
|
||||
/// Tracks the timer and physical key state for a D-pad SELECT long press.
|
||||
///
|
||||
/// Focus loss, context-menu dispatch, and transferred/touch gesture suppression
|
||||
/// stay with the caller because their behavior differs between widgets.
|
||||
class DpadSelectLongPressController {
|
||||
static const defaultDuration = Duration(milliseconds: 500);
|
||||
|
||||
Timer? _timer;
|
||||
bool _isKeyDown = false;
|
||||
|
||||
KeyEventResult handleKeyEvent(
|
||||
KeyEvent event, {
|
||||
Duration duration = defaultDuration,
|
||||
required bool Function() isOwnerActive,
|
||||
required VoidCallback onShortPress,
|
||||
required VoidCallback onLongPress,
|
||||
}) {
|
||||
if (!event.logicalKey.isSelectKey) return KeyEventResult.ignored;
|
||||
|
||||
if (event is KeyDownEvent) {
|
||||
// Some platforms report another down instead of a repeat. Only the
|
||||
// transition from up to down may start (or restart) the timer.
|
||||
if (!_isKeyDown) {
|
||||
_isKeyDown = true;
|
||||
_timer?.cancel();
|
||||
_timer = Timer(duration, () {
|
||||
if (!isOwnerActive() || !_isKeyDown) return;
|
||||
SelectKeyUpSuppressor.suppressSelectUntilKeyUp();
|
||||
onLongPress();
|
||||
});
|
||||
}
|
||||
return KeyEventResult.handled;
|
||||
}
|
||||
|
||||
if (event is KeyRepeatEvent) return KeyEventResult.handled;
|
||||
|
||||
if (event is KeyUpEvent) {
|
||||
final timerWasActive = _timer?.isActive ?? false;
|
||||
_timer?.cancel();
|
||||
if (timerWasActive && _isKeyDown) onShortPress();
|
||||
_isKeyDown = false;
|
||||
return KeyEventResult.handled;
|
||||
}
|
||||
|
||||
return KeyEventResult.ignored;
|
||||
}
|
||||
|
||||
void reset() {
|
||||
_timer?.cancel();
|
||||
_isKeyDown = false;
|
||||
}
|
||||
|
||||
void dispose() => reset();
|
||||
}
|
||||
@@ -24,17 +24,20 @@ class FocusTheme {
|
||||
return Theme.of(context).extension<MonoTokens>()?.fast ?? const Duration(milliseconds: 150);
|
||||
}
|
||||
|
||||
/// [radii] overrides [borderRadius] when per-corner radii are needed
|
||||
/// (M3E grouped cards: large outer / small inner corners).
|
||||
static BoxDecoration focusDecoration(
|
||||
BuildContext context, {
|
||||
required bool isFocused,
|
||||
double borderRadius = defaultBorderRadius,
|
||||
BorderRadius? radii,
|
||||
double borderStrokeAlign = BorderSide.strokeAlignInside,
|
||||
Color? color,
|
||||
}) {
|
||||
final focusColor = color ?? getFocusBorderColor(context);
|
||||
|
||||
return BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(borderRadius),
|
||||
borderRadius: radii ?? BorderRadius.circular(borderRadius),
|
||||
border: Border.all(
|
||||
color: isFocused ? focusColor : Colors.transparent,
|
||||
width: focusBorderWidth,
|
||||
@@ -65,10 +68,32 @@ class FocusTheme {
|
||||
|
||||
/// Build focus decoration with background color instead of border.
|
||||
/// Useful for video controls where it should match the native hover style.
|
||||
static BoxDecoration focusBackgroundDecoration({required bool isFocused, double borderRadius = defaultBorderRadius}) {
|
||||
/// [radii] overrides [borderRadius] when per-corner radii are needed.
|
||||
static BoxDecoration focusBackgroundDecoration({
|
||||
required bool isFocused,
|
||||
double borderRadius = defaultBorderRadius,
|
||||
BorderRadius? radii,
|
||||
}) {
|
||||
return BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(borderRadius),
|
||||
borderRadius: radii ?? BorderRadius.circular(borderRadius),
|
||||
color: isFocused ? Colors.white.withValues(alpha: 0.2) : Colors.transparent,
|
||||
);
|
||||
}
|
||||
|
||||
/// Focus background fill derived from the theme's text color, so it stays
|
||||
/// visible on BOTH light and dark surfaces — the white-based
|
||||
/// [focusBackgroundDecoration] disappears on light ones. This is the mono
|
||||
/// convention used by [TrackRow], the navigation rail, and the music player
|
||||
/// surfaces. Prefer this for any new mono-themed surface.
|
||||
static BoxDecoration textFillFocusDecoration(
|
||||
BuildContext context, {
|
||||
required bool isFocused,
|
||||
double borderRadius = defaultBorderRadius,
|
||||
BorderRadius? radii,
|
||||
}) {
|
||||
return BoxDecoration(
|
||||
borderRadius: radii ?? BorderRadius.circular(borderRadius),
|
||||
color: isFocused ? tokens(context).text.withValues(alpha: 0.12) : Colors.transparent,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,6 +5,7 @@ import '../widgets/clickable_cursor.dart';
|
||||
import 'focus_theme.dart';
|
||||
import 'input_mode_tracker.dart';
|
||||
import 'key_event_utils.dart';
|
||||
import 'owned_focus_node_binding.dart';
|
||||
|
||||
typedef FocusableActionBuilder = Widget Function(BuildContext context, FocusableActionBuildState state);
|
||||
|
||||
@@ -28,6 +29,7 @@ class FocusableAction {
|
||||
final IconData icon;
|
||||
final Color? iconColor;
|
||||
final double iconFill;
|
||||
final double iconSize;
|
||||
|
||||
final String? debugLabel;
|
||||
final FocusNode? focusNode;
|
||||
@@ -42,6 +44,7 @@ class FocusableAction {
|
||||
this.icon = Icons.circle,
|
||||
this.iconColor,
|
||||
this.iconFill = 1.0,
|
||||
this.iconSize = 24,
|
||||
this.debugLabel,
|
||||
this.focusNode,
|
||||
this.autofocus = false,
|
||||
@@ -94,9 +97,8 @@ class FocusableActionBar extends StatefulWidget {
|
||||
}
|
||||
|
||||
class FocusableActionBarState extends State<FocusableActionBar> {
|
||||
late List<OwnedFocusNodeBinding> _focusBindings;
|
||||
late List<FocusNode> _focusNodes;
|
||||
late List<bool> _ownsFocusNodes;
|
||||
late List<VoidCallback> _focusListeners;
|
||||
late List<bool> _focusStates;
|
||||
bool _hasAnyFocus = false;
|
||||
|
||||
@@ -131,27 +133,28 @@ class FocusableActionBarState extends State<FocusableActionBar> {
|
||||
}
|
||||
|
||||
void _initNodes() {
|
||||
_focusNodes = List.generate(
|
||||
widget.actions.length,
|
||||
(i) => widget.actions[i].focusNode ?? FocusNode(debugLabel: widget.actions[i].debugLabel ?? 'ActionBar[$i]'),
|
||||
);
|
||||
_ownsFocusNodes = List.generate(widget.actions.length, (i) => widget.actions[i].focusNode == null);
|
||||
_focusListeners = [];
|
||||
_focusStates = List.generate(widget.actions.length, (i) => _focusNodes[i].hasFocus);
|
||||
_hasAnyFocus = _focusNodes.any((node) => node.hasFocus);
|
||||
for (var i = 0; i < _focusNodes.length; i++) {
|
||||
final idx = i;
|
||||
void listener() {
|
||||
final hasFocus = _focusNodes[idx].hasFocus;
|
||||
if (_focusStates[idx] != hasFocus) {
|
||||
setState(() => _focusStates[idx] = hasFocus);
|
||||
}
|
||||
_notifyRowFocusIfChanged();
|
||||
}
|
||||
|
||||
_focusListeners.add(listener);
|
||||
_focusNodes[i].addListener(listener);
|
||||
_focusBindings = [];
|
||||
_focusNodes = [];
|
||||
_focusStates = List<bool>.filled(widget.actions.length, false);
|
||||
for (var i = 0; i < widget.actions.length; i++) {
|
||||
final index = i;
|
||||
final binding = OwnedFocusNodeBinding();
|
||||
binding.bind(
|
||||
externalNode: widget.actions[i].focusNode,
|
||||
debugLabel: widget.actions[i].debugLabel ?? 'ActionBar[$i]',
|
||||
listener: () {
|
||||
final hasFocus = _focusNodes[index].hasFocus;
|
||||
if (_focusStates[index] != hasFocus) {
|
||||
setState(() => _focusStates[index] = hasFocus);
|
||||
}
|
||||
_notifyRowFocusIfChanged();
|
||||
},
|
||||
);
|
||||
_focusBindings.add(binding);
|
||||
_focusNodes.add(binding.node);
|
||||
_focusStates[i] = binding.node.hasFocus;
|
||||
}
|
||||
_hasAnyFocus = _focusNodes.any((node) => node.hasFocus);
|
||||
}
|
||||
|
||||
void _notifyRowFocusIfChanged() {
|
||||
@@ -162,11 +165,8 @@ class FocusableActionBarState extends State<FocusableActionBar> {
|
||||
}
|
||||
|
||||
void _disposeNodes() {
|
||||
for (var i = 0; i < _focusNodes.length; i++) {
|
||||
_focusNodes[i].removeListener(_focusListeners[i]);
|
||||
if (_ownsFocusNodes[i]) {
|
||||
_focusNodes[i].dispose();
|
||||
}
|
||||
for (final binding in _focusBindings) {
|
||||
binding.dispose();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -181,7 +181,7 @@ class FocusableActionBarState extends State<FocusableActionBar> {
|
||||
final isKeyboard = InputModeTracker.isKeyboardMode(context);
|
||||
final duration = FocusTheme.getAnimationDuration(context);
|
||||
|
||||
return Row(
|
||||
final row = Row(
|
||||
mainAxisSize: widget.mainAxisSize,
|
||||
children: [
|
||||
for (var i = 0; i < widget.actions.length; i++) ...[
|
||||
@@ -190,13 +190,20 @@ class FocusableActionBarState extends State<FocusableActionBar> {
|
||||
],
|
||||
],
|
||||
);
|
||||
// While focus is outside the row (the common state — the user is browsing
|
||||
// content), every button is equally dimmed, so dim once at row level:
|
||||
// each sub-1.0 opacity is its own saveLayer, i.e. a full render-pass
|
||||
// switch on the tiled GPUs low-end TVs use, and these bars sit on screen
|
||||
// permanently. Per-button dims (below) take over only while the row holds
|
||||
// focus; mid-transition the two multiply, which stays visually seamless.
|
||||
return AnimatedOpacity(opacity: isKeyboard && !_hasAnyFocus ? 0.6 : 1.0, duration: duration, child: row);
|
||||
}
|
||||
|
||||
Widget _buildButton(int index, bool isKeyboard, Duration duration) {
|
||||
final action = widget.actions[index];
|
||||
final isFocused = _focusStates[index];
|
||||
final showFocus = isFocused && isKeyboard;
|
||||
final opacity = isKeyboard && !isFocused ? 0.6 : 1.0;
|
||||
final opacity = isKeyboard && _hasAnyFocus && !isFocused ? 0.6 : 1.0;
|
||||
|
||||
final buildState = FocusableActionBuildState(
|
||||
focusNode: _focusNodes[index],
|
||||
@@ -241,7 +248,7 @@ class FocusableActionBarState extends State<FocusableActionBar> {
|
||||
child:
|
||||
action.child ??
|
||||
IconButton(
|
||||
icon: AppIcon(action.icon, fill: action.iconFill, color: action.iconColor),
|
||||
icon: AppIcon(action.icon, size: action.iconSize, fill: action.iconFill, color: action.iconColor),
|
||||
tooltip: action.tooltip,
|
||||
onPressed: action.onPressed,
|
||||
),
|
||||
|
||||
@@ -1,9 +1,10 @@
|
||||
import 'dart:async';
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
|
||||
import '../utils/scroll_utils.dart';
|
||||
import 'owned_focus_node_binding.dart';
|
||||
import 'dpad_navigator.dart';
|
||||
import 'dpad_select_long_press_controller.dart';
|
||||
import 'key_event_utils.dart';
|
||||
|
||||
class ChipKeyCallbacks {
|
||||
@@ -44,10 +45,9 @@ class ChipKeyCallbacks {
|
||||
/// 6. Call [disposeFocusNode] in your `dispose`
|
||||
/// 7. Use [focusNode] and [isFocused] in your build method
|
||||
mixin FocusableChipStateMixin<T extends StatefulWidget> on State<T> {
|
||||
FocusNode? _internalFocusNode;
|
||||
final _focusNodeBinding = OwnedFocusNodeBinding();
|
||||
bool _isFocused = false;
|
||||
Timer? _longPressTimer;
|
||||
bool _isSelectKeyDown = false;
|
||||
final _selectLongPress = DpadSelectLongPressController();
|
||||
|
||||
/// Override to return the widget's optional external focus node.
|
||||
FocusNode? get widgetFocusNode;
|
||||
@@ -56,36 +56,40 @@ mixin FocusableChipStateMixin<T extends StatefulWidget> on State<T> {
|
||||
String get debugLabel;
|
||||
|
||||
/// The active focus node (external if provided, otherwise internal).
|
||||
FocusNode get focusNode {
|
||||
return widgetFocusNode ?? (_internalFocusNode ??= FocusNode(debugLabel: debugLabel));
|
||||
}
|
||||
FocusNode get focusNode => _focusNodeBinding.node;
|
||||
|
||||
/// Whether this widget is currently focused.
|
||||
bool get isFocused => _isFocused;
|
||||
|
||||
/// Call this in your `initState` to set up the focus listener.
|
||||
void initFocusNode() {
|
||||
focusNode.addListener(_onFocusChange);
|
||||
_focusNodeBinding.bind(externalNode: widgetFocusNode, listener: _onFocusChange, debugLabel: debugLabel);
|
||||
}
|
||||
|
||||
/// Call this in your `didUpdateWidget` with the old widget's focusNode.
|
||||
void updateFocusNode(FocusNode? oldFocusNode) {
|
||||
if (oldFocusNode != widgetFocusNode) {
|
||||
oldFocusNode?.removeListener(_onFocusChange);
|
||||
focusNode.addListener(_onFocusChange);
|
||||
_focusNodeBinding.bind(externalNode: widgetFocusNode, listener: _onFocusChange, debugLabel: debugLabel);
|
||||
}
|
||||
}
|
||||
|
||||
/// Call this in your `dispose` to clean up the focus listener.
|
||||
void disposeFocusNode() {
|
||||
focusNode.removeListener(_onFocusChange);
|
||||
_internalFocusNode?.dispose();
|
||||
_longPressTimer?.cancel();
|
||||
_focusNodeBinding.dispose();
|
||||
_selectLongPress.dispose();
|
||||
}
|
||||
|
||||
void _onFocusChange() {
|
||||
if (mounted) {
|
||||
setState(() => _isFocused = focusNode.hasFocus);
|
||||
final hasFocus = focusNode.hasFocus;
|
||||
setState(() => _isFocused = hasFocus);
|
||||
if (!hasFocus) {
|
||||
_selectLongPress.reset();
|
||||
}
|
||||
// Same convention as FocusableTileStateMixin: a chip inside a
|
||||
// scrollable strip (TabChipStrip, filter bars) reveals itself on
|
||||
// focus; a no-op when no ancestor scrollable exists.
|
||||
if (focusNode.hasFocus) scrollContextToCenter(context);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -109,35 +113,21 @@ mixin FocusableChipStateMixin<T extends StatefulWidget> on State<T> {
|
||||
}
|
||||
|
||||
if (SelectKeyUpSuppressor.consumeIfSuppressed(event)) {
|
||||
if (event is KeyUpEvent && key.isSelectKey) {
|
||||
_selectLongPress.reset();
|
||||
}
|
||||
return KeyEventResult.handled;
|
||||
}
|
||||
|
||||
// SELECT key with long press support
|
||||
if (key.isSelectKey) {
|
||||
if (callbacks.onLongPress != null) {
|
||||
if (event is KeyDownEvent) {
|
||||
if (!_isSelectKeyDown) {
|
||||
_isSelectKeyDown = true;
|
||||
_longPressTimer?.cancel();
|
||||
_longPressTimer = Timer(const Duration(milliseconds: 500), () {
|
||||
if (mounted) {
|
||||
SelectKeyUpSuppressor.suppressSelectUntilKeyUp();
|
||||
callbacks.onLongPress?.call();
|
||||
}
|
||||
});
|
||||
}
|
||||
return KeyEventResult.handled;
|
||||
} else if (event is KeyRepeatEvent) {
|
||||
return KeyEventResult.handled;
|
||||
} else if (event is KeyUpEvent) {
|
||||
final timerWasActive = _longPressTimer?.isActive ?? false;
|
||||
_longPressTimer?.cancel();
|
||||
if (timerWasActive && _isSelectKeyDown) {
|
||||
callbacks.onSelect?.call();
|
||||
}
|
||||
_isSelectKeyDown = false;
|
||||
return KeyEventResult.handled;
|
||||
}
|
||||
return _selectLongPress.handleKeyEvent(
|
||||
event,
|
||||
isOwnerActive: () => mounted,
|
||||
onShortPress: () => callbacks.onSelect?.call(),
|
||||
onLongPress: callbacks.onLongPress!,
|
||||
);
|
||||
} else if (callbacks.onSelect != null) {
|
||||
return handleOneShotSelect(event, callbacks.onSelect!);
|
||||
}
|
||||
@@ -145,7 +135,7 @@ mixin FocusableChipStateMixin<T extends StatefulWidget> on State<T> {
|
||||
|
||||
// Context menu key triggers long press directly
|
||||
if (event.isActionable && key.isContextMenuKey && callbacks.onLongPress != null) {
|
||||
SelectKeyUpSuppressor.suppressSelectUntilKeyUp();
|
||||
_selectLongPress.reset();
|
||||
callbacks.onLongPress!();
|
||||
return KeyEventResult.handled;
|
||||
}
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
|
||||
import 'dpad_navigator.dart';
|
||||
import 'focusable_wrapper.dart';
|
||||
@@ -10,9 +11,14 @@ class FocusableSlider extends StatefulWidget {
|
||||
final double max;
|
||||
final int? divisions;
|
||||
final ValueChanged<double>? onChanged;
|
||||
final ValueChanged<double>? onChangeStart;
|
||||
final ValueChanged<double>? onChangeEnd;
|
||||
final VoidCallback? onSelect;
|
||||
final FocusNode? focusNode;
|
||||
final bool autofocus;
|
||||
|
||||
final Color? activeColor;
|
||||
final Color? inactiveColor;
|
||||
const FocusableSlider({
|
||||
super.key,
|
||||
required this.value,
|
||||
@@ -20,8 +26,13 @@ class FocusableSlider extends StatefulWidget {
|
||||
this.max = 1.0,
|
||||
this.divisions,
|
||||
this.onChanged,
|
||||
this.onChangeStart,
|
||||
this.onChangeEnd,
|
||||
this.onSelect,
|
||||
this.focusNode,
|
||||
this.autofocus = false,
|
||||
this.activeColor,
|
||||
this.inactiveColor,
|
||||
});
|
||||
|
||||
@override
|
||||
@@ -44,15 +55,22 @@ class _FocusableSliderState extends State<FocusableSlider> {
|
||||
if (event.isActionable && widget.onChanged != null) {
|
||||
final delta = key.isRightKey ? _step : -_step;
|
||||
final newValue = (widget.value + delta).clamp(widget.min, widget.max);
|
||||
widget.onChangeStart?.call(widget.value);
|
||||
widget.onChanged!(newValue);
|
||||
widget.onChangeEnd?.call(newValue);
|
||||
}
|
||||
return KeyEventResult.handled;
|
||||
}
|
||||
if (key.isSelectKey && event is KeyDownEvent && widget.onSelect != null) {
|
||||
widget.onSelect!();
|
||||
return KeyEventResult.handled;
|
||||
}
|
||||
return KeyEventResult.ignored;
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final sliderTheme = SliderTheme.of(context);
|
||||
return FocusableWrapper(
|
||||
focusNode: widget.focusNode,
|
||||
autofocus: widget.autofocus,
|
||||
@@ -62,8 +80,8 @@ class _FocusableSliderState extends State<FocusableSlider> {
|
||||
onFocusChange: (focused) => setState(() => _isFocused = focused),
|
||||
onKeyEvent: _handleKeyEvent,
|
||||
child: SliderTheme(
|
||||
data: SliderTheme.of(context).copyWith(
|
||||
overlayShape: const RoundSliderOverlayShape(overlayRadius: 0),
|
||||
data: sliderTheme.copyWith(
|
||||
overlayShape: sliderTheme.overlayShape ?? const RoundSliderOverlayShape(overlayRadius: 0),
|
||||
thumbSize: WidgetStatePropertyAll(
|
||||
(!InputModeTracker.isKeyboardMode(context) || _isFocused) ? const Size(4, 20) : Size.zero,
|
||||
),
|
||||
@@ -74,6 +92,10 @@ class _FocusableSliderState extends State<FocusableSlider> {
|
||||
max: widget.max,
|
||||
divisions: widget.divisions,
|
||||
onChanged: widget.onChanged,
|
||||
onChangeStart: widget.onChangeStart,
|
||||
onChangeEnd: widget.onChangeEnd,
|
||||
activeColor: widget.activeColor,
|
||||
inactiveColor: widget.inactiveColor,
|
||||
),
|
||||
),
|
||||
);
|
||||
|
||||
@@ -8,6 +8,7 @@ import '../utils/platform_detector.dart';
|
||||
import '../utils/text_input_diagnostics.dart';
|
||||
import '../widgets/tv_virtual_keyboard.dart';
|
||||
import 'dpad_navigator.dart';
|
||||
import 'owned_focus_node_binding.dart';
|
||||
|
||||
bool _usesTvKeyboard(bool enableTvKeyboard) => enableTvKeyboard && PlatformDetector.isTV();
|
||||
|
||||
@@ -26,6 +27,30 @@ enum TvKeyboardAutoOpenBehavior {
|
||||
never,
|
||||
}
|
||||
|
||||
/// Imperative handle to the TV on-screen keyboard of a [FocusableTextField] /
|
||||
/// [FocusableTextFormField]. Pass the same instance to the field's
|
||||
/// `tvKeyboardController`; the field's host attaches itself on mount.
|
||||
///
|
||||
/// Only meaningful on TV. On other platforms the OSK never exists, so every
|
||||
/// method is an effective no-op.
|
||||
class TvKeyboardController {
|
||||
_FocusableTextInputHostState? _host;
|
||||
|
||||
void _attach(_FocusableTextInputHostState host) => _host = host;
|
||||
void _detach(_FocusableTextInputHostState host) {
|
||||
if (identical(_host, host)) _host = null;
|
||||
}
|
||||
|
||||
/// Dismiss the OSK if it is open (and prevent it from auto-reopening while
|
||||
/// the field keeps focus). No-op when nothing is open.
|
||||
void closeKeyboard() => _host?._dismissTvKeyboard();
|
||||
|
||||
/// Focus the field but do NOT open the OSK for this focus entry. Used as a
|
||||
/// fallback landing spot (e.g. a remote search that returned no results) so
|
||||
/// the remote isn't stranded on an off-screen element.
|
||||
void focusInputWithoutKeyboard() => _host?._focusWithoutKeyboard();
|
||||
}
|
||||
|
||||
String _describeTextInputKey(KeyEvent event) {
|
||||
return 'type=${event.runtimeType} logical=${event.logicalKey.keyLabel}/${event.logicalKey.keyId} '
|
||||
'physical=${event.physicalKey.usbHidUsage} deviceType=${event.deviceType} character=${event.character}';
|
||||
@@ -108,20 +133,25 @@ KeyEventResult _handleInputKey({
|
||||
VoidCallback? onNavigateDown,
|
||||
}) {
|
||||
final key = event.logicalKey;
|
||||
final diagnosticsEnabled = TextInputDiagnostics.enabled;
|
||||
KeyEventResult finish(KeyEventResult result, String reason) {
|
||||
_logTvTextInput(
|
||||
'result=$result reason=$reason key=(${_describeTextInputKey(event)}) '
|
||||
'usesTvKeyboard=$usesTvKeyboard enabled=$enabled textLength=${controller.text.length} '
|
||||
'selection=${controller.selection} onNav(up=${onNavigateUp != null},down=${onNavigateDown != null},'
|
||||
'left=${onNavigateLeft != null},right=${onNavigateRight != null}) onSelect=${onSelect != null} onBack=${onBack != null}',
|
||||
);
|
||||
if (diagnosticsEnabled) {
|
||||
_logTvTextInput(
|
||||
'result=$result reason=$reason key=(${_describeTextInputKey(event)}) '
|
||||
'usesTvKeyboard=$usesTvKeyboard enabled=$enabled textLength=${controller.text.length} '
|
||||
'selection=${controller.selection} onNav(up=${onNavigateUp != null},down=${onNavigateDown != null},'
|
||||
'left=${onNavigateLeft != null},right=${onNavigateRight != null}) onSelect=${onSelect != null} onBack=${onBack != null}',
|
||||
);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
_logTvTextInput(
|
||||
'received key=(${_describeTextInputKey(event)}) usesTvKeyboard=$usesTvKeyboard enabled=$enabled '
|
||||
'textLength=${controller.text.length} selection=${controller.selection}',
|
||||
);
|
||||
if (diagnosticsEnabled) {
|
||||
_logTvTextInput(
|
||||
'received key=(${_describeTextInputKey(event)}) usesTvKeyboard=$usesTvKeyboard enabled=$enabled '
|
||||
'textLength=${controller.text.length} selection=${controller.selection}',
|
||||
);
|
||||
}
|
||||
|
||||
if (_shouldPassNativeTvKeyToPlatform(usesTvKeyboard: usesTvKeyboard, enabled: enabled, event: event)) {
|
||||
return finish(KeyEventResult.skipRemainingHandlers, 'pass-native-tv-key-to-platform');
|
||||
@@ -218,10 +248,12 @@ KeyEventResult _handleInputKey({
|
||||
|
||||
bool _shouldPassNativeTvKeyToPlatform({required bool usesTvKeyboard, required bool enabled, required KeyEvent event}) {
|
||||
if (!enabled || usesTvKeyboard || !PlatformDetector.isTV()) {
|
||||
_logTvTextInput(
|
||||
'native-pass=false reason=disabled-or-custom-keyboard enabled=$enabled usesTvKeyboard=$usesTvKeyboard '
|
||||
'isTv=${PlatformDetector.isTV()} key=(${_describeTextInputKey(event)})',
|
||||
);
|
||||
if (TextInputDiagnostics.enabled) {
|
||||
_logTvTextInput(
|
||||
'native-pass=false reason=disabled-or-custom-keyboard enabled=$enabled usesTvKeyboard=$usesTvKeyboard '
|
||||
'isTv=${PlatformDetector.isTV()} key=(${_describeTextInputKey(event)})',
|
||||
);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -231,10 +263,12 @@ bool _shouldPassNativeTvKeyToPlatform({required bool usesTvKeyboard, required bo
|
||||
// native TV navigation cannot rely on deviceType.
|
||||
final key = event.logicalKey;
|
||||
final shouldPass = key.isDpadDirection || key.isBackKey || event.isTvSelectEvent;
|
||||
_logTvTextInput(
|
||||
'native-pass=$shouldPass reason=${shouldPass ? "remote-navigation-key" : "not-navigation-key"} '
|
||||
'key=(${_describeTextInputKey(event)})',
|
||||
);
|
||||
if (TextInputDiagnostics.enabled) {
|
||||
_logTvTextInput(
|
||||
'native-pass=$shouldPass reason=${shouldPass ? "remote-navigation-key" : "not-navigation-key"} '
|
||||
'key=(${_describeTextInputKey(event)})',
|
||||
);
|
||||
}
|
||||
return shouldPass;
|
||||
}
|
||||
|
||||
@@ -365,6 +399,14 @@ void _defaultEditingComplete(TextInputAction? textInputAction) {
|
||||
}
|
||||
}
|
||||
|
||||
({int start, int end}) _normalizedSelectionRange(TextEditingValue value) {
|
||||
final selection = value.selection;
|
||||
if (!selection.isValid) {
|
||||
return (start: value.text.length, end: value.text.length);
|
||||
}
|
||||
return (start: selection.start.clamp(0, value.text.length), end: selection.end.clamp(0, value.text.length));
|
||||
}
|
||||
|
||||
void _insertText({
|
||||
required TextEditingController controller,
|
||||
required String text,
|
||||
@@ -373,13 +415,9 @@ void _insertText({
|
||||
ValueChanged<String>? onChanged,
|
||||
}) {
|
||||
final value = controller.value;
|
||||
final selection = value.selection;
|
||||
final start = selection.isValid
|
||||
? (selection.start < selection.end ? selection.start : selection.end)
|
||||
: value.text.length;
|
||||
final end = selection.isValid
|
||||
? (selection.start > selection.end ? selection.start : selection.end)
|
||||
: value.text.length;
|
||||
final range = _normalizedSelectionRange(value);
|
||||
final start = range.start;
|
||||
final end = range.end;
|
||||
final newText = value.text.replaceRange(start, end, text);
|
||||
_replaceTextValue(
|
||||
controller: controller,
|
||||
@@ -401,13 +439,9 @@ void _backspace({
|
||||
ValueChanged<String>? onChanged,
|
||||
}) {
|
||||
final value = controller.value;
|
||||
final selection = value.selection;
|
||||
final start = selection.isValid
|
||||
? (selection.start < selection.end ? selection.start : selection.end)
|
||||
: value.text.length;
|
||||
final end = selection.isValid
|
||||
? (selection.start > selection.end ? selection.start : selection.end)
|
||||
: value.text.length;
|
||||
final range = _normalizedSelectionRange(value);
|
||||
final start = range.start;
|
||||
final end = range.end;
|
||||
if (start != end) {
|
||||
_replaceTextRange(
|
||||
controller,
|
||||
@@ -437,13 +471,9 @@ void _deleteForward({
|
||||
ValueChanged<String>? onChanged,
|
||||
}) {
|
||||
final value = controller.value;
|
||||
final selection = value.selection;
|
||||
final start = selection.isValid
|
||||
? (selection.start < selection.end ? selection.start : selection.end)
|
||||
: value.text.length;
|
||||
final end = selection.isValid
|
||||
? (selection.start > selection.end ? selection.start : selection.end)
|
||||
: value.text.length;
|
||||
final range = _normalizedSelectionRange(value);
|
||||
final start = range.start;
|
||||
final end = range.end;
|
||||
if (start != end) {
|
||||
_replaceTextRange(
|
||||
controller,
|
||||
@@ -527,6 +557,7 @@ abstract class _FocusableTextInputBase extends StatelessWidget {
|
||||
final bool enabled;
|
||||
final bool enableTvKeyboard;
|
||||
final TvKeyboardAutoOpenBehavior tvKeyboardAutoOpenBehavior;
|
||||
final TvKeyboardController? tvKeyboardController;
|
||||
final bool obscureText;
|
||||
final bool autocorrect;
|
||||
final bool enableSuggestions;
|
||||
@@ -560,6 +591,7 @@ abstract class _FocusableTextInputBase extends StatelessWidget {
|
||||
this.enabled = true,
|
||||
this.enableTvKeyboard = true,
|
||||
this.tvKeyboardAutoOpenBehavior = TvKeyboardAutoOpenBehavior.onFocus,
|
||||
this.tvKeyboardController,
|
||||
this.obscureText = false,
|
||||
this.autocorrect = true,
|
||||
this.enableSuggestions = true,
|
||||
@@ -597,6 +629,23 @@ abstract class _FocusableTextInputBase extends StatelessWidget {
|
||||
}
|
||||
}
|
||||
|
||||
({
|
||||
TextInputType? keyboardType,
|
||||
bool readOnly,
|
||||
bool? showCursor,
|
||||
bool? enableInteractiveSelection,
|
||||
VoidCallback? onTap,
|
||||
})
|
||||
_tvInputConfiguration(bool usesTvKeyboard, VoidCallback openKeyboard) {
|
||||
return (
|
||||
keyboardType: usesTvKeyboard ? TextInputType.none : keyboardType,
|
||||
readOnly: usesTvKeyboard,
|
||||
showCursor: usesTvKeyboard ? true : null,
|
||||
enableInteractiveSelection: usesTvKeyboard ? false : enableInteractiveSelection,
|
||||
onTap: usesTvKeyboard ? openKeyboard : null,
|
||||
);
|
||||
}
|
||||
|
||||
KeyEventResult _handleKey(BuildContext context, FocusNode node, KeyEvent event, VoidCallback openKeyboard) {
|
||||
return _handleInputKey(
|
||||
controller: controller,
|
||||
@@ -623,7 +672,6 @@ abstract class _FocusableTextInputBase extends StatelessWidget {
|
||||
}
|
||||
|
||||
Widget buildFocusableInput(
|
||||
BuildContext context,
|
||||
Widget Function(bool usesTvKeyboard, FocusNode focusNode, VoidCallback openKeyboard) builder,
|
||||
) {
|
||||
return _FocusableTextInputHost(input: this, builder: builder);
|
||||
@@ -641,7 +689,7 @@ class _FocusableTextInputHost extends StatefulWidget {
|
||||
}
|
||||
|
||||
class _FocusableTextInputHostState extends State<_FocusableTextInputHost> {
|
||||
FocusNode? _ownedFocusNode;
|
||||
final OwnedFocusNodeBinding _focusNodeBinding = OwnedFocusNodeBinding();
|
||||
FocusNode? _installedFocusNode;
|
||||
FocusOnKeyEventCallback? _previousOnKeyEvent;
|
||||
late final FocusOnKeyEventCallback _keyHandler = _handleKey;
|
||||
@@ -655,16 +703,27 @@ class _FocusableTextInputHostState extends State<_FocusableTextInputHost> {
|
||||
bool _hasSeenTvKeyboardFocus = false;
|
||||
bool _suppressTvKeyboardForCurrentFocus = false;
|
||||
|
||||
FocusNode get _effectiveFocusNode =>
|
||||
widget.input.focusNode ?? (_ownedFocusNode ??= FocusNode(debugLabel: 'FocusableTextInput'));
|
||||
FocusNode get _effectiveFocusNode => _focusNodeBinding.node;
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
_focusNodeBinding.bind(externalNode: widget.input.focusNode, debugLabel: 'FocusableTextInput');
|
||||
widget.input.tvKeyboardController?._attach(this);
|
||||
}
|
||||
|
||||
@override
|
||||
void didUpdateWidget(_FocusableTextInputHost oldWidget) {
|
||||
super.didUpdateWidget(oldWidget);
|
||||
if (!identical(oldWidget.input.tvKeyboardController, widget.input.tvKeyboardController)) {
|
||||
oldWidget.input.tvKeyboardController?._detach(this);
|
||||
widget.input.tvKeyboardController?._attach(this);
|
||||
}
|
||||
if (oldWidget.input.focusNode != widget.input.focusNode) {
|
||||
// An open keyboard dialog intentionally survives rebuilds and focusNode
|
||||
// swaps; it is closed only when this host unmounts — see dispose.
|
||||
_restoreInstalledHandler();
|
||||
_focusNodeBinding.bind(externalNode: widget.input.focusNode, debugLabel: 'FocusableTextInput');
|
||||
_suppressTvKeyboardAutoOpen = false;
|
||||
_tvKeyboardOpenScheduled = false;
|
||||
_hasSeenTvKeyboardFocus = false;
|
||||
@@ -675,6 +734,7 @@ class _FocusableTextInputHostState extends State<_FocusableTextInputHost> {
|
||||
|
||||
@override
|
||||
void dispose() {
|
||||
widget.input.tvKeyboardController?._detach(this);
|
||||
_restoreInstalledHandler();
|
||||
// The keyboard is a navigator route — it must not outlive the field that
|
||||
// opened it (e.g. a form section swapped out while the keyboard is up).
|
||||
@@ -683,7 +743,7 @@ class _FocusableTextInputHostState extends State<_FocusableTextInputHost> {
|
||||
if (keyboard != null) {
|
||||
WidgetsBinding.instance.addPostFrameCallback((_) => keyboard.close());
|
||||
}
|
||||
_ownedFocusNode?.dispose();
|
||||
_focusNodeBinding.dispose();
|
||||
super.dispose();
|
||||
}
|
||||
|
||||
@@ -694,25 +754,29 @@ class _FocusableTextInputHostState extends State<_FocusableTextInputHost> {
|
||||
|
||||
void _syncNativeTextInputFocus() {
|
||||
final focused = _installedFocusNode?.hasFocus == true && widget.input.enabled && widget.input._usesNativeTvKeyboard;
|
||||
_logTvTextInput(
|
||||
'Host.syncNativeTextInputFocus focused=$focused installed=${_installedFocusNode?.debugLabel} '
|
||||
'hasFocus=${_installedFocusNode?.hasFocus} enabled=${widget.input.enabled} '
|
||||
'usesNativeTvKeyboard=${widget.input._usesNativeTvKeyboard}',
|
||||
);
|
||||
if (TextInputDiagnostics.enabled) {
|
||||
_logTvTextInput(
|
||||
'Host.syncNativeTextInputFocus focused=$focused installed=${_installedFocusNode?.debugLabel} '
|
||||
'hasFocus=${_installedFocusNode?.hasFocus} enabled=${widget.input.enabled} '
|
||||
'usesNativeTvKeyboard=${widget.input._usesNativeTvKeyboard}',
|
||||
);
|
||||
}
|
||||
_setNativeTextInputFocused(focused);
|
||||
}
|
||||
|
||||
void _syncTvKeyboardAutoOpen() {
|
||||
final focused = _installedFocusNode?.hasFocus == true && widget.input.enabled && widget.input._hasTvKeyboard;
|
||||
final visible = _canShowTvKeyboard;
|
||||
_logTvTextInput(
|
||||
'Host.syncTvKeyboardAutoOpen focused=$focused open=$_tvKeyboardOpen scheduled=$_tvKeyboardOpenScheduled '
|
||||
'suppressed=$_suppressTvKeyboardAutoOpen behavior=${widget.input.tvKeyboardAutoOpenBehavior} '
|
||||
'seenFocus=$_hasSeenTvKeyboardFocus suppressCurrent=$_suppressTvKeyboardForCurrentFocus '
|
||||
'installed=${_installedFocusNode?.debugLabel} '
|
||||
'hasFocus=${_installedFocusNode?.hasFocus} enabled=${widget.input.enabled} '
|
||||
'usesTvKeyboard=${widget.input._hasTvKeyboard} visible=$visible',
|
||||
);
|
||||
if (TextInputDiagnostics.enabled) {
|
||||
_logTvTextInput(
|
||||
'Host.syncTvKeyboardAutoOpen focused=$focused open=$_tvKeyboardOpen scheduled=$_tvKeyboardOpenScheduled '
|
||||
'suppressed=$_suppressTvKeyboardAutoOpen behavior=${widget.input.tvKeyboardAutoOpenBehavior} '
|
||||
'seenFocus=$_hasSeenTvKeyboardFocus suppressCurrent=$_suppressTvKeyboardForCurrentFocus '
|
||||
'installed=${_installedFocusNode?.debugLabel} '
|
||||
'hasFocus=${_installedFocusNode?.hasFocus} enabled=${widget.input.enabled} '
|
||||
'usesTvKeyboard=${widget.input._hasTvKeyboard} visible=$visible',
|
||||
);
|
||||
}
|
||||
|
||||
if (!focused) {
|
||||
_suppressTvKeyboardForCurrentFocus = false;
|
||||
@@ -818,6 +882,35 @@ class _FocusableTextInputHostState extends State<_FocusableTextInputHost> {
|
||||
);
|
||||
}
|
||||
|
||||
/// Dismiss an open OSK imperatively (e.g. a companion-remote search that must
|
||||
/// show results instead of the keyboard). Suppresses auto-reopen so a field
|
||||
/// that regains focus when the dialog route pops does not relaunch it.
|
||||
void _dismissTvKeyboard() {
|
||||
// No-op when nothing is up: setting the suppress flag here (with no
|
||||
// compensating unfocus to clear it) would block a later legitimate
|
||||
// auto-open when the user deliberately focuses the field.
|
||||
if (!_tvKeyboardOpen && !_tvKeyboardOpenScheduled) return;
|
||||
_tvKeyboardOpenScheduled = false;
|
||||
_suppressTvKeyboardAutoOpen = true;
|
||||
_tvKeyboardHandle?.close();
|
||||
}
|
||||
|
||||
/// Focus the field without opening the OSK for this focus entry. Suppress is
|
||||
/// set BEFORE requestFocus so the resulting focus-change sync already sees it;
|
||||
/// the flag persists for this focus and resets on the next unfocus. If a
|
||||
/// same-turn focus request supersedes this one, clear the unused suppression
|
||||
/// after Flutter resolves its pending focus change.
|
||||
void _focusWithoutKeyboard() {
|
||||
_suppressTvKeyboardAutoOpen = true;
|
||||
_tvKeyboardOpenScheduled = false;
|
||||
final focusNode = _installedFocusNode ?? _effectiveFocusNode;
|
||||
focusNode.requestFocus();
|
||||
scheduleMicrotask(() {
|
||||
if (!mounted || focusNode.hasFocus || _tvKeyboardOpen || _tvKeyboardOpenScheduled) return;
|
||||
_suppressTvKeyboardAutoOpen = false;
|
||||
});
|
||||
}
|
||||
|
||||
void _setNativeTextInputFocused(bool focused) {
|
||||
if (_reportedNativeTextInputFocused == focused) {
|
||||
_logTvTextInput('Host.setNativeTextInputFocused no-op focused=$focused');
|
||||
@@ -907,6 +1000,7 @@ class FocusableTextField extends _FocusableTextInputBase {
|
||||
super.enabled,
|
||||
super.enableTvKeyboard,
|
||||
super.tvKeyboardAutoOpenBehavior,
|
||||
super.tvKeyboardController,
|
||||
super.obscureText,
|
||||
super.autocorrect,
|
||||
super.enableSuggestions,
|
||||
@@ -925,14 +1019,14 @@ class FocusableTextField extends _FocusableTextInputBase {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return buildFocusableInput(
|
||||
context,
|
||||
(usesTvKeyboard, effectiveFocusNode, openKeyboard) => TextField(
|
||||
return buildFocusableInput((usesTvKeyboard, effectiveFocusNode, openKeyboard) {
|
||||
final tvInput = _tvInputConfiguration(usesTvKeyboard, openKeyboard);
|
||||
return TextField(
|
||||
controller: controller,
|
||||
focusNode: effectiveFocusNode,
|
||||
enabled: enabled,
|
||||
decoration: decoration,
|
||||
keyboardType: usesTvKeyboard ? TextInputType.none : keyboardType,
|
||||
keyboardType: tvInput.keyboardType,
|
||||
textInputAction: textInputAction,
|
||||
inputFormatters: inputFormatters,
|
||||
onChanged: onChanged,
|
||||
@@ -948,12 +1042,12 @@ class FocusableTextField extends _FocusableTextInputBase {
|
||||
textAlign: textAlign,
|
||||
textCapitalization: textCapitalization,
|
||||
style: style,
|
||||
readOnly: usesTvKeyboard,
|
||||
showCursor: usesTvKeyboard ? true : null,
|
||||
enableInteractiveSelection: usesTvKeyboard ? false : enableInteractiveSelection,
|
||||
onTap: usesTvKeyboard ? openKeyboard : null,
|
||||
),
|
||||
);
|
||||
readOnly: tvInput.readOnly,
|
||||
showCursor: tvInput.showCursor,
|
||||
enableInteractiveSelection: tvInput.enableInteractiveSelection,
|
||||
onTap: tvInput.onTap,
|
||||
);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -983,6 +1077,7 @@ class FocusableTextFormField extends _FocusableTextInputBase {
|
||||
super.enabled,
|
||||
super.enableTvKeyboard,
|
||||
super.tvKeyboardAutoOpenBehavior,
|
||||
super.tvKeyboardController,
|
||||
super.obscureText,
|
||||
super.autocorrect,
|
||||
super.enableSuggestions,
|
||||
@@ -1001,14 +1096,14 @@ class FocusableTextFormField extends _FocusableTextInputBase {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return buildFocusableInput(
|
||||
context,
|
||||
(usesTvKeyboard, effectiveFocusNode, openKeyboard) => TextFormField(
|
||||
return buildFocusableInput((usesTvKeyboard, effectiveFocusNode, openKeyboard) {
|
||||
final tvInput = _tvInputConfiguration(usesTvKeyboard, openKeyboard);
|
||||
return TextFormField(
|
||||
controller: controller,
|
||||
focusNode: effectiveFocusNode,
|
||||
enabled: enabled,
|
||||
decoration: decoration,
|
||||
keyboardType: usesTvKeyboard ? TextInputType.none : keyboardType,
|
||||
keyboardType: tvInput.keyboardType,
|
||||
textInputAction: textInputAction,
|
||||
inputFormatters: inputFormatters,
|
||||
onChanged: onChanged,
|
||||
@@ -1027,11 +1122,11 @@ class FocusableTextFormField extends _FocusableTextInputBase {
|
||||
textAlign: textAlign,
|
||||
textCapitalization: textCapitalization,
|
||||
style: style,
|
||||
readOnly: usesTvKeyboard,
|
||||
showCursor: usesTvKeyboard ? true : null,
|
||||
enableInteractiveSelection: usesTvKeyboard ? false : enableInteractiveSelection,
|
||||
onTap: usesTvKeyboard ? openKeyboard : null,
|
||||
),
|
||||
);
|
||||
readOnly: tvInput.readOnly,
|
||||
showCursor: tvInput.showCursor,
|
||||
enableInteractiveSelection: tvInput.enableInteractiveSelection,
|
||||
onTap: tvInput.onTap,
|
||||
);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,42 +1,33 @@
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
import '../utils/scroll_utils.dart';
|
||||
import 'owned_focus_node_binding.dart';
|
||||
|
||||
/// Manages the internal/external FocusNode lifecycle for list-tile widgets and
|
||||
/// auto-scrolls the tile into view when it gains focus.
|
||||
mixin FocusableTileStateMixin<T extends StatefulWidget> on State<T> {
|
||||
late FocusNode _effectiveFocusNode;
|
||||
bool _ownsNode = false;
|
||||
final _focusNodeBinding = OwnedFocusNodeBinding();
|
||||
|
||||
FocusNode? get widgetFocusNode;
|
||||
|
||||
FocusNode get effectiveFocusNode => _effectiveFocusNode;
|
||||
FocusNode get effectiveFocusNode => _focusNodeBinding.node;
|
||||
|
||||
void initFocusNode() {
|
||||
if (widgetFocusNode != null) {
|
||||
_effectiveFocusNode = widgetFocusNode!;
|
||||
_ownsNode = false;
|
||||
} else {
|
||||
_effectiveFocusNode = FocusNode();
|
||||
_ownsNode = true;
|
||||
}
|
||||
_effectiveFocusNode.addListener(_onFocusChange);
|
||||
_focusNodeBinding.bind(externalNode: widgetFocusNode, listener: _onFocusChange);
|
||||
}
|
||||
|
||||
void updateFocusNode(FocusNode? oldFocusNode) {
|
||||
if (oldFocusNode != widgetFocusNode) {
|
||||
disposeFocusNode();
|
||||
initFocusNode();
|
||||
_focusNodeBinding.bind(externalNode: widgetFocusNode, listener: _onFocusChange);
|
||||
}
|
||||
}
|
||||
|
||||
void disposeFocusNode() {
|
||||
_effectiveFocusNode.removeListener(_onFocusChange);
|
||||
if (_ownsNode) _effectiveFocusNode.dispose();
|
||||
_focusNodeBinding.dispose();
|
||||
}
|
||||
|
||||
void _onFocusChange() {
|
||||
if (_effectiveFocusNode.hasFocus) {
|
||||
if (effectiveFocusNode.hasFocus) {
|
||||
scrollContextToCenter(context);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
import 'dart:async';
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
|
||||
@@ -7,9 +5,11 @@ import '../widgets/clickable_cursor.dart';
|
||||
import '../utils/text_input_diagnostics.dart';
|
||||
import 'card_focus_scope.dart';
|
||||
import 'dpad_navigator.dart';
|
||||
import 'dpad_select_long_press_controller.dart';
|
||||
import 'focus_glow_overlay.dart';
|
||||
import 'focus_theme.dart';
|
||||
import 'input_mode_tracker.dart';
|
||||
import 'owned_focus_node_binding.dart';
|
||||
import 'key_event_utils.dart';
|
||||
|
||||
String _describeFocusableKey(KeyEvent event) {
|
||||
@@ -68,6 +68,10 @@ class FocusableWrapper extends StatefulWidget {
|
||||
/// Border radius for the focus indicator.
|
||||
final double borderRadius;
|
||||
|
||||
/// Per-corner radii for the focus indicator; overrides [borderRadius] when
|
||||
/// set (M3E grouped cards: large outer / small inner corners).
|
||||
final BorderRadius? borderRadii;
|
||||
|
||||
/// Whether to scroll the widget into view when focused.
|
||||
final bool autoScroll;
|
||||
|
||||
@@ -138,6 +142,7 @@ class FocusableWrapper extends StatefulWidget {
|
||||
this.autofocus = false,
|
||||
this.focusNode,
|
||||
this.borderRadius = FocusTheme.defaultBorderRadius,
|
||||
this.borderRadii,
|
||||
this.autoScroll = true,
|
||||
this.scrollAlignment = 0.5,
|
||||
this.useComfortableZone = false,
|
||||
@@ -160,48 +165,42 @@ class FocusableWrapper extends StatefulWidget {
|
||||
}
|
||||
|
||||
class _FocusableWrapperState extends State<FocusableWrapper> with SingleTickerProviderStateMixin {
|
||||
late FocusNode _focusNode;
|
||||
bool _ownsNode = false;
|
||||
final OwnedFocusNodeBinding _focusNodeBinding = OwnedFocusNodeBinding();
|
||||
FocusNode get _focusNode => _focusNodeBinding.node;
|
||||
bool _isFocused = false;
|
||||
|
||||
late final AnimationController _animationController;
|
||||
late Animation<double> _scaleAnimation;
|
||||
// Created lazily on first focus/keyboard-mode build: touch scrolling builds
|
||||
// hundreds of these wrappers and must not pay for a Ticker per card.
|
||||
AnimationController? _animationController;
|
||||
Animation<double>? _scaleAnimation;
|
||||
|
||||
// Long-press detection for SELECT key
|
||||
Timer? _longPressTimer;
|
||||
bool _isSelectKeyDown = false;
|
||||
final _selectLongPress = DpadSelectLongPressController();
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
_initFocusNode();
|
||||
_initAnimations();
|
||||
_bindFocusNode();
|
||||
}
|
||||
|
||||
void _initFocusNode() {
|
||||
if (widget.focusNode != null) {
|
||||
_focusNode = widget.focusNode!;
|
||||
_ownsNode = false;
|
||||
} else {
|
||||
_focusNode = FocusNode(
|
||||
debugLabel: widget.semanticLabel ?? 'FocusableWrapper',
|
||||
canRequestFocus: widget.canRequestFocus,
|
||||
);
|
||||
_ownsNode = true;
|
||||
}
|
||||
void _bindFocusNode() {
|
||||
_focusNodeBinding.bind(externalNode: widget.focusNode, debugLabel: widget.semanticLabel ?? 'FocusableWrapper');
|
||||
_focusNode.canRequestFocus = widget.canRequestFocus;
|
||||
}
|
||||
|
||||
void _initAnimations() {
|
||||
_animationController = AnimationController(vsync: this, duration: const Duration(milliseconds: 150));
|
||||
|
||||
_scaleAnimation = _createScaleAnimation();
|
||||
AnimationController _ensureAnimationController() {
|
||||
final existing = _animationController;
|
||||
if (existing != null) return existing;
|
||||
final controller = AnimationController(vsync: this, duration: const Duration(milliseconds: 150));
|
||||
_animationController = controller;
|
||||
_scaleAnimation = _createScaleAnimation(controller);
|
||||
return controller;
|
||||
}
|
||||
|
||||
Animation<double> _createScaleAnimation() {
|
||||
Animation<double> _createScaleAnimation(AnimationController controller) {
|
||||
return Tween<double>(
|
||||
begin: 1.0,
|
||||
end: widget.focusScale,
|
||||
).animate(CurvedAnimation(parent: _animationController, curve: Curves.easeOutCubic));
|
||||
).animate(CurvedAnimation(parent: controller, curve: Curves.easeOutCubic));
|
||||
}
|
||||
|
||||
@override
|
||||
@@ -210,10 +209,7 @@ class _FocusableWrapperState extends State<FocusableWrapper> with SingleTickerPr
|
||||
|
||||
// Handle focusNode changes
|
||||
if (widget.focusNode != oldWidget.focusNode) {
|
||||
if (_ownsNode) {
|
||||
_focusNode.dispose();
|
||||
}
|
||||
_initFocusNode();
|
||||
_bindFocusNode();
|
||||
}
|
||||
|
||||
// Update canRequestFocus
|
||||
@@ -222,17 +218,18 @@ class _FocusableWrapperState extends State<FocusableWrapper> with SingleTickerPr
|
||||
}
|
||||
|
||||
if (widget.focusScale != oldWidget.focusScale) {
|
||||
_scaleAnimation = _createScaleAnimation();
|
||||
final controller = _animationController;
|
||||
if (controller != null) {
|
||||
_scaleAnimation = _createScaleAnimation(controller);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
void dispose() {
|
||||
_longPressTimer?.cancel();
|
||||
_animationController.dispose();
|
||||
if (_ownsNode) {
|
||||
_focusNode.dispose();
|
||||
}
|
||||
_selectLongPress.dispose();
|
||||
_animationController?.dispose();
|
||||
_focusNodeBinding.dispose();
|
||||
super.dispose();
|
||||
}
|
||||
|
||||
@@ -244,15 +241,14 @@ class _FocusableWrapperState extends State<FocusableWrapper> with SingleTickerPr
|
||||
|
||||
// Reset long press state when focus is lost
|
||||
if (!hasFocus) {
|
||||
_longPressTimer?.cancel();
|
||||
_isSelectKeyDown = false;
|
||||
_selectLongPress.reset();
|
||||
}
|
||||
|
||||
// Animate scale
|
||||
if (hasFocus) {
|
||||
_animationController.forward();
|
||||
_ensureAnimationController().forward();
|
||||
} else {
|
||||
_animationController.reverse();
|
||||
_animationController?.reverse();
|
||||
}
|
||||
|
||||
// Auto-scroll into view
|
||||
@@ -351,19 +347,27 @@ class _FocusableWrapperState extends State<FocusableWrapper> with SingleTickerPr
|
||||
|
||||
KeyEventResult _handleKeyEvent(FocusNode node, KeyEvent event) {
|
||||
final key = event.logicalKey;
|
||||
final diagnosticsEnabled = TextInputDiagnostics.enabled;
|
||||
KeyEventResult finish(KeyEventResult result, String reason) {
|
||||
_logFocusableWrapper(
|
||||
'node=${node.debugLabel} result=$result reason=$reason key=(${_describeFocusableKey(event)}) '
|
||||
'onNav(up=${widget.onNavigateUp != null},down=${widget.onNavigateDown != null},'
|
||||
'left=${widget.onNavigateLeft != null},right=${widget.onNavigateRight != null}) '
|
||||
'onSelect=${widget.onSelect != null} onBack=${widget.onBack != null}',
|
||||
);
|
||||
if (diagnosticsEnabled) {
|
||||
_logFocusableWrapper(
|
||||
'node=${node.debugLabel} result=$result reason=$reason key=(${_describeFocusableKey(event)}) '
|
||||
'onNav(up=${widget.onNavigateUp != null},down=${widget.onNavigateDown != null},'
|
||||
'left=${widget.onNavigateLeft != null},right=${widget.onNavigateRight != null}) '
|
||||
'onSelect=${widget.onSelect != null} onBack=${widget.onBack != null}',
|
||||
);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
_logFocusableWrapper('node=${node.debugLabel} received key=(${_describeFocusableKey(event)})');
|
||||
if (diagnosticsEnabled) {
|
||||
_logFocusableWrapper('node=${node.debugLabel} received key=(${_describeFocusableKey(event)})');
|
||||
}
|
||||
|
||||
if (SelectKeyUpSuppressor.consumeIfSuppressed(event)) {
|
||||
if (event is KeyUpEvent && key.isSelectKey) {
|
||||
_selectLongPress.reset();
|
||||
}
|
||||
return finish(KeyEventResult.handled, 'select-key-up-suppressed');
|
||||
}
|
||||
|
||||
@@ -385,33 +389,15 @@ class _FocusableWrapperState extends State<FocusableWrapper> with SingleTickerPr
|
||||
// Handle SELECT key with optional long-press detection
|
||||
if (key.isSelectKey) {
|
||||
if (widget.enableLongPress) {
|
||||
if (event is KeyDownEvent) {
|
||||
// Only start timer on initial press, not repeats
|
||||
if (!_isSelectKeyDown) {
|
||||
_isSelectKeyDown = true;
|
||||
_longPressTimer?.cancel();
|
||||
_longPressTimer = Timer(widget.longPressDuration, () {
|
||||
// Long press detected
|
||||
if (mounted) {
|
||||
SelectKeyUpSuppressor.suppressSelectUntilKeyUp();
|
||||
widget.onLongPress?.call();
|
||||
}
|
||||
});
|
||||
}
|
||||
return finish(KeyEventResult.handled, 'select-long-press-down');
|
||||
} else if (event is KeyRepeatEvent) {
|
||||
// Consume repeat events to prevent system sounds
|
||||
return finish(KeyEventResult.handled, 'select-long-press-repeat');
|
||||
} else if (event is KeyUpEvent) {
|
||||
final timerWasActive = _longPressTimer?.isActive ?? false;
|
||||
_longPressTimer?.cancel();
|
||||
if (timerWasActive && _isSelectKeyDown) {
|
||||
// Timer still active - short press
|
||||
widget.onSelect?.call();
|
||||
}
|
||||
// If timer already fired, long press was triggered - do nothing on key up
|
||||
_isSelectKeyDown = false;
|
||||
return finish(KeyEventResult.handled, 'select-long-press-up');
|
||||
final result = _selectLongPress.handleKeyEvent(
|
||||
event,
|
||||
duration: widget.longPressDuration,
|
||||
isOwnerActive: () => mounted,
|
||||
onShortPress: () => widget.onSelect?.call(),
|
||||
onLongPress: () => widget.onLongPress?.call(),
|
||||
);
|
||||
if (result != KeyEventResult.ignored) {
|
||||
return finish(result, 'select-long-press');
|
||||
}
|
||||
} else if (widget.onSelect != null) {
|
||||
return finish(handleOneShotSelect(event, widget.onSelect!), 'one-shot-select');
|
||||
@@ -425,7 +411,7 @@ class _FocusableWrapperState extends State<FocusableWrapper> with SingleTickerPr
|
||||
|
||||
// Context menu key
|
||||
if (key.isContextMenuKey) {
|
||||
SelectKeyUpSuppressor.suppressSelectUntilKeyUp();
|
||||
_selectLongPress.reset();
|
||||
widget.onLongPress?.call();
|
||||
return finish(KeyEventResult.handled, 'context-menu');
|
||||
}
|
||||
@@ -461,23 +447,28 @@ class _FocusableWrapperState extends State<FocusableWrapper> with SingleTickerPr
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final duration = FocusTheme.getAnimationDuration(context);
|
||||
// Only show focus effects during keyboard/d-pad navigation
|
||||
final showFocus = _isFocused && InputModeTracker.isKeyboardMode(context);
|
||||
// Only show focus effects during keyboard/d-pad navigation. In pointer/
|
||||
// touch mode no card ever shows focus chrome, so skip the animated
|
||||
// scale/border wrappers entirely — they cost real build time multiplied
|
||||
// by every card in a grid. The Focus node stays mounted so d-pad
|
||||
// traversal finds the cards the moment keyboard mode activates (which
|
||||
// rebuilds this widget via the inherited dependency below).
|
||||
final isKeyboardMode = InputModeTracker.isKeyboardMode(context);
|
||||
final showFocus = _isFocused && isKeyboardMode;
|
||||
|
||||
// Update animation duration if theme changes
|
||||
if (_animationController.duration != duration) {
|
||||
_animationController.duration = duration;
|
||||
}
|
||||
Widget inner;
|
||||
if (!isKeyboardMode) {
|
||||
inner = widget.child;
|
||||
} else {
|
||||
final duration = FocusTheme.getAnimationDuration(context);
|
||||
final controller = _ensureAnimationController();
|
||||
// Update animation duration if theme changes
|
||||
if (controller.duration != duration) {
|
||||
controller.duration = duration;
|
||||
}
|
||||
|
||||
Widget result = Focus(
|
||||
focusNode: _focusNode,
|
||||
autofocus: widget.autofocus,
|
||||
descendantsAreFocusable: widget.descendantsAreFocusable,
|
||||
onFocusChange: _handleFocusChange,
|
||||
onKeyEvent: _handleKeyEvent,
|
||||
child: AnimatedBuilder(
|
||||
animation: _scaleAnimation,
|
||||
inner = AnimatedBuilder(
|
||||
animation: _scaleAnimation!,
|
||||
builder: (context, child) {
|
||||
final shouldScale = showFocus && !widget.disableScale;
|
||||
// The glow (full-bleed cards) is drawn in an overlay above siblings so
|
||||
@@ -487,11 +478,16 @@ class _FocusableWrapperState extends State<FocusableWrapper> with SingleTickerPr
|
||||
card = CardFocusScope(showFocus: showFocus, child: widget.child);
|
||||
} else {
|
||||
final focusDecoration = widget.useBackgroundFocus
|
||||
? FocusTheme.focusBackgroundDecoration(isFocused: showFocus, borderRadius: widget.borderRadius)
|
||||
? FocusTheme.focusBackgroundDecoration(
|
||||
isFocused: showFocus,
|
||||
borderRadius: widget.borderRadius,
|
||||
radii: widget.borderRadii,
|
||||
)
|
||||
: FocusTheme.focusDecoration(
|
||||
context,
|
||||
isFocused: showFocus,
|
||||
borderRadius: widget.borderRadius,
|
||||
radii: widget.borderRadii,
|
||||
color: widget.focusColor,
|
||||
);
|
||||
card = AnimatedContainer(
|
||||
@@ -509,9 +505,18 @@ class _FocusableWrapperState extends State<FocusableWrapper> with SingleTickerPr
|
||||
child: card,
|
||||
);
|
||||
}
|
||||
return Transform.scale(scale: shouldScale ? _scaleAnimation.value : 1.0, child: card);
|
||||
return Transform.scale(scale: shouldScale ? _scaleAnimation!.value : 1.0, child: card);
|
||||
},
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Widget result = Focus(
|
||||
focusNode: _focusNode,
|
||||
autofocus: widget.autofocus,
|
||||
descendantsAreFocusable: widget.descendantsAreFocusable,
|
||||
onFocusChange: _handleFocusChange,
|
||||
onKeyEvent: _handleKeyEvent,
|
||||
child: inner,
|
||||
);
|
||||
|
||||
// Add semantics if label provided
|
||||
|
||||
@@ -0,0 +1,33 @@
|
||||
/// Routes vertical D-pad movement between ordered hub rows.
|
||||
///
|
||||
/// A valid target and the bottom boundary are consumed. The top boundary can
|
||||
/// either invoke an explicit focus handoff or propagate to the row's
|
||||
/// `onNavigateUp` callback.
|
||||
bool navigateVerticalHubRows({
|
||||
required int hubCount,
|
||||
required int hubIndex,
|
||||
required bool isUp,
|
||||
required void Function(int targetIndex) requestFocus,
|
||||
void Function()? onTopBoundary,
|
||||
void Function()? onBottomBoundary,
|
||||
bool propagateTopBoundary = false,
|
||||
}) {
|
||||
if (hubCount <= 0) return false;
|
||||
|
||||
final targetIndex = isUp ? hubIndex - 1 : hubIndex + 1;
|
||||
if (targetIndex < 0) {
|
||||
if (onTopBoundary != null) {
|
||||
onTopBoundary();
|
||||
return true;
|
||||
}
|
||||
return !propagateTopBoundary;
|
||||
}
|
||||
|
||||
if (targetIndex >= hubCount) {
|
||||
onBottomBoundary?.call();
|
||||
return true;
|
||||
}
|
||||
|
||||
requestFocus(targetIndex);
|
||||
return true;
|
||||
}
|
||||
@@ -32,14 +32,20 @@ class InputModeTracker extends StatefulWidget {
|
||||
const InputModeTracker({super.key, required this.child});
|
||||
|
||||
/// Get the current input mode.
|
||||
static InputMode of(BuildContext context) {
|
||||
final provider = context.dependOnInheritedWidgetOfExactType<_InputModeProvider>();
|
||||
///
|
||||
/// Set [listen] to false for event handlers and post-frame callbacks that
|
||||
/// only need a one-shot value. Those reads must not subscribe their owning
|
||||
/// screen to future input-mode changes.
|
||||
static InputMode of(BuildContext context, {bool listen = true}) {
|
||||
final provider = listen
|
||||
? context.dependOnInheritedWidgetOfExactType<_InputModeProvider>()
|
||||
: context.getInheritedWidgetOfExactType<_InputModeProvider>();
|
||||
return provider?.mode ?? InputMode.pointer;
|
||||
}
|
||||
|
||||
/// Convenience method to check if we're in keyboard mode.
|
||||
static bool isKeyboardMode(BuildContext context) {
|
||||
return of(context) == InputMode.keyboard;
|
||||
static bool isKeyboardMode(BuildContext context, {bool listen = true}) {
|
||||
return of(context, listen: listen) == InputMode.keyboard;
|
||||
}
|
||||
|
||||
/// Whether system back must be blocked because the dpad key handler owns
|
||||
@@ -117,8 +123,10 @@ class _InputModeTrackerState extends State<InputModeTracker> {
|
||||
Widget build(BuildContext context) {
|
||||
// On Android TV, don't switch to pointer mode from pointer events
|
||||
// as D-pad can generate synthetic pointer events that would incorrectly
|
||||
// trigger pointer mode and show a cursor instead of D-pad focus navigation
|
||||
if (TvDetectionService.isTVSync()) {
|
||||
// trigger pointer mode and show a cursor instead of D-pad focus navigation.
|
||||
// Desktop is exempt even in force-TV mode: its pointer events come from a
|
||||
// real mouse, which should keep flipping modes (and the cursor) as usual.
|
||||
if (TvDetectionService.isTVSync() && !PlatformDetector.isDesktopOS()) {
|
||||
return _InputModeProvider(mode: _mode, child: widget.child);
|
||||
}
|
||||
|
||||
|
||||
@@ -32,24 +32,35 @@ import 'dpad_navigator.dart';
|
||||
class BackKeyCoordinator {
|
||||
static bool _handledThisFrame = false;
|
||||
static bool _clearScheduled = false;
|
||||
static int _clearGeneration = 0;
|
||||
|
||||
static void markHandled() {
|
||||
_handledThisFrame = true;
|
||||
if (_clearScheduled) return;
|
||||
|
||||
_clearScheduled = true;
|
||||
// Clear on next frame to avoid blocking unrelated future back presses.
|
||||
final clearGeneration = _clearGeneration;
|
||||
WidgetsBinding.instance.addPostFrameCallback((_) {
|
||||
if (clearGeneration != _clearGeneration) return;
|
||||
_handledThisFrame = false;
|
||||
_clearScheduled = false;
|
||||
});
|
||||
// addPostFrameCallback does not request a frame. Ensure the one-shot
|
||||
// marker cannot leak when handling Back does not otherwise schedule one.
|
||||
WidgetsBinding.instance.scheduleFrame();
|
||||
}
|
||||
|
||||
static void clear() {
|
||||
_handledThisFrame = false;
|
||||
_clearScheduled = false;
|
||||
// Invalidate a pending callback so it cannot clear a newer marker.
|
||||
_clearGeneration++;
|
||||
}
|
||||
|
||||
static bool consumeIfHandled() {
|
||||
if (_handledThisFrame) {
|
||||
_handledThisFrame = false;
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
if (!_handledThisFrame) return false;
|
||||
clear();
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,39 @@
|
||||
import 'package:flutter/widgets.dart';
|
||||
|
||||
typedef FocusNodeFactory = FocusNode Function(String? debugLabel);
|
||||
|
||||
FocusNode _createFocusNode(String? debugLabel) => FocusNode(debugLabel: debugLabel);
|
||||
|
||||
/// Owns either a caller-provided focus node or an internally-created one and
|
||||
/// keeps one listener attached to exactly the active node.
|
||||
class OwnedFocusNodeBinding {
|
||||
OwnedFocusNodeBinding() : _createNode = _createFocusNode;
|
||||
|
||||
OwnedFocusNodeBinding.withFactory(this._createNode);
|
||||
|
||||
final FocusNodeFactory _createNode;
|
||||
FocusNode? _node;
|
||||
VoidCallback? _listener;
|
||||
bool _ownsNode = false;
|
||||
|
||||
FocusNode get node => _node!;
|
||||
|
||||
void bind({required FocusNode? externalNode, VoidCallback? listener, String? debugLabel}) {
|
||||
dispose();
|
||||
_node = externalNode ?? _createNode(debugLabel);
|
||||
_ownsNode = externalNode == null;
|
||||
_listener = listener;
|
||||
if (listener != null) _node!.addListener(listener);
|
||||
}
|
||||
|
||||
void dispose() {
|
||||
final node = _node;
|
||||
final listener = _listener;
|
||||
if (node == null) return;
|
||||
if (listener != null) node.removeListener(listener);
|
||||
if (_ownsNode) node.dispose();
|
||||
_node = null;
|
||||
_listener = null;
|
||||
_ownsNode = false;
|
||||
}
|
||||
}
|
||||
+190
-47
@@ -3,7 +3,6 @@
|
||||
"title": "Plezy"
|
||||
},
|
||||
"auth": {
|
||||
"signIn": "Вход",
|
||||
"signInWithPlex": "Вход с Plex",
|
||||
"showQRCode": "Покажи QR код",
|
||||
"authenticate": "Удостовери",
|
||||
@@ -56,10 +55,8 @@
|
||||
"episodeNumberTitle": "Епизод ${number} - ${title}",
|
||||
"chapterNumber": "Глава ${number}",
|
||||
"reconnect": "Свържи отново",
|
||||
"exit": "Изход",
|
||||
"viewAll": "Виж всички",
|
||||
"checkingNetwork": "Проверка на мрежата...",
|
||||
"refreshingServers": "Опресняване на сървърите...",
|
||||
"loadingServers": "Зареждане на сървърите...",
|
||||
"connectingToServers": "Свързване със сървърите...",
|
||||
"startingOfflineMode": "Стартиране на офлайн режим...",
|
||||
@@ -139,10 +136,16 @@
|
||||
"tvFullCardLayoutDescription": "Използвай TV карти само с изображения, с насложени имена на актьорите",
|
||||
"focusGlow": "Сияние при фокус",
|
||||
"focusGlowDescription": "Показвай меко сияние около фокусираната карта",
|
||||
"visualEffects": "Визуални ефекти",
|
||||
"visualEffectsAuto": "Автоматично",
|
||||
"visualEffectsAutoDescription": "Автоматично намалявай ефектите на по-слаби устройства",
|
||||
"visualEffectsFull": "Пълни",
|
||||
"visualEffectsReduced": "Намалени",
|
||||
"visualEffectsReducedDescription": "По-малко анимации и изображения с по-ниска резолюция",
|
||||
"hideSpoilers": "Скривай спойлери за негледани епизоди",
|
||||
"hideSpoilersDescription": "Замазвай миниатюри и описания за негледани епизоди",
|
||||
"playerBackend": "Енджин на плеъра",
|
||||
"exoPlayer": "ExoPlayer (препоръчително)",
|
||||
"exoPlayer": "ExoPlayer",
|
||||
"mpv": "mpv",
|
||||
"hardwareDecoding": "Хардуерно декодиране",
|
||||
"hardwareDecodingDescription": "Използвай хардуерно ускорение, когато е налично",
|
||||
@@ -151,7 +154,7 @@
|
||||
"bufferSizeAuto": "Автоматично (препоръчително)",
|
||||
"bufferSizeWarning": "Налична памет ${heap}MB. Буфер ${size}MB може да повлияе на възпроизвеждането.",
|
||||
"defaultQualityTitle": "Качество по подразбиране",
|
||||
"defaultQualityDescription": "Използва се при стартиране на възпроизвеждане. По-ниските стойности намаляват трафика.",
|
||||
"musicQualityTitle": "Качество на музиката",
|
||||
"subtitleStyling": "Стил на субтитрите",
|
||||
"subtitleStylingDescription": "Настройване на вида на субтитрите",
|
||||
"smallSkipDuration": "Малко прескачане",
|
||||
@@ -245,10 +248,9 @@
|
||||
"maxVolumePercent": "${percent}%",
|
||||
"discordRichPresence": "Discord Rich Presence",
|
||||
"discordRichPresenceDescription": "Показвай какво гледате в Discord",
|
||||
"trakt": "Trakt",
|
||||
"traktDescription": "Синхронизирай историята на гледане с Trakt",
|
||||
"trackers": "Тракери",
|
||||
"trackersDescription": "Синхронизирай прогреса с Trakt, MyAnimeList, AniList и Simkl",
|
||||
"services": "Услуги",
|
||||
"servicesDescription": "Свържи Trakt, MyAnimeList, Seerr и още",
|
||||
"manageLibrariesDescription": "Пренареждай и скривай библиотеки",
|
||||
"companionRemoteServer": "Сървър за дистанционно управление",
|
||||
"companionRemoteServerDescription": "Позволи на мобилни устройства във вашата мрежа да управляват това приложение",
|
||||
"autoPip": "Автоматичен режим картина в картината",
|
||||
@@ -262,6 +264,32 @@
|
||||
"displaySwitchDelay": "Забавяне при смяна на дисплея",
|
||||
"tunneledPlayback": "Тунелно възпроизвеждане",
|
||||
"tunneledPlaybackDescription": "Използвай видео тунелиране. Изключете, ако HDR възпроизвеждането показва черен екран.",
|
||||
"audioPassthrough": "Аудио passthrough",
|
||||
"audioPassthroughDescription": "Изпращай Dolby/DTS звук към ресийвъра или телевизора без прекодиране, запазвайки съраунд звука. Изключете, ако няма звук.",
|
||||
"audioPassthroughDescriptionAppleTv": "Предава Dolby Digital Plus (вкл. Atmos) на системата като битов поток. DTS и TrueHD продължават да се възпроизвеждат като многоканален PCM. При превъртане може да има кратки прекъсвания на звука.",
|
||||
"audioDownmix": "Смесване до стерео",
|
||||
"audioDownmixDescription": "Смесва съраунд звука до два канала за стерео тонколони или слушалки",
|
||||
"downmixCenterBoost": "Усилване на централния канал",
|
||||
"downmixCenterBoostValue": "${db} дБ",
|
||||
"downmixCenterBoostLabel": "Усилване (дБ)",
|
||||
"downmixCenterBoostShort": "дБ",
|
||||
"audioDownmixNormalize": "Нормализиране на звука при смесване",
|
||||
"audioDownmixNormalizeDescription": "Понижава микса, за да се предотврати клипинг. Изключете, за да запазите оригиналната сила на звука (възможни изкривявания при силни сцени).",
|
||||
"atmosDiagnostics": "Тест на Atmos изхода",
|
||||
"atmosDiagnosticsDescription": "Диагностика на Dolby Atmos изхода чрез възпроизвеждане на тестови сигнали през системния плейър",
|
||||
"atmosTestHlsAtmos": "Apple Atmos поток",
|
||||
"atmosTestHlsAtmosDescription": "Гарантирано работещ Dolby Atmos поток. Ресийвърът трябва да покаже Dolby Atmos.",
|
||||
"atmosTestHlsControl": "Apple съраунд поток",
|
||||
"atmosTestHlsControlDescription": "Контролен поток без Atmos. Ресийвърът трябва да покаже съраунд без Atmos.",
|
||||
"atmosTestRawStream": "Суров EAC3 поток",
|
||||
"atmosTestRawStreamDescription": "Стриймва тестовия файл точно както Atmos възпроизвеждането в плейъра. Изисква URL на тестовия файл.",
|
||||
"atmosTestRawFile": "Суров EAC3 файл",
|
||||
"atmosTestRawFileDescription": "Възпроизвежда тестовия файл с известна дължина. Изисква URL на тестовия файл.",
|
||||
"atmosTestStop": "Спри теста",
|
||||
"atmosTestUrl": "URL на тестовия файл",
|
||||
"atmosTestUrlDescription": "HTTP URL на суров .ec3 Dolby Atmos файл (напр. извлечен с ffmpeg)",
|
||||
"atmosTestUrlMissing": "Първо задайте URL на тестовия файл",
|
||||
"atmosTestStatus": "Състояние",
|
||||
"dvConversionMode": "Dolby Vision конвертиране",
|
||||
"dvConversionModeDescription": "Изберете как ExoPlayer обработва Dolby Vision Profile 7 файлове.",
|
||||
"dvConversionAuto": "Автоматично",
|
||||
@@ -285,7 +313,6 @@
|
||||
"showNavBarLabels": "Показвай етикети в навигационната лента",
|
||||
"showNavBarLabelsDescription": "Показвай текстови етикети под иконите в навигационната лента",
|
||||
"startupSection": "Начален раздел",
|
||||
"startupSectionDescription": "Изберете кой раздел да отваря Plezy при стартиране",
|
||||
"liveTvDefaultFavorites": "По подразбиране към любими канали",
|
||||
"liveTvDefaultFavoritesDescription": "Показвай само любими канали при отваряне на телевизия на живо",
|
||||
"display": "Дисплей",
|
||||
@@ -385,15 +412,11 @@
|
||||
"rateSheet": {
|
||||
"title": "Оцени",
|
||||
"server": "Сървър",
|
||||
"starValue": "${rating} / 5",
|
||||
"scoreValue": "${score} / 10",
|
||||
"setScore": "Задай оценка",
|
||||
"notRated": "Без оценка",
|
||||
"liked": "Харесано",
|
||||
"notLiked": "Не е харесано",
|
||||
"favorite": "Добави в любими",
|
||||
"favorited": "Добавено в любими",
|
||||
"saved": "Запазено",
|
||||
"notAvailable": "Няма намерено съвпадение",
|
||||
"noConnectedTrackers": "Свържете тракер в Настройки, за да оценявате там."
|
||||
"noConnectedServices": "Свържи услуга в Настройки, за да оценяваш там."
|
||||
},
|
||||
"accessibility": {
|
||||
"mediaCardMovie": "${title}, филм",
|
||||
@@ -403,7 +426,15 @@
|
||||
"mediaCardWatched": "гледано",
|
||||
"mediaCardPartiallyWatched": "${percent} процента изгледано",
|
||||
"mediaCardUnwatched": "негледано",
|
||||
"tapToPlay": "Докоснете за възпроизвеждане"
|
||||
"tapToPlay": "Докоснете за възпроизвеждане",
|
||||
"decrease": "Намали",
|
||||
"increase": "Увеличи",
|
||||
"decreaseValue": "Намали ${label}",
|
||||
"increaseValue": "Увеличи ${label}",
|
||||
"hue": "Нюанс",
|
||||
"saturation": "Наситеност",
|
||||
"brightness": "Яркост",
|
||||
"hexColor": "Шестнадесетичен цвят"
|
||||
},
|
||||
"tooltips": {
|
||||
"shufflePlay": "Разбъркано възпроизвеждане",
|
||||
@@ -449,13 +480,11 @@
|
||||
"settingsButton": "Настройки на възпроизвеждането",
|
||||
"tracksButton": "Аудио и субтитри",
|
||||
"chaptersButton": "Глави",
|
||||
"versionsButton": "Видео версии",
|
||||
"versionQualityButton": "Версия и качество",
|
||||
"versionColumnHeader": "Версия",
|
||||
"qualityColumnHeader": "Качество",
|
||||
"qualityOriginal": "Оригинал",
|
||||
"qualityPresetLabel": "${resolution}p ${bitrate} Mbps",
|
||||
"qualityBandwidthEstimate": "~${bitrate} Mbps",
|
||||
"transcodeUnavailableFallback": "Транскодирането не е налично — пуска се оригиналното качество",
|
||||
"pipButton": "Режим картина в картината",
|
||||
"aspectRatioButton": "Съотношение на страните",
|
||||
@@ -498,12 +527,7 @@
|
||||
"subtitleDownloadFailed": "Неуспешно изтегляне на субтитър",
|
||||
"searchLanguages": "Търсене на езици..."
|
||||
},
|
||||
"userStatus": {
|
||||
"admin": "Администратор",
|
||||
"restricted": "Ограничен",
|
||||
"protected": "Защитен",
|
||||
"current": "ТЕКУЩ"
|
||||
},
|
||||
"userStatus": {},
|
||||
"messages": {
|
||||
"markedAsWatched": "Маркирано като гледано",
|
||||
"markedAsUnwatched": "Маркирано като негледано",
|
||||
@@ -512,6 +536,8 @@
|
||||
"autoRemovedWatchedDownload": "Автоматично премахнато: ${title}",
|
||||
"removedFromContinueWatching": "Премахнато от продължаване на гледането",
|
||||
"errorLoading": "Грешка: ${error}",
|
||||
"streamInterrupted": "Потокът прекъсна. Натиснете „Пусни“ или превъртете, за да опитате отново.",
|
||||
"liveStreamInterrupted": "Потокът на живо прекъсна. Натиснете „Пусни“, за да опитате отново.",
|
||||
"fileInfoNotAvailable": "Информацията за файла не е налична",
|
||||
"errorLoadingFileInfo": "Грешка при зареждане на информация за файла: ${error}",
|
||||
"errorLoadingSeries": "Грешка при зареждане на сериала",
|
||||
@@ -634,15 +660,16 @@
|
||||
"borrowConnectionBorrowed": "Връзката е използвана.",
|
||||
"borrowFailed": "Неуспешно използване на връзка.",
|
||||
"incorrectPin": "Неправилен PIN.",
|
||||
"incorrectPinTryAgain": "Неправилен PIN. Опитайте отново.",
|
||||
"sourceProfileMissingParentAccount": "Изходният профил няма родителски акаунт.",
|
||||
"failedToLoadHomeUsers": "Потребителите на Plex Home не можаха да бъдат заредени. Проверете връзката си и опитайте отново.",
|
||||
"failedToVerifyPin": "Неуспешна проверка на PIN.",
|
||||
"newProfile": "Нов профил",
|
||||
"profileNameHint": "напр. Гости, Деца, Семейна стая",
|
||||
"pinProtectionOptional": "PIN защита (по желание)",
|
||||
"pinExplain": "Изисква се 4-цифрен PIN за смяна на профили.",
|
||||
"continueButton": "Продължи",
|
||||
"pinsDontMatch": "PIN кодовете не съвпадат",
|
||||
"initializeServicesFailed": "Неуспешно инициализиране на услугите за профили"
|
||||
"pinsDontMatch": "PIN кодовете не съвпадат"
|
||||
},
|
||||
"connections": {
|
||||
"sectionTitle": "Връзки",
|
||||
@@ -657,7 +684,6 @@
|
||||
},
|
||||
"discover": {
|
||||
"title": "Открий",
|
||||
"switchProfile": "Смяна на профил",
|
||||
"noContentAvailable": "Няма налично съдържание",
|
||||
"addMediaToLibraries": "Добавете медия към библиотеките си",
|
||||
"continueWatching": "Продължи гледането",
|
||||
@@ -666,6 +692,9 @@
|
||||
"nextUpIn": "Следва в ${library}",
|
||||
"recentlyAdded": "Наскоро добавени",
|
||||
"recentlyAddedIn": "Наскоро добавени в ${library}",
|
||||
"latestAlbumsIn": "Последни албуми в ${library}",
|
||||
"recentlyPlayedIn": "Наскоро възпроизведени в ${library}",
|
||||
"mostPlayedIn": "Най-възпроизвеждани в ${library}",
|
||||
"playEpisode": "S${season}E${episode}",
|
||||
"overview": "Обзор",
|
||||
"cast": "Актьори",
|
||||
@@ -683,8 +712,6 @@
|
||||
"connectionFailed": "Не може да се осъществи връзка с медиен сървър",
|
||||
"failedToLoad": "Неуспешно зареждане на ${context}: ${error}",
|
||||
"noClientAvailable": "Няма наличен клиент",
|
||||
"authenticationFailed": "Удостоверяването е неуспешно: ${error}",
|
||||
"couldNotLaunchUrl": "URL адресът за удостоверяване не може да бъде отворен",
|
||||
"pleaseEnterToken": "Моля, въведете токен",
|
||||
"invalidToken": "Невалиден токен",
|
||||
"failedToVerifyToken": "Неуспешна проверка на токена: ${error}",
|
||||
@@ -711,6 +738,8 @@
|
||||
"allLibrariesHidden": "Всички библиотеки са скрити",
|
||||
"hiddenLibrariesCount": "Скрити библиотеки (${count})",
|
||||
"thisLibraryIsEmpty": "Тази библиотека е празна",
|
||||
"noItemsMatchFilters": "Няма елементи, съответстващи на активните филтри",
|
||||
"resetFilters": "Нулирай филтрите",
|
||||
"all": "Всички",
|
||||
"clearAll": "Изчисти всички",
|
||||
"scanLibraryConfirm": "Сигурни ли сте, че искате да сканирате \"${title}\"?",
|
||||
@@ -745,6 +774,9 @@
|
||||
"shows": "ТВ сериали",
|
||||
"seasons": "Сезони",
|
||||
"episodes": "Епизоди",
|
||||
"artists": "Изпълнители",
|
||||
"albums": "Албуми",
|
||||
"tracks": "Песни",
|
||||
"folders": "Папки"
|
||||
},
|
||||
"filterCategories": {
|
||||
@@ -752,7 +784,8 @@
|
||||
"year": "Година",
|
||||
"contentRating": "Възрастов рейтинг",
|
||||
"tag": "Таг",
|
||||
"unwatched": "Негледани"
|
||||
"unwatched": "Негледани",
|
||||
"favorites": "Любими"
|
||||
},
|
||||
"sortLabels": {
|
||||
"title": "Заглавие",
|
||||
@@ -762,7 +795,6 @@
|
||||
"communityRating": "Оценка от общността",
|
||||
"criticRating": "Оценка от критиците",
|
||||
"userRating": "Потребителска оценка",
|
||||
"lastPlayed": "Последно възпроизведено",
|
||||
"datePlayed": "Дата на възпроизвеждане",
|
||||
"playCount": "Брой възпроизвеждания",
|
||||
"productionYear": "Година на производство",
|
||||
@@ -786,7 +818,6 @@
|
||||
"viewLicensesDescription": "Виж лицензите на библиотеки на трети страни"
|
||||
},
|
||||
"serverSelection": {
|
||||
"allServerConnectionsFailed": "Не може да се осъществи връзка с нито един сървър. Проверете мрежата.",
|
||||
"noServersFoundForAccount": "Не са намерени сървъри за ${username} (${email})",
|
||||
"failedToLoadServers": "Неуспешно зареждане на сървъри: ${error}"
|
||||
},
|
||||
@@ -811,13 +842,59 @@
|
||||
"navigation": {
|
||||
"libraries": "Библиотеки",
|
||||
"downloads": "Изтегляния",
|
||||
"liveTv": "Телевизия на живо"
|
||||
"liveTv": "Телевизия на живо",
|
||||
"explore": "Разгледай"
|
||||
},
|
||||
"explore": {
|
||||
"title": "Разгледай",
|
||||
"selectSource": "Избери източник",
|
||||
"rows": {
|
||||
"watchlist": "Списък за гледане",
|
||||
"recommendedMovies": "Препоръчани филми",
|
||||
"recommendedShows": "Препоръчани сериали",
|
||||
"trendingMovies": "Актуални филми",
|
||||
"trendingShows": "Актуални сериали",
|
||||
"popularMovies": "Популярни филми",
|
||||
"popularShows": "Популярни сериали",
|
||||
"suggestedAnime": "Препоръчани аниме",
|
||||
"airingAnime": "Топ излъчвани аниме",
|
||||
"popularAnime": "Най-популярни аниме",
|
||||
"trending": "Актуални",
|
||||
"upcomingMovies": "Предстоящи филми",
|
||||
"upcomingShows": "Предстоящи сериали"
|
||||
},
|
||||
"status": {
|
||||
"airing": "Излъчва се",
|
||||
"ended": "Приключил",
|
||||
"canceled": "Отменен",
|
||||
"upcoming": "Предстоящ"
|
||||
},
|
||||
"episodeCount": {
|
||||
"one": "${n} епизод",
|
||||
"other": "${n} епизода"
|
||||
},
|
||||
"cast": "Актьори",
|
||||
"characters": "Герои",
|
||||
"addToWatchlist": "Добави в списъка за гледане",
|
||||
"removeFromWatchlist": "Премахни от списъка за гледане",
|
||||
"watchlistUpdateFailed": "Неуспешно обновяване на списъка за гледане",
|
||||
"notInLibrary": "Не е в твоята библиотека",
|
||||
"inTheseLibraries": "В тези библиотеки",
|
||||
"checkingLibrary": "Проверка на твоята библиотека...",
|
||||
"emptyTitle": "Тук все още няма нищо",
|
||||
"emptyMessage": "Редовете от ${source} ще се появят тук, когато има съдържание.",
|
||||
"searchHint": "Търсене в ${source}",
|
||||
"searchEmpty": "Няма резултати за \"${query}\"",
|
||||
"searchPrompt": "Търси филми и сериали в ${source}.",
|
||||
"searchFailed": "Търсенето се провали. Провери връзката си и опитай отново."
|
||||
},
|
||||
"liveTv": {
|
||||
"title": "Телевизия на живо",
|
||||
"guide": "ТВ програма",
|
||||
"noChannels": "Няма налични канали",
|
||||
"noDvr": "Няма конфигуриран DVR на нито един сървър",
|
||||
"serverUnavailable": "Сървърът за телевизия на живо не е наличен.",
|
||||
"serverNotConnected": "Сървърът за телевизия на живо не е свързан.",
|
||||
"noPrograms": "Няма налични програмни данни",
|
||||
"liveStreamFailed": "Потокът на живо се провали",
|
||||
"unknownProgram": "Неизвестна програма",
|
||||
@@ -840,6 +917,7 @@
|
||||
"watchChannel": "Гледай канал",
|
||||
"favorites": "Любими",
|
||||
"reorderFavorites": "Пренареди любимите",
|
||||
"favoritesLoadFailed": "Любимите не можаха да се заредят. Проверете връзката си и опитайте отново.",
|
||||
"joinSession": "Присъедини се към текуща сесия",
|
||||
"watchFromStart": "Гледай от началото (преди ${minutes} мин)",
|
||||
"watchLive": "Гледай на живо",
|
||||
@@ -848,11 +926,11 @@
|
||||
"recordEpisode": "Запиши епизод",
|
||||
"recordSeries": "Запиши сериал",
|
||||
"recordOptions": "Опции за запис",
|
||||
"saveTo": "Запази в",
|
||||
"recordings": "Записи",
|
||||
"scheduledRecordings": "Планирани",
|
||||
"recordingRules": "Правила за запис",
|
||||
"noScheduledRecordings": "Няма планирани записи",
|
||||
"noRecordingRules": "Все още няма правила за запис",
|
||||
"manageRecording": "Управление на запис",
|
||||
"cancelRecording": "Отмени запис",
|
||||
"cancelRecordingTitle": "Да се отмени ли този запис?",
|
||||
@@ -869,7 +947,6 @@
|
||||
"recordingCancelled": "Записът е отменен",
|
||||
"recordingRuleDeleted": "Правилото за запис е изтрито",
|
||||
"processRecordingRules": "Преоцени правилата",
|
||||
"loadingRecordings": "Зареждане на записи...",
|
||||
"recordingInProgress": "Записва се сега",
|
||||
"recordingsCount": "${count} планирани",
|
||||
"editRule": "Редактирай правило",
|
||||
@@ -883,7 +960,6 @@
|
||||
"title": "Колекции",
|
||||
"collection": "Колекция",
|
||||
"empty": "Колекцията е празна",
|
||||
"unknownLibrarySection": "Не може да се изтрие: неизвестна секция на библиотеката",
|
||||
"deleteCollection": "Изтрий колекция",
|
||||
"deleteConfirm": "Да се изтрие ли \"${title}\"? Това не може да бъде отменено.",
|
||||
"deleted": "Колекцията е изтрита",
|
||||
@@ -923,6 +999,7 @@
|
||||
"itemAdded": "Добавено към плейлист",
|
||||
"itemRemoved": "Премахнато от плейлист",
|
||||
"selectPlaylist": "Избери плейлист",
|
||||
"searchPlaylists": "Търсене в плейлисти...",
|
||||
"errorCreating": "Неуспешно създаване на плейлист",
|
||||
"errorDeleting": "Неуспешно изтриване на плейлист",
|
||||
"errorLoading": "Неуспешно зареждане на плейлисти",
|
||||
@@ -930,6 +1007,33 @@
|
||||
"errorReordering": "Неуспешно пренареждане на елемент в плейлиста",
|
||||
"errorRemoving": "Неуспешно премахване от плейлист"
|
||||
},
|
||||
"music": {
|
||||
"goToAlbum": "Към албума",
|
||||
"goToArtist": "Към изпълнителя",
|
||||
"instantMix": "Мигновен микс",
|
||||
"playNext": "Пусни следващото",
|
||||
"addToQueue": "Добави към опашката",
|
||||
"discNumber": "Диск ${n}",
|
||||
"trackCount": {
|
||||
"one": "${n} песен",
|
||||
"other": "${n} песни"
|
||||
},
|
||||
"nowPlaying": "Сега се възпроизвежда",
|
||||
"playingFrom": "Възпроизвеждане от ${title}",
|
||||
"queue": "Опашка",
|
||||
"clearQueue": "Изчисти опашката",
|
||||
"lyrics": "Текст",
|
||||
"noLyrics": "Няма наличен текст",
|
||||
"sleepTimer": "Таймер за заспиване",
|
||||
"sleepTimerEndOfTrack": "Край на песента",
|
||||
"sleepTimerMinutes": "${n} минути",
|
||||
"stopPlayback": "Спри възпроизвеждането",
|
||||
"previousTrack": "Предишна песен",
|
||||
"nextTrack": "Следваща песен",
|
||||
"repeat": "Повтори",
|
||||
"repeatAll": "Повтори всички",
|
||||
"repeatOne": "Повтори една"
|
||||
},
|
||||
"watchTogether": {
|
||||
"title": "Гледане заедно",
|
||||
"description": "Гледайте съдържание синхронизирано с приятели и семейство",
|
||||
@@ -985,7 +1089,10 @@
|
||||
"participantResumed": "${name} продължи",
|
||||
"participantSeeked": "${name} превъртя",
|
||||
"participantBuffering": "${name} буферира",
|
||||
"participantNeedsUpdate": "${name} е с по-стара версия на приложението — синхронизирането не е налично",
|
||||
"resumingWithout": "Продължаване без ${name}",
|
||||
"waitingForParticipants": "Изчакване другите да заредят...",
|
||||
"waitingForName": "Изчакване на ${name}...",
|
||||
"recentRooms": "Скорошни стаи",
|
||||
"renameRoom": "Преименувай стая",
|
||||
"removeRoom": "Премахни",
|
||||
@@ -997,6 +1104,8 @@
|
||||
"manage": "Управление",
|
||||
"tvShows": "ТВ сериали",
|
||||
"movies": "Филми",
|
||||
"music": "Музика",
|
||||
"tracksQueued": "${count} песни в опашката за изтегляне",
|
||||
"noDownloads": "Все още няма изтегляния",
|
||||
"noDownloadsDescription": "Изтегленото съдържание ще се показва тук за офлайн гледане",
|
||||
"downloadNow": "Изтегли",
|
||||
@@ -1033,7 +1142,7 @@
|
||||
"customAmount": "Персонален брой...",
|
||||
"includeSpecials": "Включи специалните",
|
||||
"howManyEpisodes": "Колко епизода?",
|
||||
"itemsQueued": "${count} елемента са добавени в опашката за изтегляне",
|
||||
"invalidEpisodeCount": "Въведете валиден брой епизоди.",
|
||||
"keepSynced": "Поддържай синхронизирано",
|
||||
"downloadOnce": "Изтегли еднократно",
|
||||
"keepNUnwatched": "Пази ${count} негледани",
|
||||
@@ -1082,7 +1191,6 @@
|
||||
"unknownDevice": "Непознато устройство",
|
||||
"session": {
|
||||
"startingServer": "Стартиране на сървър за дистанционно управление...",
|
||||
"failedToCreate": "Неуспешно стартиране на сървър за дистанционно управление:",
|
||||
"hostAddress": "Адрес на хоста",
|
||||
"connected": "Свързан",
|
||||
"serverRunning": "Сървърът за дистанционно управление е активен",
|
||||
@@ -1143,6 +1251,8 @@
|
||||
"errors": {
|
||||
"noNetworkInterface": "Не е намерен мрежов интерфейс",
|
||||
"authenticationFailed": "Неуспешно удостоверяване",
|
||||
"serverStartFailed": "Неуспешно стартиране на отдалечения сървър: ${error}",
|
||||
"commandFailed": "Неуспешно изпращане на отдалечена команда: ${error}",
|
||||
"joinTimedOut": "Времето за присъединяване към сесията изтече",
|
||||
"failedToConnectAnyAddress": "Неуспешно свързване към който и да е адрес",
|
||||
"connectionLostAfterAttempts": "Връзката е загубена след ${attempts} опита",
|
||||
@@ -1159,7 +1269,8 @@
|
||||
"audioOutput": "Аудио изход",
|
||||
"performanceOverlay": "Оверлей за производителност",
|
||||
"audioPassthrough": "Аудио passthrough",
|
||||
"audioNormalization": "Нормализиране на силата на звука"
|
||||
"audioNormalization": "Нормализиране на силата на звука",
|
||||
"audioDownmix": "Смесване до стерео"
|
||||
},
|
||||
"performanceOverlay": {
|
||||
"color": "Цвят",
|
||||
@@ -1322,9 +1433,41 @@
|
||||
"watchedSync": "Синхронизирай статус гледано",
|
||||
"watchedSyncDescription": "Когато маркирате елементи като гледани в Plezy, маркирай ги и в Trakt."
|
||||
},
|
||||
"trackers": {
|
||||
"title": "Тракери",
|
||||
"hubSubtitle": "Синхронизирай прогреса на гледане с Trakt и други услуги.",
|
||||
"seerr": {
|
||||
"title": "Seerr",
|
||||
"connectTitle": "Свързване със Seerr",
|
||||
"serverUrl": "URL на сървъра",
|
||||
"serverUrlHelper": "Адресът на твоята Seerr инстанция",
|
||||
"checkServer": "Продължи",
|
||||
"signInWithJellyfin": "Вход с Jellyfin",
|
||||
"signInWithEmby": "Вход с Emby",
|
||||
"signInWithLocal": "Използвай локален акаунт",
|
||||
"email": "Имейл",
|
||||
"noSignInMethods": "Тази Seerr инстанция не предлага метод за вход, който Plezy поддържа.",
|
||||
"instance": "Инстанция",
|
||||
"disconnectConfirm": "Да се прекъсне ли Seerr?",
|
||||
"disconnectConfirmBody": "Plezy ще забрави тази Seerr инстанция. Можете да се свържете отново по всяко време.",
|
||||
"request": "Заяви",
|
||||
"request4k": "Заяви в 4K",
|
||||
"seasons": "Сезони",
|
||||
"allSeasons": "Всички сезони",
|
||||
"advancedOptions": "Разширени",
|
||||
"destinationServer": "Целеви сървър",
|
||||
"qualityProfile": "Профил за качество",
|
||||
"rootFolder": "Основна папка",
|
||||
"languageProfile": "Езиков профил",
|
||||
"requestSubmitted": "Заявката е изпратена",
|
||||
"requestFailed": "Заявката се провали: ${error}",
|
||||
"requestsLoadFailed": "Неуспешно зареждане на опциите за заявка",
|
||||
"nothingToRequest": "Всичко вече е налично или заявено.",
|
||||
"statusAvailable": "Налично",
|
||||
"statusPartiallyAvailable": "Частично налично",
|
||||
"statusRequested": "Заявено",
|
||||
"statusProcessing": "Обработва се"
|
||||
},
|
||||
"services": {
|
||||
"title": "Услуги",
|
||||
"hubSubtitle": "Синхронизирай прогреса на гледане и заявявай нови заглавия.",
|
||||
"notConnected": "Не е свързан",
|
||||
"connectedAs": "Свързан като @${username}",
|
||||
"scrobble": "Проследявай прогреса автоматично",
|
||||
@@ -1332,10 +1475,11 @@
|
||||
"disconnectConfirm": "Да се прекъсне ли ${service}?",
|
||||
"disconnectConfirmBody": "Plezy ще спре да обновява ${service}. Можете да се свържете отново по всяко време.",
|
||||
"connectFailed": "Неуспешно свързване с ${service}. Опитайте отново.",
|
||||
"services": {
|
||||
"names": {
|
||||
"mal": "MyAnimeList",
|
||||
"anilist": "AniList",
|
||||
"simkl": "Simkl"
|
||||
"simkl": "Simkl",
|
||||
"seerr": "Seerr"
|
||||
},
|
||||
"deviceCode": {
|
||||
"title": "Активиране на Plezy в ${service}",
|
||||
@@ -1382,7 +1526,6 @@
|
||||
"quickConnectFailed": "Quick Connect е неуспешен: ${error}",
|
||||
"addPlexTitle": "Вход с Plex",
|
||||
"pinExpired": "PIN-ът изтече преди вход. Моля, опитайте отново.",
|
||||
"duplicatePlexAccount": "Вече сте влезли в Plex. Излезте, за да смените акаунта.",
|
||||
"failedToRegisterAccount": "Неуспешна регистрация на акаунт: ${error}",
|
||||
"enterJellyfinUrlError": "Въведете URL адреса на вашия Jellyfin сървър",
|
||||
"addConnectionTitle": "Добави връзка",
|
||||
|
||||
+190
-47
@@ -3,7 +3,6 @@
|
||||
"title": "Plezy"
|
||||
},
|
||||
"auth": {
|
||||
"signIn": "Log ind",
|
||||
"signInWithPlex": "Log ind med Plex",
|
||||
"showQRCode": "Vis QR-kode",
|
||||
"authenticate": "Godkend",
|
||||
@@ -56,10 +55,8 @@
|
||||
"episodeNumberTitle": "Episode ${number} - ${title}",
|
||||
"chapterNumber": "Kapitel ${number}",
|
||||
"reconnect": "Genopret forbindelse",
|
||||
"exit": "Afslut",
|
||||
"viewAll": "Vis alle",
|
||||
"checkingNetwork": "Tjekker netværk...",
|
||||
"refreshingServers": "Opdaterer servere...",
|
||||
"loadingServers": "Indlæser servere...",
|
||||
"connectingToServers": "Forbinder til servere...",
|
||||
"startingOfflineMode": "Starter offlinetilstand...",
|
||||
@@ -139,10 +136,16 @@
|
||||
"tvFullCardLayoutDescription": "Brug TV-kort kun med billeder og skuespillernavne ovenpå",
|
||||
"focusGlow": "Fokusglød",
|
||||
"focusGlowDescription": "Vis en blød glød omkring det fokuserede kort",
|
||||
"visualEffects": "Visuelle effekter",
|
||||
"visualEffectsAuto": "Automatisk",
|
||||
"visualEffectsAutoDescription": "Reducer automatisk effekter på enheder med lav ydeevne",
|
||||
"visualEffectsFull": "Fuld",
|
||||
"visualEffectsReduced": "Reduceret",
|
||||
"visualEffectsReducedDescription": "Færre animationer og illustrationer i lavere opløsning",
|
||||
"hideSpoilers": "Skjul spoilere for usete episoder",
|
||||
"hideSpoilersDescription": "Slør miniaturebilleder og beskrivelser for usete episoder",
|
||||
"playerBackend": "Afspillerbackend",
|
||||
"exoPlayer": "ExoPlayer (Anbefalet)",
|
||||
"exoPlayer": "ExoPlayer",
|
||||
"mpv": "mpv",
|
||||
"hardwareDecoding": "Hardwaredekodning",
|
||||
"hardwareDecodingDescription": "Brug hardwareacceleration når tilgængelig",
|
||||
@@ -151,7 +154,7 @@
|
||||
"bufferSizeAuto": "Auto (Anbefalet)",
|
||||
"bufferSizeWarning": "${heap}MB hukommelse tilgængelig. En buffer på ${size}MB kan påvirke afspilning.",
|
||||
"defaultQualityTitle": "Standardkvalitet",
|
||||
"defaultQualityDescription": "Bruges ved start af afspilning. Lavere værdier reducerer båndbredden.",
|
||||
"musicQualityTitle": "Musikkvalitet",
|
||||
"subtitleStyling": "Undertekststil",
|
||||
"subtitleStylingDescription": "Tilpas underteksters udseende",
|
||||
"smallSkipDuration": "Kort spring-varighed",
|
||||
@@ -245,10 +248,9 @@
|
||||
"maxVolumePercent": "${percent}%",
|
||||
"discordRichPresence": "Discord Rich Presence",
|
||||
"discordRichPresenceDescription": "Vis hvad du ser på Discord",
|
||||
"trakt": "Trakt",
|
||||
"traktDescription": "Synkroniser visningshistorik med Trakt",
|
||||
"trackers": "Trackere",
|
||||
"trackersDescription": "Synkroniser fremgang til Trakt, MyAnimeList, AniList og Simkl",
|
||||
"services": "Tjenester",
|
||||
"servicesDescription": "Forbind Trakt, MyAnimeList, Seerr og mere",
|
||||
"manageLibrariesDescription": "Omarranger og skjul biblioteker",
|
||||
"companionRemoteServer": "Companion Remote Server",
|
||||
"companionRemoteServerDescription": "Tillad mobilenheder på dit netværk at styre denne app",
|
||||
"autoPip": "Auto billede-i-billede",
|
||||
@@ -262,6 +264,32 @@
|
||||
"displaySwitchDelay": "Forsinkelse ved skærmskift",
|
||||
"tunneledPlayback": "Tunneleret afspilning",
|
||||
"tunneledPlaybackDescription": "Brug videotunneling. Slå fra, hvis HDR-afspilning viser sort video.",
|
||||
"audioPassthrough": "Lyd-passthrough",
|
||||
"audioPassthroughDescription": "Send Dolby/DTS-lyd til din receiver eller dit TV uden genkodning, så surroundlyd bevares. Slå fra, hvis du ikke har lyd.",
|
||||
"audioPassthroughDescriptionAppleTv": "Overlad Dolby Digital Plus (inkl. Atmos) til systemet som bitstream. DTS og TrueHD afspilles stadig som flerkanals PCM. Korte lydhuller kan forekomme ved søgning.",
|
||||
"audioDownmix": "Downmix til stereo",
|
||||
"audioDownmixDescription": "Mikser surroundlyd ned til to kanaler til stereohøjttalere eller hovedtelefoner",
|
||||
"downmixCenterBoost": "Forstærkning af centerkanal",
|
||||
"downmixCenterBoostValue": "${db} dB",
|
||||
"downmixCenterBoostLabel": "Forstærkning (dB)",
|
||||
"downmixCenterBoostShort": "dB",
|
||||
"audioDownmixNormalize": "Normalisér lydstyrke ved downmix",
|
||||
"audioDownmixNormalizeDescription": "Sænker mixet for at undgå clipping. Slå fra for at bevare den oprindelige lydstyrke (høje scener kan forvrænges).",
|
||||
"atmosDiagnostics": "Atmos-outputtest",
|
||||
"atmosDiagnosticsDescription": "Diagnosticér Dolby Atmos-output ved at afspille testsignaler gennem systemafspilleren",
|
||||
"atmosTestHlsAtmos": "Apple Atmos-stream",
|
||||
"atmosTestHlsAtmosDescription": "Kendt god Dolby Atmos-stream. Receiveren bør vise Dolby Atmos.",
|
||||
"atmosTestHlsControl": "Apple surround-stream",
|
||||
"atmosTestHlsControlDescription": "Kontrolstream uden Atmos. Receiveren bør vise surround uden Atmos.",
|
||||
"atmosTestRawStream": "Rå EAC3-stream",
|
||||
"atmosTestRawStreamDescription": "Streamer testfilen præcis som Atmos-afspilning i afspilleren. Kræver testfilens URL.",
|
||||
"atmosTestRawFile": "Rå EAC3-fil",
|
||||
"atmosTestRawFileDescription": "Afspiller testfilen med kendt længde. Kræver testfilens URL.",
|
||||
"atmosTestStop": "Stop test",
|
||||
"atmosTestUrl": "Testfilens URL",
|
||||
"atmosTestUrlDescription": "HTTP-URL til en rå .ec3 Dolby Atmos-fil (f.eks. udtrukket med ffmpeg)",
|
||||
"atmosTestUrlMissing": "Angiv testfilens URL først",
|
||||
"atmosTestStatus": "Status",
|
||||
"dvConversionMode": "Dolby Vision-konvertering",
|
||||
"dvConversionModeDescription": "Vælg, hvordan ExoPlayer håndterer Dolby Vision Profile 7-filer.",
|
||||
"dvConversionAuto": "Auto",
|
||||
@@ -285,7 +313,6 @@
|
||||
"showNavBarLabels": "Vis navigationsbarlabels",
|
||||
"showNavBarLabelsDescription": "Vis tekstlabels under navigationsbarikoner",
|
||||
"startupSection": "Startsektion",
|
||||
"startupSectionDescription": "Vælg hvilken sektion Plezy åbner ved start",
|
||||
"liveTvDefaultFavorites": "Standard til favoritkanaler",
|
||||
"liveTvDefaultFavoritesDescription": "Vis kun favoritkanaler ved åbning af Live TV",
|
||||
"display": "Skærm",
|
||||
@@ -385,15 +412,11 @@
|
||||
"rateSheet": {
|
||||
"title": "Bedøm",
|
||||
"server": "Server",
|
||||
"starValue": "${rating} / 5",
|
||||
"scoreValue": "${score} / 10",
|
||||
"setScore": "Angiv en score",
|
||||
"notRated": "Ikke bedømt",
|
||||
"liked": "Synes godt om",
|
||||
"notLiked": "Ikke liket",
|
||||
"favorite": "Favorit",
|
||||
"favorited": "Føjet til favoritter",
|
||||
"saved": "Gemt",
|
||||
"notAvailable": "Intet match fundet",
|
||||
"noConnectedTrackers": "Forbind en tracker i Indstillinger for at bedømme der."
|
||||
"noConnectedServices": "Forbind en tjeneste i Indstillinger for at bedømme der."
|
||||
},
|
||||
"accessibility": {
|
||||
"mediaCardMovie": "${title}, film",
|
||||
@@ -403,7 +426,15 @@
|
||||
"mediaCardWatched": "set",
|
||||
"mediaCardPartiallyWatched": "${percent} procent set",
|
||||
"mediaCardUnwatched": "uset",
|
||||
"tapToPlay": "Tryk for at afspille"
|
||||
"tapToPlay": "Tryk for at afspille",
|
||||
"decrease": "Formindsk",
|
||||
"increase": "Forøg",
|
||||
"decreaseValue": "Formindsk ${label}",
|
||||
"increaseValue": "Forøg ${label}",
|
||||
"hue": "Farvetone",
|
||||
"saturation": "Mætning",
|
||||
"brightness": "Lysstyrke",
|
||||
"hexColor": "Hexfarve"
|
||||
},
|
||||
"tooltips": {
|
||||
"shufflePlay": "Afspil tilfældigt",
|
||||
@@ -449,13 +480,11 @@
|
||||
"settingsButton": "Afspilningsindstillinger",
|
||||
"tracksButton": "Lyd og undertekster",
|
||||
"chaptersButton": "Kapitler",
|
||||
"versionsButton": "Videoversioner",
|
||||
"versionQualityButton": "Version og kvalitet",
|
||||
"versionColumnHeader": "Version",
|
||||
"qualityColumnHeader": "Kvalitet",
|
||||
"qualityOriginal": "Original",
|
||||
"qualityPresetLabel": "${resolution}p ${bitrate} Mbps",
|
||||
"qualityBandwidthEstimate": "~${bitrate} Mbps",
|
||||
"transcodeUnavailableFallback": "Transkodning utilgængelig — afspiller original kvalitet",
|
||||
"pipButton": "Billede-i-billede-tilstand",
|
||||
"aspectRatioButton": "Billedformat",
|
||||
@@ -498,12 +527,7 @@
|
||||
"subtitleDownloadFailed": "Kunne ikke downloade undertekst",
|
||||
"searchLanguages": "Søg sprog..."
|
||||
},
|
||||
"userStatus": {
|
||||
"admin": "Administrator",
|
||||
"restricted": "Begrænset",
|
||||
"protected": "Beskyttet",
|
||||
"current": "NUVÆRENDE"
|
||||
},
|
||||
"userStatus": {},
|
||||
"messages": {
|
||||
"markedAsWatched": "Markeret som set",
|
||||
"markedAsUnwatched": "Markeret som uset",
|
||||
@@ -512,6 +536,8 @@
|
||||
"autoRemovedWatchedDownload": "Automatisk fjernet: ${title}",
|
||||
"removedFromContinueWatching": "Fjernet fra Fortsæt med at se",
|
||||
"errorLoading": "Fejl: ${error}",
|
||||
"streamInterrupted": "Streamen blev afbrudt. Tryk på afspil, eller spol for at prøve igen.",
|
||||
"liveStreamInterrupted": "Livestreamen blev afbrudt. Tryk på afspil for at prøve igen.",
|
||||
"fileInfoNotAvailable": "Filinfo ikke tilgængelig",
|
||||
"errorLoadingFileInfo": "Fejl ved indlæsning af filinfo: ${error}",
|
||||
"errorLoadingSeries": "Fejl ved indlæsning af serie",
|
||||
@@ -634,15 +660,16 @@
|
||||
"borrowConnectionBorrowed": "Forbindelse lånt.",
|
||||
"borrowFailed": "Kunne ikke låne forbindelse.",
|
||||
"incorrectPin": "Forkert PIN.",
|
||||
"incorrectPinTryAgain": "Forkert PIN. Prøv igen.",
|
||||
"sourceProfileMissingParentAccount": "Kildeprofilen mangler sin overordnede konto.",
|
||||
"failedToLoadHomeUsers": "Kunne ikke indlæse dine Plex Home-brugere. Tjek din forbindelse, og prøv igen.",
|
||||
"failedToVerifyPin": "Kunne ikke bekræfte PIN.",
|
||||
"newProfile": "Ny profil",
|
||||
"profileNameHint": "fx. Gæster, Børn, Familiens stue",
|
||||
"pinProtectionOptional": "PIN-beskyttelse (valgfri)",
|
||||
"pinExplain": "4-cifret PIN kræves for at skifte profiler.",
|
||||
"continueButton": "Fortsæt",
|
||||
"pinsDontMatch": "PIN-koder matcher ikke",
|
||||
"initializeServicesFailed": "Kunne ikke initialisere profiltjenester"
|
||||
"pinsDontMatch": "PIN-koder matcher ikke"
|
||||
},
|
||||
"connections": {
|
||||
"sectionTitle": "Forbindelser",
|
||||
@@ -657,7 +684,6 @@
|
||||
},
|
||||
"discover": {
|
||||
"title": "Opdag",
|
||||
"switchProfile": "Skift profil",
|
||||
"noContentAvailable": "Intet indhold tilgængeligt",
|
||||
"addMediaToLibraries": "Tilføj medier til dine biblioteker",
|
||||
"continueWatching": "Fortsæt med at se",
|
||||
@@ -666,6 +692,9 @@
|
||||
"nextUpIn": "Næste op i ${library}",
|
||||
"recentlyAdded": "Nyligt tilføjet",
|
||||
"recentlyAddedIn": "Nyligt tilføjet i ${library}",
|
||||
"latestAlbumsIn": "Nyeste album i ${library}",
|
||||
"recentlyPlayedIn": "Senest afspillet i ${library}",
|
||||
"mostPlayedIn": "Mest afspillet i ${library}",
|
||||
"playEpisode": "S${season}E${episode}",
|
||||
"overview": "Oversigt",
|
||||
"cast": "Rollebesætning",
|
||||
@@ -683,8 +712,6 @@
|
||||
"connectionFailed": "Kan ikke oprette forbindelse til medieserver",
|
||||
"failedToLoad": "Kunne ikke indlæse ${context}: ${error}",
|
||||
"noClientAvailable": "Ingen klient tilgængelig",
|
||||
"authenticationFailed": "Godkendelse mislykkedes: ${error}",
|
||||
"couldNotLaunchUrl": "Kunne ikke åbne godkendelses-URL",
|
||||
"pleaseEnterToken": "Indtast et token",
|
||||
"invalidToken": "Ugyldigt token",
|
||||
"failedToVerifyToken": "Kunne ikke verificere token: ${error}",
|
||||
@@ -711,6 +738,8 @@
|
||||
"allLibrariesHidden": "Alle biblioteker er skjult",
|
||||
"hiddenLibrariesCount": "Skjulte biblioteker (${count})",
|
||||
"thisLibraryIsEmpty": "Dette bibliotek er tomt",
|
||||
"noItemsMatchFilters": "Ingen elementer matcher de aktive filtre",
|
||||
"resetFilters": "Nulstil filtre",
|
||||
"all": "Alle",
|
||||
"clearAll": "Ryd alle",
|
||||
"scanLibraryConfirm": "Er du sikker på, at du vil scanne \"${title}\"?",
|
||||
@@ -745,6 +774,9 @@
|
||||
"shows": "TV-serier",
|
||||
"seasons": "Sæsoner",
|
||||
"episodes": "Episoder",
|
||||
"artists": "Kunstnere",
|
||||
"albums": "Album",
|
||||
"tracks": "Numre",
|
||||
"folders": "Mapper"
|
||||
},
|
||||
"filterCategories": {
|
||||
@@ -752,7 +784,8 @@
|
||||
"year": "År",
|
||||
"contentRating": "Aldersvurdering",
|
||||
"tag": "Tag",
|
||||
"unwatched": "Usete"
|
||||
"unwatched": "Usete",
|
||||
"favorites": "Favoritter"
|
||||
},
|
||||
"sortLabels": {
|
||||
"title": "Titel",
|
||||
@@ -762,7 +795,6 @@
|
||||
"communityRating": "Fællesskabsvurdering",
|
||||
"criticRating": "Kritikerbedømmelse",
|
||||
"userRating": "Brugerbedømmelse",
|
||||
"lastPlayed": "Sidst afspillet",
|
||||
"datePlayed": "Afspilningsdato",
|
||||
"playCount": "Antal afspilninger",
|
||||
"productionYear": "Produktionsår",
|
||||
@@ -786,7 +818,6 @@
|
||||
"viewLicensesDescription": "Se licenser for tredjepartsbiblioteker"
|
||||
},
|
||||
"serverSelection": {
|
||||
"allServerConnectionsFailed": "Kunne ikke oprette forbindelse til nogen servere. Tjek dit netværk.",
|
||||
"noServersFoundForAccount": "Ingen servere fundet for ${username} (${email})",
|
||||
"failedToLoadServers": "Kunne ikke indlæse servere: ${error}"
|
||||
},
|
||||
@@ -811,13 +842,59 @@
|
||||
"navigation": {
|
||||
"libraries": "Biblioteker",
|
||||
"downloads": "Downloads",
|
||||
"liveTv": "Live TV"
|
||||
"liveTv": "Live TV",
|
||||
"explore": "Udforsk"
|
||||
},
|
||||
"explore": {
|
||||
"title": "Udforsk",
|
||||
"selectSource": "Vælg kilde",
|
||||
"rows": {
|
||||
"watchlist": "Ønskeliste",
|
||||
"recommendedMovies": "Anbefalede film",
|
||||
"recommendedShows": "Anbefalede serier",
|
||||
"trendingMovies": "Trending film",
|
||||
"trendingShows": "Trending serier",
|
||||
"popularMovies": "Populære film",
|
||||
"popularShows": "Populære serier",
|
||||
"suggestedAnime": "Foreslået anime",
|
||||
"airingAnime": "Top igangværende anime",
|
||||
"popularAnime": "Mest populære anime",
|
||||
"trending": "Trending",
|
||||
"upcomingMovies": "Kommende film",
|
||||
"upcomingShows": "Kommende serier"
|
||||
},
|
||||
"status": {
|
||||
"airing": "Sendes",
|
||||
"ended": "Afsluttet",
|
||||
"canceled": "Aflyst",
|
||||
"upcoming": "Kommende"
|
||||
},
|
||||
"episodeCount": {
|
||||
"one": "${n} afsnit",
|
||||
"other": "${n} afsnit"
|
||||
},
|
||||
"cast": "Rollebesætning",
|
||||
"characters": "Figurer",
|
||||
"addToWatchlist": "Føj til ønskeliste",
|
||||
"removeFromWatchlist": "Fjern fra ønskeliste",
|
||||
"watchlistUpdateFailed": "Kunne ikke opdatere ønskelisten",
|
||||
"notInLibrary": "Ikke i dit bibliotek",
|
||||
"inTheseLibraries": "I disse biblioteker",
|
||||
"checkingLibrary": "Tjekker dit bibliotek...",
|
||||
"emptyTitle": "Der er ikke noget her endnu",
|
||||
"emptyMessage": "Rækker fra ${source} vises her, når de har indhold.",
|
||||
"searchHint": "Søg i ${source}",
|
||||
"searchEmpty": "Ingen resultater for \"${query}\"",
|
||||
"searchPrompt": "Søg efter film og serier på ${source}.",
|
||||
"searchFailed": "Søgningen mislykkedes. Tjek din forbindelse, og prøv igen."
|
||||
},
|
||||
"liveTv": {
|
||||
"title": "Live TV",
|
||||
"guide": "Guide",
|
||||
"noChannels": "Ingen kanaler tilgængelige",
|
||||
"noDvr": "Ingen DVR konfigureret på nogen server",
|
||||
"serverUnavailable": "Live-tv-serveren er ikke tilgængelig.",
|
||||
"serverNotConnected": "Live-tv-serveren er ikke forbundet.",
|
||||
"noPrograms": "Ingen programdata tilgængelig",
|
||||
"liveStreamFailed": "Livestream mislykkedes",
|
||||
"unknownProgram": "Ukendt program",
|
||||
@@ -840,6 +917,7 @@
|
||||
"watchChannel": "Se kanal",
|
||||
"favorites": "Favoritter",
|
||||
"reorderFavorites": "Omarranger favoritter",
|
||||
"favoritesLoadFailed": "Favoritter kunne ikke indlæses. Kontrollér forbindelsen, og prøv igen.",
|
||||
"joinSession": "Deltag i igangværende session",
|
||||
"watchFromStart": "Se fra start (${minutes} min siden)",
|
||||
"watchLive": "Se live",
|
||||
@@ -848,11 +926,11 @@
|
||||
"recordEpisode": "Optag episode",
|
||||
"recordSeries": "Optag serie",
|
||||
"recordOptions": "Optageindstillinger",
|
||||
"saveTo": "Gem i",
|
||||
"recordings": "Optagelser",
|
||||
"scheduledRecordings": "Planlagt",
|
||||
"recordingRules": "Optagelsesregler",
|
||||
"noScheduledRecordings": "Ingen optagelser planlagt",
|
||||
"noRecordingRules": "Ingen optagelsesregler endnu",
|
||||
"manageRecording": "Administrer optagelse",
|
||||
"cancelRecording": "Annullér optagelse",
|
||||
"cancelRecordingTitle": "Annullér denne optagelse?",
|
||||
@@ -869,7 +947,6 @@
|
||||
"recordingCancelled": "Optagelse annulleret",
|
||||
"recordingRuleDeleted": "Optagelsesregel slettet",
|
||||
"processRecordingRules": "Genberegn regler",
|
||||
"loadingRecordings": "Indlæser optagelser ...",
|
||||
"recordingInProgress": "Optager nu",
|
||||
"recordingsCount": "${count} planlagt",
|
||||
"editRule": "Rediger regel",
|
||||
@@ -883,7 +960,6 @@
|
||||
"title": "Samlinger",
|
||||
"collection": "Samling",
|
||||
"empty": "Samlingen er tom",
|
||||
"unknownLibrarySection": "Kan ikke slette: Ukendt bibliotekssektion",
|
||||
"deleteCollection": "Slet samling",
|
||||
"deleteConfirm": "Slet \"${title}\"? Dette kan ikke fortrydes.",
|
||||
"deleted": "Samling slettet",
|
||||
@@ -923,6 +999,7 @@
|
||||
"itemAdded": "Tilføjet til playliste",
|
||||
"itemRemoved": "Fjernet fra playliste",
|
||||
"selectPlaylist": "Vælg playliste",
|
||||
"searchPlaylists": "Søg i playlister...",
|
||||
"errorCreating": "Kunne ikke oprette playliste",
|
||||
"errorDeleting": "Kunne ikke slette playliste",
|
||||
"errorLoading": "Kunne ikke indlæse playlister",
|
||||
@@ -930,6 +1007,33 @@
|
||||
"errorReordering": "Kunne ikke ændre rækkefølge på playlisteelement",
|
||||
"errorRemoving": "Kunne ikke fjerne fra playliste"
|
||||
},
|
||||
"music": {
|
||||
"goToAlbum": "Gå til album",
|
||||
"goToArtist": "Gå til kunstner",
|
||||
"instantMix": "Direkte miks",
|
||||
"playNext": "Afspil næste",
|
||||
"addToQueue": "Føj til kø",
|
||||
"discNumber": "Disk ${n}",
|
||||
"trackCount": {
|
||||
"one": "${n} nummer",
|
||||
"other": "${n} numre"
|
||||
},
|
||||
"nowPlaying": "Afspiller nu",
|
||||
"playingFrom": "Afspiller fra ${title}",
|
||||
"queue": "Kø",
|
||||
"clearQueue": "Ryd kø",
|
||||
"lyrics": "Sangtekst",
|
||||
"noLyrics": "Ingen sangtekst tilgængelig",
|
||||
"sleepTimer": "Sovetimer",
|
||||
"sleepTimerEndOfTrack": "Slutningen af nummeret",
|
||||
"sleepTimerMinutes": "${n} minutter",
|
||||
"stopPlayback": "Stop afspilning",
|
||||
"previousTrack": "Forrige nummer",
|
||||
"nextTrack": "Næste nummer",
|
||||
"repeat": "Gentag",
|
||||
"repeatAll": "Gentag alle",
|
||||
"repeatOne": "Gentag ét nummer"
|
||||
},
|
||||
"watchTogether": {
|
||||
"title": "Se sammen",
|
||||
"description": "Se indhold synkroniseret med venner og familie",
|
||||
@@ -985,7 +1089,10 @@
|
||||
"participantResumed": "${name} genoptog",
|
||||
"participantSeeked": "${name} spoled",
|
||||
"participantBuffering": "${name} bufferer",
|
||||
"participantNeedsUpdate": "${name} bruger en ældre appversion — synkronisering er ikke tilgængelig",
|
||||
"resumingWithout": "Fortsætter uden ${name}",
|
||||
"waitingForParticipants": "Venter på at andre indlæser...",
|
||||
"waitingForName": "Venter på ${name}...",
|
||||
"recentRooms": "Seneste rum",
|
||||
"renameRoom": "Omdøb rum",
|
||||
"removeRoom": "Fjern",
|
||||
@@ -997,6 +1104,8 @@
|
||||
"manage": "Administrer",
|
||||
"tvShows": "TV-serier",
|
||||
"movies": "Film",
|
||||
"music": "Musik",
|
||||
"tracksQueued": "${count} numre i kø til download",
|
||||
"noDownloads": "Ingen downloads endnu",
|
||||
"noDownloadsDescription": "Downloadet indhold vises her til offlinevisning",
|
||||
"downloadNow": "Download",
|
||||
@@ -1033,7 +1142,7 @@
|
||||
"customAmount": "Angiv antal...",
|
||||
"includeSpecials": "Inkludér specials",
|
||||
"howManyEpisodes": "Hvor mange episoder?",
|
||||
"itemsQueued": "${count} elementer sat i kø til download",
|
||||
"invalidEpisodeCount": "Indtast et gyldigt antal episoder.",
|
||||
"keepSynced": "Hold synkroniseret",
|
||||
"downloadOnce": "Download én gang",
|
||||
"keepNUnwatched": "Behold ${count} usete",
|
||||
@@ -1082,7 +1191,6 @@
|
||||
"unknownDevice": "Ukendt enhed",
|
||||
"session": {
|
||||
"startingServer": "Starter fjernserver...",
|
||||
"failedToCreate": "Kunne ikke starte fjernserver:",
|
||||
"hostAddress": "Værtsadresse",
|
||||
"connected": "Forbundet",
|
||||
"serverRunning": "Fjernserver aktiv",
|
||||
@@ -1143,6 +1251,8 @@
|
||||
"errors": {
|
||||
"noNetworkInterface": "Ingen netværksgrænseflade fundet",
|
||||
"authenticationFailed": "Godkendelse mislykkedes",
|
||||
"serverStartFailed": "Kunne ikke starte fjernserveren: ${error}",
|
||||
"commandFailed": "Kunne ikke sende fjernkommando: ${error}",
|
||||
"joinTimedOut": "Tidsgrænse for deltagelse i session overskredet",
|
||||
"failedToConnectAnyAddress": "Kunne ikke oprette forbindelse til nogen adresse",
|
||||
"connectionLostAfterAttempts": "Forbindelse mistet efter ${attempts} forsøg",
|
||||
@@ -1159,7 +1269,8 @@
|
||||
"audioOutput": "Lydoutput",
|
||||
"performanceOverlay": "Ydelsesoverlay",
|
||||
"audioPassthrough": "Lyd-passthrough",
|
||||
"audioNormalization": "Normalisér lydstyrke"
|
||||
"audioNormalization": "Normalisér lydstyrke",
|
||||
"audioDownmix": "Downmix til stereo"
|
||||
},
|
||||
"performanceOverlay": {
|
||||
"color": "Farve",
|
||||
@@ -1322,9 +1433,41 @@
|
||||
"watchedSync": "Synkroniser sét-status",
|
||||
"watchedSyncDescription": "Når du markerer ting som sét i Plezy, markeres de også på Trakt."
|
||||
},
|
||||
"trackers": {
|
||||
"title": "Trackere",
|
||||
"hubSubtitle": "Synkroniser afspilningsfremskridt med Trakt og andre tjenester.",
|
||||
"seerr": {
|
||||
"title": "Seerr",
|
||||
"connectTitle": "Forbind Seerr",
|
||||
"serverUrl": "Server-URL",
|
||||
"serverUrlHelper": "Adressen på din Seerr-instans",
|
||||
"checkServer": "Fortsæt",
|
||||
"signInWithJellyfin": "Log ind med Jellyfin",
|
||||
"signInWithEmby": "Log ind med Emby",
|
||||
"signInWithLocal": "Brug en lokal konto",
|
||||
"email": "E-mail",
|
||||
"noSignInMethods": "Denne Seerr-instans tilbyder ingen loginmetode, som Plezy understøtter.",
|
||||
"instance": "Instans",
|
||||
"disconnectConfirm": "Afbryd Seerr?",
|
||||
"disconnectConfirmBody": "Plezy glemmer denne Seerr-instans. Tilslut igen når som helst.",
|
||||
"request": "Anmod",
|
||||
"request4k": "Anmod i 4K",
|
||||
"seasons": "Sæsoner",
|
||||
"allSeasons": "Alle sæsoner",
|
||||
"advancedOptions": "Avanceret",
|
||||
"destinationServer": "Destinationsserver",
|
||||
"qualityProfile": "Kvalitetsprofil",
|
||||
"rootFolder": "Rodmappe",
|
||||
"languageProfile": "Sprogprofil",
|
||||
"requestSubmitted": "Anmodning sendt",
|
||||
"requestFailed": "Anmodning mislykkedes: ${error}",
|
||||
"requestsLoadFailed": "Kunne ikke indlæse anmodningsmuligheder",
|
||||
"nothingToRequest": "Alt er allerede tilgængeligt eller anmodet.",
|
||||
"statusAvailable": "Tilgængelig",
|
||||
"statusPartiallyAvailable": "Delvist tilgængelig",
|
||||
"statusRequested": "Anmodet",
|
||||
"statusProcessing": "Behandler"
|
||||
},
|
||||
"services": {
|
||||
"title": "Tjenester",
|
||||
"hubSubtitle": "Synkroniser dit visningsfremskridt, og anmod om nye titler.",
|
||||
"notConnected": "Ikke forbundet",
|
||||
"connectedAs": "Forbundet som @${username}",
|
||||
"scrobble": "Registrer fremgang automatisk",
|
||||
@@ -1332,10 +1475,11 @@
|
||||
"disconnectConfirm": "Afbryd ${service}?",
|
||||
"disconnectConfirmBody": "Plezy stopper med at opdatere ${service}. Tilslut igen når som helst.",
|
||||
"connectFailed": "Kunne ikke forbinde til ${service}. Prøv igen.",
|
||||
"services": {
|
||||
"names": {
|
||||
"mal": "MyAnimeList",
|
||||
"anilist": "AniList",
|
||||
"simkl": "Simkl"
|
||||
"simkl": "Simkl",
|
||||
"seerr": "Seerr"
|
||||
},
|
||||
"deviceCode": {
|
||||
"title": "Aktiver Plezy på ${service}",
|
||||
@@ -1382,7 +1526,6 @@
|
||||
"quickConnectFailed": "Quick Connect mislykkedes: ${error}",
|
||||
"addPlexTitle": "Log ind med Plex",
|
||||
"pinExpired": "PIN udløb før login. Prøv igen.",
|
||||
"duplicatePlexAccount": "Allerede logget ind på Plex. Log ud for at skifte konto.",
|
||||
"failedToRegisterAccount": "Kunne ikke registrere kontoen: ${error}",
|
||||
"enterJellyfinUrlError": "Angiv URL'en til din Jellyfin-server",
|
||||
"addConnectionTitle": "Tilføj forbindelse",
|
||||
|
||||
+190
-47
@@ -3,7 +3,6 @@
|
||||
"title": "Plezy"
|
||||
},
|
||||
"auth": {
|
||||
"signIn": "Anmelden",
|
||||
"signInWithPlex": "Mit Plex anmelden",
|
||||
"showQRCode": "QR-Code anzeigen",
|
||||
"authenticate": "Authentifizieren",
|
||||
@@ -56,10 +55,8 @@
|
||||
"episodeNumberTitle": "Episode ${number} - ${title}",
|
||||
"chapterNumber": "Kapitel ${number}",
|
||||
"reconnect": "Erneut verbinden",
|
||||
"exit": "Beenden",
|
||||
"viewAll": "Alle anzeigen",
|
||||
"checkingNetwork": "Netzwerk wird geprüft...",
|
||||
"refreshingServers": "Server werden aktualisiert...",
|
||||
"loadingServers": "Server werden geladen...",
|
||||
"connectingToServers": "Verbindung zu Servern...",
|
||||
"startingOfflineMode": "Offlinemodus wird gestartet...",
|
||||
@@ -139,10 +136,16 @@
|
||||
"tvFullCardLayoutDescription": "TV-Karten nur mit Bild verwenden und Darstellernamen einblenden",
|
||||
"focusGlow": "Fokus-Leuchten",
|
||||
"focusGlowDescription": "Sanftes Leuchten um die fokussierte Karte anzeigen",
|
||||
"visualEffects": "Visuelle Effekte",
|
||||
"visualEffectsAuto": "Automatisch",
|
||||
"visualEffectsAutoDescription": "Effekte auf leistungsschwachen Geräten automatisch reduzieren",
|
||||
"visualEffectsFull": "Vollständig",
|
||||
"visualEffectsReduced": "Reduziert",
|
||||
"visualEffectsReducedDescription": "Weniger Animationen und Grafiken mit niedrigerer Auflösung",
|
||||
"hideSpoilers": "Spoiler für nicht gesehene Episoden verbergen",
|
||||
"hideSpoilersDescription": "Vorschaubilder und Beschreibungen ungesehener Episoden verwischen",
|
||||
"playerBackend": "Player-Backend",
|
||||
"exoPlayer": "ExoPlayer (Empfohlen)",
|
||||
"exoPlayer": "ExoPlayer",
|
||||
"mpv": "mpv",
|
||||
"hardwareDecoding": "Hardware-Decodierung",
|
||||
"hardwareDecodingDescription": "Hardwarebeschleunigung verwenden, sofern verfügbar",
|
||||
@@ -151,7 +154,7 @@
|
||||
"bufferSizeAuto": "Auto (Empfohlen)",
|
||||
"bufferSizeWarning": "${heap}MB Speicher verfügbar. Ein ${size}MB-Puffer kann die Wiedergabe beeinträchtigen.",
|
||||
"defaultQualityTitle": "Standardqualität",
|
||||
"defaultQualityDescription": "Wird beim Starten der Wiedergabe verwendet. Niedrigere Werte reduzieren die Bandbreite.",
|
||||
"musicQualityTitle": "Musikqualität",
|
||||
"subtitleStyling": "Untertitel-Stil",
|
||||
"subtitleStylingDescription": "Aussehen von Untertiteln anpassen",
|
||||
"smallSkipDuration": "Kleine Sprungdauer",
|
||||
@@ -245,10 +248,9 @@
|
||||
"maxVolumePercent": "${percent}%",
|
||||
"discordRichPresence": "Discord Rich Presence",
|
||||
"discordRichPresenceDescription": "Zeige auf Discord, was du gerade schaust",
|
||||
"trakt": "Trakt",
|
||||
"traktDescription": "Wiedergabeverlauf mit Trakt synchronisieren",
|
||||
"trackers": "Tracker",
|
||||
"trackersDescription": "Fortschritt mit Trakt, MyAnimeList, AniList und Simkl synchronisieren",
|
||||
"services": "Dienste",
|
||||
"servicesDescription": "Trakt, MyAnimeList, Seerr und mehr verbinden",
|
||||
"manageLibrariesDescription": "Mediatheken neu anordnen und ausblenden",
|
||||
"companionRemoteServer": "Companion Remote Server",
|
||||
"companionRemoteServerDescription": "Mobilgeräten in deinem Netzwerk erlauben, diese App zu steuern",
|
||||
"autoPip": "Automatisches Bild-in-Bild",
|
||||
@@ -262,6 +264,32 @@
|
||||
"displaySwitchDelay": "Verzögerung beim Displaywechsel",
|
||||
"tunneledPlayback": "Tunnelwiedergabe",
|
||||
"tunneledPlaybackDescription": "Video-Tunneling verwenden. Deaktivieren, wenn HDR-Wiedergabe schwarzes Video zeigt.",
|
||||
"audioPassthrough": "Audio-Durchleitung",
|
||||
"audioPassthroughDescription": "Dolby/DTS-Audio ohne Neukodierung an deinen Receiver oder Fernseher senden und Surround-Sound erhalten. Deaktivieren, wenn kein Ton zu hören ist.",
|
||||
"audioPassthroughDescriptionAppleTv": "Übergibt Dolby Digital Plus (inkl. Atmos) als Bitstream an das System. DTS und TrueHD werden weiterhin als Mehrkanal-PCM wiedergegeben. Beim Spulen können kurze Tonaussetzer auftreten.",
|
||||
"audioDownmix": "Downmix auf Stereo",
|
||||
"audioDownmixDescription": "Mischt Surround-Ton für Stereo-Lautsprecher oder Kopfhörer auf zwei Kanäle herunter",
|
||||
"downmixCenterBoost": "Center-Kanal-Verstärkung",
|
||||
"downmixCenterBoostValue": "${db} dB",
|
||||
"downmixCenterBoostLabel": "Verstärkung (dB)",
|
||||
"downmixCenterBoostShort": "dB",
|
||||
"audioDownmixNormalize": "Lautstärke beim Downmix normalisieren",
|
||||
"audioDownmixNormalizeDescription": "Senkt den Mix ab, um Übersteuerung zu vermeiden. Deaktivieren, um die Originallautstärke zu behalten (laute Szenen können verzerren).",
|
||||
"atmosDiagnostics": "Atmos-Ausgabetest",
|
||||
"atmosDiagnosticsDescription": "Dolby-Atmos-Ausgabe diagnostizieren, indem Testsignale über den Systemplayer abgespielt werden",
|
||||
"atmosTestHlsAtmos": "Apple-Atmos-Stream",
|
||||
"atmosTestHlsAtmosDescription": "Garantiert funktionierender Dolby-Atmos-Stream. Der Receiver sollte Dolby Atmos anzeigen.",
|
||||
"atmosTestHlsControl": "Apple-Surround-Stream",
|
||||
"atmosTestHlsControlDescription": "Kontrollstream ohne Atmos. Der Receiver sollte Surround ohne Atmos anzeigen.",
|
||||
"atmosTestRawStream": "Roher EAC3-Stream",
|
||||
"atmosTestRawStreamDescription": "Streamt die Testdatei genau wie die Atmos-Wiedergabe im Player. Benötigt die URL der Testdatei.",
|
||||
"atmosTestRawFile": "Rohe EAC3-Datei",
|
||||
"atmosTestRawFileDescription": "Spielt die Testdatei mit bekannter Länge ab. Benötigt die URL der Testdatei.",
|
||||
"atmosTestStop": "Test stoppen",
|
||||
"atmosTestUrl": "URL der Testdatei",
|
||||
"atmosTestUrlDescription": "HTTP-URL einer rohen .ec3-Dolby-Atmos-Datei (z. B. mit ffmpeg extrahiert)",
|
||||
"atmosTestUrlMissing": "Zuerst die URL der Testdatei festlegen",
|
||||
"atmosTestStatus": "Status",
|
||||
"dvConversionMode": "Dolby-Vision-Konvertierung",
|
||||
"dvConversionModeDescription": "Wähle, wie ExoPlayer Dolby-Vision-Profil-7-Dateien behandelt.",
|
||||
"dvConversionAuto": "Automatisch",
|
||||
@@ -285,7 +313,6 @@
|
||||
"showNavBarLabels": "Navigationsleisten-Beschriftungen anzeigen",
|
||||
"showNavBarLabelsDescription": "Textbeschriftungen unter den Symbolen der Navigationsleiste anzeigen",
|
||||
"startupSection": "Startbereich",
|
||||
"startupSectionDescription": "Legt fest, welchen Bereich Plezy beim Start öffnet",
|
||||
"liveTvDefaultFavorites": "Standardmäßig Favoritenkanäle",
|
||||
"liveTvDefaultFavoritesDescription": "Beim Öffnen von Live TV nur Favoritenkanäle anzeigen",
|
||||
"display": "Anzeige",
|
||||
@@ -385,15 +412,11 @@
|
||||
"rateSheet": {
|
||||
"title": "Bewerten",
|
||||
"server": "Server",
|
||||
"starValue": "${rating} / 5",
|
||||
"scoreValue": "${score} / 10",
|
||||
"setScore": "Eine Wertung festlegen",
|
||||
"notRated": "Nicht bewertet",
|
||||
"liked": "Gefällt mir",
|
||||
"notLiked": "Nicht geliket",
|
||||
"favorite": "Favorit",
|
||||
"favorited": "Favorisiert",
|
||||
"saved": "Gespeichert",
|
||||
"notAvailable": "Keine Übereinstimmung gefunden",
|
||||
"noConnectedTrackers": "Verbinde einen Tracker in den Einstellungen, um dort zu bewerten."
|
||||
"noConnectedServices": "Verbinde einen Dienst in den Einstellungen, um dort zu bewerten."
|
||||
},
|
||||
"accessibility": {
|
||||
"mediaCardMovie": "${title}, Film",
|
||||
@@ -403,7 +426,15 @@
|
||||
"mediaCardWatched": "angesehen",
|
||||
"mediaCardPartiallyWatched": "${percent} Prozent angesehen",
|
||||
"mediaCardUnwatched": "ungeschaut",
|
||||
"tapToPlay": "Zum Abspielen tippen"
|
||||
"tapToPlay": "Zum Abspielen tippen",
|
||||
"decrease": "Verringern",
|
||||
"increase": "Erhöhen",
|
||||
"decreaseValue": "${label} verringern",
|
||||
"increaseValue": "${label} erhöhen",
|
||||
"hue": "Farbton",
|
||||
"saturation": "Sättigung",
|
||||
"brightness": "Helligkeit",
|
||||
"hexColor": "Hex-Farbe"
|
||||
},
|
||||
"tooltips": {
|
||||
"shufflePlay": "Zufallswiedergabe",
|
||||
@@ -449,13 +480,11 @@
|
||||
"settingsButton": "Wiedergabeeinstellungen",
|
||||
"tracksButton": "Audio und Untertitel",
|
||||
"chaptersButton": "Kapitel",
|
||||
"versionsButton": "Videoversionen",
|
||||
"versionQualityButton": "Version & Qualität",
|
||||
"versionColumnHeader": "Version",
|
||||
"qualityColumnHeader": "Qualität",
|
||||
"qualityOriginal": "Original",
|
||||
"qualityPresetLabel": "${resolution}p ${bitrate} Mbps",
|
||||
"qualityBandwidthEstimate": "~${bitrate} Mbps",
|
||||
"transcodeUnavailableFallback": "Transkodierung nicht verfügbar — Wiedergabe in Originalqualität",
|
||||
"pipButton": "Bild-in-Bild Modus",
|
||||
"aspectRatioButton": "Seitenverhältnis",
|
||||
@@ -498,12 +527,7 @@
|
||||
"subtitleDownloadFailed": "Untertitel konnte nicht heruntergeladen werden",
|
||||
"searchLanguages": "Sprachen suchen..."
|
||||
},
|
||||
"userStatus": {
|
||||
"admin": "Eigentümer",
|
||||
"restricted": "Eingeschränkt",
|
||||
"protected": "Geschützt",
|
||||
"current": "AKTUELL"
|
||||
},
|
||||
"userStatus": {},
|
||||
"messages": {
|
||||
"markedAsWatched": "Als gesehen markiert",
|
||||
"markedAsUnwatched": "Als ungesehen markiert",
|
||||
@@ -512,6 +536,8 @@
|
||||
"autoRemovedWatchedDownload": "Automatisch entfernt: ${title}",
|
||||
"removedFromContinueWatching": "Aus ‚Weiterschauen' entfernt",
|
||||
"errorLoading": "Fehler: ${error}",
|
||||
"streamInterrupted": "Der Stream wurde unterbrochen. Drücke auf Wiedergabe oder spule, um es erneut zu versuchen.",
|
||||
"liveStreamInterrupted": "Der Livestream wurde unterbrochen. Drücke auf Wiedergabe, um es erneut zu versuchen.",
|
||||
"fileInfoNotAvailable": "Dateiinfo nicht verfügbar",
|
||||
"errorLoadingFileInfo": "Fehler beim Laden der Dateiinfo: ${error}",
|
||||
"errorLoadingSeries": "Fehler beim Laden der Serie",
|
||||
@@ -634,15 +660,16 @@
|
||||
"borrowConnectionBorrowed": "Verbindung ausgeliehen.",
|
||||
"borrowFailed": "Verbindung konnte nicht ausgeliehen werden.",
|
||||
"incorrectPin": "Falsche PIN.",
|
||||
"incorrectPinTryAgain": "Falsche PIN. Bitte erneut versuchen.",
|
||||
"sourceProfileMissingParentAccount": "Dem Quellprofil fehlt das übergeordnete Konto.",
|
||||
"failedToLoadHomeUsers": "Deine Plex Home-Benutzer konnten nicht geladen werden. Prüfe deine Verbindung und versuche es erneut.",
|
||||
"failedToVerifyPin": "PIN konnte nicht verifiziert werden.",
|
||||
"newProfile": "Neues Profil",
|
||||
"profileNameHint": "z. B. Gäste, Kinder, Wohnzimmer",
|
||||
"pinProtectionOptional": "PIN-Schutz (optional)",
|
||||
"pinExplain": "4-stellige PIN zum Profilwechsel erforderlich.",
|
||||
"continueButton": "Weiter",
|
||||
"pinsDontMatch": "PINs stimmen nicht überein",
|
||||
"initializeServicesFailed": "Profildienste konnten nicht initialisiert werden"
|
||||
"pinsDontMatch": "PINs stimmen nicht überein"
|
||||
},
|
||||
"connections": {
|
||||
"sectionTitle": "Verbindungen",
|
||||
@@ -657,7 +684,6 @@
|
||||
},
|
||||
"discover": {
|
||||
"title": "Entdecken",
|
||||
"switchProfile": "Profil wechseln",
|
||||
"noContentAvailable": "Kein Inhalt verfügbar",
|
||||
"addMediaToLibraries": "Medien zur Mediathek hinzufügen",
|
||||
"continueWatching": "Weiterschauen",
|
||||
@@ -666,6 +692,9 @@
|
||||
"nextUpIn": "Als Nächstes in ${library}",
|
||||
"recentlyAdded": "Kürzlich hinzugefügt",
|
||||
"recentlyAddedIn": "Kürzlich hinzugefügt in ${library}",
|
||||
"latestAlbumsIn": "Neueste Alben in ${library}",
|
||||
"recentlyPlayedIn": "Kürzlich gespielt in ${library}",
|
||||
"mostPlayedIn": "Am häufigsten gespielt in ${library}",
|
||||
"playEpisode": "S${season}E${episode}",
|
||||
"overview": "Übersicht",
|
||||
"cast": "Besetzung",
|
||||
@@ -683,8 +712,6 @@
|
||||
"connectionFailed": "Keine Verbindung zum Medienserver möglich",
|
||||
"failedToLoad": "Fehler beim Laden von ${context}: ${error}",
|
||||
"noClientAvailable": "Kein Client verfügbar",
|
||||
"authenticationFailed": "Authentifizierung fehlgeschlagen: ${error}",
|
||||
"couldNotLaunchUrl": "Auth-URL konnte nicht geöffnet werden",
|
||||
"pleaseEnterToken": "Bitte Token eingeben",
|
||||
"invalidToken": "Ungültiges Token",
|
||||
"failedToVerifyToken": "Token-Verifizierung fehlgeschlagen: ${error}",
|
||||
@@ -711,6 +738,8 @@
|
||||
"allLibrariesHidden": "Alle Mediatheken sind ausgeblendet",
|
||||
"hiddenLibrariesCount": "Ausgeblendete Mediatheken (${count})",
|
||||
"thisLibraryIsEmpty": "Diese Mediathek ist leer",
|
||||
"noItemsMatchFilters": "Keine Elemente entsprechen den aktiven Filtern",
|
||||
"resetFilters": "Filter zurücksetzen",
|
||||
"all": "Alle",
|
||||
"clearAll": "Alle löschen",
|
||||
"scanLibraryConfirm": "„${title}“ wirklich scannen?",
|
||||
@@ -745,6 +774,9 @@
|
||||
"shows": "Serien",
|
||||
"seasons": "Staffeln",
|
||||
"episodes": "Episoden",
|
||||
"artists": "Interpreten",
|
||||
"albums": "Alben",
|
||||
"tracks": "Titel",
|
||||
"folders": "Ordner"
|
||||
},
|
||||
"filterCategories": {
|
||||
@@ -752,7 +784,8 @@
|
||||
"year": "Jahr",
|
||||
"contentRating": "Altersfreigabe",
|
||||
"tag": "Tag",
|
||||
"unwatched": "Ungesehene"
|
||||
"unwatched": "Ungesehene",
|
||||
"favorites": "Favoriten"
|
||||
},
|
||||
"sortLabels": {
|
||||
"title": "Titel",
|
||||
@@ -762,7 +795,6 @@
|
||||
"communityRating": "Community-Bewertung",
|
||||
"criticRating": "Kritikerbewertung",
|
||||
"userRating": "Benutzerbewertung",
|
||||
"lastPlayed": "Zuletzt abgespielt",
|
||||
"datePlayed": "Wiedergabedatum",
|
||||
"playCount": "Wiedergaben",
|
||||
"productionYear": "Produktionsjahr",
|
||||
@@ -786,7 +818,6 @@
|
||||
"viewLicensesDescription": "Lizenzen von Drittanbieter-Bibliotheken anzeigen"
|
||||
},
|
||||
"serverSelection": {
|
||||
"allServerConnectionsFailed": "Keine Verbindung zu Servern möglich. Prüfe dein Netzwerk.",
|
||||
"noServersFoundForAccount": "Keine Server gefunden für ${username} (${email})",
|
||||
"failedToLoadServers": "Server konnten nicht geladen werden: ${error}"
|
||||
},
|
||||
@@ -811,13 +842,59 @@
|
||||
"navigation": {
|
||||
"libraries": "Medien",
|
||||
"downloads": "Downloads",
|
||||
"liveTv": "Live-TV"
|
||||
"liveTv": "Live-TV",
|
||||
"explore": "Erkunden"
|
||||
},
|
||||
"explore": {
|
||||
"title": "Erkunden",
|
||||
"selectSource": "Quelle auswählen",
|
||||
"rows": {
|
||||
"watchlist": "Merkliste",
|
||||
"recommendedMovies": "Empfohlene Filme",
|
||||
"recommendedShows": "Empfohlene Serien",
|
||||
"trendingMovies": "Angesagte Filme",
|
||||
"trendingShows": "Angesagte Serien",
|
||||
"popularMovies": "Beliebte Filme",
|
||||
"popularShows": "Beliebte Serien",
|
||||
"suggestedAnime": "Vorgeschlagene Anime",
|
||||
"airingAnime": "Top laufende Anime",
|
||||
"popularAnime": "Beliebteste Anime",
|
||||
"trending": "Angesagt",
|
||||
"upcomingMovies": "Kommende Filme",
|
||||
"upcomingShows": "Kommende Serien"
|
||||
},
|
||||
"status": {
|
||||
"airing": "Laufend",
|
||||
"ended": "Beendet",
|
||||
"canceled": "Abgesetzt",
|
||||
"upcoming": "Demnächst"
|
||||
},
|
||||
"episodeCount": {
|
||||
"one": "${n} Folge",
|
||||
"other": "${n} Folgen"
|
||||
},
|
||||
"cast": "Besetzung",
|
||||
"characters": "Charaktere",
|
||||
"addToWatchlist": "Zur Merkliste hinzufügen",
|
||||
"removeFromWatchlist": "Von Merkliste entfernen",
|
||||
"watchlistUpdateFailed": "Merkliste konnte nicht aktualisiert werden",
|
||||
"notInLibrary": "Nicht in deiner Mediathek",
|
||||
"inTheseLibraries": "In diesen Mediatheken",
|
||||
"checkingLibrary": "Deine Mediathek wird überprüft...",
|
||||
"emptyTitle": "Hier ist noch nichts",
|
||||
"emptyMessage": "Zeilen aus ${source} erscheinen hier, sobald sie Inhalte enthalten.",
|
||||
"searchHint": "${source} durchsuchen",
|
||||
"searchEmpty": "Keine Ergebnisse für \"${query}\"",
|
||||
"searchPrompt": "Suche nach Filmen und Serien auf ${source}.",
|
||||
"searchFailed": "Suche fehlgeschlagen. Prüfe deine Verbindung und versuche es erneut."
|
||||
},
|
||||
"liveTv": {
|
||||
"title": "Live-TV",
|
||||
"guide": "Programmführer",
|
||||
"noChannels": "Keine Kanäle verfügbar",
|
||||
"noDvr": "Kein DVR auf einem Server konfiguriert",
|
||||
"serverUnavailable": "Der Live-TV-Server ist nicht verfügbar.",
|
||||
"serverNotConnected": "Der Live-TV-Server ist nicht verbunden.",
|
||||
"noPrograms": "Keine Programmdaten verfügbar",
|
||||
"liveStreamFailed": "Livestream fehlgeschlagen",
|
||||
"unknownProgram": "Unbekannte Sendung",
|
||||
@@ -840,6 +917,7 @@
|
||||
"watchChannel": "Kanal ansehen",
|
||||
"favorites": "Favoriten",
|
||||
"reorderFavorites": "Favoriten sortieren",
|
||||
"favoritesLoadFailed": "Favoriten konnten nicht geladen werden. Überprüfe deine Verbindung und versuche es erneut.",
|
||||
"joinSession": "Laufender Sitzung beitreten",
|
||||
"watchFromStart": "Von Anfang an ansehen (vor ${minutes} Min.)",
|
||||
"watchLive": "Live ansehen",
|
||||
@@ -848,11 +926,11 @@
|
||||
"recordEpisode": "Episode aufnehmen",
|
||||
"recordSeries": "Serie aufnehmen",
|
||||
"recordOptions": "Aufnahmeoptionen",
|
||||
"saveTo": "Speichern in",
|
||||
"recordings": "Aufnahmen",
|
||||
"scheduledRecordings": "Geplant",
|
||||
"recordingRules": "Aufnahmeregeln",
|
||||
"noScheduledRecordings": "Keine geplanten Aufnahmen",
|
||||
"noRecordingRules": "Noch keine Aufnahmeregeln",
|
||||
"manageRecording": "Aufnahme verwalten",
|
||||
"cancelRecording": "Aufnahme abbrechen",
|
||||
"cancelRecordingTitle": "Diese Aufnahme abbrechen?",
|
||||
@@ -869,7 +947,6 @@
|
||||
"recordingCancelled": "Aufnahme abgebrochen",
|
||||
"recordingRuleDeleted": "Aufnahmeregel gelöscht",
|
||||
"processRecordingRules": "Regeln neu bewerten",
|
||||
"loadingRecordings": "Aufnahmen werden geladen ...",
|
||||
"recordingInProgress": "Wird jetzt aufgenommen",
|
||||
"recordingsCount": "${count} geplant",
|
||||
"editRule": "Regel bearbeiten",
|
||||
@@ -883,7 +960,6 @@
|
||||
"title": "Sammlungen",
|
||||
"collection": "Sammlung",
|
||||
"empty": "Sammlung ist leer",
|
||||
"unknownLibrarySection": "Löschen nicht möglich: Unbekannte Bibliothekssektion",
|
||||
"deleteCollection": "Sammlung löschen",
|
||||
"deleteConfirm": "\"${title}\" löschen? Dies kann nicht rückgängig gemacht werden.",
|
||||
"deleted": "Sammlung gelöscht",
|
||||
@@ -923,6 +999,7 @@
|
||||
"itemAdded": "Zur Wiedergabeliste hinzugefügt",
|
||||
"itemRemoved": "Aus Wiedergabeliste entfernt",
|
||||
"selectPlaylist": "Wiedergabeliste auswählen",
|
||||
"searchPlaylists": "Wiedergabelisten durchsuchen...",
|
||||
"errorCreating": "Wiedergabeliste konnte nicht erstellt werden",
|
||||
"errorDeleting": "Wiedergabeliste konnte nicht gelöscht werden",
|
||||
"errorLoading": "Wiedergabelisten konnten nicht geladen werden",
|
||||
@@ -930,6 +1007,33 @@
|
||||
"errorReordering": "Element der Wiedergabeliste konnte nicht neu geordnet werden",
|
||||
"errorRemoving": "Konnte nicht aus der Wiedergabeliste entfernt werden"
|
||||
},
|
||||
"music": {
|
||||
"goToAlbum": "Zum Album",
|
||||
"goToArtist": "Zum Interpreten",
|
||||
"instantMix": "Instant-Mix",
|
||||
"playNext": "Als Nächstes abspielen",
|
||||
"addToQueue": "Zur Warteschlange hinzufügen",
|
||||
"discNumber": "Disc ${n}",
|
||||
"trackCount": {
|
||||
"one": "${n} Titel",
|
||||
"other": "${n} Titel"
|
||||
},
|
||||
"nowPlaying": "Wird wiedergegeben",
|
||||
"playingFrom": "Wiedergabe aus ${title}",
|
||||
"queue": "Warteschlange",
|
||||
"clearQueue": "Warteschlange leeren",
|
||||
"lyrics": "Songtext",
|
||||
"noLyrics": "Kein Songtext verfügbar",
|
||||
"sleepTimer": "Einschlaf-Timer",
|
||||
"sleepTimerEndOfTrack": "Ende des Titels",
|
||||
"sleepTimerMinutes": "${n} Minuten",
|
||||
"stopPlayback": "Wiedergabe stoppen",
|
||||
"previousTrack": "Vorheriger Titel",
|
||||
"nextTrack": "Nächster Titel",
|
||||
"repeat": "Wiederholen",
|
||||
"repeatAll": "Alle wiederholen",
|
||||
"repeatOne": "Titel wiederholen"
|
||||
},
|
||||
"watchTogether": {
|
||||
"title": "Gemeinsam Schauen",
|
||||
"description": "Inhalte synchron mit Freunden und Familie schauen",
|
||||
@@ -985,7 +1089,10 @@
|
||||
"participantResumed": "${name} hat fortgesetzt",
|
||||
"participantSeeked": "${name} hat gespult",
|
||||
"participantBuffering": "${name} puffert",
|
||||
"participantNeedsUpdate": "${name} verwendet eine ältere Appversion — Synchronisierung nicht verfügbar",
|
||||
"resumingWithout": "Fortfahren ohne ${name}",
|
||||
"waitingForParticipants": "Warte auf andere zum Laden...",
|
||||
"waitingForName": "Warten auf ${name}...",
|
||||
"recentRooms": "Letzte Räume",
|
||||
"renameRoom": "Raum umbenennen",
|
||||
"removeRoom": "Entfernen",
|
||||
@@ -997,6 +1104,8 @@
|
||||
"manage": "Verwalten",
|
||||
"tvShows": "Serien",
|
||||
"movies": "Filme",
|
||||
"music": "Musik",
|
||||
"tracksQueued": "${count} Titel zum Download in Warteschlange",
|
||||
"noDownloads": "Noch keine Downloads",
|
||||
"noDownloadsDescription": "Heruntergeladene Inhalte werden hier für die Offline-Wiedergabe angezeigt",
|
||||
"downloadNow": "Herunterladen",
|
||||
@@ -1033,7 +1142,7 @@
|
||||
"customAmount": "Eigene Anzahl...",
|
||||
"includeSpecials": "Specials einschließen",
|
||||
"howManyEpisodes": "Wie viele Episoden?",
|
||||
"itemsQueued": "${count} Elemente zum Download eingereiht",
|
||||
"invalidEpisodeCount": "Gib eine gültige Episodenanzahl ein.",
|
||||
"keepSynced": "Synchronisiert halten",
|
||||
"downloadOnce": "Einmal herunterladen",
|
||||
"keepNUnwatched": "${count} ungesehene behalten",
|
||||
@@ -1082,7 +1191,6 @@
|
||||
"unknownDevice": "Unbekanntes Gerät",
|
||||
"session": {
|
||||
"startingServer": "Remote-Server wird gestartet...",
|
||||
"failedToCreate": "Remote-Server konnte nicht gestartet werden:",
|
||||
"hostAddress": "Host-Adresse",
|
||||
"connected": "Verbunden",
|
||||
"serverRunning": "Remote-Server aktiv",
|
||||
@@ -1143,6 +1251,8 @@
|
||||
"errors": {
|
||||
"noNetworkInterface": "Keine Netzwerkschnittstelle gefunden",
|
||||
"authenticationFailed": "Authentifizierung fehlgeschlagen",
|
||||
"serverStartFailed": "Remote-Server konnte nicht gestartet werden: ${error}",
|
||||
"commandFailed": "Remote-Befehl konnte nicht gesendet werden: ${error}",
|
||||
"joinTimedOut": "Zeitüberschreitung beim Beitreten zur Sitzung",
|
||||
"failedToConnectAnyAddress": "Keine Verbindung zu einer Adresse möglich",
|
||||
"connectionLostAfterAttempts": "Verbindung nach ${attempts} Versuchen verloren",
|
||||
@@ -1159,7 +1269,8 @@
|
||||
"audioOutput": "Audioausgabe",
|
||||
"performanceOverlay": "Leistungsanzeige",
|
||||
"audioPassthrough": "Audio-Durchleitung",
|
||||
"audioNormalization": "Lautstärke normalisieren"
|
||||
"audioNormalization": "Lautstärke normalisieren",
|
||||
"audioDownmix": "Downmix auf Stereo"
|
||||
},
|
||||
"performanceOverlay": {
|
||||
"color": "Farbe",
|
||||
@@ -1322,9 +1433,41 @@
|
||||
"watchedSync": "Gesehen-Status synchronisieren",
|
||||
"watchedSyncDescription": "Wenn du Inhalte in Plezy als gesehen markierst, werden sie auch auf Trakt markiert."
|
||||
},
|
||||
"trackers": {
|
||||
"title": "Tracker",
|
||||
"hubSubtitle": "Wiedergabefortschritt mit Trakt und anderen Diensten synchronisieren.",
|
||||
"seerr": {
|
||||
"title": "Seerr",
|
||||
"connectTitle": "Seerr verbinden",
|
||||
"serverUrl": "Server-URL",
|
||||
"serverUrlHelper": "Die Adresse deiner Seerr-Instanz",
|
||||
"checkServer": "Weiter",
|
||||
"signInWithJellyfin": "Mit Jellyfin anmelden",
|
||||
"signInWithEmby": "Mit Emby anmelden",
|
||||
"signInWithLocal": "Lokales Konto verwenden",
|
||||
"email": "E-Mail",
|
||||
"noSignInMethods": "Diese Seerr-Instanz bietet keine von Plezy unterstützte Anmeldemethode.",
|
||||
"instance": "Instanz",
|
||||
"disconnectConfirm": "Seerr trennen?",
|
||||
"disconnectConfirmBody": "Plezy vergisst diese Seerr-Instanz. Jederzeit erneut verbinden.",
|
||||
"request": "Anfragen",
|
||||
"request4k": "In 4K anfragen",
|
||||
"seasons": "Staffeln",
|
||||
"allSeasons": "Alle Staffeln",
|
||||
"advancedOptions": "Erweitert",
|
||||
"destinationServer": "Zielserver",
|
||||
"qualityProfile": "Qualitätsprofil",
|
||||
"rootFolder": "Stammordner",
|
||||
"languageProfile": "Sprachprofil",
|
||||
"requestSubmitted": "Anfrage gesendet",
|
||||
"requestFailed": "Anfrage fehlgeschlagen: ${error}",
|
||||
"requestsLoadFailed": "Anfrageoptionen konnten nicht geladen werden",
|
||||
"nothingToRequest": "Alles ist bereits verfügbar oder angefragt.",
|
||||
"statusAvailable": "Verfügbar",
|
||||
"statusPartiallyAvailable": "Teilweise verfügbar",
|
||||
"statusRequested": "Angefragt",
|
||||
"statusProcessing": "Wird verarbeitet"
|
||||
},
|
||||
"services": {
|
||||
"title": "Dienste",
|
||||
"hubSubtitle": "Wiedergabefortschritt synchronisieren und neue Titel anfragen.",
|
||||
"notConnected": "Nicht verbunden",
|
||||
"connectedAs": "Verbunden als @${username}",
|
||||
"scrobble": "Fortschritt automatisch verfolgen",
|
||||
@@ -1332,10 +1475,11 @@
|
||||
"disconnectConfirm": "${service} trennen?",
|
||||
"disconnectConfirmBody": "Plezy aktualisiert ${service} nicht mehr. Jederzeit erneut verbinden.",
|
||||
"connectFailed": "Verbindung zu ${service} fehlgeschlagen. Versuche es erneut.",
|
||||
"services": {
|
||||
"names": {
|
||||
"mal": "MyAnimeList",
|
||||
"anilist": "AniList",
|
||||
"simkl": "Simkl"
|
||||
"simkl": "Simkl",
|
||||
"seerr": "Seerr"
|
||||
},
|
||||
"deviceCode": {
|
||||
"title": "Plezy auf ${service} aktivieren",
|
||||
@@ -1382,7 +1526,6 @@
|
||||
"quickConnectFailed": "Quick Connect fehlgeschlagen: ${error}",
|
||||
"addPlexTitle": "Mit Plex anmelden",
|
||||
"pinExpired": "PIN ist vor der Anmeldung abgelaufen. Bitte erneut versuchen.",
|
||||
"duplicatePlexAccount": "Bereits bei Plex angemeldet. Melde dich ab, um Konten zu wechseln.",
|
||||
"failedToRegisterAccount": "Konto konnte nicht registriert werden: ${error}",
|
||||
"enterJellyfinUrlError": "Gib die URL deines Jellyfin-Servers ein",
|
||||
"addConnectionTitle": "Verbindung hinzufügen",
|
||||
|
||||
+191
-47
@@ -3,7 +3,6 @@
|
||||
"title": "Plezy"
|
||||
},
|
||||
"auth": {
|
||||
"signIn": "Sign in",
|
||||
"signInWithPlex": "Sign in with Plex",
|
||||
"showQRCode": "Show QR Code",
|
||||
"authenticate": "Authenticate",
|
||||
@@ -56,10 +55,8 @@
|
||||
"episodeNumberTitle": "Episode ${number} - ${title}",
|
||||
"chapterNumber": "Chapter ${number}",
|
||||
"reconnect": "Reconnect",
|
||||
"exit": "Exit",
|
||||
"viewAll": "View All",
|
||||
"checkingNetwork": "Checking network...",
|
||||
"refreshingServers": "Refreshing servers...",
|
||||
"loadingServers": "Loading servers...",
|
||||
"connectingToServers": "Connecting to servers...",
|
||||
"startingOfflineMode": "Starting offline mode...",
|
||||
@@ -148,7 +145,7 @@
|
||||
"hideSpoilers": "Hide Spoilers for Unwatched Episodes",
|
||||
"hideSpoilersDescription": "Blur thumbnails and descriptions for unwatched episodes",
|
||||
"playerBackend": "Player Backend",
|
||||
"exoPlayer": "ExoPlayer (Recommended)",
|
||||
"exoPlayer": "ExoPlayer",
|
||||
"mpv": "mpv",
|
||||
"hardwareDecoding": "Hardware Decoding",
|
||||
"hardwareDecodingDescription": "Use hardware acceleration when available",
|
||||
@@ -157,7 +154,7 @@
|
||||
"bufferSizeAuto": "Auto (Recommended)",
|
||||
"bufferSizeWarning": "${heap}MB memory available. A ${size}MB buffer may affect playback.",
|
||||
"defaultQualityTitle": "Default Quality",
|
||||
"defaultQualityDescription": "Used when starting playback. Lower values reduce bandwidth.",
|
||||
"musicQualityTitle": "Music Quality",
|
||||
"subtitleStyling": "Subtitle Styling",
|
||||
"subtitleStylingDescription": "Customize subtitle appearance",
|
||||
"smallSkipDuration": "Small Skip Duration",
|
||||
@@ -251,10 +248,9 @@
|
||||
"maxVolumePercent": "${percent}%",
|
||||
"discordRichPresence": "Discord Rich Presence",
|
||||
"discordRichPresenceDescription": "Show what you're watching on Discord",
|
||||
"trakt": "Trakt",
|
||||
"traktDescription": "Sync watch history with Trakt",
|
||||
"trackers": "Trackers",
|
||||
"trackersDescription": "Sync progress to Trakt, MyAnimeList, AniList, and Simkl",
|
||||
"services": "Services",
|
||||
"servicesDescription": "Connect Trakt, MyAnimeList, Seerr, and more",
|
||||
"manageLibrariesDescription": "Reorder and hide libraries",
|
||||
"companionRemoteServer": "Companion Remote Server",
|
||||
"companionRemoteServerDescription": "Allow mobile devices on your network to control this app",
|
||||
"autoPip": "Auto Picture-in-Picture",
|
||||
@@ -268,6 +264,32 @@
|
||||
"displaySwitchDelay": "Display Switch Delay",
|
||||
"tunneledPlayback": "Tunneled Playback",
|
||||
"tunneledPlaybackDescription": "Use video tunneling. Disable if HDR playback shows black video.",
|
||||
"audioPassthrough": "Audio Passthrough",
|
||||
"audioPassthroughDescription": "Send Dolby/DTS audio to your receiver or TV without re-encoding, preserving surround sound. Turn off if you have no sound.",
|
||||
"audioPassthroughDescriptionAppleTv": "Use Apple's native Dolby decoder for Dolby Digital Plus, including Atmos. DTS and TrueHD still play as multichannel PCM. Turn off if you have no sound.",
|
||||
"audioDownmix": "Downmix to Stereo",
|
||||
"audioDownmixDescription": "Mix surround audio down to two channels for stereo speakers or headphones",
|
||||
"downmixCenterBoost": "Center Channel Boost",
|
||||
"downmixCenterBoostValue": "${db} dB",
|
||||
"downmixCenterBoostLabel": "Boost (dB)",
|
||||
"downmixCenterBoostShort": "dB",
|
||||
"audioDownmixNormalize": "Normalize Volume on Downmix",
|
||||
"audioDownmixNormalizeDescription": "Lower the mix to prevent clipping. Turn off to keep the original volume (may distort loud scenes).",
|
||||
"atmosDiagnostics": "Atmos Output Test",
|
||||
"atmosDiagnosticsDescription": "Diagnose Dolby Atmos output by playing test signals through the system player",
|
||||
"atmosTestHlsAtmos": "Apple Atmos stream",
|
||||
"atmosTestHlsAtmosDescription": "Known-good Dolby Atmos stream. The receiver should show Dolby Atmos.",
|
||||
"atmosTestHlsControl": "Apple surround stream",
|
||||
"atmosTestHlsControlDescription": "Non-Atmos control stream. The receiver should show surround without Atmos.",
|
||||
"atmosTestRawStream": "Raw EAC3 stream",
|
||||
"atmosTestRawStreamDescription": "Streams the test file exactly like in-player Atmos playback. Needs the test file URL.",
|
||||
"atmosTestRawFile": "Raw EAC3 file",
|
||||
"atmosTestRawFileDescription": "Plays the test file with a known length. Needs the test file URL.",
|
||||
"atmosTestStop": "Stop test",
|
||||
"atmosTestUrl": "Test file URL",
|
||||
"atmosTestUrlDescription": "HTTP URL of a raw .ec3 Dolby Atmos file (e.g. extracted with ffmpeg)",
|
||||
"atmosTestUrlMissing": "Set the test file URL first",
|
||||
"atmosTestStatus": "Status",
|
||||
"dvConversionMode": "Dolby Vision Conversion",
|
||||
"dvConversionModeDescription": "Choose how ExoPlayer handles Dolby Vision Profile 7 files.",
|
||||
"dvConversionAuto": "Auto",
|
||||
@@ -291,7 +313,6 @@
|
||||
"showNavBarLabels": "Show Navigation Bar Labels",
|
||||
"showNavBarLabelsDescription": "Display text labels under navigation bar icons",
|
||||
"startupSection": "Startup Section",
|
||||
"startupSectionDescription": "Choose which section Plezy opens to when it starts",
|
||||
"liveTvDefaultFavorites": "Default to Favorite Channels",
|
||||
"liveTvDefaultFavoritesDescription": "Show only favorite channels when opening Live TV",
|
||||
"display": "Display",
|
||||
@@ -315,6 +336,8 @@
|
||||
"clearShortcut": "Clear shortcut",
|
||||
"noShortcutSet": "No shortcut set",
|
||||
"currentShortcut": "Current shortcut:",
|
||||
"pressToRecord": "Select to record a shortcut",
|
||||
"recordingShortcut": "Press the shortcut now",
|
||||
"actions": {
|
||||
"playPause": "Play/Pause",
|
||||
"volumeUp": "Volume Up",
|
||||
@@ -391,15 +414,11 @@
|
||||
"rateSheet": {
|
||||
"title": "Rate",
|
||||
"server": "Server",
|
||||
"starValue": "${rating} / 5",
|
||||
"scoreValue": "${score} / 10",
|
||||
"setScore": "Set a score",
|
||||
"notRated": "Not rated",
|
||||
"liked": "Liked",
|
||||
"notLiked": "Not liked",
|
||||
"favorite": "Favorite",
|
||||
"favorited": "Favorited",
|
||||
"saved": "Saved",
|
||||
"notAvailable": "No match found",
|
||||
"noConnectedTrackers": "Connect a tracker in Settings to rate there."
|
||||
"noConnectedServices": "Connect a service in Settings to rate there."
|
||||
},
|
||||
"accessibility": {
|
||||
"mediaCardMovie": "${title}, movie",
|
||||
@@ -409,7 +428,17 @@
|
||||
"mediaCardWatched": "watched",
|
||||
"mediaCardPartiallyWatched": "${percent} percent watched",
|
||||
"mediaCardUnwatched": "unwatched",
|
||||
"tapToPlay": "Tap to play"
|
||||
"tapToPlay": "Tap to play",
|
||||
"decrease": "Decrease",
|
||||
"increase": "Increase",
|
||||
"decreaseValue": "Decrease ${label}",
|
||||
"increaseValue": "Increase ${label}",
|
||||
"hue": "Hue",
|
||||
"saturation": "Saturation",
|
||||
"brightness": "Brightness",
|
||||
"hexColor": "Hex color",
|
||||
"expandText": "Expand text",
|
||||
"collapseText": "Collapse text"
|
||||
},
|
||||
"tooltips": {
|
||||
"shufflePlay": "Shuffle play",
|
||||
@@ -455,13 +484,11 @@
|
||||
"settingsButton": "Playback Settings",
|
||||
"tracksButton": "Audio & Subtitles",
|
||||
"chaptersButton": "Chapters",
|
||||
"versionsButton": "Video versions",
|
||||
"versionQualityButton": "Version & Quality",
|
||||
"versionColumnHeader": "Version",
|
||||
"qualityColumnHeader": "Quality",
|
||||
"qualityOriginal": "Original",
|
||||
"qualityPresetLabel": "${resolution}p ${bitrate} Mbps",
|
||||
"qualityBandwidthEstimate": "~${bitrate} Mbps",
|
||||
"transcodeUnavailableFallback": "Transcoding unavailable — playing original quality",
|
||||
"pipButton": "Picture-in-Picture mode",
|
||||
"aspectRatioButton": "Aspect ratio",
|
||||
@@ -504,12 +531,7 @@
|
||||
"subtitleDownloadFailed": "Failed to download subtitle",
|
||||
"searchLanguages": "Search languages..."
|
||||
},
|
||||
"userStatus": {
|
||||
"admin": "Admin",
|
||||
"restricted": "Restricted",
|
||||
"protected": "Protected",
|
||||
"current": "CURRENT"
|
||||
},
|
||||
"userStatus": {},
|
||||
"messages": {
|
||||
"markedAsWatched": "Marked as watched",
|
||||
"markedAsUnwatched": "Marked as unwatched",
|
||||
@@ -518,6 +540,8 @@
|
||||
"autoRemovedWatchedDownload": "Auto-removed: ${title}",
|
||||
"removedFromContinueWatching": "Removed from Continue Watching",
|
||||
"errorLoading": "Error: ${error}",
|
||||
"streamInterrupted": "The stream was interrupted. Press play or seek to retry.",
|
||||
"liveStreamInterrupted": "The live stream was interrupted. Press play to retry.",
|
||||
"fileInfoNotAvailable": "File information not available",
|
||||
"errorLoadingFileInfo": "Error loading file info: ${error}",
|
||||
"errorLoadingSeries": "Error loading series",
|
||||
@@ -640,15 +664,16 @@
|
||||
"borrowConnectionBorrowed": "Connection borrowed.",
|
||||
"borrowFailed": "Failed to borrow connection.",
|
||||
"incorrectPin": "Incorrect PIN.",
|
||||
"incorrectPinTryAgain": "Incorrect PIN. Please try again.",
|
||||
"sourceProfileMissingParentAccount": "Source profile is missing its parent account.",
|
||||
"failedToLoadHomeUsers": "Could not load your Plex Home users. Check your connection and try again.",
|
||||
"failedToVerifyPin": "Failed to verify PIN.",
|
||||
"newProfile": "New profile",
|
||||
"profileNameHint": "e.g. Guests, Kids, Family Room",
|
||||
"pinProtectionOptional": "PIN protection (optional)",
|
||||
"pinExplain": "4-digit PIN required to switch profiles.",
|
||||
"continueButton": "Continue",
|
||||
"pinsDontMatch": "PINs don't match",
|
||||
"initializeServicesFailed": "Failed to initialize profile services"
|
||||
"pinsDontMatch": "PINs don't match"
|
||||
},
|
||||
"connections": {
|
||||
"sectionTitle": "Connections",
|
||||
@@ -663,7 +688,6 @@
|
||||
},
|
||||
"discover": {
|
||||
"title": "Discover",
|
||||
"switchProfile": "Switch Profile",
|
||||
"noContentAvailable": "No content available",
|
||||
"addMediaToLibraries": "Add some media to your libraries",
|
||||
"continueWatching": "Continue Watching",
|
||||
@@ -672,6 +696,9 @@
|
||||
"nextUpIn": "Next Up in ${library}",
|
||||
"recentlyAdded": "Recently Added",
|
||||
"recentlyAddedIn": "Recently Added in ${library}",
|
||||
"latestAlbumsIn": "Latest Albums in ${library}",
|
||||
"recentlyPlayedIn": "Recently Played in ${library}",
|
||||
"mostPlayedIn": "Most Played in ${library}",
|
||||
"playEpisode": "S${season}E${episode}",
|
||||
"overview": "Overview",
|
||||
"cast": "Cast",
|
||||
@@ -689,8 +716,6 @@
|
||||
"connectionFailed": "Unable to connect to media server",
|
||||
"failedToLoad": "Failed to load ${context}: ${error}",
|
||||
"noClientAvailable": "No client available",
|
||||
"authenticationFailed": "Authentication failed: ${error}",
|
||||
"couldNotLaunchUrl": "Could not launch auth URL",
|
||||
"pleaseEnterToken": "Please enter a token",
|
||||
"invalidToken": "Invalid token",
|
||||
"failedToVerifyToken": "Failed to verify token: ${error}",
|
||||
@@ -717,6 +742,8 @@
|
||||
"allLibrariesHidden": "All libraries are hidden",
|
||||
"hiddenLibrariesCount": "Hidden libraries (${count})",
|
||||
"thisLibraryIsEmpty": "This library is empty",
|
||||
"noItemsMatchFilters": "No items match the active filters",
|
||||
"resetFilters": "Reset filters",
|
||||
"all": "All",
|
||||
"clearAll": "Clear All",
|
||||
"scanLibraryConfirm": "Are you sure you want to scan \"${title}\"?",
|
||||
@@ -751,6 +778,9 @@
|
||||
"shows": "TV Shows",
|
||||
"seasons": "Seasons",
|
||||
"episodes": "Episodes",
|
||||
"artists": "Artists",
|
||||
"albums": "Albums",
|
||||
"tracks": "Tracks",
|
||||
"folders": "Folders"
|
||||
},
|
||||
"filterCategories": {
|
||||
@@ -758,7 +788,8 @@
|
||||
"year": "Year",
|
||||
"contentRating": "Content Rating",
|
||||
"tag": "Tag",
|
||||
"unwatched": "Unwatched"
|
||||
"unwatched": "Unwatched",
|
||||
"favorites": "Favorites"
|
||||
},
|
||||
"sortLabels": {
|
||||
"title": "Title",
|
||||
@@ -768,7 +799,6 @@
|
||||
"communityRating": "Community Rating",
|
||||
"criticRating": "Critic Rating",
|
||||
"userRating": "User Rating",
|
||||
"lastPlayed": "Last Played",
|
||||
"datePlayed": "Date Played",
|
||||
"playCount": "Play Count",
|
||||
"productionYear": "Production Year",
|
||||
@@ -792,7 +822,6 @@
|
||||
"viewLicensesDescription": "View licenses of third-party libraries"
|
||||
},
|
||||
"serverSelection": {
|
||||
"allServerConnectionsFailed": "Couldn't connect to any servers. Check your network.",
|
||||
"noServersFoundForAccount": "No servers found for ${username} (${email})",
|
||||
"failedToLoadServers": "Failed to load servers: ${error}"
|
||||
},
|
||||
@@ -817,13 +846,59 @@
|
||||
"navigation": {
|
||||
"libraries": "Libraries",
|
||||
"downloads": "Downloads",
|
||||
"liveTv": "Live TV"
|
||||
"liveTv": "Live TV",
|
||||
"explore": "Explore"
|
||||
},
|
||||
"explore": {
|
||||
"title": "Explore",
|
||||
"selectSource": "Select source",
|
||||
"rows": {
|
||||
"watchlist": "Watchlist",
|
||||
"recommendedMovies": "Recommended Movies",
|
||||
"recommendedShows": "Recommended Shows",
|
||||
"trendingMovies": "Trending Movies",
|
||||
"trendingShows": "Trending Shows",
|
||||
"popularMovies": "Popular Movies",
|
||||
"popularShows": "Popular Shows",
|
||||
"suggestedAnime": "Suggested Anime",
|
||||
"airingAnime": "Top Airing Anime",
|
||||
"popularAnime": "Most Popular Anime",
|
||||
"trending": "Trending",
|
||||
"upcomingMovies": "Upcoming Movies",
|
||||
"upcomingShows": "Upcoming Shows"
|
||||
},
|
||||
"status": {
|
||||
"airing": "Airing",
|
||||
"ended": "Ended",
|
||||
"canceled": "Canceled",
|
||||
"upcoming": "Upcoming"
|
||||
},
|
||||
"episodeCount": {
|
||||
"one": "${n} episode",
|
||||
"other": "${n} episodes"
|
||||
},
|
||||
"cast": "Cast",
|
||||
"characters": "Characters",
|
||||
"addToWatchlist": "Add to Watchlist",
|
||||
"removeFromWatchlist": "Remove from Watchlist",
|
||||
"watchlistUpdateFailed": "Couldn't update watchlist",
|
||||
"notInLibrary": "Not in your library",
|
||||
"inTheseLibraries": "In these libraries",
|
||||
"checkingLibrary": "Checking your library...",
|
||||
"emptyTitle": "Nothing here yet",
|
||||
"emptyMessage": "Rows from ${source} will appear here once they have content.",
|
||||
"searchHint": "Search ${source}",
|
||||
"searchEmpty": "No results for \"${query}\"",
|
||||
"searchPrompt": "Search for movies and shows on ${source}.",
|
||||
"searchFailed": "Search failed. Check your connection and try again."
|
||||
},
|
||||
"liveTv": {
|
||||
"title": "Live TV",
|
||||
"guide": "Guide",
|
||||
"noChannels": "No channels available",
|
||||
"noDvr": "No DVR configured on any server",
|
||||
"serverUnavailable": "Live TV server is not available.",
|
||||
"serverNotConnected": "Live TV server is not connected.",
|
||||
"noPrograms": "No program data available",
|
||||
"liveStreamFailed": "Live stream failed",
|
||||
"unknownProgram": "Unknown Program",
|
||||
@@ -846,6 +921,7 @@
|
||||
"watchChannel": "Watch Channel",
|
||||
"favorites": "Favorites",
|
||||
"reorderFavorites": "Reorder Favorites",
|
||||
"favoritesLoadFailed": "Could not load favorites. Check your connection and try again.",
|
||||
"joinSession": "Join Session in Progress",
|
||||
"watchFromStart": "Watch from start (${minutes} min ago)",
|
||||
"watchLive": "Watch Live",
|
||||
@@ -854,11 +930,11 @@
|
||||
"recordEpisode": "Record Episode",
|
||||
"recordSeries": "Record Series",
|
||||
"recordOptions": "Record Options",
|
||||
"saveTo": "Save to",
|
||||
"recordings": "Recordings",
|
||||
"scheduledRecordings": "Scheduled",
|
||||
"recordingRules": "Recording Rules",
|
||||
"noScheduledRecordings": "Nothing scheduled to record",
|
||||
"noRecordingRules": "No recording rules yet",
|
||||
"manageRecording": "Manage recording",
|
||||
"cancelRecording": "Cancel recording",
|
||||
"cancelRecordingTitle": "Cancel this recording?",
|
||||
@@ -875,7 +951,6 @@
|
||||
"recordingCancelled": "Recording cancelled",
|
||||
"recordingRuleDeleted": "Recording rule deleted",
|
||||
"processRecordingRules": "Re-evaluate rules",
|
||||
"loadingRecordings": "Loading recordings...",
|
||||
"recordingInProgress": "Recording now",
|
||||
"recordingsCount": "${count} scheduled",
|
||||
"editRule": "Edit rule",
|
||||
@@ -889,7 +964,6 @@
|
||||
"title": "Collections",
|
||||
"collection": "Collection",
|
||||
"empty": "Collection is empty",
|
||||
"unknownLibrarySection": "Cannot delete: Unknown library section",
|
||||
"deleteCollection": "Delete Collection",
|
||||
"deleteConfirm": "Delete \"${title}\"? This can't be undone.",
|
||||
"deleted": "Collection deleted",
|
||||
@@ -929,6 +1003,7 @@
|
||||
"itemAdded": "Added to playlist",
|
||||
"itemRemoved": "Removed from playlist",
|
||||
"selectPlaylist": "Select Playlist",
|
||||
"searchPlaylists": "Search playlists...",
|
||||
"errorCreating": "Failed to create playlist",
|
||||
"errorDeleting": "Failed to delete playlist",
|
||||
"errorLoading": "Failed to load playlists",
|
||||
@@ -936,6 +1011,33 @@
|
||||
"errorReordering": "Failed to reorder playlist item",
|
||||
"errorRemoving": "Failed to remove from playlist"
|
||||
},
|
||||
"music": {
|
||||
"goToAlbum": "Go to album",
|
||||
"goToArtist": "Go to artist",
|
||||
"instantMix": "Instant Mix",
|
||||
"playNext": "Play next",
|
||||
"addToQueue": "Add to queue",
|
||||
"discNumber": "Disc ${n}",
|
||||
"trackCount": {
|
||||
"one": "${n} track",
|
||||
"other": "${n} tracks"
|
||||
},
|
||||
"nowPlaying": "Now Playing",
|
||||
"playingFrom": "Playing from ${title}",
|
||||
"queue": "Queue",
|
||||
"clearQueue": "Clear queue",
|
||||
"lyrics": "Lyrics",
|
||||
"noLyrics": "No lyrics available",
|
||||
"sleepTimer": "Sleep timer",
|
||||
"sleepTimerEndOfTrack": "End of track",
|
||||
"sleepTimerMinutes": "${n} minutes",
|
||||
"stopPlayback": "Stop playback",
|
||||
"previousTrack": "Previous track",
|
||||
"nextTrack": "Next track",
|
||||
"repeat": "Repeat",
|
||||
"repeatAll": "Repeat all",
|
||||
"repeatOne": "Repeat one"
|
||||
},
|
||||
"watchTogether": {
|
||||
"title": "Watch Together",
|
||||
"description": "Watch content in sync with friends and family",
|
||||
@@ -950,6 +1052,8 @@
|
||||
"hostingSession": "Hosting Session",
|
||||
"inSession": "In Session",
|
||||
"sessionCode": "Session Code",
|
||||
"openSessionControls": "Open Watch Together session controls",
|
||||
"copySessionCode": "Copy session code",
|
||||
"hostControlsPlayback": "Host controls playback",
|
||||
"anyoneCanControl": "Anyone can control playback",
|
||||
"hostControls": "Host controls",
|
||||
@@ -1006,6 +1110,8 @@
|
||||
"manage": "Manage",
|
||||
"tvShows": "TV Shows",
|
||||
"movies": "Movies",
|
||||
"music": "Music",
|
||||
"tracksQueued": "${count} tracks queued for download",
|
||||
"noDownloads": "No downloads yet",
|
||||
"noDownloadsDescription": "Downloaded content will appear here for offline viewing",
|
||||
"downloadNow": "Download",
|
||||
@@ -1042,7 +1148,7 @@
|
||||
"customAmount": "Custom amount...",
|
||||
"includeSpecials": "Include Specials",
|
||||
"howManyEpisodes": "How many episodes?",
|
||||
"itemsQueued": "${count} items queued for download",
|
||||
"invalidEpisodeCount": "Enter a valid episode count.",
|
||||
"keepSynced": "Keep synced",
|
||||
"downloadOnce": "Download once",
|
||||
"keepNUnwatched": "Keep ${count} unwatched",
|
||||
@@ -1091,7 +1197,6 @@
|
||||
"unknownDevice": "Unknown Device",
|
||||
"session": {
|
||||
"startingServer": "Starting remote server...",
|
||||
"failedToCreate": "Failed to start remote server:",
|
||||
"hostAddress": "Host Address",
|
||||
"connected": "Connected",
|
||||
"serverRunning": "Remote server active",
|
||||
@@ -1152,6 +1257,8 @@
|
||||
"errors": {
|
||||
"noNetworkInterface": "No network interface found",
|
||||
"authenticationFailed": "Authentication failed",
|
||||
"serverStartFailed": "Failed to start remote server: ${error}",
|
||||
"commandFailed": "Failed to send remote command: ${error}",
|
||||
"joinTimedOut": "Timed out joining session",
|
||||
"failedToConnectAnyAddress": "Failed to connect to any address",
|
||||
"connectionLostAfterAttempts": "Connection lost after ${attempts} attempts",
|
||||
@@ -1168,7 +1275,8 @@
|
||||
"audioOutput": "Audio Output",
|
||||
"performanceOverlay": "Performance Overlay",
|
||||
"audioPassthrough": "Audio Passthrough",
|
||||
"audioNormalization": "Normalize Loudness"
|
||||
"audioNormalization": "Normalize Loudness",
|
||||
"audioDownmix": "Downmix to Stereo"
|
||||
},
|
||||
"performanceOverlay": {
|
||||
"color": "Color",
|
||||
@@ -1256,6 +1364,8 @@
|
||||
"artworkUpdated": "Artwork updated",
|
||||
"artworkUpdateFailed": "Failed to update artwork",
|
||||
"noArtworkAvailable": "No artwork available",
|
||||
"artworkOption": "Artwork option ${index}",
|
||||
"selectedArtworkOption": "Artwork option ${index}, selected",
|
||||
"notSet": "Not set",
|
||||
"libraryDefault": "Library default",
|
||||
"accountDefault": "Account default",
|
||||
@@ -1331,9 +1441,41 @@
|
||||
"watchedSync": "Sync watched status",
|
||||
"watchedSyncDescription": "When you mark items watched in Plezy, mark them on Trakt."
|
||||
},
|
||||
"trackers": {
|
||||
"title": "Trackers",
|
||||
"hubSubtitle": "Sync watch progress with Trakt and other services.",
|
||||
"seerr": {
|
||||
"title": "Seerr",
|
||||
"connectTitle": "Connect Seerr",
|
||||
"serverUrl": "Server URL",
|
||||
"serverUrlHelper": "The address of your Seerr instance",
|
||||
"checkServer": "Continue",
|
||||
"signInWithJellyfin": "Sign in with Jellyfin",
|
||||
"signInWithEmby": "Sign in with Emby",
|
||||
"signInWithLocal": "Use a local account",
|
||||
"email": "Email",
|
||||
"noSignInMethods": "This Seerr instance offers no sign-in method Plezy supports.",
|
||||
"instance": "Instance",
|
||||
"disconnectConfirm": "Disconnect Seerr?",
|
||||
"disconnectConfirmBody": "Plezy will forget this Seerr instance. Reconnect any time.",
|
||||
"request": "Request",
|
||||
"request4k": "Request in 4K",
|
||||
"seasons": "Seasons",
|
||||
"allSeasons": "All seasons",
|
||||
"advancedOptions": "Advanced",
|
||||
"destinationServer": "Destination server",
|
||||
"qualityProfile": "Quality profile",
|
||||
"rootFolder": "Root folder",
|
||||
"languageProfile": "Language profile",
|
||||
"requestSubmitted": "Request submitted",
|
||||
"requestFailed": "Request failed: ${error}",
|
||||
"requestsLoadFailed": "Couldn't load request options",
|
||||
"nothingToRequest": "Everything is already available or requested.",
|
||||
"statusAvailable": "Available",
|
||||
"statusPartiallyAvailable": "Partially available",
|
||||
"statusRequested": "Requested",
|
||||
"statusProcessing": "Processing"
|
||||
},
|
||||
"services": {
|
||||
"title": "Services",
|
||||
"hubSubtitle": "Sync watch progress and request new titles.",
|
||||
"notConnected": "Not connected",
|
||||
"connectedAs": "Connected as @${username}",
|
||||
"scrobble": "Track progress automatically",
|
||||
@@ -1341,15 +1483,17 @@
|
||||
"disconnectConfirm": "Disconnect ${service}?",
|
||||
"disconnectConfirmBody": "Plezy will stop updating ${service}. Reconnect any time.",
|
||||
"connectFailed": "Couldn't connect to ${service}. Try again.",
|
||||
"services": {
|
||||
"names": {
|
||||
"mal": "MyAnimeList",
|
||||
"anilist": "AniList",
|
||||
"simkl": "Simkl"
|
||||
"simkl": "Simkl",
|
||||
"seerr": "Seerr"
|
||||
},
|
||||
"deviceCode": {
|
||||
"title": "Activate Plezy on ${service}",
|
||||
"body": "Visit ${url} and enter this code:",
|
||||
"openToActivate": "Open ${service} to activate",
|
||||
"copyCode": "Copy activation code",
|
||||
"waitingForAuthorization": "Waiting for authorization…",
|
||||
"codeCopied": "Code copied"
|
||||
},
|
||||
@@ -1357,6 +1501,7 @@
|
||||
"title": "Sign in to ${service}",
|
||||
"body": "Scan this QR code or open the URL on any device.",
|
||||
"openToSignIn": "Open ${service} to sign in",
|
||||
"copyUrl": "Copy sign-in URL",
|
||||
"urlCopied": "URL copied"
|
||||
},
|
||||
"libraryFilter": {
|
||||
@@ -1391,7 +1536,6 @@
|
||||
"quickConnectFailed": "Quick Connect failed: ${error}",
|
||||
"addPlexTitle": "Sign in with Plex",
|
||||
"pinExpired": "PIN expired before sign-in. Please try again.",
|
||||
"duplicatePlexAccount": "Already signed in to Plex. Sign out to switch accounts.",
|
||||
"failedToRegisterAccount": "Failed to register account: ${error}",
|
||||
"enterJellyfinUrlError": "Enter your Jellyfin server URL",
|
||||
"addConnectionTitle": "Add connection",
|
||||
|
||||
+190
-47
@@ -3,7 +3,6 @@
|
||||
"title": "Plezy"
|
||||
},
|
||||
"auth": {
|
||||
"signIn": "Iniciar sesión",
|
||||
"signInWithPlex": "Inicia sesión con Plex",
|
||||
"showQRCode": "Mostrar código QR",
|
||||
"authenticate": "Autenticar",
|
||||
@@ -56,10 +55,8 @@
|
||||
"episodeNumberTitle": "Episodio ${number} - ${title}",
|
||||
"chapterNumber": "Capítulo ${number}",
|
||||
"reconnect": "Reconectar",
|
||||
"exit": "Salir",
|
||||
"viewAll": "Ver todo",
|
||||
"checkingNetwork": "Comprobando red...",
|
||||
"refreshingServers": "Actualizando servidores...",
|
||||
"loadingServers": "Cargando servidores...",
|
||||
"connectingToServers": "Conectando a servidores...",
|
||||
"startingOfflineMode": "Iniciando modo sin conexión...",
|
||||
@@ -139,10 +136,16 @@
|
||||
"tvFullCardLayoutDescription": "Usar tarjetas TV solo con imagen y nombres de actores superpuestos",
|
||||
"focusGlow": "Brillo de foco",
|
||||
"focusGlowDescription": "Mostrar un brillo suave alrededor de la tarjeta con foco",
|
||||
"visualEffects": "Efectos visuales",
|
||||
"visualEffectsAuto": "Automático",
|
||||
"visualEffectsAutoDescription": "Reduce automáticamente los efectos en dispositivos de bajo consumo",
|
||||
"visualEffectsFull": "Completos",
|
||||
"visualEffectsReduced": "Reducidos",
|
||||
"visualEffectsReducedDescription": "Menos animaciones e ilustraciones de menor resolución",
|
||||
"hideSpoilers": "Ocultar spoilers de episodios no vistos",
|
||||
"hideSpoilersDescription": "Desenfocar miniaturas y descripciones de episodios no vistos",
|
||||
"playerBackend": "Reproductor",
|
||||
"exoPlayer": "ExoPlayer (Recomendado)",
|
||||
"exoPlayer": "ExoPlayer",
|
||||
"mpv": "mpv",
|
||||
"hardwareDecoding": "Decodificación por Hardware",
|
||||
"hardwareDecodingDescription": "Usar aceleración por hardware cuando esté disponible",
|
||||
@@ -151,7 +154,7 @@
|
||||
"bufferSizeAuto": "Auto (Recomendado)",
|
||||
"bufferSizeWarning": "${heap}MB de memoria disponible. Un búfer de ${size}MB puede afectar la reproducción.",
|
||||
"defaultQualityTitle": "Calidad predeterminada",
|
||||
"defaultQualityDescription": "Se utiliza al iniciar la reproducción. Los valores más bajos reducen el ancho de banda.",
|
||||
"musicQualityTitle": "Calidad de música",
|
||||
"subtitleStyling": "Estilo de Subtítulos",
|
||||
"subtitleStylingDescription": "Personalizar la apariencia de los subtítulos",
|
||||
"smallSkipDuration": "Salto pequeño",
|
||||
@@ -245,10 +248,9 @@
|
||||
"maxVolumePercent": "${percent}%",
|
||||
"discordRichPresence": "Presencia de Discord",
|
||||
"discordRichPresenceDescription": "Mostrar lo que estás viendo en Discord",
|
||||
"trakt": "Trakt",
|
||||
"traktDescription": "Sincronizar historial de visualización con Trakt",
|
||||
"trackers": "Rastreadores",
|
||||
"trackersDescription": "Sincronizar progreso con Trakt, MyAnimeList, AniList y Simkl",
|
||||
"services": "Servicios",
|
||||
"servicesDescription": "Conecta Trakt, MyAnimeList, Seerr y más",
|
||||
"manageLibrariesDescription": "Reordena y oculta bibliotecas",
|
||||
"companionRemoteServer": "Servidor de control remoto",
|
||||
"companionRemoteServerDescription": "Permitir que dispositivos móviles en tu red controlen esta aplicación",
|
||||
"autoPip": "Imagen en imagen automática",
|
||||
@@ -262,6 +264,32 @@
|
||||
"displaySwitchDelay": "Retraso de cambio de pantalla",
|
||||
"tunneledPlayback": "Reproducción tunelizada",
|
||||
"tunneledPlaybackDescription": "Usar tunelización de video. Desactívala si HDR muestra video negro.",
|
||||
"audioPassthrough": "Audio Passthrough",
|
||||
"audioPassthroughDescription": "Envía el audio Dolby/DTS a tu receptor o TV sin recodificar, conservando el sonido envolvente. Desactívalo si no tienes sonido.",
|
||||
"audioPassthroughDescriptionAppleTv": "Entrega Dolby Digital Plus (incluido Atmos) al sistema como bitstream. DTS y TrueHD se siguen reproduciendo como PCM multicanal. Pueden producirse breves cortes de audio al buscar.",
|
||||
"audioDownmix": "Mezclar a estéreo",
|
||||
"audioDownmixDescription": "Mezcla el sonido envolvente a dos canales para altavoces estéreo o auriculares",
|
||||
"downmixCenterBoost": "Realce del canal central",
|
||||
"downmixCenterBoostValue": "${db} dB",
|
||||
"downmixCenterBoostLabel": "Realce (dB)",
|
||||
"downmixCenterBoostShort": "dB",
|
||||
"audioDownmixNormalize": "Normalizar volumen al mezclar",
|
||||
"audioDownmixNormalizeDescription": "Reduce la mezcla para evitar saturación. Desactívalo para mantener el volumen original (puede distorsionar escenas fuertes).",
|
||||
"atmosDiagnostics": "Prueba de salida Atmos",
|
||||
"atmosDiagnosticsDescription": "Diagnostica la salida Dolby Atmos reproduciendo señales de prueba con el reproductor del sistema",
|
||||
"atmosTestHlsAtmos": "Stream Atmos de Apple",
|
||||
"atmosTestHlsAtmosDescription": "Stream Dolby Atmos de referencia. El receptor debería mostrar Dolby Atmos.",
|
||||
"atmosTestHlsControl": "Stream surround de Apple",
|
||||
"atmosTestHlsControlDescription": "Stream de control sin Atmos. El receptor debería mostrar surround sin Atmos.",
|
||||
"atmosTestRawStream": "Stream EAC3 sin procesar",
|
||||
"atmosTestRawStreamDescription": "Transmite el archivo de prueba igual que la reproducción Atmos del reproductor. Necesita la URL del archivo de prueba.",
|
||||
"atmosTestRawFile": "Archivo EAC3 sin procesar",
|
||||
"atmosTestRawFileDescription": "Reproduce el archivo de prueba con longitud conocida. Necesita la URL del archivo de prueba.",
|
||||
"atmosTestStop": "Detener prueba",
|
||||
"atmosTestUrl": "URL del archivo de prueba",
|
||||
"atmosTestUrlDescription": "URL HTTP de un archivo .ec3 Dolby Atmos sin procesar (p. ej., extraído con ffmpeg)",
|
||||
"atmosTestUrlMissing": "Configura primero la URL del archivo de prueba",
|
||||
"atmosTestStatus": "Estado",
|
||||
"dvConversionMode": "Conversión de Dolby Vision",
|
||||
"dvConversionModeDescription": "Elige cómo ExoPlayer gestiona archivos Dolby Vision Profile 7.",
|
||||
"dvConversionAuto": "Automático",
|
||||
@@ -285,7 +313,6 @@
|
||||
"showNavBarLabels": "Mostrar etiquetas de la barra de navegación",
|
||||
"showNavBarLabelsDescription": "Mostrar etiquetas de texto bajo los iconos de la barra de navegación",
|
||||
"startupSection": "Sección de inicio",
|
||||
"startupSectionDescription": "Elige qué sección abre Plezy al iniciarse",
|
||||
"liveTvDefaultFavorites": "Canales favoritos por defecto",
|
||||
"liveTvDefaultFavoritesDescription": "Mostrar solo canales favoritos al abrir TV en vivo",
|
||||
"display": "Pantalla",
|
||||
@@ -385,15 +412,11 @@
|
||||
"rateSheet": {
|
||||
"title": "Calificar",
|
||||
"server": "Servidor",
|
||||
"starValue": "${rating} / 5",
|
||||
"scoreValue": "${score} / 10",
|
||||
"setScore": "Establecer puntuación",
|
||||
"notRated": "Sin calificar",
|
||||
"liked": "Me gusta",
|
||||
"notLiked": "Sin Me gusta",
|
||||
"favorite": "Favorito",
|
||||
"favorited": "Marcado como favorito",
|
||||
"saved": "Guardado",
|
||||
"notAvailable": "No se encontró coincidencia",
|
||||
"noConnectedTrackers": "Conecta un tracker en Ajustes para calificar allí."
|
||||
"noConnectedServices": "Conecta un servicio en Configuración para calificar ahí."
|
||||
},
|
||||
"accessibility": {
|
||||
"mediaCardMovie": "${title}, película",
|
||||
@@ -403,7 +426,15 @@
|
||||
"mediaCardWatched": "visto",
|
||||
"mediaCardPartiallyWatched": "${percent} por ciento visto",
|
||||
"mediaCardUnwatched": "no visto",
|
||||
"tapToPlay": "Toca para reproducir"
|
||||
"tapToPlay": "Toca para reproducir",
|
||||
"decrease": "Disminuir",
|
||||
"increase": "Aumentar",
|
||||
"decreaseValue": "Disminuir ${label}",
|
||||
"increaseValue": "Aumentar ${label}",
|
||||
"hue": "Tono",
|
||||
"saturation": "Saturación",
|
||||
"brightness": "Brillo",
|
||||
"hexColor": "Color hexadecimal"
|
||||
},
|
||||
"tooltips": {
|
||||
"shufflePlay": "Reproducción aleatoria",
|
||||
@@ -449,13 +480,11 @@
|
||||
"settingsButton": "Ajustes de reproducción",
|
||||
"tracksButton": "Audio y subtítulos",
|
||||
"chaptersButton": "Capítulos",
|
||||
"versionsButton": "Versiones de video",
|
||||
"versionQualityButton": "Versión y calidad",
|
||||
"versionColumnHeader": "Versión",
|
||||
"qualityColumnHeader": "Calidad",
|
||||
"qualityOriginal": "Original",
|
||||
"qualityPresetLabel": "${resolution}p ${bitrate} Mbps",
|
||||
"qualityBandwidthEstimate": "~${bitrate} Mbps",
|
||||
"transcodeUnavailableFallback": "Transcodificación no disponible — reproduciendo calidad original",
|
||||
"pipButton": "Modo PiP (Imagen en Imagen)",
|
||||
"aspectRatioButton": "Relación de aspecto",
|
||||
@@ -498,12 +527,7 @@
|
||||
"subtitleDownloadFailed": "Error al descargar subtítulo",
|
||||
"searchLanguages": "Buscar idiomas..."
|
||||
},
|
||||
"userStatus": {
|
||||
"admin": "Administrador",
|
||||
"restricted": "Restringido",
|
||||
"protected": "Protegido",
|
||||
"current": "ACTUAL"
|
||||
},
|
||||
"userStatus": {},
|
||||
"messages": {
|
||||
"markedAsWatched": "Marcado como visto",
|
||||
"markedAsUnwatched": "Marcado como no visto",
|
||||
@@ -512,6 +536,8 @@
|
||||
"autoRemovedWatchedDownload": "Eliminado automáticamente: ${title}",
|
||||
"removedFromContinueWatching": "Eliminado de Seguir Viendo",
|
||||
"errorLoading": "Error: ${error}",
|
||||
"streamInterrupted": "La reproducción se interrumpió. Pulsa reproducir o avanza para volver a intentarlo.",
|
||||
"liveStreamInterrupted": "La transmisión en vivo se interrumpió. Pulsa reproducir para volver a intentarlo.",
|
||||
"fileInfoNotAvailable": "Información de archivo no disponible",
|
||||
"errorLoadingFileInfo": "Error al cargar info de archivo: ${error}",
|
||||
"errorLoadingSeries": "Error al cargar la serie",
|
||||
@@ -634,15 +660,16 @@
|
||||
"borrowConnectionBorrowed": "Conexión tomada prestada.",
|
||||
"borrowFailed": "No se pudo tomar prestada la conexión.",
|
||||
"incorrectPin": "PIN incorrecto.",
|
||||
"incorrectPinTryAgain": "PIN incorrecto. Inténtalo de nuevo.",
|
||||
"sourceProfileMissingParentAccount": "Al perfil de origen le falta su cuenta principal.",
|
||||
"failedToLoadHomeUsers": "No se pudieron cargar tus usuarios de Plex Home. Comprueba tu conexión e inténtalo de nuevo.",
|
||||
"failedToVerifyPin": "No se pudo verificar el PIN.",
|
||||
"newProfile": "Nuevo perfil",
|
||||
"profileNameHint": "p. ej. Invitados, Niños, Sala familiar",
|
||||
"pinProtectionOptional": "Protección con PIN (opcional)",
|
||||
"pinExplain": "Se requiere PIN de 4 dígitos para cambiar de perfil.",
|
||||
"continueButton": "Continuar",
|
||||
"pinsDontMatch": "Los PIN no coinciden",
|
||||
"initializeServicesFailed": "No se pudieron inicializar los servicios de perfil"
|
||||
"pinsDontMatch": "Los PIN no coinciden"
|
||||
},
|
||||
"connections": {
|
||||
"sectionTitle": "Conexiones",
|
||||
@@ -657,7 +684,6 @@
|
||||
},
|
||||
"discover": {
|
||||
"title": "Descubrir",
|
||||
"switchProfile": "Cambiar Perfil",
|
||||
"noContentAvailable": "No hay contenido disponible",
|
||||
"addMediaToLibraries": "Añade contenido a tus bibliotecas",
|
||||
"continueWatching": "Seguir Viendo",
|
||||
@@ -666,6 +692,9 @@
|
||||
"nextUpIn": "A continuación en ${library}",
|
||||
"recentlyAdded": "Añadido recientemente",
|
||||
"recentlyAddedIn": "Añadido recientemente en ${library}",
|
||||
"latestAlbumsIn": "Últimos álbumes en ${library}",
|
||||
"recentlyPlayedIn": "Reproducido recientemente en ${library}",
|
||||
"mostPlayedIn": "Más reproducido en ${library}",
|
||||
"playEpisode": "T${season}E${episode}",
|
||||
"overview": "Resumen",
|
||||
"cast": "Reparto",
|
||||
@@ -683,8 +712,6 @@
|
||||
"connectionFailed": "No se puede conectar al servidor multimedia",
|
||||
"failedToLoad": "Error al cargar ${context}: ${error}",
|
||||
"noClientAvailable": "No hay cliente disponible",
|
||||
"authenticationFailed": "Error de autenticación: ${error}",
|
||||
"couldNotLaunchUrl": "No se pudo abrir la URL de autenticación",
|
||||
"pleaseEnterToken": "Por favor, introduce un token",
|
||||
"invalidToken": "Token no válido",
|
||||
"failedToVerifyToken": "Error al verificar el token: ${error}",
|
||||
@@ -711,6 +738,8 @@
|
||||
"allLibrariesHidden": "Todas las bibliotecas están ocultas",
|
||||
"hiddenLibrariesCount": "Bibliotecas ocultas (${count})",
|
||||
"thisLibraryIsEmpty": "Esta biblioteca está vacía",
|
||||
"noItemsMatchFilters": "Ningún elemento coincide con los filtros activos",
|
||||
"resetFilters": "Restablecer filtros",
|
||||
"all": "Todos",
|
||||
"clearAll": "Borrar Todo",
|
||||
"scanLibraryConfirm": "¿Estás seguro de que quieres escanear \"${title}\"?",
|
||||
@@ -745,6 +774,9 @@
|
||||
"shows": "Series",
|
||||
"seasons": "Temporadas",
|
||||
"episodes": "Episodios",
|
||||
"artists": "Artistas",
|
||||
"albums": "Álbumes",
|
||||
"tracks": "Canciones",
|
||||
"folders": "Carpetas"
|
||||
},
|
||||
"filterCategories": {
|
||||
@@ -752,7 +784,8 @@
|
||||
"year": "Año",
|
||||
"contentRating": "Clasificación",
|
||||
"tag": "Etiqueta",
|
||||
"unwatched": "No vistos"
|
||||
"unwatched": "No vistos",
|
||||
"favorites": "Favoritos"
|
||||
},
|
||||
"sortLabels": {
|
||||
"title": "Título",
|
||||
@@ -762,7 +795,6 @@
|
||||
"communityRating": "Calificación de comunidad",
|
||||
"criticRating": "Calificación de crítica",
|
||||
"userRating": "Calificación del usuario",
|
||||
"lastPlayed": "Última reproducción",
|
||||
"datePlayed": "Fecha de reproducción",
|
||||
"playCount": "Reproducciones",
|
||||
"productionYear": "Año de producción",
|
||||
@@ -786,7 +818,6 @@
|
||||
"viewLicensesDescription": "Ver licencias de librerías de terceros"
|
||||
},
|
||||
"serverSelection": {
|
||||
"allServerConnectionsFailed": "No se pudo conectar a ningún servidor. Revisa tu red.",
|
||||
"noServersFoundForAccount": "No se encontraron servidores para ${username} (${email})",
|
||||
"failedToLoadServers": "Error al cargar servidores: ${error}"
|
||||
},
|
||||
@@ -811,13 +842,59 @@
|
||||
"navigation": {
|
||||
"libraries": "Medios",
|
||||
"downloads": "Descargas",
|
||||
"liveTv": "TV en vivo"
|
||||
"liveTv": "TV en vivo",
|
||||
"explore": "Explorar"
|
||||
},
|
||||
"explore": {
|
||||
"title": "Explorar",
|
||||
"selectSource": "Seleccionar fuente",
|
||||
"rows": {
|
||||
"watchlist": "Lista de seguimiento",
|
||||
"recommendedMovies": "Películas recomendadas",
|
||||
"recommendedShows": "Series recomendadas",
|
||||
"trendingMovies": "Películas en tendencia",
|
||||
"trendingShows": "Series en tendencia",
|
||||
"popularMovies": "Películas populares",
|
||||
"popularShows": "Series populares",
|
||||
"suggestedAnime": "Anime sugerido",
|
||||
"airingAnime": "Mejor anime en emisión",
|
||||
"popularAnime": "Anime más popular",
|
||||
"trending": "Tendencias",
|
||||
"upcomingMovies": "Próximas películas",
|
||||
"upcomingShows": "Próximas series"
|
||||
},
|
||||
"status": {
|
||||
"airing": "En emisión",
|
||||
"ended": "Finalizada",
|
||||
"canceled": "Cancelada",
|
||||
"upcoming": "Próximamente"
|
||||
},
|
||||
"episodeCount": {
|
||||
"one": "${n} episodio",
|
||||
"other": "${n} episodios"
|
||||
},
|
||||
"cast": "Reparto",
|
||||
"characters": "Personajes",
|
||||
"addToWatchlist": "Añadir a la lista de seguimiento",
|
||||
"removeFromWatchlist": "Quitar de la lista de seguimiento",
|
||||
"watchlistUpdateFailed": "No se pudo actualizar la lista de seguimiento",
|
||||
"notInLibrary": "No está en tu biblioteca",
|
||||
"inTheseLibraries": "En estas bibliotecas",
|
||||
"checkingLibrary": "Comprobando tu biblioteca...",
|
||||
"emptyTitle": "Aquí no hay nada todavía",
|
||||
"emptyMessage": "Las filas de ${source} aparecerán aquí cuando tengan contenido.",
|
||||
"searchHint": "Buscar en ${source}",
|
||||
"searchEmpty": "Sin resultados para \"${query}\"",
|
||||
"searchPrompt": "Busca películas y series en ${source}.",
|
||||
"searchFailed": "La búsqueda falló. Comprueba tu conexión e inténtalo de nuevo."
|
||||
},
|
||||
"liveTv": {
|
||||
"title": "TV en vivo",
|
||||
"guide": "Guía",
|
||||
"noChannels": "No hay canales disponibles",
|
||||
"noDvr": "No hay DVR configurado en ningún servidor",
|
||||
"serverUnavailable": "El servidor de TV en directo no está disponible.",
|
||||
"serverNotConnected": "El servidor de TV en directo no está conectado.",
|
||||
"noPrograms": "No hay datos de programación disponibles",
|
||||
"liveStreamFailed": "Falló la transmisión en vivo",
|
||||
"unknownProgram": "Programa desconocido",
|
||||
@@ -840,6 +917,7 @@
|
||||
"watchChannel": "Ver canal",
|
||||
"favorites": "Favoritos",
|
||||
"reorderFavorites": "Reordenar favoritos",
|
||||
"favoritesLoadFailed": "No se pudieron cargar los favoritos. Comprueba tu conexión e inténtalo de nuevo.",
|
||||
"joinSession": "Unirse a sesión en curso",
|
||||
"watchFromStart": "Ver desde el inicio (hace ${minutes} min)",
|
||||
"watchLive": "Ver en vivo",
|
||||
@@ -848,11 +926,11 @@
|
||||
"recordEpisode": "Grabar episodio",
|
||||
"recordSeries": "Grabar serie",
|
||||
"recordOptions": "Opciones de grabación",
|
||||
"saveTo": "Guardar en",
|
||||
"recordings": "Grabaciones",
|
||||
"scheduledRecordings": "Programadas",
|
||||
"recordingRules": "Reglas de grabación",
|
||||
"noScheduledRecordings": "No hay grabaciones programadas",
|
||||
"noRecordingRules": "Aún no hay reglas de grabación",
|
||||
"manageRecording": "Gestionar grabación",
|
||||
"cancelRecording": "Cancelar grabación",
|
||||
"cancelRecordingTitle": "¿Cancelar esta grabación?",
|
||||
@@ -869,7 +947,6 @@
|
||||
"recordingCancelled": "Grabación cancelada",
|
||||
"recordingRuleDeleted": "Regla de grabación eliminada",
|
||||
"processRecordingRules": "Reevaluar reglas",
|
||||
"loadingRecordings": "Cargando grabaciones...",
|
||||
"recordingInProgress": "Grabando ahora",
|
||||
"recordingsCount": "${count} programadas",
|
||||
"editRule": "Editar regla",
|
||||
@@ -883,7 +960,6 @@
|
||||
"title": "Colecciones",
|
||||
"collection": "Colección",
|
||||
"empty": "La colección está vacía",
|
||||
"unknownLibrarySection": "No se puede eliminar: Sección de biblioteca desconocida",
|
||||
"deleteCollection": "Eliminar Colección",
|
||||
"deleteConfirm": "¿Eliminar \"${title}\"? No se puede deshacer.",
|
||||
"deleted": "Colección eliminada",
|
||||
@@ -923,6 +999,7 @@
|
||||
"itemAdded": "Añadido a la lista",
|
||||
"itemRemoved": "Eliminado de la lista",
|
||||
"selectPlaylist": "Seleccionar Lista",
|
||||
"searchPlaylists": "Buscar listas...",
|
||||
"errorCreating": "Error al crear la lista",
|
||||
"errorDeleting": "Error al eliminar la lista",
|
||||
"errorLoading": "Error al cargar las listas",
|
||||
@@ -930,6 +1007,33 @@
|
||||
"errorReordering": "Error al reordenar los elementos de la lista",
|
||||
"errorRemoving": "Error al eliminar de la lista"
|
||||
},
|
||||
"music": {
|
||||
"goToAlbum": "Ir al álbum",
|
||||
"goToArtist": "Ir al artista",
|
||||
"instantMix": "Mezcla instantánea",
|
||||
"playNext": "Reproducir a continuación",
|
||||
"addToQueue": "Añadir a la cola",
|
||||
"discNumber": "Disco ${n}",
|
||||
"trackCount": {
|
||||
"one": "${n} canción",
|
||||
"other": "${n} canciones"
|
||||
},
|
||||
"nowPlaying": "Reproduciendo ahora",
|
||||
"playingFrom": "Reproduciendo desde ${title}",
|
||||
"queue": "Cola",
|
||||
"clearQueue": "Vaciar la cola",
|
||||
"lyrics": "Letra",
|
||||
"noLyrics": "No hay letra disponible",
|
||||
"sleepTimer": "Temporizador de apagado",
|
||||
"sleepTimerEndOfTrack": "Fin de la canción",
|
||||
"sleepTimerMinutes": "${n} minutos",
|
||||
"stopPlayback": "Detener reproducción",
|
||||
"previousTrack": "Canción anterior",
|
||||
"nextTrack": "Canción siguiente",
|
||||
"repeat": "Repetir",
|
||||
"repeatAll": "Repetir todo",
|
||||
"repeatOne": "Repetir una"
|
||||
},
|
||||
"watchTogether": {
|
||||
"title": "Ver Juntos",
|
||||
"description": "Mira contenido en sincronía con amigos y familiares",
|
||||
@@ -985,7 +1089,10 @@
|
||||
"participantResumed": "${name} reanudó",
|
||||
"participantSeeked": "${name} avanzó",
|
||||
"participantBuffering": "${name} está cargando",
|
||||
"participantNeedsUpdate": "${name} usa una versión anterior de la app — sincronización no disponible",
|
||||
"resumingWithout": "Reanudando sin ${name}",
|
||||
"waitingForParticipants": "Esperando a que otros carguen...",
|
||||
"waitingForName": "Esperando a ${name}...",
|
||||
"recentRooms": "Salas recientes",
|
||||
"renameRoom": "Renombrar sala",
|
||||
"removeRoom": "Eliminar",
|
||||
@@ -997,6 +1104,8 @@
|
||||
"manage": "Gestionar",
|
||||
"tvShows": "Series de TV",
|
||||
"movies": "Películas",
|
||||
"music": "Música",
|
||||
"tracksQueued": "${count} canciones en cola para descargar",
|
||||
"noDownloads": "No hay descargas aún",
|
||||
"noDownloadsDescription": "El contenido descargado aparecerá aquí para verlo sin conexión",
|
||||
"downloadNow": "Descargar",
|
||||
@@ -1033,7 +1142,7 @@
|
||||
"customAmount": "Cantidad personalizada...",
|
||||
"includeSpecials": "Incluir especiales",
|
||||
"howManyEpisodes": "¿Cuántos episodios?",
|
||||
"itemsQueued": "${count} elementos en cola de descarga",
|
||||
"invalidEpisodeCount": "Introduce un número de episodios válido.",
|
||||
"keepSynced": "Mantener sincronizado",
|
||||
"downloadOnce": "Descargar una vez",
|
||||
"keepNUnwatched": "Mantener ${count} sin ver",
|
||||
@@ -1082,7 +1191,6 @@
|
||||
"unknownDevice": "Dispositivo desconocido",
|
||||
"session": {
|
||||
"startingServer": "Iniciando servidor remoto...",
|
||||
"failedToCreate": "Error al iniciar el servidor remoto:",
|
||||
"hostAddress": "Dirección del host",
|
||||
"connected": "Conectado",
|
||||
"serverRunning": "Servidor remoto activo",
|
||||
@@ -1143,6 +1251,8 @@
|
||||
"errors": {
|
||||
"noNetworkInterface": "No se encontró ninguna interfaz de red",
|
||||
"authenticationFailed": "Autenticación fallida",
|
||||
"serverStartFailed": "No se pudo iniciar el servidor remoto: ${error}",
|
||||
"commandFailed": "No se pudo enviar el comando remoto: ${error}",
|
||||
"joinTimedOut": "Se agotó el tiempo al unirse a la sesión",
|
||||
"failedToConnectAnyAddress": "No se pudo conectar a ninguna dirección",
|
||||
"connectionLostAfterAttempts": "Conexión perdida tras ${attempts} intentos",
|
||||
@@ -1159,7 +1269,8 @@
|
||||
"audioOutput": "Salida de audio",
|
||||
"performanceOverlay": "Indicador de rendimiento",
|
||||
"audioPassthrough": "Audio Passthrough",
|
||||
"audioNormalization": "Normalizar volumen"
|
||||
"audioNormalization": "Normalizar volumen",
|
||||
"audioDownmix": "Mezclar a estéreo"
|
||||
},
|
||||
"performanceOverlay": {
|
||||
"color": "Color",
|
||||
@@ -1322,9 +1433,41 @@
|
||||
"watchedSync": "Sincronizar estado de visto",
|
||||
"watchedSyncDescription": "Cuando marques elementos como vistos en Plezy, también se marcarán en Trakt."
|
||||
},
|
||||
"trackers": {
|
||||
"title": "Rastreadores",
|
||||
"hubSubtitle": "Sincroniza el progreso de visualización con Trakt y otros servicios.",
|
||||
"seerr": {
|
||||
"title": "Seerr",
|
||||
"connectTitle": "Conectar Seerr",
|
||||
"serverUrl": "URL del servidor",
|
||||
"serverUrlHelper": "La dirección de tu instancia de Seerr",
|
||||
"checkServer": "Continuar",
|
||||
"signInWithJellyfin": "Iniciar sesión con Jellyfin",
|
||||
"signInWithEmby": "Iniciar sesión con Emby",
|
||||
"signInWithLocal": "Usar una cuenta local",
|
||||
"email": "Correo electrónico",
|
||||
"noSignInMethods": "Esta instancia de Seerr no ofrece ningún método de inicio de sesión compatible con Plezy.",
|
||||
"instance": "Instancia",
|
||||
"disconnectConfirm": "¿Desconectar Seerr?",
|
||||
"disconnectConfirmBody": "Plezy olvidará esta instancia de Seerr. Reconecta cuando quieras.",
|
||||
"request": "Solicitar",
|
||||
"request4k": "Solicitar en 4K",
|
||||
"seasons": "Temporadas",
|
||||
"allSeasons": "Todas las temporadas",
|
||||
"advancedOptions": "Avanzado",
|
||||
"destinationServer": "Servidor de destino",
|
||||
"qualityProfile": "Perfil de calidad",
|
||||
"rootFolder": "Carpeta raíz",
|
||||
"languageProfile": "Perfil de idioma",
|
||||
"requestSubmitted": "Solicitud enviada",
|
||||
"requestFailed": "La solicitud falló: ${error}",
|
||||
"requestsLoadFailed": "No se pudieron cargar las opciones de solicitud",
|
||||
"nothingToRequest": "Todo ya está disponible o solicitado.",
|
||||
"statusAvailable": "Disponible",
|
||||
"statusPartiallyAvailable": "Parcialmente disponible",
|
||||
"statusRequested": "Solicitado",
|
||||
"statusProcessing": "Procesando"
|
||||
},
|
||||
"services": {
|
||||
"title": "Servicios",
|
||||
"hubSubtitle": "Sincroniza tu progreso de visualización y solicita nuevos títulos.",
|
||||
"notConnected": "No conectado",
|
||||
"connectedAs": "Conectado como @${username}",
|
||||
"scrobble": "Registrar progreso automáticamente",
|
||||
@@ -1332,10 +1475,11 @@
|
||||
"disconnectConfirm": "¿Desconectar ${service}?",
|
||||
"disconnectConfirmBody": "Plezy dejará de actualizar ${service}. Reconecta cuando quieras.",
|
||||
"connectFailed": "No se pudo conectar a ${service}. Inténtalo de nuevo.",
|
||||
"services": {
|
||||
"names": {
|
||||
"mal": "MyAnimeList",
|
||||
"anilist": "AniList",
|
||||
"simkl": "Simkl"
|
||||
"simkl": "Simkl",
|
||||
"seerr": "Seerr"
|
||||
},
|
||||
"deviceCode": {
|
||||
"title": "Activar Plezy en ${service}",
|
||||
@@ -1382,7 +1526,6 @@
|
||||
"quickConnectFailed": "Quick Connect ha fallado: ${error}",
|
||||
"addPlexTitle": "Iniciar sesión con Plex",
|
||||
"pinExpired": "El PIN caducó antes de iniciar sesión. Inténtalo de nuevo.",
|
||||
"duplicatePlexAccount": "Ya iniciaste sesión en Plex. Cierra sesión para cambiar de cuenta.",
|
||||
"failedToRegisterAccount": "No se pudo registrar la cuenta: ${error}",
|
||||
"enterJellyfinUrlError": "Introduce la URL de tu servidor Jellyfin",
|
||||
"addConnectionTitle": "Añadir conexión",
|
||||
|
||||
+190
-47
@@ -3,7 +3,6 @@
|
||||
"title": "Plezy"
|
||||
},
|
||||
"auth": {
|
||||
"signIn": "Se connecter",
|
||||
"signInWithPlex": "S'inscrire avec Plex",
|
||||
"showQRCode": "Afficher le QR Code",
|
||||
"authenticate": "S'authentifier",
|
||||
@@ -56,10 +55,8 @@
|
||||
"episodeNumberTitle": "Épisode ${number} - ${title}",
|
||||
"chapterNumber": "Chapitre ${number}",
|
||||
"reconnect": "Reconnecter",
|
||||
"exit": "Quitter",
|
||||
"viewAll": "Tout afficher",
|
||||
"checkingNetwork": "Vérification du réseau...",
|
||||
"refreshingServers": "Actualisation des serveurs...",
|
||||
"loadingServers": "Chargement des serveurs...",
|
||||
"connectingToServers": "Connexion aux serveurs...",
|
||||
"startingOfflineMode": "Démarrage en mode hors-ligne...",
|
||||
@@ -139,10 +136,16 @@
|
||||
"tvFullCardLayoutDescription": "Utiliser des cartes TV avec image seule et noms des acteurs superposés",
|
||||
"focusGlow": "Halo de sélection",
|
||||
"focusGlowDescription": "Afficher un léger halo autour de la carte sélectionnée",
|
||||
"visualEffects": "Effets visuels",
|
||||
"visualEffectsAuto": "Automatique",
|
||||
"visualEffectsAutoDescription": "Réduire automatiquement les effets sur les appareils peu puissants",
|
||||
"visualEffectsFull": "Complets",
|
||||
"visualEffectsReduced": "Réduits",
|
||||
"visualEffectsReducedDescription": "Moins d’animations et d’illustrations de plus faible résolution",
|
||||
"hideSpoilers": "Masquer les spoilers des épisodes non vus",
|
||||
"hideSpoilersDescription": "Flouter les miniatures et descriptions des épisodes non vus",
|
||||
"playerBackend": "Moteur de lecture",
|
||||
"exoPlayer": "ExoPlayer (Recommandé)",
|
||||
"exoPlayer": "ExoPlayer",
|
||||
"mpv": "mpv",
|
||||
"hardwareDecoding": "Décodage matériel",
|
||||
"hardwareDecodingDescription": "Utilisez l'accélération matérielle lorsqu'elle est disponible.",
|
||||
@@ -151,7 +154,7 @@
|
||||
"bufferSizeAuto": "Auto (Recommandé)",
|
||||
"bufferSizeWarning": "${heap}MB de mémoire disponible. Un tampon de ${size}MB peut affecter la lecture.",
|
||||
"defaultQualityTitle": "Qualité par défaut",
|
||||
"defaultQualityDescription": "Utilisé au démarrage de la lecture. Les valeurs plus basses réduisent la bande passante.",
|
||||
"musicQualityTitle": "Qualité de la musique",
|
||||
"subtitleStyling": "Stylisation des sous-titres",
|
||||
"subtitleStylingDescription": "Personnaliser l'apparence des sous-titres",
|
||||
"smallSkipDuration": "Durée du petit saut",
|
||||
@@ -245,10 +248,9 @@
|
||||
"maxVolumePercent": "${percent}%",
|
||||
"discordRichPresence": "Discord Rich Presence",
|
||||
"discordRichPresenceDescription": "Montrez ce que vous regardez sur Discord",
|
||||
"trakt": "Trakt",
|
||||
"traktDescription": "Synchroniser l'historique de visionnage avec Trakt",
|
||||
"trackers": "Trackers",
|
||||
"trackersDescription": "Synchroniser la progression avec Trakt, MyAnimeList, AniList et Simkl",
|
||||
"services": "Services",
|
||||
"servicesDescription": "Connectez Trakt, MyAnimeList, Seerr et plus",
|
||||
"manageLibrariesDescription": "Réorganiser et masquer les bibliothèques",
|
||||
"companionRemoteServer": "Serveur de télécommande",
|
||||
"companionRemoteServerDescription": "Autoriser les appareils mobiles de votre réseau à contrôler cette application",
|
||||
"autoPip": "Image dans l'image automatique",
|
||||
@@ -262,6 +264,32 @@
|
||||
"displaySwitchDelay": "Délai de changement d'affichage",
|
||||
"tunneledPlayback": "Lecture tunnelée",
|
||||
"tunneledPlaybackDescription": "Utiliser le tunneling vidéo. Désactivez si la lecture HDR affiche un écran noir.",
|
||||
"audioPassthrough": "Audio Pass-Through",
|
||||
"audioPassthroughDescription": "Envoyez l'audio Dolby/DTS vers votre ampli ou téléviseur sans réencodage, en conservant le son surround. Désactivez si vous n'avez aucun son.",
|
||||
"audioPassthroughDescriptionAppleTv": "Transmet le Dolby Digital Plus (y compris Atmos) au système en bitstream. Le DTS et le TrueHD restent lus en PCM multicanal. De brèves coupures audio peuvent survenir lors des sauts.",
|
||||
"audioDownmix": "Downmix en stéréo",
|
||||
"audioDownmixDescription": "Réduit le son surround à deux canaux pour les enceintes stéréo ou le casque",
|
||||
"downmixCenterBoost": "Renforcement du canal central",
|
||||
"downmixCenterBoostValue": "${db} dB",
|
||||
"downmixCenterBoostLabel": "Renforcement (dB)",
|
||||
"downmixCenterBoostShort": "dB",
|
||||
"audioDownmixNormalize": "Normaliser le volume lors du downmix",
|
||||
"audioDownmixNormalizeDescription": "Atténue le mixage pour éviter la saturation. Désactivez pour conserver le volume d'origine (risque de distorsion sur les scènes fortes).",
|
||||
"atmosDiagnostics": "Test de sortie Atmos",
|
||||
"atmosDiagnosticsDescription": "Diagnostiquer la sortie Dolby Atmos en lisant des signaux de test via le lecteur système",
|
||||
"atmosTestHlsAtmos": "Flux Atmos d'Apple",
|
||||
"atmosTestHlsAtmosDescription": "Flux Dolby Atmos réputé fiable. L'ampli devrait afficher Dolby Atmos.",
|
||||
"atmosTestHlsControl": "Flux surround d'Apple",
|
||||
"atmosTestHlsControlDescription": "Flux témoin sans Atmos. L'ampli devrait afficher du surround sans Atmos.",
|
||||
"atmosTestRawStream": "Flux EAC3 brut",
|
||||
"atmosTestRawStreamDescription": "Diffuse le fichier de test exactement comme la lecture Atmos du lecteur. Nécessite l'URL du fichier de test.",
|
||||
"atmosTestRawFile": "Fichier EAC3 brut",
|
||||
"atmosTestRawFileDescription": "Lit le fichier de test avec une longueur connue. Nécessite l'URL du fichier de test.",
|
||||
"atmosTestStop": "Arrêter le test",
|
||||
"atmosTestUrl": "URL du fichier de test",
|
||||
"atmosTestUrlDescription": "URL HTTP d'un fichier .ec3 Dolby Atmos brut (extrait par ex. avec ffmpeg)",
|
||||
"atmosTestUrlMissing": "Définissez d'abord l'URL du fichier de test",
|
||||
"atmosTestStatus": "État",
|
||||
"dvConversionMode": "Conversion Dolby Vision",
|
||||
"dvConversionModeDescription": "Choisissez comment ExoPlayer gère les fichiers Dolby Vision Profile 7.",
|
||||
"dvConversionAuto": "Auto",
|
||||
@@ -285,7 +313,6 @@
|
||||
"showNavBarLabels": "Afficher les libellés de la barre de navigation",
|
||||
"showNavBarLabelsDescription": "Afficher les libellés sous les icônes de la barre de navigation",
|
||||
"startupSection": "Section de démarrage",
|
||||
"startupSectionDescription": "Choisissez la section que Plezy ouvre au démarrage",
|
||||
"liveTvDefaultFavorites": "Chaînes favorites par défaut",
|
||||
"liveTvDefaultFavoritesDescription": "Afficher uniquement les chaînes favorites à l'ouverture de la TV en direct",
|
||||
"display": "Affichage",
|
||||
@@ -385,15 +412,11 @@
|
||||
"rateSheet": {
|
||||
"title": "Noter",
|
||||
"server": "Serveur",
|
||||
"starValue": "${rating} / 5",
|
||||
"scoreValue": "${score} / 10",
|
||||
"setScore": "Définir une note",
|
||||
"notRated": "Non noté",
|
||||
"liked": "Aimé",
|
||||
"notLiked": "Non aimé",
|
||||
"favorite": "Favori",
|
||||
"favorited": "Ajouté aux favoris",
|
||||
"saved": "Enregistré",
|
||||
"notAvailable": "Aucune correspondance trouvée",
|
||||
"noConnectedTrackers": "Connectez un tracker dans Paramètres pour y noter."
|
||||
"noConnectedServices": "Connectez un service dans les Réglages pour noter ici."
|
||||
},
|
||||
"accessibility": {
|
||||
"mediaCardMovie": "${title}, film",
|
||||
@@ -403,7 +426,15 @@
|
||||
"mediaCardWatched": "visionné",
|
||||
"mediaCardPartiallyWatched": "${percent} pourcentage visionné",
|
||||
"mediaCardUnwatched": "non visionné",
|
||||
"tapToPlay": "Appuyez pour lire"
|
||||
"tapToPlay": "Appuyez pour lire",
|
||||
"decrease": "Diminuer",
|
||||
"increase": "Augmenter",
|
||||
"decreaseValue": "Diminuer ${label}",
|
||||
"increaseValue": "Augmenter ${label}",
|
||||
"hue": "Teinte",
|
||||
"saturation": "Saturation",
|
||||
"brightness": "Luminosité",
|
||||
"hexColor": "Couleur hexadécimale"
|
||||
},
|
||||
"tooltips": {
|
||||
"shufflePlay": "Lecture aléatoire",
|
||||
@@ -449,13 +480,11 @@
|
||||
"settingsButton": "Paramètres de lecture",
|
||||
"tracksButton": "Audio et sous-titres",
|
||||
"chaptersButton": "Chapitres",
|
||||
"versionsButton": "Versions vidéo",
|
||||
"versionQualityButton": "Version et qualité",
|
||||
"versionColumnHeader": "Version",
|
||||
"qualityColumnHeader": "Qualité",
|
||||
"qualityOriginal": "Originale",
|
||||
"qualityPresetLabel": "${resolution}p ${bitrate} Mbps",
|
||||
"qualityBandwidthEstimate": "~${bitrate} Mbps",
|
||||
"transcodeUnavailableFallback": "Transcodage indisponible — lecture en qualité originale",
|
||||
"pipButton": "Mode PiP (Picture-in-Picture)",
|
||||
"aspectRatioButton": "Format d'image",
|
||||
@@ -498,12 +527,7 @@
|
||||
"subtitleDownloadFailed": "Échec du téléchargement du sous-titre",
|
||||
"searchLanguages": "Rechercher des langues..."
|
||||
},
|
||||
"userStatus": {
|
||||
"admin": "Admin",
|
||||
"restricted": "Restreint",
|
||||
"protected": "Protégé",
|
||||
"current": "ACTUEL"
|
||||
},
|
||||
"userStatus": {},
|
||||
"messages": {
|
||||
"markedAsWatched": "Marqué comme vu",
|
||||
"markedAsUnwatched": "Marqué comme non vu",
|
||||
@@ -512,6 +536,8 @@
|
||||
"autoRemovedWatchedDownload": "Supprimé automatiquement : ${title}",
|
||||
"removedFromContinueWatching": "Supprimer de \"Continuer à regarder\"",
|
||||
"errorLoading": "Erreur: ${error}",
|
||||
"streamInterrupted": "La lecture a été interrompue. Appuyez sur Lecture ou avancez pour réessayer.",
|
||||
"liveStreamInterrupted": "Le direct a été interrompu. Appuyez sur Lecture pour réessayer.",
|
||||
"fileInfoNotAvailable": "Informations sur le fichier non disponibles",
|
||||
"errorLoadingFileInfo": "Erreur lors du chargement des informations sur le fichier: ${error}",
|
||||
"errorLoadingSeries": "Erreur lors du chargement de la série",
|
||||
@@ -634,15 +660,16 @@
|
||||
"borrowConnectionBorrowed": "Connexion empruntée.",
|
||||
"borrowFailed": "Impossible d'emprunter la connexion.",
|
||||
"incorrectPin": "PIN incorrect.",
|
||||
"incorrectPinTryAgain": "PIN incorrect. Veuillez réessayer.",
|
||||
"sourceProfileMissingParentAccount": "Le profil source n'a pas son compte parent.",
|
||||
"failedToLoadHomeUsers": "Impossible de charger vos utilisateurs Plex Home. Vérifiez votre connexion et réessayez.",
|
||||
"failedToVerifyPin": "Impossible de vérifier le PIN.",
|
||||
"newProfile": "Nouveau profil",
|
||||
"profileNameHint": "ex. Invités, Enfants, Salon familial",
|
||||
"pinProtectionOptional": "Protection par PIN (optionnelle)",
|
||||
"pinExplain": "PIN à 4 chiffres requis pour changer de profil.",
|
||||
"continueButton": "Continuer",
|
||||
"pinsDontMatch": "Les PIN ne correspondent pas",
|
||||
"initializeServicesFailed": "Impossible d’initialiser les services de profil"
|
||||
"pinsDontMatch": "Les PIN ne correspondent pas"
|
||||
},
|
||||
"connections": {
|
||||
"sectionTitle": "Connexions",
|
||||
@@ -657,7 +684,6 @@
|
||||
},
|
||||
"discover": {
|
||||
"title": "Découvrez",
|
||||
"switchProfile": "Changer de profil",
|
||||
"noContentAvailable": "Aucun contenu disponible",
|
||||
"addMediaToLibraries": "Ajoutez des médias à votre bibliothèque",
|
||||
"continueWatching": "Continuer à regarder",
|
||||
@@ -666,6 +692,9 @@
|
||||
"nextUpIn": "À suivre dans ${library}",
|
||||
"recentlyAdded": "Récemment ajouté",
|
||||
"recentlyAddedIn": "Récemment ajouté dans ${library}",
|
||||
"latestAlbumsIn": "Derniers albums dans ${library}",
|
||||
"recentlyPlayedIn": "Récemment lus dans ${library}",
|
||||
"mostPlayedIn": "Les plus lus dans ${library}",
|
||||
"playEpisode": "S${season}E${episode}",
|
||||
"overview": "Aperçu",
|
||||
"cast": "Cast",
|
||||
@@ -683,8 +712,6 @@
|
||||
"connectionFailed": "Impossible de se connecter au serveur multimédia",
|
||||
"failedToLoad": "Échec du chargement ${context}: ${error}",
|
||||
"noClientAvailable": "Aucun client disponible",
|
||||
"authenticationFailed": "Échec de l'authentification: ${error}",
|
||||
"couldNotLaunchUrl": "Impossible de lancer l'URL d'authentification",
|
||||
"pleaseEnterToken": "Veuillez saisir un token",
|
||||
"invalidToken": "Token invalide",
|
||||
"failedToVerifyToken": "Échec de la vérification du token: ${error}",
|
||||
@@ -711,6 +738,8 @@
|
||||
"allLibrariesHidden": "Toutes les bibliothèques sont masquées",
|
||||
"hiddenLibrariesCount": "Bibliothèques masquées (${count})",
|
||||
"thisLibraryIsEmpty": "Cette bibliothèque est vide",
|
||||
"noItemsMatchFilters": "Aucun élément ne correspond aux filtres actifs",
|
||||
"resetFilters": "Réinitialiser les filtres",
|
||||
"all": "Tout",
|
||||
"clearAll": "Tout effacer",
|
||||
"scanLibraryConfirm": "Êtes-vous sûr de vouloir lancer le scan de \"${title}\"?",
|
||||
@@ -745,6 +774,9 @@
|
||||
"shows": "Show TV",
|
||||
"seasons": "Saisons",
|
||||
"episodes": "Épisodes",
|
||||
"artists": "Artistes",
|
||||
"albums": "Albums",
|
||||
"tracks": "Titres",
|
||||
"folders": "Dossiers"
|
||||
},
|
||||
"filterCategories": {
|
||||
@@ -752,7 +784,8 @@
|
||||
"year": "Année",
|
||||
"contentRating": "Classification",
|
||||
"tag": "Tag",
|
||||
"unwatched": "Non vus"
|
||||
"unwatched": "Non vus",
|
||||
"favorites": "Favoris"
|
||||
},
|
||||
"sortLabels": {
|
||||
"title": "Titre",
|
||||
@@ -762,7 +795,6 @@
|
||||
"communityRating": "Note communautaire",
|
||||
"criticRating": "Note critique",
|
||||
"userRating": "Note utilisateur",
|
||||
"lastPlayed": "Dernière lecture",
|
||||
"datePlayed": "Date de lecture",
|
||||
"playCount": "Lectures",
|
||||
"productionYear": "Année de production",
|
||||
@@ -786,7 +818,6 @@
|
||||
"viewLicensesDescription": "Afficher les licences des bibliothèques tierces"
|
||||
},
|
||||
"serverSelection": {
|
||||
"allServerConnectionsFailed": "Connexion impossible à tous les serveurs. Vérifiez votre réseau.",
|
||||
"noServersFoundForAccount": "Aucun serveur trouvé pour ${username} (${email})",
|
||||
"failedToLoadServers": "Échec du chargement des serveurs: ${error}"
|
||||
},
|
||||
@@ -811,13 +842,59 @@
|
||||
"navigation": {
|
||||
"libraries": "Medias",
|
||||
"downloads": "Téléch.",
|
||||
"liveTv": "TV direct"
|
||||
"liveTv": "TV direct",
|
||||
"explore": "Explorer"
|
||||
},
|
||||
"explore": {
|
||||
"title": "Explorer",
|
||||
"selectSource": "Sélectionner la source",
|
||||
"rows": {
|
||||
"watchlist": "Liste de suivi",
|
||||
"recommendedMovies": "Films recommandés",
|
||||
"recommendedShows": "Show TV recommandés",
|
||||
"trendingMovies": "Films tendance",
|
||||
"trendingShows": "Show TV tendance",
|
||||
"popularMovies": "Films populaires",
|
||||
"popularShows": "Show TV populaires",
|
||||
"suggestedAnime": "Anime suggérés",
|
||||
"airingAnime": "Meilleurs anime en diffusion",
|
||||
"popularAnime": "Anime les plus populaires",
|
||||
"trending": "Tendances",
|
||||
"upcomingMovies": "Films à venir",
|
||||
"upcomingShows": "Show TV à venir"
|
||||
},
|
||||
"status": {
|
||||
"airing": "En cours",
|
||||
"ended": "Terminée",
|
||||
"canceled": "Annulée",
|
||||
"upcoming": "À venir"
|
||||
},
|
||||
"episodeCount": {
|
||||
"one": "${n} épisode",
|
||||
"other": "${n} épisodes"
|
||||
},
|
||||
"cast": "Cast",
|
||||
"characters": "Personnages",
|
||||
"addToWatchlist": "Ajouter à la liste de suivi",
|
||||
"removeFromWatchlist": "Retirer de la liste de suivi",
|
||||
"watchlistUpdateFailed": "Impossible de mettre à jour la liste de suivi",
|
||||
"notInLibrary": "Absent de votre bibliothèque",
|
||||
"inTheseLibraries": "Dans ces bibliothèques",
|
||||
"checkingLibrary": "Vérification de votre bibliothèque...",
|
||||
"emptyTitle": "Rien ici pour l'instant",
|
||||
"emptyMessage": "Les rangées de ${source} apparaîtront ici une fois qu'elles auront du contenu.",
|
||||
"searchHint": "Rechercher dans ${source}",
|
||||
"searchEmpty": "Aucun résultat pour \"${query}\"",
|
||||
"searchPrompt": "Recherchez des films et des séries sur ${source}.",
|
||||
"searchFailed": "Échec de la recherche. Vérifiez votre connexion et réessayez."
|
||||
},
|
||||
"liveTv": {
|
||||
"title": "TV en direct",
|
||||
"guide": "Guide",
|
||||
"noChannels": "Aucune chaîne disponible",
|
||||
"noDvr": "Aucun DVR configuré sur les serveurs",
|
||||
"serverUnavailable": "Le serveur de TV en direct n’est pas disponible.",
|
||||
"serverNotConnected": "Le serveur de TV en direct n’est pas connecté.",
|
||||
"noPrograms": "Aucune donnée de programme disponible",
|
||||
"liveStreamFailed": "Échec du direct",
|
||||
"unknownProgram": "Programme inconnu",
|
||||
@@ -840,6 +917,7 @@
|
||||
"watchChannel": "Regarder la chaîne",
|
||||
"favorites": "Favoris",
|
||||
"reorderFavorites": "Réorganiser les favoris",
|
||||
"favoritesLoadFailed": "Impossible de charger les favoris. Vérifiez votre connexion et réessayez.",
|
||||
"joinSession": "Rejoindre la session en cours",
|
||||
"watchFromStart": "Regarder depuis le début (il y a ${minutes} min)",
|
||||
"watchLive": "Regarder en direct",
|
||||
@@ -848,11 +926,11 @@
|
||||
"recordEpisode": "Enregistrer l'épisode",
|
||||
"recordSeries": "Enregistrer la série",
|
||||
"recordOptions": "Options d'enregistrement",
|
||||
"saveTo": "Enregistrer dans",
|
||||
"recordings": "Enregistrements",
|
||||
"scheduledRecordings": "Programmés",
|
||||
"recordingRules": "Règles d'enregistrement",
|
||||
"noScheduledRecordings": "Aucun enregistrement programmé",
|
||||
"noRecordingRules": "Aucune règle d'enregistrement",
|
||||
"manageRecording": "Gérer l'enregistrement",
|
||||
"cancelRecording": "Annuler l'enregistrement",
|
||||
"cancelRecordingTitle": "Annuler cet enregistrement ?",
|
||||
@@ -869,7 +947,6 @@
|
||||
"recordingCancelled": "Enregistrement annulé",
|
||||
"recordingRuleDeleted": "Règle d'enregistrement supprimée",
|
||||
"processRecordingRules": "Réévaluer les règles",
|
||||
"loadingRecordings": "Chargement des enregistrements...",
|
||||
"recordingInProgress": "Enregistrement en cours",
|
||||
"recordingsCount": "${count} programmés",
|
||||
"editRule": "Modifier la règle",
|
||||
@@ -883,7 +960,6 @@
|
||||
"title": "Collections",
|
||||
"collection": "Collection",
|
||||
"empty": "La collection est vide",
|
||||
"unknownLibrarySection": "Impossible de supprimer : section de bibliothèque inconnue",
|
||||
"deleteCollection": "Supprimer la collection",
|
||||
"deleteConfirm": "Supprimer \"${title}\" ? Action irréversible.",
|
||||
"deleted": "Collection supprimée",
|
||||
@@ -923,6 +999,7 @@
|
||||
"itemAdded": "Ajouté à la playlist",
|
||||
"itemRemoved": "Retiré de la playlist",
|
||||
"selectPlaylist": "Sélectionner une playlist",
|
||||
"searchPlaylists": "Rechercher des playlists...",
|
||||
"errorCreating": "Échec de la création de playlist",
|
||||
"errorDeleting": "Échec de suppression de playlist",
|
||||
"errorLoading": "Échec de chargement de playlists",
|
||||
@@ -930,6 +1007,33 @@
|
||||
"errorReordering": "Échec de réordonnacement d'élément de playlist",
|
||||
"errorRemoving": "Échec de suppression depuis la playlist"
|
||||
},
|
||||
"music": {
|
||||
"goToAlbum": "Aller à l'album",
|
||||
"goToArtist": "Aller à l'artiste",
|
||||
"instantMix": "Mix instantané",
|
||||
"playNext": "Lire ensuite",
|
||||
"addToQueue": "Ajouter à la file d'attente",
|
||||
"discNumber": "Disque ${n}",
|
||||
"trackCount": {
|
||||
"one": "${n} titre",
|
||||
"other": "${n} titres"
|
||||
},
|
||||
"nowPlaying": "Lecture en cours",
|
||||
"playingFrom": "Lecture depuis ${title}",
|
||||
"queue": "File d'attente",
|
||||
"clearQueue": "Vider la file d'attente",
|
||||
"lyrics": "Paroles",
|
||||
"noLyrics": "Aucune parole disponible",
|
||||
"sleepTimer": "Minuterie de veille",
|
||||
"sleepTimerEndOfTrack": "Fin du titre",
|
||||
"sleepTimerMinutes": "${n} minutes",
|
||||
"stopPlayback": "Arrêter la lecture",
|
||||
"previousTrack": "Titre précédent",
|
||||
"nextTrack": "Titre suivant",
|
||||
"repeat": "Répéter",
|
||||
"repeatAll": "Tout répéter",
|
||||
"repeatOne": "Répéter le titre"
|
||||
},
|
||||
"watchTogether": {
|
||||
"title": "Regarder ensemble",
|
||||
"description": "Regardez du contenu en synchronisation avec vos amis et votre famille",
|
||||
@@ -985,7 +1089,10 @@
|
||||
"participantResumed": "${name} a repris",
|
||||
"participantSeeked": "${name} a avancé",
|
||||
"participantBuffering": "${name} met en mémoire tampon",
|
||||
"participantNeedsUpdate": "${name} utilise une ancienne version de l’app — synchronisation indisponible",
|
||||
"resumingWithout": "Reprise sans ${name}",
|
||||
"waitingForParticipants": "En attente du chargement des autres...",
|
||||
"waitingForName": "En attente de ${name}...",
|
||||
"recentRooms": "Salons récents",
|
||||
"renameRoom": "Renommer le salon",
|
||||
"removeRoom": "Supprimer",
|
||||
@@ -997,6 +1104,8 @@
|
||||
"manage": "Gérer",
|
||||
"tvShows": "Show TV",
|
||||
"movies": "Films",
|
||||
"music": "Musique",
|
||||
"tracksQueued": "${count} titres en file d'attente de téléchargement",
|
||||
"noDownloads": "Aucun téléchargement pour le moment",
|
||||
"noDownloadsDescription": "Le contenu téléchargé apparaîtra ici pour être consulté hors ligne.",
|
||||
"downloadNow": "Télécharger",
|
||||
@@ -1033,7 +1142,7 @@
|
||||
"customAmount": "Quantité personnalisée...",
|
||||
"includeSpecials": "Inclure les spéciaux",
|
||||
"howManyEpisodes": "Combien d'épisodes ?",
|
||||
"itemsQueued": "${count} éléments mis en file d'attente",
|
||||
"invalidEpisodeCount": "Saisissez un nombre d'épisodes valide.",
|
||||
"keepSynced": "Garder synchronisé",
|
||||
"downloadOnce": "Télécharger une fois",
|
||||
"keepNUnwatched": "Garder ${count} non vus",
|
||||
@@ -1082,7 +1191,6 @@
|
||||
"unknownDevice": "Appareil inconnu",
|
||||
"session": {
|
||||
"startingServer": "Démarrage du serveur distant...",
|
||||
"failedToCreate": "Échec du démarrage du serveur distant :",
|
||||
"hostAddress": "Adresse de l'hôte",
|
||||
"connected": "Connecté",
|
||||
"serverRunning": "Serveur distant actif",
|
||||
@@ -1143,6 +1251,8 @@
|
||||
"errors": {
|
||||
"noNetworkInterface": "Aucune interface réseau trouvée",
|
||||
"authenticationFailed": "Échec de l’authentification",
|
||||
"serverStartFailed": "Impossible de démarrer le serveur distant : ${error}",
|
||||
"commandFailed": "Impossible d’envoyer la commande à distance : ${error}",
|
||||
"joinTimedOut": "Délai dépassé lors de la connexion à la session",
|
||||
"failedToConnectAnyAddress": "Impossible de se connecter à une adresse",
|
||||
"connectionLostAfterAttempts": "Connexion perdue après ${attempts} tentatives",
|
||||
@@ -1159,7 +1269,8 @@
|
||||
"audioOutput": "Sortie audio",
|
||||
"performanceOverlay": "Superposition de performance",
|
||||
"audioPassthrough": "Audio Pass-Through",
|
||||
"audioNormalization": "Normaliser le volume"
|
||||
"audioNormalization": "Normaliser le volume",
|
||||
"audioDownmix": "Downmix en stéréo"
|
||||
},
|
||||
"performanceOverlay": {
|
||||
"color": "Couleur",
|
||||
@@ -1322,9 +1433,41 @@
|
||||
"watchedSync": "Synchroniser le statut « vu »",
|
||||
"watchedSyncDescription": "Lorsque vous marquez un élément comme vu dans Plezy, il l'est aussi sur Trakt."
|
||||
},
|
||||
"trackers": {
|
||||
"title": "Trackers",
|
||||
"hubSubtitle": "Synchronisez la progression de visionnage avec Trakt et d'autres services.",
|
||||
"seerr": {
|
||||
"title": "Seerr",
|
||||
"connectTitle": "Connecter Seerr",
|
||||
"serverUrl": "URL du serveur",
|
||||
"serverUrlHelper": "L'adresse de votre instance Seerr",
|
||||
"checkServer": "Continuer",
|
||||
"signInWithJellyfin": "Se connecter avec Jellyfin",
|
||||
"signInWithEmby": "Se connecter avec Emby",
|
||||
"signInWithLocal": "Utiliser un compte local",
|
||||
"email": "E-mail",
|
||||
"noSignInMethods": "Cette instance Seerr ne propose aucune méthode de connexion prise en charge par Plezy.",
|
||||
"instance": "Instance",
|
||||
"disconnectConfirm": "Déconnecter Seerr ?",
|
||||
"disconnectConfirmBody": "Plezy oubliera cette instance Seerr. Reconnectez à tout moment.",
|
||||
"request": "Demander",
|
||||
"request4k": "Demander en 4K",
|
||||
"seasons": "Saisons",
|
||||
"allSeasons": "Toutes les saisons",
|
||||
"advancedOptions": "Avancé",
|
||||
"destinationServer": "Serveur de destination",
|
||||
"qualityProfile": "Profil de qualité",
|
||||
"rootFolder": "Dossier racine",
|
||||
"languageProfile": "Profil de langue",
|
||||
"requestSubmitted": "Demande envoyée",
|
||||
"requestFailed": "Échec de la demande : ${error}",
|
||||
"requestsLoadFailed": "Impossible de charger les options de demande",
|
||||
"nothingToRequest": "Tout est déjà disponible ou demandé.",
|
||||
"statusAvailable": "Disponible",
|
||||
"statusPartiallyAvailable": "Partiellement disponible",
|
||||
"statusRequested": "Demandé",
|
||||
"statusProcessing": "En cours de traitement"
|
||||
},
|
||||
"services": {
|
||||
"title": "Services",
|
||||
"hubSubtitle": "Synchronisez votre progression et demandez de nouveaux titres.",
|
||||
"notConnected": "Non connecté",
|
||||
"connectedAs": "Connecté en tant que @${username}",
|
||||
"scrobble": "Suivre la progression automatiquement",
|
||||
@@ -1332,10 +1475,11 @@
|
||||
"disconnectConfirm": "Déconnecter ${service} ?",
|
||||
"disconnectConfirmBody": "Plezy cessera de mettre à jour ${service}. Reconnectez à tout moment.",
|
||||
"connectFailed": "Échec de la connexion à ${service}. Réessayez.",
|
||||
"services": {
|
||||
"names": {
|
||||
"mal": "MyAnimeList",
|
||||
"anilist": "AniList",
|
||||
"simkl": "Simkl"
|
||||
"simkl": "Simkl",
|
||||
"seerr": "Seerr"
|
||||
},
|
||||
"deviceCode": {
|
||||
"title": "Activer Plezy sur ${service}",
|
||||
@@ -1382,7 +1526,6 @@
|
||||
"quickConnectFailed": "Échec de Quick Connect : ${error}",
|
||||
"addPlexTitle": "Se connecter avec Plex",
|
||||
"pinExpired": "Le PIN a expiré avant la connexion. Veuillez réessayer.",
|
||||
"duplicatePlexAccount": "Déjà connecté à Plex. Déconnectez-vous pour changer de compte.",
|
||||
"failedToRegisterAccount": "Échec de l'enregistrement du compte : ${error}",
|
||||
"enterJellyfinUrlError": "Saisissez l'URL de votre serveur Jellyfin",
|
||||
"addConnectionTitle": "Ajouter une connexion",
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user