Compare commits

..
59 Commits
Author SHA1 Message Date
github-actions[bot] db50cb4837 chore: bump version to 1.30.0 2026-03-26 09:05:04 +00:00
edde746 b4b90eec63 fix: use forked material_symbols_icons for IconData compat 2026-03-26 08:32:16 +01:00
edde746 beff313814 fix: use Flutter 3.41.5 for arm64 builds 2026-03-26 07:12:09 +01:00
edde746 0dc9cd38af fix: pin arm64 Flutter version before IconData final 2026-03-26 00:45:18 +01:00
edde746 8ff7676e60 fix: use continuous play queue for aired date episode order
close #756
2026-03-25 23:28:57 +01:00
edde746 bfe35220aa fix: skip SAF picker on Android TV 2026-03-25 20:56:32 +01:00
edde746 843faee4c5 fix: run sqlite on background isolate 2026-03-25 20:50:35 +01:00
edde746 f8bfeb0ec6 fix: use stable Flutter channel for arm64 builds 2026-03-25 20:34:08 +01:00
edde746 dd441fee66 fix: ignore EOF completion events for live TV streams 2026-03-25 19:51:11 +01:00
edde746 2204b05d6c fix: remove reconnect_at_eof from live TV stream options 2026-03-25 19:10:35 +01:00
edde746 a1841804b6 fix: non-primary CustomScrollViews in IndexedStack tabs 2026-03-25 19:10:35 +01:00
edde746andGitHub 5e31ad9c67 Merge pull request #753 from micahmo/fix/single-season
Fix missing season tabs
2026-03-25 15:45:11 +01:00
Micah Morrison 477b92291b Fix missing season tabs 2026-03-25 09:20:49 -04:00
edde746 fcc6186796 fix: dedupe live TV timeline heartbeat, delay initial send 2026-03-25 12:25:19 +01:00
edde746 23179f6d17 perf: ValueNotifier detail scroll, skip redundant arrow rebuilds 2026-03-25 08:12:18 +01:00
edde746 996e8621fa perf: ValueNotifier scroll state, static skeletons, scoped selects 2026-03-25 08:03:47 +01:00
edde746 8ad1cb988f fix: detach mpv surface before view removal in dispose 2026-03-25 07:25:32 +01:00
edde746 4cef99dda2 perf: coalesce watch together rebuilds, static TV overlays 2026-03-25 06:40:17 +01:00
edde746 4beeedd318 fix: library grid stuck skeletons on fast scroll 2026-03-25 06:35:01 +01:00
edde746 23043c61f4 fix: Tensor SoC detection for internal model IDs 2026-03-25 04:15:34 +01:00
edde746 8d56171bd2 perf: library grid scroll and idle frame rendering
- Window _loadedItems and focus nodes to bound memory growth
- Eager prefetch and image precaching near viewport
- Static skeleton placeholders during active scroll
- Throttle alpha bar updates, dynamic initial fetch size
- Fix discover timer scheduling frames when tab hidden
- Disable tickers for offscreen IndexedStack children
- Static image placeholder with fade-in transition
2026-03-24 17:19:28 +01:00
edde746 ff0fafe938 fix: speed step 0.1 -> 0.25 for keyboard shortcuts
close #741
2026-03-23 15:02:13 +01:00
edde746 8b7f369c16 fix: keyboard shortcuts for unmapped keys
close #740
2026-03-23 14:32:54 +01:00
github-actions[bot] 5c0e40bddb chore: update cask to 1.29.0 2026-03-23 05:22:26 +00:00
github-actions[bot] 58b0bf5306 chore: bump version to 1.29.0 2026-03-23 02:51:31 +00:00
edde746 9bd2774820 fix: race conditions in mpv dispose and track manager, add debug fallback trigger 2026-03-23 03:48:48 +01:00
edde746 cc7da5bbc9 fix: live tv channels for non-admin users 2026-03-22 15:58:25 +01:00
edde746 bd4e30e653 fix: external subtitles on android mpv 2026-03-22 15:34:49 +01:00
edde746 e759dafa87 fix: disable impeller on Tensor/NVIDIA GPUs 2026-03-22 14:35:42 +01:00
edde746 3ae2488adf feat: screen lock
close #286
2026-03-22 11:48:34 +01:00
edde746 2f5b596fff fix: disable pip on android tv
close #698
2026-03-22 11:17:45 +01:00
edde746 472ac90fea feat: rewind on resume setting
close #735
2026-03-22 09:24:22 +01:00
edde746 e9dfee6870 fix: profile select back button bypass
close #737
2026-03-22 09:03:14 +01:00
edde746 48e57fd375 fix: match content frame rate
close #736
2026-03-22 08:12:16 +01:00
edde746 4b05ed79ea fix: bump libmpv-android to v1.0.6 2026-03-22 04:59:31 +01:00
edde746 4365e70a78 fix(android): libmpv failed init reinit 2026-03-21 16:51:25 +01:00
edde746 e8c02d04ae fix: linux titlebar height on non-GNOME DEs 2026-03-21 15:57:03 +01:00
edde746 0539c1d869 fix: overlay sheet position, scroll-to-selected in bottom sheets 2026-03-21 11:49:08 +01:00
edde746 1980ce92d5 fix: pip aspect ratio after exoplayer→mpv fallback 2026-03-21 09:19:21 +01:00
edde746 b5576fa6de fix: reduce hub section vertical spacing 2026-03-21 09:05:21 +01:00
edde746 d355e07e10 refactor: switch to libmpv-android fork, fix ANR and track selection 2026-03-21 08:53:08 +01:00
edde746 09ff47e19f fix: reduce CPU when paused and backgrounded on macOS 2026-03-21 08:36:25 +01:00
edde746 4ee4a766d6 fix: pip background thread layout crash 2026-03-21 07:54:04 +01:00
edde746 7ebbf75cb9 fix: handle background isolate shutdown on iOS 2026-03-21 01:43:34 +01:00
edde746 e95b768350 chore: update appcast.xml url 2026-03-21 00:04:10 +01:00
edde746 82f0d46acc fix: update libass 2026-03-20 09:07:17 +01:00
edde746 bafba0b151 fix: guard cache put against non-Map response data 2026-03-20 08:29:36 +01:00
edde746 7a68218439 fix: guard setState with mounted in pairing screen 2026-03-20 08:07:29 +01:00
edde746 2d37d37596 refactor: extract TrackManager, fix subtitle bugs
- Extract track lifecycle logic from VideoPlayerScreen (3248→2928 lines) into TrackManager
- Parse isDefault/isForced for subtitle tracks in parseTrackList
- Emit forced flag from ExoPlayer's emitTrackList
- Fix detectSubtitleMimeType failing on URLs with query params
- Add missing external_ ID prefix in ExoPlayer addSubtitleTrack
- Replace polling loop with stream in selectAndApplyTracks
- Handle play() failure in resumeAfterSubtitleLoad
- Handle addExternalSubtitles failure in onBackendSwitched
2026-03-20 03:32:32 +01:00
edde746 d64c72f40e fix: await external subs before track selection in backend fallback 2026-03-20 00:05:18 +01:00
edde746 efe375f817 fix: check track state before subscribing to broadcast stream 2026-03-19 23:38:50 +01:00
edde746 1f8dfd3587 fix: regenerate macos Podfile.lock 2026-03-19 21:48:01 +01:00
edde746 60eae5d14f fix: reapply track selection and external subs after MPV fallback 2026-03-19 21:37:37 +01:00
edde746 5123a5ec48 chore: bump dependencies 2026-03-19 20:53:35 +01:00
edde746 dbb3ae38b3 chore: bump sentry_flutter to 9.15.0 2026-03-19 19:56:36 +01:00
edde746 fbf6fc988b chore: update libass-android 2026-03-19 19:52:05 +01:00
edde746 17da465e4e chore: bump mobile_scanner to 7.2.0 2026-03-19 19:49:57 +01:00
edde746 e096a4ccb8 fix: use direct TrackGroup refs for track selection, clear stale overrides 2026-03-19 18:58:07 +01:00
github-actions[bot] 079417ad3e chore: update cask to 1.28.0 2026-03-19 05:06:01 +00:00
105 changed files with 2966 additions and 2016 deletions
+2 -2
View File
@@ -1,6 +1,6 @@
cask "plezy" do
version "1.27.2"
sha256 "5cd0ff1aa7390fd208ea69069e352bb02a0f57c242556e10b7dcb3707c12850e"
version "1.29.0"
sha256 "5f856275e7d5fe66f25238708a41e9f04fa4d327a932a16626b1424807b05866"
url "https://github.com/edde746/plezy/releases/download/#{version}/plezy-macos.dmg"
name "Plezy"
+27 -11
View File
@@ -8,11 +8,26 @@ plugins {
id("dev.flutter.flutter-gradle-plugin")
}
val assVersion = "flags"
val assDir = layout.buildDirectory.dir("libass-android").get().asFile
val mpvVersion = "v1.0.6"
val mpvDir = layout.buildDirectory.dir("libmpv").get().asFile
val mpvAar = "libmpv-release.aar"
val downloadLibmpv by tasks.registering {
val stamp = File(mpvDir, ".version")
outputs.upToDateWhen { stamp.exists() && stamp.readText().trim() == mpvVersion }
doLast {
mpvDir.mkdirs()
val url = "https://github.com/edde746/libmpv-android/releases/download/$mpvVersion/$mpvAar"
exec { commandLine("curl", "-sfL", url, "-o", File(mpvDir, mpvAar).absolutePath) }
stamp.writeText(mpvVersion)
}
}
val assVersion = "safety-2"
val assDir = layout.buildDirectory.dir("libass").get().asFile
val assAars = listOf("lib_ass-release.aar", "lib_ass_kt-release.aar", "lib_ass_media-release.aar")
val downloadLibassAndroid by tasks.registering {
val downloadLibass by tasks.registering {
val stamp = File(assDir, ".version")
outputs.upToDateWhen { stamp.exists() && stamp.readText().trim() == assVersion }
doLast {
@@ -145,13 +160,16 @@ tasks.matching { it.name.contains("CMake") || it.name.contains("externalNative")
dependsOn(downloadLibdovi)
}
// Download libass-android AARs before compilation
tasks.matching { it.name.startsWith("compile") || it.name.startsWith("pre") }.configureEach {
dependsOn(downloadLibassAndroid)
// Download libmpv and libass AARs before compilation
tasks.matching { it.name.startsWith("pre") && it.name.endsWith("Build") }.configureEach {
dependsOn(downloadLibmpv)
dependsOn(downloadLibass)
}
dependencies {
implementation("dev.jdtech.mpv:libmpv:0.5.1")
implementation(files(File(mpvDir, mpvAar)))
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-android:1.9.0")
// Android TV Watch Next integration
implementation("androidx.tvprovider:tvprovider:1.0.0")
@@ -168,8 +186,6 @@ dependencies {
// FFmpeg audio decoder for unsupported codecs (ALAC, DTS, TrueHD, etc.)
implementation("org.jellyfin.media3:media3-ffmpeg-decoder:1.9.0+1")
// libass-android for ASS/SSA subtitle rendering (forked for AssMatroskaExtractor flags constructor)
implementation(files("${assDir.absolutePath}/lib_ass-release.aar"))
implementation(files("${assDir.absolutePath}/lib_ass_kt-release.aar"))
implementation(files("${assDir.absolutePath}/lib_ass_media-release.aar"))
// libass-android for ASS/SSA subtitle rendering
assAars.forEach { implementation(files(File(assDir, it))) }
}
@@ -19,6 +19,7 @@ import android.view.inputmethod.InputMethodManager
import android.widget.FrameLayout
import androidx.core.content.FileProvider
import io.flutter.embedding.android.FlutterActivity
import io.flutter.embedding.engine.FlutterShellArgs
import io.flutter.embedding.android.FlutterTextureView
import io.flutter.embedding.android.RenderMode
import io.flutter.embedding.android.TransparencyMode
@@ -32,6 +33,10 @@ import java.io.File
class MainActivity : FlutterActivity() {
companion object {
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"
@@ -113,6 +118,28 @@ class MainActivity : FlutterActivity() {
}
}
override fun getFlutterShellArgs(): FlutterShellArgs {
val args = super.getFlutterShellArgs()
usingSkia = shouldDisableImpeller()
if (usingSkia) args.add("--enable-impeller=false")
return args
}
private fun shouldDisableImpeller(): Boolean {
// Android TV devices — weaker GPUs, less Impeller testing
if (packageManager.hasSystemFeature("android.software.leanback")) return true
// Google Tensor SoC (Mali GPU) — Pixel 6+
// SOC_MODEL may return marketing name ("Tensor G2") or internal ID ("GS201")
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.S) {
val soc = Build.SOC_MODEL
if (soc.startsWith("Tensor", ignoreCase = true) ||
soc.startsWith("GS", ignoreCase = true)) return true
}
// NVIDIA Tegra (Shield TV)
if (Build.MANUFACTURER.equals("NVIDIA", ignoreCase = true)) return true
return false
}
override fun getRenderMode(): RenderMode {
// Use TextureView so Flutter doesn't occupy a SurfaceView layer.
// This allows the libass subtitle SurfaceView to sit between video and Flutter UI.
@@ -140,9 +167,11 @@ class MainActivity : FlutterActivity() {
lastWidth = w; lastHeight = h
pendingResize?.let { handler.removeCallbacks(it) }
pendingResize = Runnable {
original.onSurfaceTextureSizeChanged(surface, w, h)
if (flutterTextureView.isAvailable) {
original.onSurfaceTextureSizeChanged(surface, w, h)
}
}
handler.post(pendingResize!!)
handler.postDelayed(pendingResize!!, 100)
}
override fun onSurfaceTextureUpdated(surface: SurfaceTexture) {
original.onSurfaceTextureUpdated(surface)
@@ -214,6 +243,7 @@ class MainActivity : FlutterActivity() {
// Splash screen theme: persist user's chosen theme for next launch (API 31+)
MethodChannel(flutterEngine.dartExecutor.binaryMessenger, THEME_CHANNEL).setMethodCallHandler { call, result ->
when (call.method) {
"getRenderer" -> result.success(if (usingSkia) "Skia" else "Impeller")
"setSplashTheme" -> {
val mode = call.argument<String>("mode")
@@ -83,6 +83,7 @@ class ExoPlayerCore(private val activity: Activity) : Player.Listener {
private const val WATCHDOG_CHECK_INTERVAL_MS = 1000L
private const val WATCHDOG_TIMEOUT_MS = 8000L
private const val DECODER_HANG_TIMEOUT_MS = 5000L
private const val FPS_SAMPLE_COUNT = 8
// Codec capability caches — codec support doesn't change at runtime
private val hwAudioDecoderCache = HashMap<String, Boolean>()
@@ -140,6 +141,11 @@ class ExoPlayerCore(private val activity: Activity) : Player.Listener {
private var frameRateManager: FrameRateManager? = null
private val handler = Handler(Looper.getMainLooper())
// FPS detection from frame timestamps (fallback when Format.frameRate is NO_VALUE)
@Volatile private var detectedFrameRate: Float = -1f
private val fpsTimestamps = LongArray(FPS_SAMPLE_COUNT)
@Volatile private var fpsTimestampCount = 0
// Audio focus
private var audioFocusManager: AudioFocusManager? = null
@@ -153,13 +159,15 @@ class ExoPlayerCore(private val activity: Activity) : Player.Listener {
// External subtitles added dynamically
private val externalSubtitles = mutableListOf<MediaItem.SubtitleConfiguration>()
private val externalSubtitleUris = mutableListOf<String>()
private var currentMediaUri: String? = null
private var currentHeaders: Map<String, String>? = null
private var currentMediaIsLive: Boolean = false
private var currentVisible: Boolean = false
private var selectedAudioTrackId: String? = null
private var selectedSubtitleTrackId: String? = null
private var selectedExternalSubtitleIndex: Int? = null
private val audioTrackGroupMap = mutableMapOf<String, TrackGroup>()
private val subtitleTrackGroupMap = mutableMapOf<String, TrackGroup>()
private fun emitLog(level: String, prefix: String, message: String) {
when (level) {
@@ -253,8 +261,8 @@ class ExoPlayerCore(private val activity: Activity) : Player.Listener {
activity = activity,
handler = handler,
onDisplayChanged = {
if (exoPlayer?.isPlaying == false && audioFocusManager?.wasPlayingBeforeFocusLoss == true) {
Log.d(TAG, "Display changed, resuming playback")
if (exoPlayer?.isPlaying == false) {
Log.d(TAG, "Display changed after frame rate switch, resuming playback")
exoPlayer?.play()
}
},
@@ -475,6 +483,17 @@ class ExoPlayerCore(private val activity: Activity) : Player.Listener {
exoPlayer!!.addListener(this)
exoPlayer!!.addAnalyticsListener(decoderHangListener)
exoPlayer!!.setVideoFrameMetadataListener { presentationTimeUs, _, _, _ ->
val count = fpsTimestampCount
if (count < FPS_SAMPLE_COUNT) {
fpsTimestamps[count] = presentationTimeUs
fpsTimestampCount = count + 1
if (count + 1 == FPS_SAMPLE_COUNT) {
detectedFrameRate = computeFrameRate(fpsTimestamps)
Log.d(TAG, "Detected frame rate: $detectedFrameRate fps")
}
}
}
surfaceView?.let { exoPlayer!!.setVideoSurfaceView(it) }
Log.d(TAG, "SubtitleView childCount after ASS setup: ${subtitleView?.childCount}")
@@ -782,6 +801,8 @@ class ExoPlayerCore(private val activity: Activity) : Player.Listener {
val tracks = player.currentTracks
val trackList = mutableListOf<Map<String, Any?>>()
audioTrackGroupMap.clear()
subtitleTrackGroupMap.clear()
// Group tracks by type and use group index as track ID (matching select functions)
val audioGroups = tracks.groups.filter { it.type == C.TRACK_TYPE_AUDIO }
@@ -797,6 +818,7 @@ class ExoPlayerCore(private val activity: Activity) : Player.Listener {
// Use first format in group as the representative track
val format = trackGroup.getFormat(0)
val trackId = "${C.TRACK_TYPE_AUDIO}_$groupIndex"
audioTrackGroupMap[trackId] = trackGroup
val isSelected = group.isSelected
val track = mutableMapOf<String, Any?>(
@@ -817,15 +839,21 @@ class ExoPlayerCore(private val activity: Activity) : Player.Listener {
}
}
// Process subtitle tracks
// Process subtitle tracks (embedded + side-loaded external)
Log.d(TAG, "emitTrackList: found ${textGroups.size} subtitle track groups")
textGroups.forEachIndexed { groupIndex, group ->
val trackGroup = group.mediaTrackGroup
val format = trackGroup.getFormat(0)
val trackId = "${C.TRACK_TYPE_TEXT}_$groupIndex"
subtitleTrackGroupMap[trackId] = trackGroup
val isSelected = group.isSelected
Log.d(TAG, "Subtitle track $groupIndex: codec=${format.codecs}, lang=${format.language}, selected=$isSelected")
// Detect external (side-loaded) subtitle by the ID prefix set in open()
val isExternal = format.id?.startsWith("external_") == true
val externalIndex = if (isExternal) format.id?.removePrefix("external_")?.toIntOrNull() else null
val externalUri = externalIndex?.takeIf { it in externalSubtitleUris.indices }?.let { externalSubtitleUris[it] }
Log.d(TAG, "Subtitle track $groupIndex: codec=${format.codecs}, lang=${format.language}, selected=$isSelected, external=$isExternal")
val track = mutableMapOf<String, Any?>(
"type" to "sub",
@@ -834,8 +862,10 @@ class ExoPlayerCore(private val activity: Activity) : Player.Listener {
"lang" to format.language,
"codec" to format.codecs,
"default" to (format.selectionFlags and C.SELECTION_FLAG_DEFAULT != 0),
"forced" to (format.selectionFlags and C.SELECTION_FLAG_FORCED != 0),
"selected" to isSelected,
"external" to false
"external" to isExternal,
"external-filename" to externalUri
)
trackList.add(track)
@@ -868,31 +898,12 @@ class ExoPlayerCore(private val activity: Activity) : Player.Listener {
delegate?.onPropertyChange("aid", selectedAudioId)
}
val effectiveSubtitleId = when {
selectedExternalSubtitleIndex != null -> "ext_sub_$selectedExternalSubtitleIndex"
selectedSubId != null -> selectedSubId
textGroups.isNotEmpty() || externalSubtitles.isNotEmpty() -> "no"
else -> null
}
if (effectiveSubtitleId != null) {
selectedSubtitleTrackId = effectiveSubtitleId
delegate?.onPropertyChange("sid", effectiveSubtitleId)
}
// Add external subtitles to track list
externalSubtitles.forEachIndexed { index, subtitle ->
val extTrackId = "ext_sub_$index"
trackList.add(mapOf(
"type" to "sub",
"id" to extTrackId,
"title" to (subtitle.label ?: "External"),
"lang" to subtitle.language,
"codec" to subtitle.mimeType,
"default" to false,
"selected" to (selectedExternalSubtitleIndex == index),
"external" to true,
"external-filename" to subtitle.uri.toString()
))
if (selectedSubId != null) {
selectedSubtitleTrackId = selectedSubId
delegate?.onPropertyChange("sid", selectedSubId)
} else if (textGroups.isNotEmpty()) {
selectedSubtitleTrackId = "no"
delegate?.onPropertyChange("sid", "no")
}
delegate?.onPropertyChange("track-list", trackList)
@@ -1020,8 +1031,8 @@ class ExoPlayerCore(private val activity: Activity) : Player.Listener {
val mediaItemBuilder = MediaItem.Builder()
.setUri(uri)
selectedExternalSubtitleIndex?.takeIf { it in externalSubtitles.indices }?.let { subtitleIndex ->
mediaItemBuilder.setSubtitleConfigurations(listOf(externalSubtitles[subtitleIndex]))
if (externalSubtitles.isNotEmpty()) {
mediaItemBuilder.setSubtitleConfigurations(externalSubtitles.toList())
}
return mediaItemBuilder.build()
@@ -1167,12 +1178,17 @@ class ExoPlayerCore(private val activity: Activity) : Player.Listener {
// Public API
fun open(uri: String, headers: Map<String, String>?, startPositionMs: Long, autoPlay: Boolean, isLive: Boolean = false) {
fun open(uri: String, headers: Map<String, String>?, startPositionMs: Long, autoPlay: Boolean, isLive: Boolean = false,
externalSubtitleList: List<Map<String, String?>>? = null) {
if (!isInitialized) return
stopFrameWatchdog()
cancelDecoderHangCheck()
// Reset FPS detection for new content
detectedFrameRate = -1f
fpsTimestampCount = 0
// Reset DV7 retry flag when opening a different file
if (uri != currentMediaUri) {
dv7RetryAttempted = false
@@ -1190,15 +1206,33 @@ class ExoPlayerCore(private val activity: Activity) : Player.Listener {
)
externalSubtitles.clear()
selectedExternalSubtitleIndex = null
externalSubtitleUris.clear()
audioTrackGroupMap.clear()
subtitleTrackGroupMap.clear()
selectedAudioTrackId = null
selectedSubtitleTrackId = null
// Build external subtitle configurations (attached to MediaItem before prepare)
externalSubtitleList?.forEachIndexed { index, sub ->
val subUri = sub["uri"] ?: return@forEachIndexed
val config = MediaItem.SubtitleConfiguration.Builder(Uri.parse(subUri))
.setId("external_$index")
.setLabel(sub["title"] ?: "External")
.setLanguage(sub["language"])
.setMimeType(sub["mimeType"] ?: detectSubtitleMimeType(subUri))
.build()
externalSubtitles.add(config)
externalSubtitleUris.add(subUri)
}
tunnelingDisabledForAudioCodec = false
tunnelingDisabledForVideoCodec = false
currentTunneledPlayback = tunnelingUserEnabled
pendingStartPositionMs = startPositionMs
trackSelector?.setParameters(
trackSelector!!.buildUponParameters().setTunnelingEnabled(tunnelingUserEnabled)
trackSelector!!.buildUponParameters()
.setTunnelingEnabled(tunnelingUserEnabled)
.clearOverridesOfType(C.TRACK_TYPE_AUDIO)
.clearOverridesOfType(C.TRACK_TYPE_TEXT)
)
emitSeekable(false, force = true)
@@ -1268,35 +1302,22 @@ class ExoPlayerCore(private val activity: Activity) : Player.Listener {
}
fun selectAudioTrack(trackId: String) {
val player = exoPlayer ?: return
val selector = trackSelector ?: return
val trackGroup = audioTrackGroupMap[trackId] ?: return
// Parse track ID (format: "type_index")
val parts = trackId.split("_")
if (parts.size < 2) return
selector.parameters = selector.buildUponParameters()
.setOverrideForType(TrackSelectionOverride(trackGroup, 0))
.setTrackTypeDisabled(C.TRACK_TYPE_AUDIO, false)
.build()
val trackIndex = parts[1].toIntOrNull() ?: return
val audioGroups = player.currentTracks.groups.filter { it.type == C.TRACK_TYPE_AUDIO }
if (trackIndex >= 0 && trackIndex < audioGroups.size) {
val group = audioGroups[trackIndex]
selector.parameters = selector.buildUponParameters()
.setOverrideForType(TrackSelectionOverride(group.mediaTrackGroup, 0))
.setTrackTypeDisabled(C.TRACK_TYPE_AUDIO, false)
.build()
selectedAudioTrackId = trackId
delegate?.onPropertyChange("aid", trackId)
}
selectedAudioTrackId = trackId
delegate?.onPropertyChange("aid", trackId)
}
fun selectSubtitleTrack(trackId: String?) {
val player = exoPlayer ?: return
val selector = trackSelector ?: return
if (trackId == null || trackId == "no") {
// Disable subtitles
selectedExternalSubtitleIndex = null
selectedSubtitleTrackId = "no"
selector.parameters = selector.buildUponParameters()
.setTrackTypeDisabled(C.TRACK_TYPE_TEXT, true)
@@ -1305,80 +1326,42 @@ class ExoPlayerCore(private val activity: Activity) : Player.Listener {
return
}
// Check if external subtitle
if (trackId.startsWith("ext_sub_")) {
val index = trackId.removePrefix("ext_sub_").toIntOrNull() ?: return
if (index >= 0 && index < externalSubtitles.size) {
// Reload media with selected external subtitle
selectedExternalSubtitleIndex = index
selectedSubtitleTrackId = trackId
reloadWithExternalSubtitle(index)
return
}
}
// Parse track ID for embedded subtitles
val parts = trackId.split("_")
if (parts.size < 2) return
val trackIndex = parts[1].toIntOrNull() ?: return
val textGroups = player.currentTracks.groups.filter { it.type == C.TRACK_TYPE_TEXT }
if (trackIndex >= 0 && trackIndex < textGroups.size) {
val group = textGroups[trackIndex]
selectedExternalSubtitleIndex = null
selectedSubtitleTrackId = trackId
selector.parameters = selector.buildUponParameters()
.setOverrideForType(TrackSelectionOverride(group.mediaTrackGroup, 0))
.setTrackTypeDisabled(C.TRACK_TYPE_TEXT, false)
.build()
delegate?.onPropertyChange("sid", trackId)
}
}
private fun reloadWithExternalSubtitle(subtitleIndex: Int) {
val uri = currentMediaUri ?: return
val player = exoPlayer ?: return
val currentPosition = player.currentPosition
val shouldResume = player.playWhenReady
selectedExternalSubtitleIndex = subtitleIndex
selectedSubtitleTrackId = "ext_sub_$subtitleIndex"
val mediaItem = buildMediaItem(uri)
player.setMediaItem(mediaItem, currentPosition)
player.prepare()
player.playWhenReady = shouldResume
delegate?.onPropertyChange("sid", "ext_sub_$subtitleIndex")
val trackGroup = subtitleTrackGroupMap[trackId] ?: return
selectedSubtitleTrackId = trackId
selector.parameters = selector.buildUponParameters()
.setOverrideForType(TrackSelectionOverride(trackGroup, 0))
.setTrackTypeDisabled(C.TRACK_TYPE_TEXT, false)
.build()
delegate?.onPropertyChange("sid", trackId)
}
fun addSubtitleTrack(uri: String, title: String?, language: String?, mimeType: String?, select: Boolean) {
val index = externalSubtitles.size
val subtitleConfig = MediaItem.SubtitleConfiguration.Builder(Uri.parse(uri))
.setId("external_$index")
.setLabel(title ?: "External")
.setLanguage(language)
.setMimeType(mimeType ?: detectSubtitleMimeType(uri))
.setSelectionFlags(if (select) C.SELECTION_FLAG_DEFAULT else 0)
.build()
externalSubtitles.add(subtitleConfig)
externalSubtitleUris.add(uri)
// Emit updated track list
// Note: ExoPlayer won't see these until the media is reloaded.
// On Android, external subs are normally passed at open() time.
// This path is only reached if the Flutter layer calls addSubtitleTrack
// while ExoPlayer (not MPV fallback) is active.
emitTrackList()
if (select) {
selectSubtitleTrack("ext_sub_${externalSubtitles.size - 1}")
}
}
private fun detectSubtitleMimeType(uri: String): String {
val lowerUri = uri.lowercase()
// Strip query params before checking extension (Plex URLs have ?X-Plex-Token=...)
val path = Uri.parse(uri).path?.lowercase() ?: uri.lowercase()
return when {
lowerUri.endsWith(".srt") -> MimeTypes.APPLICATION_SUBRIP
lowerUri.endsWith(".ass") || lowerUri.endsWith(".ssa") -> MimeTypes.TEXT_SSA
lowerUri.endsWith(".vtt") -> MimeTypes.TEXT_VTT
lowerUri.endsWith(".ttml") -> MimeTypes.APPLICATION_TTML
path.endsWith(".srt") -> MimeTypes.APPLICATION_SUBRIP
path.endsWith(".ass") || path.endsWith(".ssa") -> MimeTypes.TEXT_SSA
path.endsWith(".vtt") -> MimeTypes.TEXT_VTT
path.endsWith(".ttml") -> MimeTypes.APPLICATION_TTML
else -> MimeTypes.APPLICATION_SUBRIP
}
}
@@ -1493,6 +1476,20 @@ class ExoPlayerCore(private val activity: Activity) : Player.Listener {
frameRateManager?.clearVideoFrameRate()
}
private fun computeFrameRate(timestamps: LongArray): Float {
val deltas = (1 until FPS_SAMPLE_COUNT).map { timestamps[it] - timestamps[it - 1] }.filter { it > 0 }
if (deltas.isEmpty()) return -1f
val medianDelta = deltas.sorted()[deltas.size / 2]
val rawFps = 1_000_000.0 / medianDelta
return normalizeFrameRate(rawFps)
}
private fun normalizeFrameRate(fps: Double): Float {
val knownRates = doubleArrayOf(23.976, 24.0, 25.0, 29.97, 30.0, 48.0, 50.0, 59.94, 60.0)
val nearest = knownRates.minByOrNull { kotlin.math.abs(it - fps) } ?: fps
return if (kotlin.math.abs(nearest - fps) < 0.5) nearest.toFloat() else fps.toFloat()
}
// Stats
fun getStats(): Map<String, Any?> {
@@ -1509,7 +1506,7 @@ class ExoPlayerCore(private val activity: Activity) : Player.Listener {
"videoMimeType" to videoFormat?.sampleMimeType,
"videoWidth" to videoFormat?.width,
"videoHeight" to videoFormat?.height,
"videoFps" to videoFormat?.frameRate,
"videoFps" to (videoFormat?.frameRate?.takeIf { it > 0 } ?: detectedFrameRate.takeIf { it > 0 }),
"videoBitrate" to videoFormat?.bitrate,
"videoDecoderName" to (decoderInitName ?: videoDecoderInfo),
"videoDroppedFrames" to player.videoDecoderCounters?.droppedBufferCount,
@@ -1585,6 +1582,12 @@ class ExoPlayerCore(private val activity: Activity) : Player.Listener {
return "Off"
}
fun triggerFallback() {
val uri = currentMediaUri ?: return
val pos = exoPlayer?.currentPosition ?: 0L
delegate?.onFormatUnsupported(uri, currentHeaders, pos, "debug: manual fallback trigger")
}
// Cleanup
fun dispose() {
@@ -1613,7 +1616,8 @@ class ExoPlayerCore(private val activity: Activity) : Player.Listener {
emitSeekable(false, force = true)
selectedAudioTrackId = null
selectedSubtitleTrackId = null
selectedExternalSubtitleIndex = null
audioTrackGroupMap.clear()
subtitleTrackGroupMap.clear()
exoPlayer?.clearVideoSurface()
exoPlayer?.removeListener(this)
exoPlayer?.release()
@@ -1621,6 +1625,7 @@ class ExoPlayerCore(private val activity: Activity) : Player.Listener {
trackSelector = null
httpDataSourceFactory = null
dataSourceFactory = null
assHandler?.release()
assHandler = null
// Capture locals for deferred cleanup
@@ -147,6 +147,10 @@ class ExoPlayerPlugin : FlutterPlugin, MethodChannel.MethodCallHandler,
playerCore?.debugLoggingEnabled = debugLoggingEnabled
result.success(null)
}
"triggerFallback" -> {
playerCore?.triggerFallback()
result.success(null)
}
else -> result.notImplemented()
}
}
@@ -214,12 +218,14 @@ class ExoPlayerPlugin : FlutterPlugin, MethodChannel.MethodCallHandler,
} ?: result.success(null)
}
@Suppress("UNCHECKED_CAST")
private fun handleOpen(call: MethodCall, result: MethodChannel.Result) {
val uri = call.argument<String>("uri")
val headers = call.argument<Map<String, String>>("headers")
val startPositionMs = call.argument<Number>("startPositionMs")?.toLong() ?: 0L
val autoPlay = call.argument<Boolean>("autoPlay") ?: true
val isLive = call.argument<Boolean>("isLive") ?: false
val externalSubtitles = call.argument<List<Map<String, String?>>>("externalSubtitles")
if (uri == null) {
result.error("INVALID_ARGS", "Missing 'uri'", null)
@@ -245,11 +251,9 @@ class ExoPlayerPlugin : FlutterPlugin, MethodChannel.MethodCallHandler,
val optionsStr = options.joinToString(",")
// Convert content:// URIs to fdclose:// for MPV (SAF SD card downloads)
val mpvUri = openContentFd(uri)?.let { "fdclose://$it" } ?: uri
mpvCore?.runOnExecutor {
mpvCore?.command(arrayOf("loadfile", mpvUri, "replace", "-1", optionsStr))
}
mpvCore?.command(arrayOf("loadfile", mpvUri, "replace", "-1", optionsStr))
} else {
playerCore?.open(uri, headers, startPositionMs, autoPlay, isLive)
playerCore?.open(uri, headers, startPositionMs, autoPlay, isLive, externalSubtitles)
}
result.success(null)
} ?: result.error("NO_ACTIVITY", "Activity not available", null)
@@ -258,7 +262,7 @@ class ExoPlayerPlugin : FlutterPlugin, MethodChannel.MethodCallHandler,
private fun handlePlay(result: MethodChannel.Result) {
activity?.runOnUiThread {
if (usingMpvFallback) {
mpvCore?.runOnExecutor { mpvCore?.setProperty("pause", "no") }
mpvCore?.setProperty("pause", "no")
} else {
playerCore?.play()
}
@@ -269,7 +273,7 @@ class ExoPlayerPlugin : FlutterPlugin, MethodChannel.MethodCallHandler,
private fun handlePause(result: MethodChannel.Result) {
activity?.runOnUiThread {
if (usingMpvFallback) {
mpvCore?.runOnExecutor { mpvCore?.setProperty("pause", "yes") }
mpvCore?.setProperty("pause", "yes")
} else {
playerCore?.pause()
}
@@ -280,10 +284,8 @@ class ExoPlayerPlugin : FlutterPlugin, MethodChannel.MethodCallHandler,
private fun handleStop(result: MethodChannel.Result) {
activity?.runOnUiThread {
if (usingMpvFallback) {
mpvCore?.runOnExecutor {
mpvCore?.command(arrayOf("stop"))
mpvCore?.setVisible(false)
}
mpvCore?.command(arrayOf("stop"))
mpvCore?.setVisible(false)
} else {
playerCore?.stop()
}
@@ -302,9 +304,7 @@ class ExoPlayerPlugin : FlutterPlugin, MethodChannel.MethodCallHandler,
activity?.runOnUiThread {
if (usingMpvFallback) {
val positionSeconds = positionMs / 1000.0
mpvCore?.runOnExecutor {
mpvCore?.command(arrayOf("seek", positionSeconds.toString(), "absolute"))
}
mpvCore?.command(arrayOf("seek", positionSeconds.toString(), "absolute"))
} else {
playerCore?.seekTo(positionMs)
}
@@ -322,7 +322,7 @@ class ExoPlayerPlugin : FlutterPlugin, MethodChannel.MethodCallHandler,
activity?.runOnUiThread {
if (usingMpvFallback) {
mpvCore?.runOnExecutor { mpvCore?.setProperty("volume", volume.toString()) }
mpvCore?.setProperty("volume", volume.toString())
} else {
playerCore?.setVolume(volume / 100f) // Convert 0-100 to 0-1
}
@@ -340,7 +340,7 @@ class ExoPlayerPlugin : FlutterPlugin, MethodChannel.MethodCallHandler,
activity?.runOnUiThread {
if (usingMpvFallback) {
mpvCore?.runOnExecutor { mpvCore?.setProperty("speed", rate.toString()) }
mpvCore?.setProperty("speed", rate.toString())
} else {
playerCore?.setPlaybackSpeed(rate)
}
@@ -358,9 +358,8 @@ class ExoPlayerPlugin : FlutterPlugin, MethodChannel.MethodCallHandler,
activity?.runOnUiThread {
if (usingMpvFallback) {
// MPV uses numeric track IDs - extract from string format
val numericId = trackId.split("_").lastOrNull()?.toIntOrNull() ?: 1
mpvCore?.runOnExecutor { mpvCore?.setProperty("aid", numericId.toString()) }
// After fallback, track IDs come from mpv's track-list (already 1-indexed)
mpvCore?.setProperty("aid", trackId)
} else {
playerCore?.selectAudioTrack(trackId)
}
@@ -374,14 +373,7 @@ class ExoPlayerPlugin : FlutterPlugin, MethodChannel.MethodCallHandler,
// trackId can be null or "no" to disable subtitles
activity?.runOnUiThread {
if (usingMpvFallback) {
mpvCore?.runOnExecutor {
if (trackId == null || trackId == "no") {
mpvCore?.setProperty("sid", "no")
} else {
val numericId = trackId.split("_").lastOrNull()?.toIntOrNull() ?: 1
mpvCore?.setProperty("sid", numericId.toString())
}
}
mpvCore?.setProperty("sid", trackId ?: "no")
} else {
playerCore?.selectSubtitleTrack(trackId)
}
@@ -404,9 +396,7 @@ class ExoPlayerPlugin : FlutterPlugin, MethodChannel.MethodCallHandler,
activity?.runOnUiThread {
if (usingMpvFallback) {
val selectFlag = if (select) "select" else "auto"
mpvCore?.runOnExecutor {
mpvCore?.command(arrayOf("sub-add", uri, selectFlag, title ?: "External"))
}
mpvCore?.command(arrayOf("sub-add", uri, selectFlag, title ?: "External"))
} else {
playerCore?.addSubtitleTrack(uri, title, language, mimeType, select)
}
@@ -515,7 +505,7 @@ class ExoPlayerPlugin : FlutterPlugin, MethodChannel.MethodCallHandler,
}
if (usingMpvFallback) {
mpvCore?.runOnExecutor { mpvCore?.setProperty(name, value) }
mpvCore?.setProperty(name, value)
} else {
// Store for later application if ExoPlayer falls back to MPV
pendingMpvProperties.add(Pair(name, value))
@@ -525,10 +515,10 @@ class ExoPlayerPlugin : FlutterPlugin, MethodChannel.MethodCallHandler,
private fun handleGetStats(result: MethodChannel.Result) {
if (usingMpvFallback) {
mpvCore?.runOnExecutor {
Thread {
val stats = getMpvStats()
activity?.runOnUiThread { result.success(stats) }
} ?: result.success(mapOf("playerType" to "mpv"))
}.start()
} else {
activity?.runOnUiThread {
val coreStats = playerCore?.getStats() ?: emptyMap()
@@ -553,6 +543,8 @@ class ExoPlayerPlugin : FlutterPlugin, MethodChannel.MethodCallHandler,
"video-codec" to mpv.getProperty("video-codec"),
"video-params/w" to mpv.getProperty("video-params/w"),
"video-params/h" to mpv.getProperty("video-params/h"),
"videoWidth" to mpv.getProperty("dwidth"),
"videoHeight" to mpv.getProperty("dheight"),
"container-fps" to mpv.getProperty("container-fps"),
"estimated-vf-fps" to mpv.getProperty("estimated-vf-fps"),
"video-bitrate" to mpv.getProperty("video-bitrate"),
@@ -731,52 +723,52 @@ class ExoPlayerPlugin : FlutterPlugin, MethodChannel.MethodCallHandler,
fallbackInProgress = false
return@initialize
}
core.runOnExecutor {
// Configure basic MPV properties for Plex playback
core.setProperty("hwdec", "mediacodec,mediacodec-copy")
core.setProperty("vo", "gpu")
core.setProperty("ao", "audiotrack")
// 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())
}
// 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)
}
// Apply pending MPV properties from Dart
for ((propName, propValue) in pendingProps) {
core.setProperty(propName, propValue)
}
// Setup property observers
core.observeProperty("time-pos", "double")
core.observeProperty("duration", "double")
core.observeProperty("seekable", "flag")
core.observeProperty("pause", "flag")
core.observeProperty("paused-for-cache", "flag")
core.observeProperty("demuxer-cache-time", "double")
core.observeProperty("eof-reached", "flag")
core.observeProperty("track-list", "string")
core.observeProperty("aid", "string")
core.observeProperty("sid", "string")
core.observeProperty("volume", "double")
core.observeProperty("speed", "double")
// Setup property observers
core.observeProperty("time-pos", "double")
core.observeProperty("duration", "double")
core.observeProperty("seekable", "flag")
core.observeProperty("pause", "flag")
core.observeProperty("paused-for-cache", "flag")
core.observeProperty("demuxer-cache-time", "double")
core.observeProperty("eof-reached", "flag")
core.observeProperty("track-list", "string")
core.observeProperty("aid", "string")
core.observeProperty("sid", "string")
core.observeProperty("volume", "double")
core.observeProperty("speed", "double")
// Show the MPV surface (internally posts to UI)
core.setVisible(true)
// 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("start=$startSeconds")
headers?.forEach { (key, value) ->
options.add("http-header-fields-append=$key: $value")
}
val optionsStr = options.joinToString(",")
core.command(arrayOf("loadfile", mpvUri, "replace", "-1", optionsStr))
// Load media at the same position
val startSeconds = positionMs / 1000.0
val options = mutableListOf<String>()
options.add("start=$startSeconds")
headers?.forEach { (key, value) ->
options.add("http-header-fields-append=$key: $value")
}
val optionsStr = options.joinToString(",")
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.
// 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")
@@ -784,17 +776,17 @@ class ExoPlayerPlugin : FlutterPlugin, MethodChannel.MethodCallHandler,
core.setProperty("tone-mapping-param", "0.7")
core.setProperty("tone-mapping-mode", "luma")
}
}.start()
// Request audio focus
core.requestAudioFocus()
// Request audio focus
core.requestAudioFocus()
// Emit backend-switched event on main thread
activity?.runOnUiThread {
onEvent("backend-switched", null)
}
Log.i(TAG, "Successfully switched to MPV fallback")
// Emit backend-switched event on main thread
activity?.runOnUiThread {
onEvent("backend-switched", null)
}
Log.i(TAG, "Successfully switched to MPV fallback")
}
} catch (e: Exception) {
fallbackInProgress = false
@@ -1,9 +1,7 @@
package com.edde746.plezy.mpv
import android.app.Activity
import android.content.Context
import android.graphics.Color
import android.os.Build
import android.os.Handler
import android.os.Looper
import android.util.Log
@@ -17,41 +15,18 @@ 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 dev.jdtech.mpv.MPVLib
import io.flutter.plugin.common.MethodChannel
import java.util.concurrent.Executors
import dev.jdtech.mpv.*
import kotlinx.coroutines.*
class MpvPlayerCore(private val activity: Activity) :
SurfaceHolder.Callback,
MPVLib.EventObserver,
MPVLib.LogObserver {
class MpvPlayerCore(private val activity: Activity) : SurfaceHolder.Callback {
companion object {
private const val TAG = "MpvPlayerCore"
// Guards MPVLib.create/destroy which share global native state
private val mpvLock = Object()
// JNI's NewStringUTF may produce Java Strings with lone surrogates when
// mpv passes invalid UTF-8 (log messages, system-encoded paths, etc.).
// Lone surrogates cause FormatException in Flutter's StandardMessageCodec
// when it encodes them as UTF-8. Re-encoding strips these invalid chars.
private fun safeString(s: String): String {
for (c in s) {
if (c.isSurrogate()) {
// Slow path: re-encode through UTF-8 to replace lone surrogates with U+FFFD
return s.encodeToByteArray().decodeToString()
}
}
return s // Fast path: no surrogates, string is safe
}
}
private var surfaceView: SurfaceView? = null
private var surfaceContainer: android.widget.FrameLayout? = null
private var overlayLayoutListener: ViewTreeObserver.OnGlobalLayoutListener? =
null
@Volatile private var nativeReady: Boolean = false
private var overlayLayoutListener: ViewTreeObserver.OnGlobalLayoutListener? = null
@Volatile private var disposing: Boolean = false
private var pendingSurface: Surface? = null
private var lastSurfaceSize: String? = null
@@ -59,8 +34,8 @@ class MpvPlayerCore(private val activity: Activity) :
var isInitialized: Boolean = false
private set
// Executor for running MPV commands off the UI thread to prevent ANR
private val commandExecutor = Executors.newSingleThreadExecutor()
private var player: MpvPlayer? = null
private var scope = CoroutineScope(SupervisorJob() + Dispatchers.Main)
// Frame rate matching
private var frameRateManager: FrameRateManager? = null
@@ -68,6 +43,7 @@ class MpvPlayerCore(private val activity: Activity) :
// Audio focus
private var audioFocusManager: AudioFocusManager? = null
@Volatile private var cachedPaused: Boolean = true
private var flutterOverlayApplied = false
@@ -96,6 +72,7 @@ class MpvPlayerCore(private val activity: Activity) :
try {
disposing = false
cachedPaused = true
pendingSurface = null
// Initialize audio focus handling
@@ -103,40 +80,37 @@ class MpvPlayerCore(private val activity: Activity) :
context = activity,
handler = handler,
onPause = {
if (isInitialized) {
try { MPVLib.setPropertyBoolean("pause", true) }
scope.launch {
try { player?.setProperty("pause", true) }
catch (e: Exception) { Log.w(TAG, "Failed to pause on focus loss", e) }
}
},
onResume = {
if (isInitialized) {
try { MPVLib.setPropertyBoolean("pause", false) }
scope.launch {
try { player?.setProperty("pause", false) }
catch (e: Exception) { Log.w(TAG, "Failed to resume after focus gain", e) }
}
},
isPaused = {
try { MPVLib.getPropertyBoolean("pause") == true }
catch (e: Exception) { true }
}
isPaused = { cachedPaused }
)
frameRateManager = FrameRateManager(
activity = activity,
handler = handler,
onDisplayChanged = {
try {
if (MPVLib.getPropertyBoolean("pause") == true) {
Log.d(TAG, "Display changed, resuming playback")
MPVLib.setPropertyBoolean("pause", false)
scope.launch {
try {
if (player?.getFlag("pause") == true) {
Log.d(TAG, "Display changed, resuming playback")
player?.setProperty("pause", false)
}
} catch (e: Exception) {
Log.w(TAG, "Failed to resume after display change", e)
}
} catch (e: Exception) {
Log.w(TAG, "Failed to resume after display change", e)
}
}
)
// Create FrameLayout container for video (matches ExoPlayer pattern)
// Setting visibility on container instead of SurfaceView directly allows
// the surface to be created even when hidden (required with RenderMode.texture)
// Create FrameLayout container for video
surfaceContainer = android.widget.FrameLayout(activity).apply {
layoutParams = ViewGroup.LayoutParams(
ViewGroup.LayoutParams.MATCH_PARENT,
@@ -152,8 +126,6 @@ class MpvPlayerCore(private val activity: Activity) :
android.widget.FrameLayout.LayoutParams.MATCH_PARENT
)
holder.addCallback(this@MpvPlayerCore)
// Critical: Ensure SurfaceView renders BEHIND Flutter's view
setZOrderOnTop(false)
setZOrderMediaOverlay(false)
}
@@ -170,11 +142,9 @@ class MpvPlayerCore(private val activity: Activity) :
FlutterOverlayHelper.configureFlutterZOrder(contentView, container, zOrderOnTop = true)
flutterOverlayApplied = true
}
// Repeat after layout settles to catch late-added Flutter surfaces (release builds)
ensureFlutterOverlayOnTop()
overlayLayoutListener = ViewTreeObserver.OnGlobalLayoutListener {
ensureFlutterOverlayOnTop()
// Re-apply surface size on layout change (orientation transitions)
val sv = surfaceView
if (sv != null) applySurfaceSize(sv.width, sv.height)
}
@@ -182,77 +152,102 @@ class MpvPlayerCore(private val activity: Activity) :
Log.d(TAG, "SurfaceView added to content view")
// Native MPVLib init on background thread — waits for any
// in-flight destroy to finish without blocking the UI thread.
val ctx = activity.applicationContext
Thread {
// Create MpvPlayer on background thread via coroutine
scope.launch {
try {
synchronized(mpvLock) {
if (disposing) {
handler.post { onResult(false) }
return@Thread
}
MPVLib.create(ctx)
setupMpvDefaults()
MPVLib.init()
nativeReady = true
if (disposing) {
onResult(false)
return@launch
}
handler.post {
if (disposing) {
if (nativeReady) {
Thread {
synchronized(mpvLock) {
try {
MPVLib.destroy()
} catch (_: Exception) {
} finally {
nativeReady = false
}
}
}.start()
}
onResult(false)
return@post
}
MPVLib.addObserver(this)
MPVLib.addLogObserver(this)
isInitialized = true
// surfaceCreated can fire before MPV init finishes.
// Defer attaching the surface until native init is ready.
pendingSurface?.takeIf { it.isValid }?.let {
attachSurfaceInternal(it)
}
pendingSurface = null
Log.d(TAG, "Initialized successfully")
onResult(true)
val p = MpvPlayer.create(activity.applicationContext) {
setOption("vo", "gpu")
setOption("gpu-context", "android")
setOption("opengl-es", "yes")
setOption("vd-lavc-film-grain", "cpu")
setOption("ao", "audiotrack,opensles")
}
if (disposing) {
p.close()
onResult(false)
return@launch
}
player = p
isInitialized = true
// Attach pending surface
pendingSurface?.takeIf { it.isValid }?.let { attachSurfaceInternal(it) }
pendingSurface = null
// Start collecting events/properties/logs
collectEvents(p)
collectPropertyChanges(p)
collectLogMessages(p)
Log.d(TAG, "Initialized successfully")
onResult(true)
} catch (e: Exception) {
Log.e(TAG, "Failed to initialize native: ${e.message}", e)
nativeReady = false
handler.post { onResult(false) }
onResult(false)
}
}.start()
}
} catch (e: Exception) {
Log.e(TAG, "Failed to initialize: ${e.message}", e)
onResult(false)
}
}
private fun setupMpvDefaults() {
// Video output configuration
MPVLib.setOptionString("vo", "gpu")
MPVLib.setOptionString("gpu-context", "android")
MPVLib.setOptionString("opengl-es", "yes")
// hwdec is set from Flutter via setProperty based on user preference
// Flow collectors
// Prevent crashes/artifacts from hardware film grain synthesis (mpv #14651)
MPVLib.setOptionString("vd-lavc-film-grain", "cpu")
private fun collectEvents(p: MpvPlayer) {
scope.launch(start = CoroutineStart.UNDISPATCHED) {
p.eventFlow.collect { event ->
when (event) {
is MpvEvent.EndFile -> {
val data = event.reason?.let { mapOf("reason" to it.id) }
delegate?.onEvent("end-file", data)
}
is MpvEvent.FileLoaded -> delegate?.onEvent("file-loaded", null)
is MpvEvent.PlaybackRestart -> delegate?.onEvent("playback-restart", null)
else -> {}
}
}
}
}
// Audio configuration
MPVLib.setOptionString("ao", "audiotrack,opensles")
private fun collectPropertyChanges(p: MpvPlayer) {
scope.launch(start = CoroutineStart.UNDISPATCHED) {
p.propertyFlow.collect { change ->
// Skip None — matches old MPVLib behavior where eventProperty(name)
// with no value was a no-op. Forwarding null would incorrectly clear
// track selections (aid/sid) before the file loads.
if (change is PropertyChange.None) return@collect
val value: Any? = when (change) {
is PropertyChange.Flag -> change.value
is PropertyChange.Int64 -> change.value
is PropertyChange.Double -> change.value
is PropertyChange.Str -> change.value
is PropertyChange.None -> null
}
if (change.name == "pause" && change is PropertyChange.Flag) {
cachedPaused = change.value
}
delegate?.onPropertyChange(change.name, value)
}
}
}
private fun collectLogMessages(p: MpvPlayer) {
scope.launch(start = CoroutineStart.UNDISPATCHED) {
p.logFlow.collect { msg ->
delegate?.onEvent("log-message", mapOf(
"prefix" to msg.prefix,
"level" to msg.level.name.lowercase(),
"text" to msg.text
))
}
}
}
// Audio Focus
@@ -268,14 +263,13 @@ class MpvPlayerCore(private val activity: Activity) :
if (disposing) return
val surface = holder.surface
if (!nativeReady) {
if (player == null) {
pendingSurface = surface
Log.d(TAG, "Deferring surface attach until MPV native init completes")
Log.d(TAG, "Deferring surface attach until MPV init completes")
return
}
attachSurfaceInternal(surface)
// Reassert overlay order whenever the surface is recreated
flutterOverlayApplied = false
ensureFlutterOverlayOnTop()
}
@@ -288,279 +282,86 @@ class MpvPlayerCore(private val activity: Activity) :
override fun surfaceDestroyed(holder: SurfaceHolder) {
Log.d(TAG, "Surface destroyed")
pendingSurface = null
if (!nativeReady || disposing) return
if (player == null || disposing) return
detachSurfaceInternal()
}
private fun attachSurfaceInternal(surface: Surface) {
if (!nativeReady || disposing || !surface.isValid) return
val p = player ?: return
if (disposing || !surface.isValid) return
try {
MPVLib.attachSurface(surface)
MPVLib.setOptionString("force-window", "yes")
// Restore video output after surface is available
MPVLib.setPropertyString("vo", "gpu")
p.attachSurface(surface)
scope.launch {
p.setProperty("force-window", "yes")
p.setProperty("vo", "gpu")
}
} catch (e: Exception) {
Log.w(TAG, "Failed to attach MPV surface", e)
}
}
private fun applySurfaceSize(width: Int, height: Int) {
if (!nativeReady || disposing || width <= 0 || height <= 0) return
val p = player ?: return
if (disposing || width <= 0 || height <= 0) return
val size = "${width}x${height}"
if (size == lastSurfaceSize) return
lastSurfaceSize = size
try {
MPVLib.setPropertyString("android-surface-size", size)
} catch (e: Exception) {
Log.w(TAG, "Failed to apply surface size to MPV", e)
scope.launch {
try { p.setProperty("android-surface-size", size) }
catch (e: Exception) { Log.w(TAG, "Failed to apply surface size to MPV", e) }
}
}
private fun detachSurfaceInternal() {
lastSurfaceSize = null
if (!nativeReady) return
// Disable video output before detaching (like mpv-android)
val p = player ?: return
try {
MPVLib.setPropertyString("vo", "null")
MPVLib.setOptionString("force-window", "no")
MPVLib.detachSurface()
scope.launch {
p.setProperty("vo", "null")
p.setProperty("force-window", "no")
}
p.detachSurface()
} catch (e: Exception) {
Log.w(TAG, "Failed to detach MPV surface", e)
}
}
// MPVLib.EventObserver
override fun eventProperty(property: String) {
// No value provided
}
override fun eventProperty(property: String, value: Long) {
activity.runOnUiThread {
delegate?.onPropertyChange(property, value)
}
}
override fun eventProperty(property: String, value: Double) {
activity.runOnUiThread {
delegate?.onPropertyChange(property, value)
}
}
override fun eventProperty(property: String, value: Boolean) {
activity.runOnUiThread {
delegate?.onPropertyChange(property, value)
}
}
override fun eventProperty(property: String, value: String) {
val safe = safeString(value)
activity.runOnUiThread {
delegate?.onPropertyChange(property, safe)
}
}
override fun event(eventId: Int) {
if (disposing) return
when (eventId) {
MPVLib.MPV_EVENT_END_FILE -> {
val eofReached = try { MPVLib.getPropertyBoolean("eof-reached") == true } catch (_: Exception) { false }
val data: Map<String, Any>? = if (eofReached) {
mapOf("reason" to 0) // EOF
} else {
null // Could be stop, quit, or error — no way to distinguish from JNI
}
activity.runOnUiThread { delegate?.onEvent("end-file", data) }
}
MPVLib.MPV_EVENT_FILE_LOADED -> {
activity.runOnUiThread { delegate?.onEvent("file-loaded", null) }
}
MPVLib.MPV_EVENT_PLAYBACK_RESTART -> {
activity.runOnUiThread { delegate?.onEvent("playback-restart", null) }
}
}
}
// MPVLib.LogObserver
override fun logMessage(prefix: String, level: Int, text: String) {
val levelStr = when (level) {
MPVLib.MPV_LOG_LEVEL_FATAL -> "fatal"
MPVLib.MPV_LOG_LEVEL_ERROR -> "error"
MPVLib.MPV_LOG_LEVEL_WARN -> "warn"
MPVLib.MPV_LOG_LEVEL_INFO -> "info"
MPVLib.MPV_LOG_LEVEL_V -> "v"
MPVLib.MPV_LOG_LEVEL_DEBUG -> "debug"
MPVLib.MPV_LOG_LEVEL_TRACE -> "trace"
else -> "info"
}
val safePrefix = safeString(prefix)
val safeText = safeString(text)
activity.runOnUiThread {
delegate?.onEvent("log-message", mapOf(
"prefix" to safePrefix,
"level" to levelStr,
"text" to safeText
))
}
}
// Public API
fun setProperty(name: String, value: String) {
if (!isInitialized) return
MPVLib.setPropertyString(name, value)
if (!isInitialized || disposing) return
scope.launch {
try { player?.setProperty(name, value) }
catch (e: Exception) { Log.w(TAG, "setProperty($name) failed", e) }
}
}
fun getProperty(name: String): String? {
if (!isInitialized) return null
if (!isInitialized || disposing) return null
return try {
MPVLib.getPropertyString(name)
runBlocking(Dispatchers.IO) { player?.getString(name) }
} catch (e: Exception) {
null
}
}
fun observeProperty(name: String, format: String) {
val p = player ?: return
if (!isInitialized) return
val mpvFormat = when (format) {
"double" -> MPVLib.MPV_FORMAT_DOUBLE
"flag" -> MPVLib.MPV_FORMAT_FLAG
"string" -> MPVLib.MPV_FORMAT_STRING
"node" -> MPVLib.MPV_FORMAT_NODE
else -> MPVLib.MPV_FORMAT_NONE
}
MPVLib.observeProperty(name, mpvFormat)
}
/**
* Get an MPV property asynchronously off the UI thread.
* This prevents ANR when mpv_get_property blocks waiting for internal locks.
*/
fun getPropertyAsync(name: String, result: MethodChannel.Result) {
if (!isInitialized || disposing) {
result.success(null)
return
}
try {
commandExecutor.execute {
try {
val value = MPVLib.getPropertyString(name)
activity.runOnUiThread { result.success(value) }
} catch (e: Exception) {
activity.runOnUiThread { result.success(null) }
}
}
} catch (e: java.util.concurrent.RejectedExecutionException) {
Log.w(TAG, "getPropertyAsync rejected (executor shut down)")
result.success(null)
}
}
/**
* Set an MPV property asynchronously off the UI thread.
* This prevents ANR when mpv_set_property blocks waiting for internal locks.
*/
fun setPropertyAsync(name: String, value: String, result: MethodChannel.Result) {
if (!isInitialized || disposing) {
result.success(null)
return
}
try {
commandExecutor.execute {
try {
MPVLib.setPropertyString(name, value)
activity.runOnUiThread { result.success(null) }
} catch (e: Exception) {
Log.e(TAG, "Async setProperty failed: ${e.message}", e)
activity.runOnUiThread { result.success(null) }
}
}
} catch (e: java.util.concurrent.RejectedExecutionException) {
Log.w(TAG, "setPropertyAsync rejected (executor shut down)")
result.success(null)
}
}
/**
* Observe an MPV property asynchronously off the UI thread.
* This prevents ANR when mpv_observe_property blocks waiting for internal locks.
*/
fun observePropertyAsync(name: String, format: String, result: MethodChannel.Result) {
if (!isInitialized || disposing) {
result.success(null)
return
}
val mpvFormat = when (format) {
"double" -> MPVLib.MPV_FORMAT_DOUBLE
"flag" -> MPVLib.MPV_FORMAT_FLAG
"string" -> MPVLib.MPV_FORMAT_STRING
"node" -> MPVLib.MPV_FORMAT_NODE
else -> MPVLib.MPV_FORMAT_NONE
}
try {
commandExecutor.execute {
try {
MPVLib.observeProperty(name, mpvFormat)
activity.runOnUiThread { result.success(null) }
} catch (e: Exception) {
Log.e(TAG, "Async observeProperty failed: ${e.message}", e)
activity.runOnUiThread { result.success(null) }
}
}
} catch (e: java.util.concurrent.RejectedExecutionException) {
Log.w(TAG, "observePropertyAsync rejected (executor shut down)")
result.success(null)
}
}
/**
* Run a block on the command executor (background thread).
* Used by the plugin for I/O operations that shouldn't block the main thread.
*/
fun runOnExecutor(block: () -> Unit) {
if (disposing) return
try {
commandExecutor.execute(block)
} catch (e: java.util.concurrent.RejectedExecutionException) {
Log.w(TAG, "runOnExecutor rejected (executor shut down)")
val fmt = when (format) {
"double" -> PropertyFormat.Double
"flag" -> PropertyFormat.Flag
"string" -> PropertyFormat.String
else -> PropertyFormat.None
}
p.observeProperty(name, fmt)
}
fun command(args: Array<String>) {
if (!isInitialized || args.isEmpty()) return
MPVLib.command(args)
}
/**
* Execute an MPV command asynchronously off the UI thread.
* This prevents ANR when commands like loadfile block waiting for network I/O.
* The result is called back on the UI thread when the command completes.
*/
fun commandAsync(args: Array<String>, result: MethodChannel.Result) {
if (!isInitialized || disposing || args.isEmpty()) {
result.success(null)
return
}
try {
commandExecutor.execute {
try {
MPVLib.command(args)
activity.runOnUiThread {
result.success(null)
}
} catch (e: Exception) {
Log.e(TAG, "Async command failed: ${e.message}", e)
activity.runOnUiThread {
result.error("COMMAND_FAILED", e.message, null)
}
}
}
} catch (e: java.util.concurrent.RejectedExecutionException) {
Log.w(TAG, "commandAsync rejected (executor shut down)")
result.success(null)
if (!isInitialized || disposing || args.isEmpty()) return
scope.launch {
try { player?.command(*args) }
catch (e: Exception) { Log.w(TAG, "command failed", e) }
}
}
@@ -598,8 +399,6 @@ class MpvPlayerCore(private val activity: Activity) :
check(Looper.myLooper() == Looper.getMainLooper())
Log.d(TAG, "Disposing")
// Shutdown command executor
commandExecutor.shutdown()
handler.removeCallbacksAndMessages(null)
// Clean up frame rate and audio focus
@@ -608,12 +407,17 @@ class MpvPlayerCore(private val activity: Activity) :
audioFocusManager?.release()
audioFocusManager = null
if (nativeReady) {
// Cancel all coroutines
scope.cancel()
// Detach surface from MPV BEFORE removing views to prevent GPU mutex contention
val p = player
if (p != null) {
try {
MPVLib.removeObserver(this)
MPVLib.removeLogObserver(this)
runBlocking(Dispatchers.IO) { p.setProperty("vo", "null") }
p.detachSurface()
} catch (e: Exception) {
Log.w(TAG, "Failed to remove MPV observers during dispose", e)
Log.w(TAG, "Failed to detach surface during dispose", e)
}
}
@@ -622,8 +426,6 @@ class MpvPlayerCore(private val activity: Activity) :
val container = surfaceContainer
val contentView = activity.findViewById<ViewGroup>(android.R.id.content)
// Synchronous ownership invalidation — stale code can no longer
// reach surface state through instance fields.
surfaceContainer = null
surfaceView = null
@@ -636,40 +438,36 @@ class MpvPlayerCore(private val activity: Activity) :
pendingSurface = null
isInitialized = false
// Deferred view removal only — uses captured locals.
// postAtFrontOfQueue as defense-in-depth: orders removal before
// queued initialize messages.
Handler(Looper.getMainLooper()).postAtFrontOfQueue {
sv?.holder?.removeCallback(this)
if (container?.parent != null) {
contentView.removeView(container)
}
}
// Run native destroy on background thread to avoid ANR —
// MPVLib.destroy() blocks on pthread_cond_wait while mpv's
// internal threads (lua, demux, vo) shut down.
// The completion callback is posted to the main thread so the
// caller (MpvPlayerPlugin) can defer result.success() until
// native resources are fully released, preventing a new mpv
// instance from being created while the old one still holds memory.
if (nativeReady) {
// Close player on background thread, then remove views
if (p != null) {
Thread {
synchronized(mpvLock) {
try {
detachSurfaceInternal()
MPVLib.destroy()
} catch (e: Exception) {
Log.w(TAG, "MPV destroy failed", e)
} finally {
nativeReady = false
}
try {
p.close()
} catch (e: Exception) {
Log.w(TAG, "MPV close failed", e)
}
player = null
Log.d(TAG, "Disposed (native)")
onComplete?.let { Handler(Looper.getMainLooper()).post(it) }
Handler(Looper.getMainLooper()).post {
sv?.holder?.removeCallback(this)
if (container?.parent != null) {
contentView.removeView(container)
}
onComplete?.invoke()
}
}.start()
} else {
// No player — safe to remove views immediately
Handler(Looper.getMainLooper()).postAtFrontOfQueue {
sv?.holder?.removeCallback(this)
if (container?.parent != null) {
contentView.removeView(container)
}
}
onComplete?.invoke()
}
// Reset scope for potential re-initialization
scope = CoroutineScope(SupervisorJob() + Dispatchers.Main)
}
}
@@ -26,6 +26,7 @@ class MpvPlayerPlugin : FlutterPlugin, MethodChannel.MethodCallHandler,
private var activity: Activity? = null
private var activityBinding: ActivityPluginBinding? = null
private val nameToId = mutableMapOf<String, Int>()
private var sessionGeneration = 0
// FlutterPlugin
@@ -54,6 +55,7 @@ class MpvPlayerPlugin : FlutterPlugin, MethodChannel.MethodCallHandler,
}
override fun onDetachedFromActivity() {
++sessionGeneration
playerCore?.dispose()
playerCore = null
activity = null
@@ -122,17 +124,28 @@ class MpvPlayerPlugin : FlutterPlugin, MethodChannel.MethodCallHandler,
currentActivity.runOnUiThread {
try {
playerCore = MpvPlayerCore(currentActivity).apply {
// Dispose stale core idempotently
playerCore?.dispose()
playerCore = null
val gen = ++sessionGeneration
val core = MpvPlayerCore(currentActivity).apply {
delegate = this@MpvPlayerPlugin
}
playerCore = core
playerCore?.initialize { success ->
core.initialize { success ->
if (gen != sessionGeneration || playerCore !== core) {
Log.d(TAG, "Stale init callback (gen=$gen, current=$sessionGeneration)")
result.success(false)
return@initialize
}
// Start hidden - now safe because setVisible operates on the container,
// not the SurfaceView directly (matching ExoPlayer's approach)
playerCore?.setVisible(false)
core.setVisible(false)
Log.d(TAG, "Initialized: $success")
result.success(success)
} ?: result.success(false)
}
} catch (e: Exception) {
Log.e(TAG, "Failed to initialize: ${e.message}", e)
result.error("INIT_FAILED", e.message, null)
@@ -142,14 +155,14 @@ class MpvPlayerPlugin : FlutterPlugin, MethodChannel.MethodCallHandler,
private fun handleDispose(result: MethodChannel.Result) {
activity?.runOnUiThread {
playerCore?.dispose {
playerCore = null
val core = playerCore
++sessionGeneration
playerCore = null
core?.dispose {
Log.d(TAG, "Disposed")
result.success(null)
} ?: run {
playerCore = null
result.success(null)
}
} ?: result.success(null)
} ?: result.success(null)
}
@@ -162,8 +175,8 @@ class MpvPlayerPlugin : FlutterPlugin, MethodChannel.MethodCallHandler,
return
}
playerCore?.setPropertyAsync(name, value, result)
?: result.success(null)
playerCore?.setProperty(name, value)
result.success(null)
}
private fun handleGetProperty(call: MethodCall, result: MethodChannel.Result) {
@@ -174,8 +187,8 @@ class MpvPlayerPlugin : FlutterPlugin, MethodChannel.MethodCallHandler,
return
}
playerCore?.getPropertyAsync(name, result)
?: result.success(null)
val value = playerCore?.getProperty(name)
result.success(value)
}
private fun handleObserveProperty(call: MethodCall, result: MethodChannel.Result) {
@@ -189,8 +202,8 @@ class MpvPlayerPlugin : FlutterPlugin, MethodChannel.MethodCallHandler,
}
nameToId[name] = id
playerCore?.observePropertyAsync(name, format, result)
?: result.success(null)
playerCore?.observeProperty(name, format)
result.success(null)
}
private fun handleCommand(call: MethodCall, result: MethodChannel.Result) {
@@ -201,10 +214,8 @@ class MpvPlayerPlugin : FlutterPlugin, MethodChannel.MethodCallHandler,
return
}
// Use async command to prevent ANR - command executes off UI thread
// and result is called back when complete
playerCore?.commandAsync(args.toTypedArray(), result)
?: result.success(null)
playerCore?.command(args.toTypedArray())
result.success(null)
}
private fun handleSetVisible(call: MethodCall, result: MethodChannel.Result) {
@@ -260,7 +271,7 @@ class MpvPlayerPlugin : FlutterPlugin, MethodChannel.MethodCallHandler,
}
// Open file descriptor off UI thread to prevent ANR on slow storage
playerCore?.runOnExecutor {
Thread {
try {
val uri = Uri.parse(uriString)
val pfd = contentResolver.openFileDescriptor(uri, "r")
@@ -268,7 +279,7 @@ class MpvPlayerPlugin : FlutterPlugin, MethodChannel.MethodCallHandler,
activity?.runOnUiThread {
result.error("OPEN_FAILED", "Failed to open file descriptor for $uriString", null)
}
return@runOnExecutor
return@Thread
}
val fd = pfd.detachFd()
@@ -278,7 +289,7 @@ class MpvPlayerPlugin : FlutterPlugin, MethodChannel.MethodCallHandler,
Log.e(TAG, "Failed to open content FD: ${e.message}", e)
activity?.runOnUiThread { result.error("OPEN_FAILED", e.message, null) }
}
} ?: result.error("NO_PLAYER", "Player not initialized", null)
}.start()
}
// PlayerDelegate
@@ -37,16 +37,19 @@ class FrameRateManager(
return
}
if (surface == null) {
Log.d(TAG, "setVideoFrameRate: Surface not available")
return
}
log("fps=$fps, duration=${videoDurationMs}ms, API=${Build.VERSION.SDK_INT}")
when {
Build.VERSION.SDK_INT >= Build.VERSION_CODES.S -> setFrameRateS(fps, surface, videoDurationMs)
Build.VERSION.SDK_INT >= Build.VERSION_CODES.R -> setFrameRateR(fps, surface)
Build.VERSION.SDK_INT >= Build.VERSION_CODES.S -> {
if (surface == null) {
Log.d(TAG, "setVideoFrameRate: Surface not available")
return
}
setFrameRateS(fps, surface, videoDurationMs)
}
// API R's Surface.setFrameRate() only supports seamless switching (no
// CHANGE_FRAME_RATE_ALWAYS), so 60→24Hz won't switch. Fall through to
// preferredDisplayModeId which directly sets the display mode.
Build.VERSION.SDK_INT >= Build.VERSION_CODES.M -> setFrameRateM(fps)
}
}
@@ -58,6 +61,13 @@ class FrameRateManager(
getDisplayManager().unregisterDisplayListener(it)
displayListener = null
}
// Restore default display mode on API M (preferredDisplayModeId persists)
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
activity.window?.attributes?.let { attrs ->
attrs.preferredDisplayModeId = 0
activity.window?.attributes = attrs
}
}
}
private fun registerDisplayListener() {
@@ -79,13 +89,6 @@ class FrameRateManager(
getDisplayManager().registerDisplayListener(displayListener, handler)
}
@RequiresApi(Build.VERSION_CODES.R)
private fun setFrameRateR(fps: Float, surface: Surface) {
Log.d(TAG, "setFrameRateR: Setting frame rate to $fps")
surface.setFrameRate(fps, Surface.FRAME_RATE_COMPATIBILITY_FIXED_SOURCE)
registerDisplayListener()
}
@RequiresApi(Build.VERSION_CODES.S)
private fun setFrameRateS(fps: Float, surface: Surface, videoDurationMs: Long) {
Log.d(TAG, "setFrameRateS: fps=$fps, duration=${videoDurationMs}ms")
@@ -162,7 +165,7 @@ class FrameRateManager(
BigDecimal(mode.refreshRate.toString()).setScale(1, RoundingMode.FLOOR)) {
modeToUse = mode
break
} else if (mode.refreshRate % fps == 0f) {
} else if ((mode.refreshRate % fps).let { it < 0.1f || (fps - it) < 0.1f }) {
modeToUse = mode
break
}
+22 -103
View File
@@ -8,94 +8,45 @@ PODS:
- file_picker (0.0.1):
- Flutter
- Flutter (1.0.0)
- GoogleDataTransport (10.1.0):
- nanopb (~> 3.30910.0)
- PromisesObjC (~> 2.4)
- GoogleMLKit/BarcodeScanning (7.0.0):
- GoogleMLKit/MLKitCore
- MLKitBarcodeScanning (~> 6.0.0)
- GoogleMLKit/MLKitCore (7.0.0):
- MLKitCommon (~> 12.0.0)
- GoogleToolboxForMac/Defines (4.2.1)
- GoogleToolboxForMac/Logger (4.2.1):
- GoogleToolboxForMac/Defines (= 4.2.1)
- "GoogleToolboxForMac/NSData+zlib (4.2.1)":
- GoogleToolboxForMac/Defines (= 4.2.1)
- GoogleUtilities/Environment (8.1.0):
- GoogleUtilities/Privacy
- GoogleUtilities/Logger (8.1.0):
- GoogleUtilities/Environment
- GoogleUtilities/Privacy
- GoogleUtilities/Privacy (8.1.0)
- GoogleUtilities/UserDefaults (8.1.0):
- GoogleUtilities/Logger
- GoogleUtilities/Privacy
- GTMSessionFetcher/Core (3.5.0)
- in_app_review (2.0.0):
- Flutter
- MLImage (1.0.0-beta6)
- MLKitBarcodeScanning (6.0.0):
- MLKitCommon (~> 12.0)
- MLKitVision (~> 8.0)
- MLKitCommon (12.0.0):
- GoogleDataTransport (~> 10.0)
- GoogleToolboxForMac/Logger (< 5.0, >= 4.2.1)
- "GoogleToolboxForMac/NSData+zlib (< 5.0, >= 4.2.1)"
- GoogleUtilities/Logger (~> 8.0)
- GoogleUtilities/UserDefaults (~> 8.0)
- GTMSessionFetcher/Core (< 4.0, >= 3.3.2)
- MLKitVision (8.0.0):
- GoogleToolboxForMac/Logger (< 5.0, >= 4.2.1)
- "GoogleToolboxForMac/NSData+zlib (< 5.0, >= 4.2.1)"
- GTMSessionFetcher/Core (< 4.0, >= 3.3.2)
- MLImage (= 1.0.0-beta6)
- MLKitCommon (~> 12.0)
- mobile_scanner (6.0.2):
- mobile_scanner (7.0.0):
- Flutter
- GoogleMLKit/BarcodeScanning (~> 7.0.0)
- nanopb (3.30910.0):
- nanopb/decode (= 3.30910.0)
- nanopb/encode (= 3.30910.0)
- nanopb/decode (3.30910.0)
- nanopb/encode (3.30910.0)
- FlutterMacOS
- os_media_controls (0.0.1):
- Flutter
- package_info_plus (0.4.5):
- Flutter
- path_provider_foundation (0.0.1):
- Sentry/HybridSDK (8.58.0)
- sentry_flutter (9.15.0):
- Flutter
- FlutterMacOS
- PromisesObjC (2.4.0)
- Sentry/HybridSDK (8.46.0)
- sentry_flutter (8.14.2):
- Flutter
- FlutterMacOS
- Sentry/HybridSDK (= 8.46.0)
- Sentry/HybridSDK (= 8.58.0)
- shared_preferences_foundation (0.0.1):
- Flutter
- FlutterMacOS
- sqflite_darwin (0.0.4):
- Flutter
- FlutterMacOS
- sqlite3 (3.51.1):
- sqlite3/common (= 3.51.1)
- sqlite3/common (3.51.1)
- sqlite3/dbstatvtab (3.51.1):
- sqlite3 (3.52.0):
- sqlite3/common (= 3.52.0)
- sqlite3/common (3.52.0)
- sqlite3/dbstatvtab (3.52.0):
- sqlite3/common
- sqlite3/fts5 (3.51.1):
- sqlite3/fts5 (3.52.0):
- sqlite3/common
- sqlite3/math (3.51.1):
- sqlite3/math (3.52.0):
- sqlite3/common
- sqlite3/perf-threadsafe (3.51.1):
- sqlite3/perf-threadsafe (3.52.0):
- sqlite3/common
- sqlite3/rtree (3.51.1):
- sqlite3/rtree (3.52.0):
- sqlite3/common
- sqlite3/session (3.51.1):
- sqlite3/session (3.52.0):
- sqlite3/common
- sqlite3_flutter_libs (0.0.1):
- Flutter
- FlutterMacOS
- sqlite3 (~> 3.51.1)
- sqlite3 (~> 3.52.0)
- sqlite3/dbstatvtab
- sqlite3/fts5
- sqlite3/math
@@ -108,8 +59,6 @@ PODS:
- Flutter
- wakelock_plus (0.0.1):
- Flutter
- workmanager_apple (0.0.1):
- Flutter
DEPENDENCIES:
- background_downloader (from `.symlinks/plugins/background_downloader/ios`)
@@ -118,10 +67,9 @@ DEPENDENCIES:
- file_picker (from `.symlinks/plugins/file_picker/ios`)
- Flutter (from `Flutter`)
- in_app_review (from `.symlinks/plugins/in_app_review/ios`)
- mobile_scanner (from `.symlinks/plugins/mobile_scanner/ios`)
- mobile_scanner (from `.symlinks/plugins/mobile_scanner/darwin`)
- os_media_controls (from `.symlinks/plugins/os_media_controls/ios`)
- package_info_plus (from `.symlinks/plugins/package_info_plus/ios`)
- path_provider_foundation (from `.symlinks/plugins/path_provider_foundation/darwin`)
- sentry_flutter (from `.symlinks/plugins/sentry_flutter/ios`)
- shared_preferences_foundation (from `.symlinks/plugins/shared_preferences_foundation/darwin`)
- sqflite_darwin (from `.symlinks/plugins/sqflite_darwin/darwin`)
@@ -129,21 +77,9 @@ DEPENDENCIES:
- universal_gamepad (from `.symlinks/plugins/universal_gamepad/ios`)
- url_launcher_ios (from `.symlinks/plugins/url_launcher_ios/ios`)
- wakelock_plus (from `.symlinks/plugins/wakelock_plus/ios`)
- workmanager_apple (from `.symlinks/plugins/workmanager_apple/ios`)
SPEC REPOS:
trunk:
- GoogleDataTransport
- GoogleMLKit
- GoogleToolboxForMac
- GoogleUtilities
- GTMSessionFetcher
- MLImage
- MLKitBarcodeScanning
- MLKitCommon
- MLKitVision
- nanopb
- PromisesObjC
- Sentry
- sqlite3
@@ -161,13 +97,11 @@ EXTERNAL SOURCES:
in_app_review:
:path: ".symlinks/plugins/in_app_review/ios"
mobile_scanner:
:path: ".symlinks/plugins/mobile_scanner/ios"
:path: ".symlinks/plugins/mobile_scanner/darwin"
os_media_controls:
:path: ".symlinks/plugins/os_media_controls/ios"
package_info_plus:
:path: ".symlinks/plugins/package_info_plus/ios"
path_provider_foundation:
:path: ".symlinks/plugins/path_provider_foundation/darwin"
sentry_flutter:
:path: ".symlinks/plugins/sentry_flutter/ios"
shared_preferences_foundation:
@@ -182,8 +116,6 @@ EXTERNAL SOURCES:
:path: ".symlinks/plugins/url_launcher_ios/ios"
wakelock_plus:
:path: ".symlinks/plugins/wakelock_plus/ios"
workmanager_apple:
:path: ".symlinks/plugins/workmanager_apple/ios"
SPEC CHECKSUMS:
background_downloader: 50e91d979067b82081aba359d7d916b3ba5fadad
@@ -191,32 +123,19 @@ SPEC CHECKSUMS:
device_info_plus: 21fcca2080fbcd348be798aa36c3e5ed849eefbe
file_picker: 8fc6fe5e42585a217d44d22f79ec046cb8d81140
Flutter: cabc95a1d2626b1b06e7179b784ebcf0c0cde467
GoogleDataTransport: aae35b7ea0c09004c3797d53c8c41f66f219d6a7
GoogleMLKit: eff9e23ec1d90ea4157a1ee2e32a4f610c5b3318
GoogleToolboxForMac: d1a2cbf009c453f4d6ded37c105e2f67a32206d8
GoogleUtilities: 00c88b9a86066ef77f0da2fab05f65d7768ed8e1
GTMSessionFetcher: 5aea5ba6bd522a239e236100971f10cb71b96ab6
in_app_review: 7dd1ea365263f834b8464673f9df72c80c17c937
MLImage: 0ad1c5f50edd027672d8b26b0fee78a8b4a0fc56
MLKitBarcodeScanning: 0a3064da0a7f49ac24ceb3cb46a5bc67496facd2
MLKitCommon: 07c2c33ae5640e5380beaaa6e4b9c249a205542d
MLKitVision: 45e79d68845a2de77e2dd4d7f07947f0ed157b0e
mobile_scanner: af8f71879eaba2bbcb4d86c6a462c3c0e7f23036
nanopb: fad817b59e0457d11a5dfbde799381cd727c1275
mobile_scanner: 9157936403f5a0644ca3779a38ff8404c5434a93
os_media_controls: 86dceab6245a5325af90fc0fdebe243c42d789b4
package_info_plus: af8e2ca6888548050f16fa2f1938db7b5a5df499
path_provider_foundation: bb55f6dbba17d0dccd6737fe6f7f34fbd0376880
PromisesObjC: f5707f49cb48b9636751c5b2e7d227e43fba9f47
Sentry: da60d980b197a46db0b35ea12cb8f39af48d8854
sentry_flutter: 27892878729f42701297c628eb90e7c6529f3684
Sentry: d587a8fe91ca13503ecd69a1905f3e8a0fcf61be
sentry_flutter: 8939e491bc1511868118c96cae47d945e6f69798
shared_preferences_foundation: 7036424c3d8ec98dfe75ff1667cb0cd531ec82bb
sqflite_darwin: 20b2a3a3b70e43edae938624ce550a3cbf66a3d0
sqlite3: 8d708bc63e9f4ce48f0ad9d6269e478c5ced1d9b
sqlite3_flutter_libs: d13b8b3003f18f596e542bcb9482d105577eff41
sqlite3: a51c07cf16e023d6c48abd5e5791a61a47354921
sqlite3_flutter_libs: b3e120efe9a82017e5552a620f696589ed4f62ab
universal_gamepad: e10172778a8a399cce234494968f38724974919e
url_launcher_ios: 7a95fa5b60cc718a708b8f2966718e93db0cef1b
wakelock_plus: e29112ab3ef0b318e58cfa5c32326458be66b556
workmanager_apple: 904529ae31e97fc5be632cf628507652294a0778
PODFILE CHECKSUM: 16bb7f67e16d8aaa2bfb97666803fbfb291b6559
+91 -109
View File
@@ -8,20 +8,20 @@
/* Begin PBXBuildFile section */
1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */ = {isa = PBXBuildFile; fileRef = 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */; };
2CA552536A23AFD33344616B /* Pods_RunnerTests.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 200265C4B9C45EDD150FB4C3 /* Pods_RunnerTests.framework */; };
331C808B294A63AB00263BE5 /* RunnerTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 331C807B294A618700263BE5 /* RunnerTests.swift */; };
3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */; };
50DEEA8E23D1B433DE5341D6 /* Pods_Runner.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 2C12D873DE8572579684A82C /* Pods_Runner.framework */; };
6A48DFB02EA70C7100C1F7CD /* plezy.icon in Resources */ = {isa = PBXBuildFile; fileRef = 6A48DFAF2EA70C7100C1F7CD /* plezy.icon */; };
6A8A46212EDB320D0057B88C /* MPVKit in Frameworks */ = {isa = PBXBuildFile; productRef = 6A8A46202EDB320D0057B88C /* MPVKit */; };
6A8A46252EDB370C0057B88C /* MpvPlayerPlugin.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6A8A46232EDB370C0057B88C /* MpvPlayerPlugin.swift */; };
6A8A46262EDB370C0057B88C /* MpvPlayerCore.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6A8A46222EDB370C0057B88C /* MpvPlayerCore.swift */; };
B1D51A6A2F00110000000001 /* MpvPlayerCoreBase.swift in Sources */ = {isa = PBXBuildFile; fileRef = B1D51A6A2F00110000000002 /* MpvPlayerCoreBase.swift */; };
B1D51A6A2F00110000000005 /* MpvPlayerPluginShared.swift in Sources */ = {isa = PBXBuildFile; fileRef = B1D51A6A2F00110000000006 /* MpvPlayerPluginShared.swift */; };
92F969587D0E464D999910F5 /* MpvPipController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 92F969587D0E464D999910F4 /* MpvPipController.swift */; };
702A247AA28B055172318FF9 /* Pods_Runner.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 61B22BEA638334DA7861BCF6 /* Pods_Runner.framework */; };
74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 74858FAE1ED2DC5600515810 /* AppDelegate.swift */; };
92F969587D0E464D999910F5 /* MpvPipController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 92F969587D0E464D999910F4 /* MpvPipController.swift */; };
97C146FC1CF9000F007C117D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FA1CF9000F007C117D /* Main.storyboard */; };
97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */; };
F37BB572E0F0606E20596E43 /* Pods_RunnerTests.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3469ED9D4F3E58F8C3AEB7DC /* Pods_RunnerTests.framework */; };
B1D51A6A2F00110000000001 /* MpvPlayerCoreBase.swift in Sources */ = {isa = PBXBuildFile; fileRef = B1D51A6A2F00110000000002 /* MpvPlayerCoreBase.swift */; };
B1D51A6A2F00110000000005 /* MpvPlayerPluginShared.swift in Sources */ = {isa = PBXBuildFile; fileRef = B1D51A6A2F00110000000006 /* MpvPlayerPluginShared.swift */; };
/* End PBXBuildFile section */
/* Begin PBXContainerItemProxy section */
@@ -48,34 +48,34 @@
/* End PBXCopyFilesBuildPhase section */
/* Begin PBXFileReference section */
030239DB288C484414523AFE /* Pods-RunnerTests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-RunnerTests.debug.xcconfig"; path = "Target Support Files/Pods-RunnerTests/Pods-RunnerTests.debug.xcconfig"; sourceTree = "<group>"; };
1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GeneratedPluginRegistrant.h; sourceTree = "<group>"; };
1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GeneratedPluginRegistrant.m; sourceTree = "<group>"; };
1E1EC7646F3085BF9127AB2A /* 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>"; };
2C12D873DE8572579684A82C /* Pods_Runner.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Runner.framework; sourceTree = BUILT_PRODUCTS_DIR; };
200265C4B9C45EDD150FB4C3 /* Pods_RunnerTests.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_RunnerTests.framework; sourceTree = BUILT_PRODUCTS_DIR; };
230D46AA7CEA8CB81C420035 /* Pods-RunnerTests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-RunnerTests.release.xcconfig"; path = "Target Support Files/Pods-RunnerTests/Pods-RunnerTests.release.xcconfig"; sourceTree = "<group>"; };
331C807B294A618700263BE5 /* RunnerTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RunnerTests.swift; sourceTree = "<group>"; };
331C8081294A63A400263BE5 /* RunnerTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = RunnerTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
3469ED9D4F3E58F8C3AEB7DC /* Pods_RunnerTests.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_RunnerTests.framework; sourceTree = BUILT_PRODUCTS_DIR; };
3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = "<group>"; };
5B81FA7048BFA976F49D555E /* Pods-RunnerTests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-RunnerTests.debug.xcconfig"; path = "Target Support Files/Pods-RunnerTests/Pods-RunnerTests.debug.xcconfig"; sourceTree = "<group>"; };
5C4660106A040D374746C713 /* Pods-Runner.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.release.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"; sourceTree = "<group>"; };
61B22BEA638334DA7861BCF6 /* Pods_Runner.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Runner.framework; sourceTree = BUILT_PRODUCTS_DIR; };
6A48DFAF2EA70C7100C1F7CD /* plezy.icon */ = {isa = PBXFileReference; lastKnownFileType = folder.iconcomposer.icon; path = plezy.icon; sourceTree = "<group>"; };
6A8A46222EDB370C0057B88C /* MpvPlayerCore.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MpvPlayerCore.swift; sourceTree = "<group>"; };
6A8A46232EDB370C0057B88C /* MpvPlayerPlugin.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MpvPlayerPlugin.swift; 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; };
92F969587D0E464D999910F4 /* MpvPipController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MpvPipController.swift; sourceTree = "<group>"; };
6E3FE696F0F85B37E212CCEE /* Pods-Runner.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.debug.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"; sourceTree = "<group>"; };
6FAF62B46A8A7A431F17FCD8 /* Pods-RunnerTests.profile.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-RunnerTests.profile.xcconfig"; path = "Target Support Files/Pods-RunnerTests/Pods-RunnerTests.profile.xcconfig"; sourceTree = "<group>"; };
74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Runner-Bridging-Header.h"; sourceTree = "<group>"; };
74858FAE1ED2DC5600515810 /* AppDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; };
7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = "<group>"; };
83B9EB35C25EEF40090F6A88 /* Pods-Runner.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.release.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"; sourceTree = "<group>"; };
87ADF6219C65A13967DFF03C /* Pods-RunnerTests.profile.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-RunnerTests.profile.xcconfig"; path = "Target Support Files/Pods-RunnerTests/Pods-RunnerTests.profile.xcconfig"; sourceTree = "<group>"; };
92F969587D0E464D999910F4 /* MpvPipController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MpvPipController.swift; sourceTree = "<group>"; };
9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Debug.xcconfig; path = Flutter/Debug.xcconfig; sourceTree = "<group>"; };
9740EEB31CF90195004384FC /* Generated.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Generated.xcconfig; path = Flutter/Generated.xcconfig; sourceTree = "<group>"; };
97C146EE1CF9000F007C117D /* Runner.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Runner.app; sourceTree = BUILT_PRODUCTS_DIR; };
97C146FB1CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = "<group>"; };
97C147001CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = "<group>"; };
97C147021CF9000F007C117D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
A8738BEC00467F05948734DD /* Pods-Runner.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.debug.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"; sourceTree = "<group>"; };
D239CED757CED630C2B0A161 /* Pods-RunnerTests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-RunnerTests.release.xcconfig"; path = "Target Support Files/Pods-RunnerTests/Pods-RunnerTests.release.xcconfig"; 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; };
C208E69E3A3B935CE009B4D5 /* 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>"; };
/* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */
@@ -83,7 +83,7 @@
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
F37BB572E0F0606E20596E43 /* Pods_RunnerTests.framework in Frameworks */,
2CA552536A23AFD33344616B /* Pods_RunnerTests.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -91,14 +91,23 @@
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
50DEEA8E23D1B433DE5341D6 /* Pods_Runner.framework in Frameworks */,
6A8A46212EDB320D0057B88C /* MPVKit in Frameworks */,
702A247AA28B055172318FF9 /* Pods_Runner.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXFrameworksBuildPhase section */
/* Begin PBXGroup section */
19B1F8004DD75C8EEB4662AB /* Frameworks */ = {
isa = PBXGroup;
children = (
61B22BEA638334DA7861BCF6 /* Pods_Runner.framework */,
200265C4B9C45EDD150FB4C3 /* Pods_RunnerTests.framework */,
);
name = Frameworks;
sourceTree = "<group>";
};
331C8082294A63A400263BE5 /* RunnerTests */ = {
isa = PBXGroup;
children = (
@@ -107,15 +116,6 @@
path = RunnerTests;
sourceTree = "<group>";
};
67716449E04A72AA71A90156 /* Frameworks */ = {
isa = PBXGroup;
children = (
2C12D873DE8572579684A82C /* Pods_Runner.framework */,
3469ED9D4F3E58F8C3AEB7DC /* Pods_RunnerTests.framework */,
);
name = Frameworks;
sourceTree = "<group>";
};
6A8A46242EDB370C0057B88C /* MpvPlayer */ = {
isa = PBXGroup;
children = (
@@ -131,12 +131,12 @@
875C8AEFBBA3759A1849D674 /* Pods */ = {
isa = PBXGroup;
children = (
A8738BEC00467F05948734DD /* Pods-Runner.debug.xcconfig */,
83B9EB35C25EEF40090F6A88 /* Pods-Runner.release.xcconfig */,
1E1EC7646F3085BF9127AB2A /* Pods-Runner.profile.xcconfig */,
5B81FA7048BFA976F49D555E /* Pods-RunnerTests.debug.xcconfig */,
D239CED757CED630C2B0A161 /* Pods-RunnerTests.release.xcconfig */,
87ADF6219C65A13967DFF03C /* Pods-RunnerTests.profile.xcconfig */,
6E3FE696F0F85B37E212CCEE /* Pods-Runner.debug.xcconfig */,
5C4660106A040D374746C713 /* Pods-Runner.release.xcconfig */,
C208E69E3A3B935CE009B4D5 /* Pods-Runner.profile.xcconfig */,
030239DB288C484414523AFE /* Pods-RunnerTests.debug.xcconfig */,
230D46AA7CEA8CB81C420035 /* Pods-RunnerTests.release.xcconfig */,
6FAF62B46A8A7A431F17FCD8 /* Pods-RunnerTests.profile.xcconfig */,
);
path = Pods;
sourceTree = "<group>";
@@ -160,8 +160,8 @@
97C146EF1CF9000F007C117D /* Products */,
331C8082294A63A400263BE5 /* RunnerTests */,
875C8AEFBBA3759A1849D674 /* Pods */,
67716449E04A72AA71A90156 /* Frameworks */,
6A48DFAF2EA70C7100C1F7CD /* plezy.icon */,
19B1F8004DD75C8EEB4662AB /* Frameworks */,
);
sourceTree = "<group>";
};
@@ -196,7 +196,7 @@
isa = PBXNativeTarget;
buildConfigurationList = 331C8087294A63A400263BE5 /* Build configuration list for PBXNativeTarget "RunnerTests" */;
buildPhases = (
684A4A968F313A7FDAEBF3B8 /* [CP] Check Pods Manifest.lock */,
C5965E09A75FF4B9D47A6A5A /* [CP] Check Pods Manifest.lock */,
331C807D294A63A400263BE5 /* Sources */,
331C807F294A63A400263BE5 /* Resources */,
582EBCC1C90BEBEC365D972D /* Frameworks */,
@@ -215,15 +215,14 @@
isa = PBXNativeTarget;
buildConfigurationList = 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */;
buildPhases = (
01D58DD9E289D97FD8DBE66E /* [CP] Check Pods Manifest.lock */,
A7BAF2DBCB81960BDC752F05 /* [CP] Check Pods Manifest.lock */,
9740EEB61CF901F6004384FC /* Run Script */,
97C146EA1CF9000F007C117D /* Sources */,
97C146EB1CF9000F007C117D /* Frameworks */,
97C146EC1CF9000F007C117D /* Resources */,
9705A1C41CF9048500538489 /* Embed Frameworks */,
3B06AD1E1E4923F5004D2608 /* Thin Binary */,
2E10BAE564A4AFFCFF5B4EF0 /* [CP] Embed Pods Frameworks */,
BE3E47DA555D39F032C6A1DB /* [CP] Copy Pods Resources */,
87CA3559B76E3AB2BA77B235 /* [CP] Embed Pods Frameworks */,
);
buildRules = (
);
@@ -298,7 +297,55 @@
/* End PBXResourcesBuildPhase section */
/* Begin PBXShellScriptBuildPhase section */
01D58DD9E289D97FD8DBE66E /* [CP] Check Pods Manifest.lock */ = {
3B06AD1E1E4923F5004D2608 /* Thin Binary */ = {
isa = PBXShellScriptBuildPhase;
alwaysOutOfDate = 1;
buildActionMask = 2147483647;
files = (
);
inputPaths = (
"${TARGET_BUILD_DIR}/${INFOPLIST_PATH}",
);
name = "Thin Binary";
outputPaths = (
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" embed_and_thin";
};
87CA3559B76E3AB2BA77B235 /* [CP] Embed Pods Frameworks */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputFileListPaths = (
"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-input-files.xcfilelist",
);
name = "[CP] Embed Pods Frameworks";
outputFileListPaths = (
"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-output-files.xcfilelist",
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh\"\n";
showEnvVarsInLog = 0;
};
9740EEB61CF901F6004384FC /* Run Script */ = {
isa = PBXShellScriptBuildPhase;
alwaysOutOfDate = 1;
buildActionMask = 2147483647;
files = (
);
inputPaths = (
);
name = "Run Script";
outputPaths = (
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" build";
};
A7BAF2DBCB81960BDC752F05 /* [CP] Check Pods Manifest.lock */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
@@ -320,40 +367,7 @@
shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n";
showEnvVarsInLog = 0;
};
2E10BAE564A4AFFCFF5B4EF0 /* [CP] Embed Pods Frameworks */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputFileListPaths = (
"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-input-files.xcfilelist",
);
name = "[CP] Embed Pods Frameworks";
outputFileListPaths = (
"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-output-files.xcfilelist",
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh\"\n";
showEnvVarsInLog = 0;
};
3B06AD1E1E4923F5004D2608 /* Thin Binary */ = {
isa = PBXShellScriptBuildPhase;
alwaysOutOfDate = 1;
buildActionMask = 2147483647;
files = (
);
inputPaths = (
"${TARGET_BUILD_DIR}/${INFOPLIST_PATH}",
);
name = "Thin Binary";
outputPaths = (
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" embed_and_thin";
};
684A4A968F313A7FDAEBF3B8 /* [CP] Check Pods Manifest.lock */ = {
C5965E09A75FF4B9D47A6A5A /* [CP] Check Pods Manifest.lock */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
@@ -375,38 +389,6 @@
shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n";
showEnvVarsInLog = 0;
};
9740EEB61CF901F6004384FC /* Run Script */ = {
isa = PBXShellScriptBuildPhase;
alwaysOutOfDate = 1;
buildActionMask = 2147483647;
files = (
);
inputPaths = (
);
name = "Run Script";
outputPaths = (
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" build";
};
BE3E47DA555D39F032C6A1DB /* [CP] Copy Pods Resources */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputFileListPaths = (
"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-resources-${CONFIGURATION}-input-files.xcfilelist",
);
name = "[CP] Copy Pods Resources";
outputFileListPaths = (
"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-resources-${CONFIGURATION}-output-files.xcfilelist",
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-resources.sh\"\n";
showEnvVarsInLog = 0;
};
/* End PBXShellScriptBuildPhase section */
/* Begin PBXSourcesBuildPhase section */
@@ -542,7 +524,7 @@
};
331C8088294A63A400263BE5 /* Debug */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = 5B81FA7048BFA976F49D555E /* Pods-RunnerTests.debug.xcconfig */;
baseConfigurationReference = 030239DB288C484414523AFE /* Pods-RunnerTests.debug.xcconfig */;
buildSettings = {
BUNDLE_LOADER = "$(TEST_HOST)";
CODE_SIGN_STYLE = Automatic;
@@ -560,7 +542,7 @@
};
331C8089294A63A400263BE5 /* Release */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = D239CED757CED630C2B0A161 /* Pods-RunnerTests.release.xcconfig */;
baseConfigurationReference = 230D46AA7CEA8CB81C420035 /* Pods-RunnerTests.release.xcconfig */;
buildSettings = {
BUNDLE_LOADER = "$(TEST_HOST)";
CODE_SIGN_STYLE = Automatic;
@@ -576,7 +558,7 @@
};
331C808A294A63A400263BE5 /* Profile */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = 87ADF6219C65A13967DFF03C /* Pods-RunnerTests.profile.xcconfig */;
baseConfigurationReference = 6FAF62B46A8A7A431F17FCD8 /* Pods-RunnerTests.profile.xcconfig */;
buildSettings = {
BUNDLE_LOADER = "$(TEST_HOST)";
CODE_SIGN_STYLE = Automatic;
@@ -804,7 +786,7 @@
6A8A46202EDB320D0057B88C /* MPVKit */ = {
isa = XCSwiftPackageProductDependency;
package = 6A8A461F2EDB320D0057B88C /* XCRemoteSwiftPackageReference "MPVKit" */;
productName = "MPVKit";
productName = MPVKit;
};
/* End XCSwiftPackageProductDependency section */
};
@@ -57,7 +57,6 @@ class MpvPipController: NSObject {
if let windowScene = UIApplication.shared.connectedScenes.first as? UIWindowScene,
let window = windowScene.windows.first(where: { $0.isKeyWindow }) {
let view = UIView(frame: window.bounds)
view.autoresizingMask = [.flexibleWidth, .flexibleHeight]
view.clipsToBounds = true
view.isUserInteractionEnabled = false
sampleBufferLayer.frame = view.bounds
+22 -19
View File
@@ -139,28 +139,31 @@ class MpvPlayerPlugin: NSObject, FlutterPlugin, FlutterStreamHandler, MpvPluginS
}
private func handlePipCall(_ call: FlutterMethodCall, result: @escaping FlutterResult) {
switch call.method {
case "isSupported":
result(MpvPipController.isSupported)
case "enter":
enterPip(manual: true, result: result)
case "setAutoPipReady":
if let args = call.arguments as? [String: Any], let ready = args["ready"] as? Bool {
autoPipEnabled = ready
if ready {
let pip = ensurePipController()
pip.setAutoStart(true)
// Warm the layer so the system considers PiP possible
if let pc = playerCore {
pip.warmLayer(currentTime: pc.timePos, isPlaying: !pc.isPaused)
DispatchQueue.main.async { [weak self] in
guard let self = self else { result(nil); return }
switch call.method {
case "isSupported":
result(MpvPipController.isSupported)
case "enter":
self.enterPip(manual: true, result: result)
case "setAutoPipReady":
if let args = call.arguments as? [String: Any], let ready = args["ready"] as? Bool {
self.autoPipEnabled = ready
if ready {
let pip = self.ensurePipController()
pip.setAutoStart(true)
// Warm the layer so the system considers PiP possible
if let pc = self.playerCore {
pip.warmLayer(currentTime: pc.timePos, isPlaying: !pc.isPaused)
}
} else {
self.pipController?.setAutoStart(false)
}
} else {
pipController?.setAutoStart(false)
}
result(nil)
default:
result(FlutterMethodNotImplemented)
}
result(nil)
default:
result(FlutterMethodNotImplemented)
}
}
+1 -1
View File
@@ -225,7 +225,7 @@ LazyDatabase _openConnection() {
}
}
return NativeDatabase(file, setup: (db) {
return NativeDatabase.createInBackground(file, setup: (db) {
db.execute('PRAGMA journal_mode=WAL');
db.execute('PRAGMA synchronous=NORMAL');
});
+6
View File
@@ -135,6 +135,8 @@
"subtitleStylingDescription": "Tilpas underteksters udseende",
"smallSkipDuration": "Kort spring-varighed",
"largeSkipDuration": "Lang spring-varighed",
"rewindOnResume": "Spol tilbage ved genoptagelse",
"rewindOnResumeDescription": "Spol tilbage med denne mængde ved genoptagelse af afspilning",
"secondsUnit": "${seconds} sekunder",
"defaultSleepTimer": "Standard sove-timer",
"minutesUnit": "${minutes} minutter",
@@ -344,6 +346,10 @@
"exitFullscreenButton": "Forlad fuldskærm",
"alwaysOnTopButton": "Altid øverst",
"rotationLockButton": "Rotationslås",
"lockScreen": "Lås skærm",
"unlockScreen": "Lås skærm op",
"screenLockButton": "Skærmlås",
"longPressToUnlock": "Langt tryk for at låse op",
"timelineSlider": "Videotidslinje",
"volumeSlider": "Lydstyrkeniveau",
"endsAt": "Slutter kl. ${time}",
+6
View File
@@ -135,6 +135,8 @@
"subtitleStylingDescription": "Aussehen von Untertiteln anpassen",
"smallSkipDuration": "Kleine Sprungdauer",
"largeSkipDuration": "Große Sprungdauer",
"rewindOnResume": "Zurückspulen bei Fortsetzung",
"rewindOnResumeDescription": "Um diesen Betrag zurückspulen, wenn die Wiedergabe fortgesetzt wird",
"secondsUnit": "${seconds} Sekunden",
"defaultSleepTimer": "Standard-Sleep-Timer",
"minutesUnit": "${minutes} Minuten",
@@ -344,6 +346,10 @@
"exitFullscreenButton": "Vollbild verlassen",
"alwaysOnTopButton": "Immer im Vordergrund",
"rotationLockButton": "Dreh­sperre",
"lockScreen": "Bildschirm sperren",
"unlockScreen": "Bildschirm entsperren",
"screenLockButton": "Bildschirmsperre",
"longPressToUnlock": "Lange drücken zum Entsperren",
"timelineSlider": "Video-Zeitleiste",
"volumeSlider": "Lautstärkepegel",
"endsAt": "Endet um ${time}",
+6
View File
@@ -135,6 +135,8 @@
"subtitleStylingDescription": "Customize subtitle appearance",
"smallSkipDuration": "Small Skip Duration",
"largeSkipDuration": "Large Skip Duration",
"rewindOnResume": "Rewind on Resume",
"rewindOnResumeDescription": "Rewind by this amount when resuming playback",
"secondsUnit": "${seconds} seconds",
"defaultSleepTimer": "Default Sleep Timer",
"minutesUnit": "${minutes} minutes",
@@ -344,6 +346,10 @@
"exitFullscreenButton": "Exit fullscreen",
"alwaysOnTopButton": "Always on top",
"rotationLockButton": "Rotation lock",
"lockScreen": "Lock screen",
"unlockScreen": "Unlock screen",
"screenLockButton": "Screen lock",
"longPressToUnlock": "Long press to unlock",
"timelineSlider": "Video timeline",
"volumeSlider": "Volume level",
"endsAt": "Ends at ${time}",
+6
View File
@@ -135,6 +135,8 @@
"subtitleStylingDescription": "Personalizar la apariencia de los subtítulos",
"smallSkipDuration": "Salto pequeño",
"largeSkipDuration": "Salto grande",
"rewindOnResume": "Rebobinar al reanudar",
"rewindOnResumeDescription": "Rebobinar esta cantidad al reanudar la reproducción",
"secondsUnit": "${seconds} segundos",
"defaultSleepTimer": "Temporizador de apagado",
"minutesUnit": "${minutes} minutos",
@@ -344,6 +346,10 @@
"exitFullscreenButton": "Salir de pantalla completa",
"alwaysOnTopButton": "Siempre visible",
"rotationLockButton": "Bloqueo de rotación",
"lockScreen": "Bloquear pantalla",
"unlockScreen": "Desbloquear pantalla",
"screenLockButton": "Bloqueo de pantalla",
"longPressToUnlock": "Mantén pulsado para desbloquear",
"timelineSlider": "Línea de tiempo del video",
"volumeSlider": "Nivel de volumen",
"endsAt": "Termina a las ${time}",
+6
View File
@@ -135,6 +135,8 @@
"subtitleStylingDescription": "Personnaliser l'apparence des sous-titres",
"smallSkipDuration": "Durée du petit saut",
"largeSkipDuration": "Durée du grand saut",
"rewindOnResume": "Rembobiner à la reprise",
"rewindOnResumeDescription": "Rembobiner de cette durée lors de la reprise de la lecture",
"secondsUnit": "${seconds} secondes",
"defaultSleepTimer": "Minuterie de mise en veille par défaut",
"minutesUnit": "${minutes} minutes",
@@ -344,6 +346,10 @@
"exitFullscreenButton": "Quitter le mode plein écran",
"alwaysOnTopButton": "Toujours au premier plan",
"rotationLockButton": "Verrouillage de rotation",
"lockScreen": "Verrouiller l'écran",
"unlockScreen": "Déverrouiller l'écran",
"screenLockButton": "Verrouillage de l'écran",
"longPressToUnlock": "Appui long pour déverrouiller",
"timelineSlider": "Timeline vidéo",
"volumeSlider": "Niveau sonore",
"endsAt": "Fin à ${time}",
+6
View File
@@ -135,6 +135,8 @@
"subtitleStylingDescription": "Personalizza l'aspetto dei sottotitoli",
"smallSkipDuration": "Durata skip breve",
"largeSkipDuration": "Durata skip lungo",
"rewindOnResume": "Riavvolgi alla ripresa",
"rewindOnResumeDescription": "Riavvolgi di questa quantità alla ripresa della riproduzione",
"secondsUnit": "${seconds} secondi",
"defaultSleepTimer": "Timer spegnimento predefinito",
"minutesUnit": "${minutes} minuti",
@@ -344,6 +346,10 @@
"exitFullscreenButton": "Esci da schermo intero",
"alwaysOnTopButton": "Sempre in primo piano",
"rotationLockButton": "Blocco rotazione",
"lockScreen": "Blocca schermo",
"unlockScreen": "Sblocca schermo",
"screenLockButton": "Blocco schermo",
"longPressToUnlock": "Premi a lungo per sbloccare",
"timelineSlider": "Timeline video",
"volumeSlider": "Livello volume",
"endsAt": "Finisce alle ${time}",
+6
View File
@@ -135,6 +135,8 @@
"subtitleStylingDescription": "字幕の外観をカスタマイズ",
"smallSkipDuration": "短いスキップ時間",
"largeSkipDuration": "長いスキップ時間",
"rewindOnResume": "再開時に巻き戻し",
"rewindOnResumeDescription": "再生再開時にこの秒数分巻き戻す",
"secondsUnit": "${seconds}秒",
"defaultSleepTimer": "デフォルトスリープタイマー",
"minutesUnit": "${minutes}分",
@@ -344,6 +346,10 @@
"exitFullscreenButton": "フルスクリーンを終了",
"alwaysOnTopButton": "常に前面に表示",
"rotationLockButton": "回転ロック",
"lockScreen": "画面をロック",
"unlockScreen": "画面のロックを解除",
"screenLockButton": "画面ロック",
"longPressToUnlock": "長押しでロック解除",
"timelineSlider": "動画タイムライン",
"volumeSlider": "音量レベル",
"endsAt": "${time}に終了",
+6
View File
@@ -135,6 +135,8 @@
"subtitleStylingDescription": "자막의 외형을 사용자 설정",
"smallSkipDuration": "짧은 건너뛰기 시간",
"largeSkipDuration": "긴 건너뛰기 시간",
"rewindOnResume": "재개 시 되감기",
"rewindOnResumeDescription": "재생 재개 시 이 시간만큼 되감기",
"secondsUnit": "${seconds}초",
"defaultSleepTimer": "기본 취침 타이머",
"minutesUnit": "${minutes}분",
@@ -344,6 +346,10 @@
"exitFullscreenButton": "전체화면 종료",
"alwaysOnTopButton": "창 최상위 고정",
"rotationLockButton": "회전 잠금",
"lockScreen": "화면 잠금",
"unlockScreen": "화면 잠금 해제",
"screenLockButton": "화면 잠금",
"longPressToUnlock": "길게 눌러 잠금 해제",
"timelineSlider": "타임라인",
"volumeSlider": "볼륨 조절",
"endsAt": "${time}에 종료",
+6
View File
@@ -135,6 +135,8 @@
"subtitleStylingDescription": "Tilpass utseendet på undertekster",
"smallSkipDuration": "Kort hoppvarighet",
"largeSkipDuration": "Lang hoppvarighet",
"rewindOnResume": "Spol tilbake ved gjenopptakelse",
"rewindOnResumeDescription": "Spol tilbake med denne mengden ved gjenopptakelse av avspilling",
"secondsUnit": "${seconds} sekunder",
"defaultSleepTimer": "Standard søvntimer",
"minutesUnit": "${minutes} minutter",
@@ -344,6 +346,10 @@
"exitFullscreenButton": "Avslutt fullskjerm",
"alwaysOnTopButton": "Alltid øverst",
"rotationLockButton": "Rotasjonslås",
"lockScreen": "Lås skjerm",
"unlockScreen": "Lås opp skjerm",
"screenLockButton": "Skjermlås",
"longPressToUnlock": "Langt trykk for å låse opp",
"timelineSlider": "Videotidslinje",
"volumeSlider": "Volumnivå",
"endsAt": "Slutter kl. ${time}",
+6
View File
@@ -135,6 +135,8 @@
"subtitleStylingDescription": "Pas ondertitel uiterlijk aan",
"smallSkipDuration": "Korte skip duur",
"largeSkipDuration": "Lange skip duur",
"rewindOnResume": "Terugspoelen bij hervatten",
"rewindOnResumeDescription": "Spoel dit aantal seconden terug bij het hervatten van afspelen",
"secondsUnit": "${seconds} seconden",
"defaultSleepTimer": "Standaard slaap timer",
"minutesUnit": "bij ${minutes} minuten",
@@ -344,6 +346,10 @@
"exitFullscreenButton": "Volledig scherm verlaten",
"alwaysOnTopButton": "Altijd bovenop",
"rotationLockButton": "Rotatievergrendeling",
"lockScreen": "Vergrendel scherm",
"unlockScreen": "Ontgrendel scherm",
"screenLockButton": "Schermvergrendeling",
"longPressToUnlock": "Lang indrukken om te ontgrendelen",
"timelineSlider": "Videotijdlijn",
"volumeSlider": "Volumeniveau",
"endsAt": "Eindigt om ${time}",
+6
View File
@@ -135,6 +135,8 @@
"subtitleStylingDescription": "Dostosuj wygląd napisów",
"smallSkipDuration": "Krótki skok",
"largeSkipDuration": "Długi skok",
"rewindOnResume": "Przewiń przy wznowieniu",
"rewindOnResumeDescription": "Przewiń o tę wartość przy wznawianiu odtwarzania",
"secondsUnit": "${seconds} sekund",
"defaultSleepTimer": "Domyślny wyłącznik czasowy",
"minutesUnit": "${minutes} minut",
@@ -344,6 +346,10 @@
"exitFullscreenButton": "Wyjdź z pełnego ekranu",
"alwaysOnTopButton": "Zawsze na wierzchu",
"rotationLockButton": "Blokada obrotu",
"lockScreen": "Zablokuj ekran",
"unlockScreen": "Odblokuj ekran",
"screenLockButton": "Blokada ekranu",
"longPressToUnlock": "Przytrzymaj, aby odblokować",
"timelineSlider": "Oś czasu wideo",
"volumeSlider": "Poziom głośności",
"endsAt": "Kończy się o ${time}",
+6
View File
@@ -135,6 +135,8 @@
"subtitleStylingDescription": "Personalizar aparência das legendas",
"smallSkipDuration": "Duração do Avanço Curto",
"largeSkipDuration": "Duração do Avanço Longo",
"rewindOnResume": "Rebobinar ao retomar",
"rewindOnResumeDescription": "Rebobinar esta quantidade ao retomar a reprodução",
"secondsUnit": "${seconds} segundos",
"defaultSleepTimer": "Timer de Sono Padrão",
"minutesUnit": "${minutes} minutos",
@@ -344,6 +346,10 @@
"exitFullscreenButton": "Sair da tela cheia",
"alwaysOnTopButton": "Sempre no topo",
"rotationLockButton": "Travar rotação",
"lockScreen": "Travar tela",
"unlockScreen": "Destravar tela",
"screenLockButton": "Travar tela",
"longPressToUnlock": "Pressione e segure para destravar",
"timelineSlider": "Linha do tempo do vídeo",
"volumeSlider": "Nível de volume",
"endsAt": "Termina às ${time}",
+6
View File
@@ -135,6 +135,8 @@
"subtitleStylingDescription": "Настроить внешний вид субтитров",
"smallSkipDuration": "Малая перемотка",
"largeSkipDuration": "Большая перемотка",
"rewindOnResume": "Перемотка при возобновлении",
"rewindOnResumeDescription": "Перемотать на это количество секунд при возобновлении воспроизведения",
"secondsUnit": "${seconds} секунд",
"defaultSleepTimer": "Таймер сна по умолчанию",
"minutesUnit": "${minutes} минут",
@@ -344,6 +346,10 @@
"exitFullscreenButton": "Выйти из полноэкранного режима",
"alwaysOnTopButton": "Всегда поверх",
"rotationLockButton": "Блокировка поворота",
"lockScreen": "Заблокировать экран",
"unlockScreen": "Разблокировать экран",
"screenLockButton": "Блокировка экрана",
"longPressToUnlock": "Удерживайте для разблокировки",
"timelineSlider": "Временная шкала",
"volumeSlider": "Уровень громкости",
"endsAt": "Закончится в ${time}",
+2 -2
View File
@@ -4,9 +4,9 @@
/// To regenerate, run: `dart run slang`
///
/// Locales: 15
/// Strings: 11880 (792 per locale)
/// Strings: 11970 (798 per locale)
///
/// Built on 2026-03-15 at 06:54 UTC
/// Built on 2026-03-22 at 10:44 UTC
// coverage:ignore-file
// ignore_for_file: type=lint, unused_import
+14 -2
View File
@@ -253,6 +253,8 @@ class _TranslationsSettingsDa implements TranslationsSettingsEn {
@override String get subtitleStylingDescription => 'Tilpas underteksters udseende';
@override String get smallSkipDuration => 'Kort spring-varighed';
@override String get largeSkipDuration => 'Lang spring-varighed';
@override String get rewindOnResume => 'Spol tilbage ved genoptagelse';
@override String get rewindOnResumeDescription => 'Spol tilbage med denne mængde ved genoptagelse af afspilning';
@override String secondsUnit({required Object seconds}) => '${seconds} sekunder';
@override String get defaultSleepTimer => 'Standard sove-timer';
@override String minutesUnit({required Object minutes}) => '${minutes} minutter';
@@ -491,6 +493,10 @@ class _TranslationsVideoControlsDa implements TranslationsVideoControlsEn {
@override String get exitFullscreenButton => 'Forlad fuldskærm';
@override String get alwaysOnTopButton => 'Altid øverst';
@override String get rotationLockButton => 'Rotationslås';
@override String get lockScreen => 'Lås skærm';
@override String get unlockScreen => 'Lås skærm op';
@override String get screenLockButton => 'Skærmlås';
@override String get longPressToUnlock => 'Langt tryk for at låse op';
@override String get timelineSlider => 'Videotidslinje';
@override String get volumeSlider => 'Lydstyrkeniveau';
@override String endsAt({required Object time}) => 'Slutter kl. ${time}';
@@ -1404,6 +1410,8 @@ extension on TranslationsDa {
'settings.subtitleStylingDescription' => 'Tilpas underteksters udseende',
'settings.smallSkipDuration' => 'Kort spring-varighed',
'settings.largeSkipDuration' => 'Lang spring-varighed',
'settings.rewindOnResume' => 'Spol tilbage ved genoptagelse',
'settings.rewindOnResumeDescription' => 'Spol tilbage med denne mængde ved genoptagelse af afspilning',
'settings.secondsUnit' => ({required Object seconds}) => '${seconds} sekunder',
'settings.defaultSleepTimer' => 'Standard sove-timer',
'settings.minutesUnit' => ({required Object minutes}) => '${minutes} minutter',
@@ -1597,6 +1605,10 @@ extension on TranslationsDa {
'videoControls.exitFullscreenButton' => 'Forlad fuldskærm',
'videoControls.alwaysOnTopButton' => 'Altid øverst',
'videoControls.rotationLockButton' => 'Rotationslås',
'videoControls.lockScreen' => 'Lås skærm',
'videoControls.unlockScreen' => 'Lås skærm op',
'videoControls.screenLockButton' => 'Skærmlås',
'videoControls.longPressToUnlock' => 'Langt tryk for at låse op',
'videoControls.timelineSlider' => 'Videotidslinje',
'videoControls.volumeSlider' => 'Lydstyrkeniveau',
'videoControls.endsAt' => ({required Object time}) => 'Slutter kl. ${time}',
@@ -1785,14 +1797,14 @@ extension on TranslationsDa {
'liveTv.lateNight' => 'Sen aften',
'liveTv.whatsOn' => 'Hvad der kører',
'liveTv.watchChannel' => 'Se kanal',
_ => null,
} ?? switch (path) {
'liveTv.favorites' => 'Favoritter',
'collections.title' => 'Samlinger',
'collections.collection' => 'Samling',
'collections.empty' => 'Samlingen er tom',
'collections.unknownLibrarySection' => 'Kan ikke slette: Ukendt bibliotekssektion',
'collections.deleteCollection' => 'Slet samling',
_ => null,
} ?? switch (path) {
'collections.deleteConfirm' => ({required Object title}) => 'Er du sikker på, at du vil slette "${title}"? Denne handling kan ikke fortrydes.',
'collections.deleted' => 'Samling slettet',
'collections.deleteFailed' => 'Kunne ikke slette samling',
+14 -2
View File
@@ -253,6 +253,8 @@ class _TranslationsSettingsDe implements TranslationsSettingsEn {
@override String get subtitleStylingDescription => 'Aussehen von Untertiteln anpassen';
@override String get smallSkipDuration => 'Kleine Sprungdauer';
@override String get largeSkipDuration => 'Große Sprungdauer';
@override String get rewindOnResume => 'Zurückspulen bei Fortsetzung';
@override String get rewindOnResumeDescription => 'Um diesen Betrag zurückspulen, wenn die Wiedergabe fortgesetzt wird';
@override String secondsUnit({required Object seconds}) => '${seconds} Sekunden';
@override String get defaultSleepTimer => 'Standard-Sleep-Timer';
@override String minutesUnit({required Object minutes}) => '${minutes} Minuten';
@@ -491,6 +493,10 @@ class _TranslationsVideoControlsDe implements TranslationsVideoControlsEn {
@override String get exitFullscreenButton => 'Vollbild verlassen';
@override String get alwaysOnTopButton => 'Immer im Vordergrund';
@override String get rotationLockButton => 'Dreh­sperre';
@override String get lockScreen => 'Bildschirm sperren';
@override String get unlockScreen => 'Bildschirm entsperren';
@override String get screenLockButton => 'Bildschirmsperre';
@override String get longPressToUnlock => 'Lange drücken zum Entsperren';
@override String get timelineSlider => 'Video-Zeitleiste';
@override String get volumeSlider => 'Lautstärkepegel';
@override String endsAt({required Object time}) => 'Endet um ${time}';
@@ -1404,6 +1410,8 @@ extension on TranslationsDe {
'settings.subtitleStylingDescription' => 'Aussehen von Untertiteln anpassen',
'settings.smallSkipDuration' => 'Kleine Sprungdauer',
'settings.largeSkipDuration' => 'Große Sprungdauer',
'settings.rewindOnResume' => 'Zurückspulen bei Fortsetzung',
'settings.rewindOnResumeDescription' => 'Um diesen Betrag zurückspulen, wenn die Wiedergabe fortgesetzt wird',
'settings.secondsUnit' => ({required Object seconds}) => '${seconds} Sekunden',
'settings.defaultSleepTimer' => 'Standard-Sleep-Timer',
'settings.minutesUnit' => ({required Object minutes}) => '${minutes} Minuten',
@@ -1597,6 +1605,10 @@ extension on TranslationsDe {
'videoControls.exitFullscreenButton' => 'Vollbild verlassen',
'videoControls.alwaysOnTopButton' => 'Immer im Vordergrund',
'videoControls.rotationLockButton' => 'Dreh­sperre',
'videoControls.lockScreen' => 'Bildschirm sperren',
'videoControls.unlockScreen' => 'Bildschirm entsperren',
'videoControls.screenLockButton' => 'Bildschirmsperre',
'videoControls.longPressToUnlock' => 'Lange drücken zum Entsperren',
'videoControls.timelineSlider' => 'Video-Zeitleiste',
'videoControls.volumeSlider' => 'Lautstärkepegel',
'videoControls.endsAt' => ({required Object time}) => 'Endet um ${time}',
@@ -1785,14 +1797,14 @@ extension on TranslationsDe {
'liveTv.lateNight' => 'Spätnacht',
'liveTv.whatsOn' => 'Jetzt im TV',
'liveTv.watchChannel' => 'Kanal ansehen',
_ => null,
} ?? switch (path) {
'liveTv.favorites' => 'Favoriten',
'downloads.title' => 'Downloads',
'downloads.manage' => 'Verwalten',
'downloads.tvShows' => 'Serien',
'downloads.movies' => 'Filme',
'downloads.noDownloads' => 'Noch keine Downloads',
_ => null,
} ?? switch (path) {
'downloads.noDownloadsDescription' => 'Heruntergeladene Inhalte werden hier für die Offline-Wiedergabe angezeigt',
'downloads.downloadNow' => 'Herunterladen',
'downloads.deleteDownload' => 'Download löschen',
+26 -2
View File
@@ -507,6 +507,12 @@ class TranslationsSettingsEn {
/// en: 'Large Skip Duration'
String get largeSkipDuration => 'Large Skip Duration';
/// en: 'Rewind on Resume'
String get rewindOnResume => 'Rewind on Resume';
/// en: 'Rewind by this amount when resuming playback'
String get rewindOnResumeDescription => 'Rewind by this amount when resuming playback';
/// en: '${seconds} seconds'
String secondsUnit({required Object seconds}) => '${seconds} seconds';
@@ -1094,6 +1100,18 @@ class TranslationsVideoControlsEn {
/// en: 'Rotation lock'
String get rotationLockButton => 'Rotation lock';
/// en: 'Lock screen'
String get lockScreen => 'Lock screen';
/// en: 'Unlock screen'
String get unlockScreen => 'Unlock screen';
/// en: 'Screen lock'
String get screenLockButton => 'Screen lock';
/// en: 'Long press to unlock'
String get longPressToUnlock => 'Long press to unlock';
/// en: 'Video timeline'
String get timelineSlider => 'Video timeline';
@@ -2995,6 +3013,8 @@ extension on Translations {
'settings.subtitleStylingDescription' => 'Customize subtitle appearance',
'settings.smallSkipDuration' => 'Small Skip Duration',
'settings.largeSkipDuration' => 'Large Skip Duration',
'settings.rewindOnResume' => 'Rewind on Resume',
'settings.rewindOnResumeDescription' => 'Rewind by this amount when resuming playback',
'settings.secondsUnit' => ({required Object seconds}) => '${seconds} seconds',
'settings.defaultSleepTimer' => 'Default Sleep Timer',
'settings.minutesUnit' => ({required Object minutes}) => '${minutes} minutes',
@@ -3188,6 +3208,10 @@ extension on Translations {
'videoControls.exitFullscreenButton' => 'Exit fullscreen',
'videoControls.alwaysOnTopButton' => 'Always on top',
'videoControls.rotationLockButton' => 'Rotation lock',
'videoControls.lockScreen' => 'Lock screen',
'videoControls.unlockScreen' => 'Unlock screen',
'videoControls.screenLockButton' => 'Screen lock',
'videoControls.longPressToUnlock' => 'Long press to unlock',
'videoControls.timelineSlider' => 'Video timeline',
'videoControls.volumeSlider' => 'Volume level',
'videoControls.endsAt' => ({required Object time}) => 'Ends at ${time}',
@@ -3376,14 +3400,14 @@ extension on Translations {
'liveTv.lateNight' => 'Late Night',
'liveTv.whatsOn' => 'What\'s On',
'liveTv.watchChannel' => 'Watch Channel',
_ => null,
} ?? switch (path) {
'liveTv.favorites' => 'Favorites',
'collections.title' => 'Collections',
'collections.collection' => 'Collection',
'collections.empty' => 'Collection is empty',
'collections.unknownLibrarySection' => 'Cannot delete: Unknown library section',
'collections.deleteCollection' => 'Delete Collection',
_ => null,
} ?? switch (path) {
'collections.deleteConfirm' => ({required Object title}) => 'Are you sure you want to delete "${title}"? This action cannot be undone.',
'collections.deleted' => 'Collection deleted',
'collections.deleteFailed' => 'Failed to delete collection',
+14 -2
View File
@@ -253,6 +253,8 @@ class _TranslationsSettingsEs implements TranslationsSettingsEn {
@override String get subtitleStylingDescription => 'Personalizar la apariencia de los subtítulos';
@override String get smallSkipDuration => 'Salto pequeño';
@override String get largeSkipDuration => 'Salto grande';
@override String get rewindOnResume => 'Rebobinar al reanudar';
@override String get rewindOnResumeDescription => 'Rebobinar esta cantidad al reanudar la reproducción';
@override String secondsUnit({required Object seconds}) => '${seconds} segundos';
@override String get defaultSleepTimer => 'Temporizador de apagado';
@override String minutesUnit({required Object minutes}) => '${minutes} minutos';
@@ -491,6 +493,10 @@ class _TranslationsVideoControlsEs implements TranslationsVideoControlsEn {
@override String get exitFullscreenButton => 'Salir de pantalla completa';
@override String get alwaysOnTopButton => 'Siempre visible';
@override String get rotationLockButton => 'Bloqueo de rotación';
@override String get lockScreen => 'Bloquear pantalla';
@override String get unlockScreen => 'Desbloquear pantalla';
@override String get screenLockButton => 'Bloqueo de pantalla';
@override String get longPressToUnlock => 'Mantén pulsado para desbloquear';
@override String get timelineSlider => 'Línea de tiempo del video';
@override String get volumeSlider => 'Nivel de volumen';
@override String endsAt({required Object time}) => 'Termina a las ${time}';
@@ -1404,6 +1410,8 @@ extension on TranslationsEs {
'settings.subtitleStylingDescription' => 'Personalizar la apariencia de los subtítulos',
'settings.smallSkipDuration' => 'Salto pequeño',
'settings.largeSkipDuration' => 'Salto grande',
'settings.rewindOnResume' => 'Rebobinar al reanudar',
'settings.rewindOnResumeDescription' => 'Rebobinar esta cantidad al reanudar la reproducción',
'settings.secondsUnit' => ({required Object seconds}) => '${seconds} segundos',
'settings.defaultSleepTimer' => 'Temporizador de apagado',
'settings.minutesUnit' => ({required Object minutes}) => '${minutes} minutos',
@@ -1597,6 +1605,10 @@ extension on TranslationsEs {
'videoControls.exitFullscreenButton' => 'Salir de pantalla completa',
'videoControls.alwaysOnTopButton' => 'Siempre visible',
'videoControls.rotationLockButton' => 'Bloqueo de rotación',
'videoControls.lockScreen' => 'Bloquear pantalla',
'videoControls.unlockScreen' => 'Desbloquear pantalla',
'videoControls.screenLockButton' => 'Bloqueo de pantalla',
'videoControls.longPressToUnlock' => 'Mantén pulsado para desbloquear',
'videoControls.timelineSlider' => 'Línea de tiempo del video',
'videoControls.volumeSlider' => 'Nivel de volumen',
'videoControls.endsAt' => ({required Object time}) => 'Termina a las ${time}',
@@ -1785,14 +1797,14 @@ extension on TranslationsEs {
'liveTv.lateNight' => 'Trasnoche',
'liveTv.whatsOn' => 'En emisión',
'liveTv.watchChannel' => 'Ver canal',
_ => null,
} ?? switch (path) {
'liveTv.favorites' => 'Favoritos',
'collections.title' => 'Colecciones',
'collections.collection' => 'Colección',
'collections.empty' => 'La colección está vacía',
'collections.unknownLibrarySection' => 'No se puede eliminar: Sección de biblioteca desconocida',
'collections.deleteCollection' => 'Eliminar Colección',
_ => null,
} ?? switch (path) {
'collections.deleteConfirm' => ({required Object title}) => '¿Estás seguro de que quieres eliminar "${title}"? Esta acción no se puede deshacer.',
'collections.deleted' => 'Colección eliminada',
'collections.deleteFailed' => 'Error al eliminar la colección',
+14 -2
View File
@@ -253,6 +253,8 @@ class _TranslationsSettingsFr implements TranslationsSettingsEn {
@override String get subtitleStylingDescription => 'Personnaliser l\'apparence des sous-titres';
@override String get smallSkipDuration => 'Durée du petit saut';
@override String get largeSkipDuration => 'Durée du grand saut';
@override String get rewindOnResume => 'Rembobiner à la reprise';
@override String get rewindOnResumeDescription => 'Rembobiner de cette durée lors de la reprise de la lecture';
@override String secondsUnit({required Object seconds}) => '${seconds} secondes';
@override String get defaultSleepTimer => 'Minuterie de mise en veille par défaut';
@override String minutesUnit({required Object minutes}) => '${minutes} minutes';
@@ -491,6 +493,10 @@ class _TranslationsVideoControlsFr implements TranslationsVideoControlsEn {
@override String get exitFullscreenButton => 'Quitter le mode plein écran';
@override String get alwaysOnTopButton => 'Toujours au premier plan';
@override String get rotationLockButton => 'Verrouillage de rotation';
@override String get lockScreen => 'Verrouiller l\'écran';
@override String get unlockScreen => 'Déverrouiller l\'écran';
@override String get screenLockButton => 'Verrouillage de l\'écran';
@override String get longPressToUnlock => 'Appui long pour déverrouiller';
@override String get timelineSlider => 'Timeline vidéo';
@override String get volumeSlider => 'Niveau sonore';
@override String endsAt({required Object time}) => 'Fin à ${time}';
@@ -1404,6 +1410,8 @@ extension on TranslationsFr {
'settings.subtitleStylingDescription' => 'Personnaliser l\'apparence des sous-titres',
'settings.smallSkipDuration' => 'Durée du petit saut',
'settings.largeSkipDuration' => 'Durée du grand saut',
'settings.rewindOnResume' => 'Rembobiner à la reprise',
'settings.rewindOnResumeDescription' => 'Rembobiner de cette durée lors de la reprise de la lecture',
'settings.secondsUnit' => ({required Object seconds}) => '${seconds} secondes',
'settings.defaultSleepTimer' => 'Minuterie de mise en veille par défaut',
'settings.minutesUnit' => ({required Object minutes}) => '${minutes} minutes',
@@ -1597,6 +1605,10 @@ extension on TranslationsFr {
'videoControls.exitFullscreenButton' => 'Quitter le mode plein écran',
'videoControls.alwaysOnTopButton' => 'Toujours au premier plan',
'videoControls.rotationLockButton' => 'Verrouillage de rotation',
'videoControls.lockScreen' => 'Verrouiller l\'écran',
'videoControls.unlockScreen' => 'Déverrouiller l\'écran',
'videoControls.screenLockButton' => 'Verrouillage de l\'écran',
'videoControls.longPressToUnlock' => 'Appui long pour déverrouiller',
'videoControls.timelineSlider' => 'Timeline vidéo',
'videoControls.volumeSlider' => 'Niveau sonore',
'videoControls.endsAt' => ({required Object time}) => 'Fin à ${time}',
@@ -1785,14 +1797,14 @@ extension on TranslationsFr {
'liveTv.lateNight' => 'Nuit tardive',
'liveTv.whatsOn' => 'En ce moment',
'liveTv.watchChannel' => 'Regarder la chaîne',
_ => null,
} ?? switch (path) {
'liveTv.favorites' => 'Favoris',
'collections.title' => 'Collections',
'collections.collection' => 'Collection',
'collections.empty' => 'La collection est vide',
'collections.unknownLibrarySection' => 'Impossible de supprimer : section de bibliothèque inconnue',
'collections.deleteCollection' => 'Supprimer la collection',
_ => null,
} ?? switch (path) {
'collections.deleteConfirm' => ({required Object title}) => 'Êtes-vous sûr de vouloir supprimer "${title}" ? Cette action ne peut pas être annulée.',
'collections.deleted' => 'Collection supprimée',
'collections.deleteFailed' => 'Échec de la suppression de la collection',
+14 -2
View File
@@ -253,6 +253,8 @@ class _TranslationsSettingsIt implements TranslationsSettingsEn {
@override String get subtitleStylingDescription => 'Personalizza l\'aspetto dei sottotitoli';
@override String get smallSkipDuration => 'Durata skip breve';
@override String get largeSkipDuration => 'Durata skip lungo';
@override String get rewindOnResume => 'Riavvolgi alla ripresa';
@override String get rewindOnResumeDescription => 'Riavvolgi di questa quantità alla ripresa della riproduzione';
@override String secondsUnit({required Object seconds}) => '${seconds} secondi';
@override String get defaultSleepTimer => 'Timer spegnimento predefinito';
@override String minutesUnit({required Object minutes}) => '${minutes} minuti';
@@ -491,6 +493,10 @@ class _TranslationsVideoControlsIt implements TranslationsVideoControlsEn {
@override String get exitFullscreenButton => 'Esci da schermo intero';
@override String get alwaysOnTopButton => 'Sempre in primo piano';
@override String get rotationLockButton => 'Blocco rotazione';
@override String get lockScreen => 'Blocca schermo';
@override String get unlockScreen => 'Sblocca schermo';
@override String get screenLockButton => 'Blocco schermo';
@override String get longPressToUnlock => 'Premi a lungo per sbloccare';
@override String get timelineSlider => 'Timeline video';
@override String get volumeSlider => 'Livello volume';
@override String endsAt({required Object time}) => 'Finisce alle ${time}';
@@ -1404,6 +1410,8 @@ extension on TranslationsIt {
'settings.subtitleStylingDescription' => 'Personalizza l\'aspetto dei sottotitoli',
'settings.smallSkipDuration' => 'Durata skip breve',
'settings.largeSkipDuration' => 'Durata skip lungo',
'settings.rewindOnResume' => 'Riavvolgi alla ripresa',
'settings.rewindOnResumeDescription' => 'Riavvolgi di questa quantità alla ripresa della riproduzione',
'settings.secondsUnit' => ({required Object seconds}) => '${seconds} secondi',
'settings.defaultSleepTimer' => 'Timer spegnimento predefinito',
'settings.minutesUnit' => ({required Object minutes}) => '${minutes} minuti',
@@ -1597,6 +1605,10 @@ extension on TranslationsIt {
'videoControls.exitFullscreenButton' => 'Esci da schermo intero',
'videoControls.alwaysOnTopButton' => 'Sempre in primo piano',
'videoControls.rotationLockButton' => 'Blocco rotazione',
'videoControls.lockScreen' => 'Blocca schermo',
'videoControls.unlockScreen' => 'Sblocca schermo',
'videoControls.screenLockButton' => 'Blocco schermo',
'videoControls.longPressToUnlock' => 'Premi a lungo per sbloccare',
'videoControls.timelineSlider' => 'Timeline video',
'videoControls.volumeSlider' => 'Livello volume',
'videoControls.endsAt' => ({required Object time}) => 'Finisce alle ${time}',
@@ -1785,14 +1797,14 @@ extension on TranslationsIt {
'liveTv.lateNight' => 'Notte tarda',
'liveTv.whatsOn' => 'In onda ora',
'liveTv.watchChannel' => 'Guarda canale',
_ => null,
} ?? switch (path) {
'liveTv.favorites' => 'Preferiti',
'downloads.title' => 'Download',
'downloads.manage' => 'Gestisci',
'downloads.tvShows' => 'Serie TV',
'downloads.movies' => 'Film',
'downloads.noDownloads' => 'Nessun download',
_ => null,
} ?? switch (path) {
'downloads.noDownloadsDescription' => 'I contenuti scaricati appariranno qui per la visualizzazione offline',
'downloads.downloadNow' => 'Scarica',
'downloads.deleteDownload' => 'Elimina download',
+14 -2
View File
@@ -253,6 +253,8 @@ class _TranslationsSettingsJa implements TranslationsSettingsEn {
@override String get subtitleStylingDescription => '字幕の外観をカスタマイズ';
@override String get smallSkipDuration => '短いスキップ時間';
@override String get largeSkipDuration => '長いスキップ時間';
@override String get rewindOnResume => '再開時に巻き戻し';
@override String get rewindOnResumeDescription => '再生再開時にこの秒数分巻き戻す';
@override String secondsUnit({required Object seconds}) => '${seconds}秒';
@override String get defaultSleepTimer => 'デフォルトスリープタイマー';
@override String minutesUnit({required Object minutes}) => '${minutes}分';
@@ -491,6 +493,10 @@ class _TranslationsVideoControlsJa implements TranslationsVideoControlsEn {
@override String get exitFullscreenButton => 'フルスクリーンを終了';
@override String get alwaysOnTopButton => '常に前面に表示';
@override String get rotationLockButton => '回転ロック';
@override String get lockScreen => '画面をロック';
@override String get unlockScreen => '画面のロックを解除';
@override String get screenLockButton => '画面ロック';
@override String get longPressToUnlock => '長押しでロック解除';
@override String get timelineSlider => '動画タイムライン';
@override String get volumeSlider => '音量レベル';
@override String endsAt({required Object time}) => '${time}に終了';
@@ -1404,6 +1410,8 @@ extension on TranslationsJa {
'settings.subtitleStylingDescription' => '字幕の外観をカスタマイズ',
'settings.smallSkipDuration' => '短いスキップ時間',
'settings.largeSkipDuration' => '長いスキップ時間',
'settings.rewindOnResume' => '再開時に巻き戻し',
'settings.rewindOnResumeDescription' => '再生再開時にこの秒数分巻き戻す',
'settings.secondsUnit' => ({required Object seconds}) => '${seconds}秒',
'settings.defaultSleepTimer' => 'デフォルトスリープタイマー',
'settings.minutesUnit' => ({required Object minutes}) => '${minutes}分',
@@ -1597,6 +1605,10 @@ extension on TranslationsJa {
'videoControls.exitFullscreenButton' => 'フルスクリーンを終了',
'videoControls.alwaysOnTopButton' => '常に前面に表示',
'videoControls.rotationLockButton' => '回転ロック',
'videoControls.lockScreen' => '画面をロック',
'videoControls.unlockScreen' => '画面のロックを解除',
'videoControls.screenLockButton' => '画面ロック',
'videoControls.longPressToUnlock' => '長押しでロック解除',
'videoControls.timelineSlider' => '動画タイムライン',
'videoControls.volumeSlider' => '音量レベル',
'videoControls.endsAt' => ({required Object time}) => '${time}に終了',
@@ -1785,14 +1797,14 @@ extension on TranslationsJa {
'liveTv.lateNight' => '深夜',
'liveTv.whatsOn' => '放送中',
'liveTv.watchChannel' => 'チャンネルを視聴',
_ => null,
} ?? switch (path) {
'liveTv.favorites' => 'お気に入り',
'collections.title' => 'コレクション',
'collections.collection' => 'コレクション',
'collections.empty' => 'コレクションは空です',
'collections.unknownLibrarySection' => '削除できません:不明なライブラリセクション',
'collections.deleteCollection' => 'コレクションを削除',
_ => null,
} ?? switch (path) {
'collections.deleteConfirm' => ({required Object title}) => '"${title}"を削除してもよろしいですか?この操作は元に戻せません。',
'collections.deleted' => 'コレクションを削除しました',
'collections.deleteFailed' => 'コレクションの削除に失敗しました',
+14 -2
View File
@@ -253,6 +253,8 @@ class _TranslationsSettingsKo implements TranslationsSettingsEn {
@override String get subtitleStylingDescription => '자막의 외형을 사용자 설정';
@override String get smallSkipDuration => '짧은 건너뛰기 시간';
@override String get largeSkipDuration => '긴 건너뛰기 시간';
@override String get rewindOnResume => '재개 시 되감기';
@override String get rewindOnResumeDescription => '재생 재개 시 이 시간만큼 되감기';
@override String secondsUnit({required Object seconds}) => '${seconds}초';
@override String get defaultSleepTimer => '기본 취침 타이머';
@override String minutesUnit({required Object minutes}) => '${minutes}분';
@@ -491,6 +493,10 @@ class _TranslationsVideoControlsKo implements TranslationsVideoControlsEn {
@override String get exitFullscreenButton => '전체화면 종료';
@override String get alwaysOnTopButton => '창 최상위 고정';
@override String get rotationLockButton => '회전 잠금';
@override String get lockScreen => '화면 잠금';
@override String get unlockScreen => '화면 잠금 해제';
@override String get screenLockButton => '화면 잠금';
@override String get longPressToUnlock => '길게 눌러 잠금 해제';
@override String get timelineSlider => '타임라인';
@override String get volumeSlider => '볼륨 조절';
@override String endsAt({required Object time}) => '${time}에 종료';
@@ -1404,6 +1410,8 @@ extension on TranslationsKo {
'settings.subtitleStylingDescription' => '자막의 외형을 사용자 설정',
'settings.smallSkipDuration' => '짧은 건너뛰기 시간',
'settings.largeSkipDuration' => '긴 건너뛰기 시간',
'settings.rewindOnResume' => '재개 시 되감기',
'settings.rewindOnResumeDescription' => '재생 재개 시 이 시간만큼 되감기',
'settings.secondsUnit' => ({required Object seconds}) => '${seconds}초',
'settings.defaultSleepTimer' => '기본 취침 타이머',
'settings.minutesUnit' => ({required Object minutes}) => '${minutes}분',
@@ -1597,6 +1605,10 @@ extension on TranslationsKo {
'videoControls.exitFullscreenButton' => '전체화면 종료',
'videoControls.alwaysOnTopButton' => '창 최상위 고정',
'videoControls.rotationLockButton' => '회전 잠금',
'videoControls.lockScreen' => '화면 잠금',
'videoControls.unlockScreen' => '화면 잠금 해제',
'videoControls.screenLockButton' => '화면 잠금',
'videoControls.longPressToUnlock' => '길게 눌러 잠금 해제',
'videoControls.timelineSlider' => '타임라인',
'videoControls.volumeSlider' => '볼륨 조절',
'videoControls.endsAt' => ({required Object time}) => '${time}에 종료',
@@ -1785,14 +1797,14 @@ extension on TranslationsKo {
'liveTv.lateNight' => '심야 방송',
'liveTv.whatsOn' => '지금 방송 중',
'liveTv.watchChannel' => '채널 시청',
_ => null,
} ?? switch (path) {
'liveTv.favorites' => '즐겨찾기',
'collections.title' => '컬렉션',
'collections.collection' => '컬렉션',
'collections.empty' => '컬렉션이 비어 있습니다',
'collections.unknownLibrarySection' => '삭제할 수 없습니다: 알 수 없는 미디어 라이브러리 섹션입니다',
'collections.deleteCollection' => '컬렉션 삭제',
_ => null,
} ?? switch (path) {
'collections.deleteConfirm' => ({required Object title}) => '"${title}"을(를) 삭제 하시겠습니까? 이 작업은 되돌릴 수 없습니다.',
'collections.deleted' => '컬렉션 삭제됨',
'collections.deleteFailed' => '컬렉션 삭제 실패',
+14 -2
View File
@@ -253,6 +253,8 @@ class _TranslationsSettingsNb implements TranslationsSettingsEn {
@override String get subtitleStylingDescription => 'Tilpass utseendet på undertekster';
@override String get smallSkipDuration => 'Kort hoppvarighet';
@override String get largeSkipDuration => 'Lang hoppvarighet';
@override String get rewindOnResume => 'Spol tilbake ved gjenopptakelse';
@override String get rewindOnResumeDescription => 'Spol tilbake med denne mengden ved gjenopptakelse av avspilling';
@override String secondsUnit({required Object seconds}) => '${seconds} sekunder';
@override String get defaultSleepTimer => 'Standard søvntimer';
@override String minutesUnit({required Object minutes}) => '${minutes} minutter';
@@ -491,6 +493,10 @@ class _TranslationsVideoControlsNb implements TranslationsVideoControlsEn {
@override String get exitFullscreenButton => 'Avslutt fullskjerm';
@override String get alwaysOnTopButton => 'Alltid øverst';
@override String get rotationLockButton => 'Rotasjonslås';
@override String get lockScreen => 'Lås skjerm';
@override String get unlockScreen => 'Lås opp skjerm';
@override String get screenLockButton => 'Skjermlås';
@override String get longPressToUnlock => 'Langt trykk for å låse opp';
@override String get timelineSlider => 'Videotidslinje';
@override String get volumeSlider => 'Volumnivå';
@override String endsAt({required Object time}) => 'Slutter kl. ${time}';
@@ -1404,6 +1410,8 @@ extension on TranslationsNb {
'settings.subtitleStylingDescription' => 'Tilpass utseendet på undertekster',
'settings.smallSkipDuration' => 'Kort hoppvarighet',
'settings.largeSkipDuration' => 'Lang hoppvarighet',
'settings.rewindOnResume' => 'Spol tilbake ved gjenopptakelse',
'settings.rewindOnResumeDescription' => 'Spol tilbake med denne mengden ved gjenopptakelse av avspilling',
'settings.secondsUnit' => ({required Object seconds}) => '${seconds} sekunder',
'settings.defaultSleepTimer' => 'Standard søvntimer',
'settings.minutesUnit' => ({required Object minutes}) => '${minutes} minutter',
@@ -1597,6 +1605,10 @@ extension on TranslationsNb {
'videoControls.exitFullscreenButton' => 'Avslutt fullskjerm',
'videoControls.alwaysOnTopButton' => 'Alltid øverst',
'videoControls.rotationLockButton' => 'Rotasjonslås',
'videoControls.lockScreen' => 'Lås skjerm',
'videoControls.unlockScreen' => 'Lås opp skjerm',
'videoControls.screenLockButton' => 'Skjermlås',
'videoControls.longPressToUnlock' => 'Langt trykk for å låse opp',
'videoControls.timelineSlider' => 'Videotidslinje',
'videoControls.volumeSlider' => 'Volumnivå',
'videoControls.endsAt' => ({required Object time}) => 'Slutter kl. ${time}',
@@ -1785,14 +1797,14 @@ extension on TranslationsNb {
'liveTv.lateNight' => 'Sen kveld',
'liveTv.whatsOn' => 'Hva går nå',
'liveTv.watchChannel' => 'Se kanal',
_ => null,
} ?? switch (path) {
'liveTv.favorites' => 'Favoritter',
'collections.title' => 'Samlinger',
'collections.collection' => 'Samling',
'collections.empty' => 'Samlingen er tom',
'collections.unknownLibrarySection' => 'Kan ikke slette: Ukjent bibliotekseksjon',
'collections.deleteCollection' => 'Slett samling',
_ => null,
} ?? switch (path) {
'collections.deleteConfirm' => ({required Object title}) => 'Er du sikker på at du vil slette "${title}"? Denne handlingen kan ikke angres.',
'collections.deleted' => 'Samling slettet',
'collections.deleteFailed' => 'Kunne ikke slette samling',
+14 -2
View File
@@ -253,6 +253,8 @@ class _TranslationsSettingsNl implements TranslationsSettingsEn {
@override String get subtitleStylingDescription => 'Pas ondertitel uiterlijk aan';
@override String get smallSkipDuration => 'Korte skip duur';
@override String get largeSkipDuration => 'Lange skip duur';
@override String get rewindOnResume => 'Terugspoelen bij hervatten';
@override String get rewindOnResumeDescription => 'Spoel dit aantal seconden terug bij het hervatten van afspelen';
@override String secondsUnit({required Object seconds}) => '${seconds} seconden';
@override String get defaultSleepTimer => 'Standaard slaap timer';
@override String minutesUnit({required Object minutes}) => 'bij ${minutes} minuten';
@@ -491,6 +493,10 @@ class _TranslationsVideoControlsNl implements TranslationsVideoControlsEn {
@override String get exitFullscreenButton => 'Volledig scherm verlaten';
@override String get alwaysOnTopButton => 'Altijd bovenop';
@override String get rotationLockButton => 'Rotatievergrendeling';
@override String get lockScreen => 'Vergrendel scherm';
@override String get unlockScreen => 'Ontgrendel scherm';
@override String get screenLockButton => 'Schermvergrendeling';
@override String get longPressToUnlock => 'Lang indrukken om te ontgrendelen';
@override String get timelineSlider => 'Videotijdlijn';
@override String get volumeSlider => 'Volumeniveau';
@override String endsAt({required Object time}) => 'Eindigt om ${time}';
@@ -1404,6 +1410,8 @@ extension on TranslationsNl {
'settings.subtitleStylingDescription' => 'Pas ondertitel uiterlijk aan',
'settings.smallSkipDuration' => 'Korte skip duur',
'settings.largeSkipDuration' => 'Lange skip duur',
'settings.rewindOnResume' => 'Terugspoelen bij hervatten',
'settings.rewindOnResumeDescription' => 'Spoel dit aantal seconden terug bij het hervatten van afspelen',
'settings.secondsUnit' => ({required Object seconds}) => '${seconds} seconden',
'settings.defaultSleepTimer' => 'Standaard slaap timer',
'settings.minutesUnit' => ({required Object minutes}) => 'bij ${minutes} minuten',
@@ -1597,6 +1605,10 @@ extension on TranslationsNl {
'videoControls.exitFullscreenButton' => 'Volledig scherm verlaten',
'videoControls.alwaysOnTopButton' => 'Altijd bovenop',
'videoControls.rotationLockButton' => 'Rotatievergrendeling',
'videoControls.lockScreen' => 'Vergrendel scherm',
'videoControls.unlockScreen' => 'Ontgrendel scherm',
'videoControls.screenLockButton' => 'Schermvergrendeling',
'videoControls.longPressToUnlock' => 'Lang indrukken om te ontgrendelen',
'videoControls.timelineSlider' => 'Videotijdlijn',
'videoControls.volumeSlider' => 'Volumeniveau',
'videoControls.endsAt' => ({required Object time}) => 'Eindigt om ${time}',
@@ -1785,14 +1797,14 @@ extension on TranslationsNl {
'liveTv.lateNight' => 'Late avond',
'liveTv.whatsOn' => 'Nu op TV',
'liveTv.watchChannel' => 'Kanaal bekijken',
_ => null,
} ?? switch (path) {
'liveTv.favorites' => 'Favorieten',
'downloads.title' => 'Downloads',
'downloads.manage' => 'Beheren',
'downloads.tvShows' => 'Series',
'downloads.movies' => 'Films',
'downloads.noDownloads' => 'Nog geen downloads',
_ => null,
} ?? switch (path) {
'downloads.noDownloadsDescription' => 'Gedownloade content verschijnt hier voor offline weergave',
'downloads.downloadNow' => 'Download',
'downloads.deleteDownload' => 'Download verwijderen',
+14 -2
View File
@@ -253,6 +253,8 @@ class _TranslationsSettingsPl implements TranslationsSettingsEn {
@override String get subtitleStylingDescription => 'Dostosuj wygląd napisów';
@override String get smallSkipDuration => 'Krótki skok';
@override String get largeSkipDuration => 'Długi skok';
@override String get rewindOnResume => 'Przewiń przy wznowieniu';
@override String get rewindOnResumeDescription => 'Przewiń o tę wartość przy wznawianiu odtwarzania';
@override String secondsUnit({required Object seconds}) => '${seconds} sekund';
@override String get defaultSleepTimer => 'Domyślny wyłącznik czasowy';
@override String minutesUnit({required Object minutes}) => '${minutes} minut';
@@ -491,6 +493,10 @@ class _TranslationsVideoControlsPl implements TranslationsVideoControlsEn {
@override String get exitFullscreenButton => 'Wyjdź z pełnego ekranu';
@override String get alwaysOnTopButton => 'Zawsze na wierzchu';
@override String get rotationLockButton => 'Blokada obrotu';
@override String get lockScreen => 'Zablokuj ekran';
@override String get unlockScreen => 'Odblokuj ekran';
@override String get screenLockButton => 'Blokada ekranu';
@override String get longPressToUnlock => 'Przytrzymaj, aby odblokować';
@override String get timelineSlider => 'Oś czasu wideo';
@override String get volumeSlider => 'Poziom głośności';
@override String endsAt({required Object time}) => 'Kończy się o ${time}';
@@ -1404,6 +1410,8 @@ extension on TranslationsPl {
'settings.subtitleStylingDescription' => 'Dostosuj wygląd napisów',
'settings.smallSkipDuration' => 'Krótki skok',
'settings.largeSkipDuration' => 'Długi skok',
'settings.rewindOnResume' => 'Przewiń przy wznowieniu',
'settings.rewindOnResumeDescription' => 'Przewiń o tę wartość przy wznawianiu odtwarzania',
'settings.secondsUnit' => ({required Object seconds}) => '${seconds} sekund',
'settings.defaultSleepTimer' => 'Domyślny wyłącznik czasowy',
'settings.minutesUnit' => ({required Object minutes}) => '${minutes} minut',
@@ -1597,6 +1605,10 @@ extension on TranslationsPl {
'videoControls.exitFullscreenButton' => 'Wyjdź z pełnego ekranu',
'videoControls.alwaysOnTopButton' => 'Zawsze na wierzchu',
'videoControls.rotationLockButton' => 'Blokada obrotu',
'videoControls.lockScreen' => 'Zablokuj ekran',
'videoControls.unlockScreen' => 'Odblokuj ekran',
'videoControls.screenLockButton' => 'Blokada ekranu',
'videoControls.longPressToUnlock' => 'Przytrzymaj, aby odblokować',
'videoControls.timelineSlider' => 'Oś czasu wideo',
'videoControls.volumeSlider' => 'Poziom głośności',
'videoControls.endsAt' => ({required Object time}) => 'Kończy się o ${time}',
@@ -1785,14 +1797,14 @@ extension on TranslationsPl {
'liveTv.lateNight' => 'Późna noc',
'liveTv.whatsOn' => 'Co leci',
'liveTv.watchChannel' => 'Oglądaj kanał',
_ => null,
} ?? switch (path) {
'liveTv.favorites' => 'Ulubione',
'collections.title' => 'Kolekcje',
'collections.collection' => 'Kolekcja',
'collections.empty' => 'Kolekcja jest pusta',
'collections.unknownLibrarySection' => 'Nie można usunąć: Nieznana sekcja biblioteki',
'collections.deleteCollection' => 'Usuń kolekcję',
_ => null,
} ?? switch (path) {
'collections.deleteConfirm' => ({required Object title}) => 'Czy na pewno chcesz usunąć "${title}"? Tej operacji nie można cofnąć.',
'collections.deleted' => 'Kolekcja usunięta',
'collections.deleteFailed' => 'Nie udało się usunąć kolekcji',
+14 -2
View File
@@ -253,6 +253,8 @@ class _TranslationsSettingsPt implements TranslationsSettingsEn {
@override String get subtitleStylingDescription => 'Personalizar aparência das legendas';
@override String get smallSkipDuration => 'Duração do Avanço Curto';
@override String get largeSkipDuration => 'Duração do Avanço Longo';
@override String get rewindOnResume => 'Rebobinar ao retomar';
@override String get rewindOnResumeDescription => 'Rebobinar esta quantidade ao retomar a reprodução';
@override String secondsUnit({required Object seconds}) => '${seconds} segundos';
@override String get defaultSleepTimer => 'Timer de Sono Padrão';
@override String minutesUnit({required Object minutes}) => '${minutes} minutos';
@@ -491,6 +493,10 @@ class _TranslationsVideoControlsPt implements TranslationsVideoControlsEn {
@override String get exitFullscreenButton => 'Sair da tela cheia';
@override String get alwaysOnTopButton => 'Sempre no topo';
@override String get rotationLockButton => 'Travar rotação';
@override String get lockScreen => 'Travar tela';
@override String get unlockScreen => 'Destravar tela';
@override String get screenLockButton => 'Travar tela';
@override String get longPressToUnlock => 'Pressione e segure para destravar';
@override String get timelineSlider => 'Linha do tempo do vídeo';
@override String get volumeSlider => 'Nível de volume';
@override String endsAt({required Object time}) => 'Termina às ${time}';
@@ -1404,6 +1410,8 @@ extension on TranslationsPt {
'settings.subtitleStylingDescription' => 'Personalizar aparência das legendas',
'settings.smallSkipDuration' => 'Duração do Avanço Curto',
'settings.largeSkipDuration' => 'Duração do Avanço Longo',
'settings.rewindOnResume' => 'Rebobinar ao retomar',
'settings.rewindOnResumeDescription' => 'Rebobinar esta quantidade ao retomar a reprodução',
'settings.secondsUnit' => ({required Object seconds}) => '${seconds} segundos',
'settings.defaultSleepTimer' => 'Timer de Sono Padrão',
'settings.minutesUnit' => ({required Object minutes}) => '${minutes} minutos',
@@ -1597,6 +1605,10 @@ extension on TranslationsPt {
'videoControls.exitFullscreenButton' => 'Sair da tela cheia',
'videoControls.alwaysOnTopButton' => 'Sempre no topo',
'videoControls.rotationLockButton' => 'Travar rotação',
'videoControls.lockScreen' => 'Travar tela',
'videoControls.unlockScreen' => 'Destravar tela',
'videoControls.screenLockButton' => 'Travar tela',
'videoControls.longPressToUnlock' => 'Pressione e segure para destravar',
'videoControls.timelineSlider' => 'Linha do tempo do vídeo',
'videoControls.volumeSlider' => 'Nível de volume',
'videoControls.endsAt' => ({required Object time}) => 'Termina às ${time}',
@@ -1785,14 +1797,14 @@ extension on TranslationsPt {
'liveTv.lateNight' => 'Madrugada',
'liveTv.whatsOn' => 'O que Está Passando',
'liveTv.watchChannel' => 'Assistir Canal',
_ => null,
} ?? switch (path) {
'liveTv.favorites' => 'Favoritos',
'collections.title' => 'Coleções',
'collections.collection' => 'Coleção',
'collections.empty' => 'A coleção está vazia',
'collections.unknownLibrarySection' => 'Não é possível excluir: Seção de biblioteca desconhecida',
'collections.deleteCollection' => 'Excluir Coleção',
_ => null,
} ?? switch (path) {
'collections.deleteConfirm' => ({required Object title}) => 'Tem certeza que deseja excluir "${title}"? Esta ação não pode ser desfeita.',
'collections.deleted' => 'Coleção excluída',
'collections.deleteFailed' => 'Falha ao excluir coleção',
+14 -2
View File
@@ -253,6 +253,8 @@ class _TranslationsSettingsRu implements TranslationsSettingsEn {
@override String get subtitleStylingDescription => 'Настроить внешний вид субтитров';
@override String get smallSkipDuration => 'Малая перемотка';
@override String get largeSkipDuration => 'Большая перемотка';
@override String get rewindOnResume => 'Перемотка при возобновлении';
@override String get rewindOnResumeDescription => 'Перемотать на это количество секунд при возобновлении воспроизведения';
@override String secondsUnit({required Object seconds}) => '${seconds} секунд';
@override String get defaultSleepTimer => 'Таймер сна по умолчанию';
@override String minutesUnit({required Object minutes}) => '${minutes} минут';
@@ -491,6 +493,10 @@ class _TranslationsVideoControlsRu implements TranslationsVideoControlsEn {
@override String get exitFullscreenButton => 'Выйти из полноэкранного режима';
@override String get alwaysOnTopButton => 'Всегда поверх';
@override String get rotationLockButton => 'Блокировка поворота';
@override String get lockScreen => 'Заблокировать экран';
@override String get unlockScreen => 'Разблокировать экран';
@override String get screenLockButton => 'Блокировка экрана';
@override String get longPressToUnlock => 'Удерживайте для разблокировки';
@override String get timelineSlider => 'Временная шкала';
@override String get volumeSlider => 'Уровень громкости';
@override String endsAt({required Object time}) => 'Закончится в ${time}';
@@ -1404,6 +1410,8 @@ extension on TranslationsRu {
'settings.subtitleStylingDescription' => 'Настроить внешний вид субтитров',
'settings.smallSkipDuration' => 'Малая перемотка',
'settings.largeSkipDuration' => 'Большая перемотка',
'settings.rewindOnResume' => 'Перемотка при возобновлении',
'settings.rewindOnResumeDescription' => 'Перемотать на это количество секунд при возобновлении воспроизведения',
'settings.secondsUnit' => ({required Object seconds}) => '${seconds} секунд',
'settings.defaultSleepTimer' => 'Таймер сна по умолчанию',
'settings.minutesUnit' => ({required Object minutes}) => '${minutes} минут',
@@ -1597,6 +1605,10 @@ extension on TranslationsRu {
'videoControls.exitFullscreenButton' => 'Выйти из полноэкранного режима',
'videoControls.alwaysOnTopButton' => 'Всегда поверх',
'videoControls.rotationLockButton' => 'Блокировка поворота',
'videoControls.lockScreen' => 'Заблокировать экран',
'videoControls.unlockScreen' => 'Разблокировать экран',
'videoControls.screenLockButton' => 'Блокировка экрана',
'videoControls.longPressToUnlock' => 'Удерживайте для разблокировки',
'videoControls.timelineSlider' => 'Временная шкала',
'videoControls.volumeSlider' => 'Уровень громкости',
'videoControls.endsAt' => ({required Object time}) => 'Закончится в ${time}',
@@ -1785,14 +1797,14 @@ extension on TranslationsRu {
'liveTv.lateNight' => 'Поздний вечер',
'liveTv.whatsOn' => 'Что идёт',
'liveTv.watchChannel' => 'Смотреть канал',
_ => null,
} ?? switch (path) {
'liveTv.favorites' => 'Избранное',
'collections.title' => 'Коллекции',
'collections.collection' => 'Коллекция',
'collections.empty' => 'Коллекция пуста',
'collections.unknownLibrarySection' => 'Невозможно удалить: неизвестный раздел библиотеки',
'collections.deleteCollection' => 'Удалить коллекцию',
_ => null,
} ?? switch (path) {
'collections.deleteConfirm' => ({required Object title}) => 'Вы уверены, что хотите удалить "${title}"? Это действие нельзя отменить.',
'collections.deleted' => 'Коллекция удалена',
'collections.deleteFailed' => 'Не удалось удалить коллекцию',
+14 -2
View File
@@ -253,6 +253,8 @@ class _TranslationsSettingsSv implements TranslationsSettingsEn {
@override String get subtitleStylingDescription => 'Anpassa undertextutseende';
@override String get smallSkipDuration => 'Kort hoppvaraktighet';
@override String get largeSkipDuration => 'Lång hoppvaraktighet';
@override String get rewindOnResume => 'Spola tillbaka vid återupptagning';
@override String get rewindOnResumeDescription => 'Spola tillbaka med denna tid vid återupptagning av uppspelning';
@override String secondsUnit({required Object seconds}) => '${seconds} sekunder';
@override String get defaultSleepTimer => 'Standard sovtimer';
@override String minutesUnit({required Object minutes}) => '${minutes} minuter';
@@ -491,6 +493,10 @@ class _TranslationsVideoControlsSv implements TranslationsVideoControlsEn {
@override String get exitFullscreenButton => 'Avsluta helskärm';
@override String get alwaysOnTopButton => 'Alltid överst';
@override String get rotationLockButton => 'Rotationslås';
@override String get lockScreen => 'Lås skärm';
@override String get unlockScreen => 'Lås upp skärm';
@override String get screenLockButton => 'Skärmlås';
@override String get longPressToUnlock => 'Tryck länge för att låsa upp';
@override String get timelineSlider => 'Videotidslinje';
@override String get volumeSlider => 'Volymnivå';
@override String endsAt({required Object time}) => 'Slutar ${time}';
@@ -1404,6 +1410,8 @@ extension on TranslationsSv {
'settings.subtitleStylingDescription' => 'Anpassa undertextutseende',
'settings.smallSkipDuration' => 'Kort hoppvaraktighet',
'settings.largeSkipDuration' => 'Lång hoppvaraktighet',
'settings.rewindOnResume' => 'Spola tillbaka vid återupptagning',
'settings.rewindOnResumeDescription' => 'Spola tillbaka med denna tid vid återupptagning av uppspelning',
'settings.secondsUnit' => ({required Object seconds}) => '${seconds} sekunder',
'settings.defaultSleepTimer' => 'Standard sovtimer',
'settings.minutesUnit' => ({required Object minutes}) => '${minutes} minuter',
@@ -1597,6 +1605,10 @@ extension on TranslationsSv {
'videoControls.exitFullscreenButton' => 'Avsluta helskärm',
'videoControls.alwaysOnTopButton' => 'Alltid överst',
'videoControls.rotationLockButton' => 'Rotationslås',
'videoControls.lockScreen' => 'Lås skärm',
'videoControls.unlockScreen' => 'Lås upp skärm',
'videoControls.screenLockButton' => 'Skärmlås',
'videoControls.longPressToUnlock' => 'Tryck länge för att låsa upp',
'videoControls.timelineSlider' => 'Videotidslinje',
'videoControls.volumeSlider' => 'Volymnivå',
'videoControls.endsAt' => ({required Object time}) => 'Slutar ${time}',
@@ -1785,14 +1797,14 @@ extension on TranslationsSv {
'liveTv.lateNight' => 'Sen kväll',
'liveTv.whatsOn' => 'På TV nu',
'liveTv.watchChannel' => 'Titta på kanal',
_ => null,
} ?? switch (path) {
'liveTv.favorites' => 'Favoriter',
'downloads.title' => 'Nedladdningar',
'downloads.manage' => 'Hantera',
'downloads.tvShows' => 'TV-serier',
'downloads.movies' => 'Filmer',
'downloads.noDownloads' => 'Inga nedladdningar ännu',
_ => null,
} ?? switch (path) {
'downloads.noDownloadsDescription' => 'Nedladdat innehåll visas här för offline-visning',
'downloads.downloadNow' => 'Ladda ner',
'downloads.deleteDownload' => 'Ta bort nedladdning',
+14 -2
View File
@@ -253,6 +253,8 @@ class _TranslationsSettingsZh implements TranslationsSettingsEn {
@override String get subtitleStylingDescription => '调整字幕外观';
@override String get smallSkipDuration => '短跳过时长';
@override String get largeSkipDuration => '长跳过时长';
@override String get rewindOnResume => '恢复时回退';
@override String get rewindOnResumeDescription => '恢复播放时回退此时长';
@override String secondsUnit({required Object seconds}) => '${seconds} 秒';
@override String get defaultSleepTimer => '默认睡眠定时器';
@override String minutesUnit({required Object minutes}) => '${minutes} 分钟';
@@ -491,6 +493,10 @@ class _TranslationsVideoControlsZh implements TranslationsVideoControlsEn {
@override String get exitFullscreenButton => '退出全屏';
@override String get alwaysOnTopButton => '置顶窗口';
@override String get rotationLockButton => '旋转锁定';
@override String get lockScreen => '锁定屏幕';
@override String get unlockScreen => '解锁屏幕';
@override String get screenLockButton => '屏幕锁定';
@override String get longPressToUnlock => '长按解锁';
@override String get timelineSlider => '视频时间轴';
@override String get volumeSlider => '音量调节';
@override String endsAt({required Object time}) => '${time} 结束';
@@ -1404,6 +1410,8 @@ extension on TranslationsZh {
'settings.subtitleStylingDescription' => '调整字幕外观',
'settings.smallSkipDuration' => '短跳过时长',
'settings.largeSkipDuration' => '长跳过时长',
'settings.rewindOnResume' => '恢复时回退',
'settings.rewindOnResumeDescription' => '恢复播放时回退此时长',
'settings.secondsUnit' => ({required Object seconds}) => '${seconds} 秒',
'settings.defaultSleepTimer' => '默认睡眠定时器',
'settings.minutesUnit' => ({required Object minutes}) => '${minutes} 分钟',
@@ -1597,6 +1605,10 @@ extension on TranslationsZh {
'videoControls.exitFullscreenButton' => '退出全屏',
'videoControls.alwaysOnTopButton' => '置顶窗口',
'videoControls.rotationLockButton' => '旋转锁定',
'videoControls.lockScreen' => '锁定屏幕',
'videoControls.unlockScreen' => '解锁屏幕',
'videoControls.screenLockButton' => '屏幕锁定',
'videoControls.longPressToUnlock' => '长按解锁',
'videoControls.timelineSlider' => '视频时间轴',
'videoControls.volumeSlider' => '音量调节',
'videoControls.endsAt' => ({required Object time}) => '${time} 结束',
@@ -1785,14 +1797,14 @@ extension on TranslationsZh {
'liveTv.lateNight' => '深夜',
'liveTv.whatsOn' => '正在播出',
'liveTv.watchChannel' => '观看频道',
_ => null,
} ?? switch (path) {
'liveTv.favorites' => '收藏',
'downloads.title' => '下载',
'downloads.manage' => '管理',
'downloads.tvShows' => '电视剧',
'downloads.movies' => '电影',
'downloads.noDownloads' => '暂无下载',
_ => null,
} ?? switch (path) {
'downloads.noDownloadsDescription' => '下载的内容将在此处显示以供离线观看',
'downloads.downloadNow' => '下载',
'downloads.deleteDownload' => '删除下载',
+6
View File
@@ -135,6 +135,8 @@
"subtitleStylingDescription": "Anpassa undertextutseende",
"smallSkipDuration": "Kort hoppvaraktighet",
"largeSkipDuration": "Lång hoppvaraktighet",
"rewindOnResume": "Spola tillbaka vid återupptagning",
"rewindOnResumeDescription": "Spola tillbaka med denna tid vid återupptagning av uppspelning",
"secondsUnit": "${seconds} sekunder",
"defaultSleepTimer": "Standard sovtimer",
"minutesUnit": "${minutes} minuter",
@@ -344,6 +346,10 @@
"exitFullscreenButton": "Avsluta helskärm",
"alwaysOnTopButton": "Alltid överst",
"rotationLockButton": "Rotationslås",
"lockScreen": "Lås skärm",
"unlockScreen": "Lås upp skärm",
"screenLockButton": "Skärmlås",
"longPressToUnlock": "Tryck länge för att låsa upp",
"timelineSlider": "Videotidslinje",
"volumeSlider": "Volymnivå",
"endsAt": "Slutar ${time}",
+6
View File
@@ -135,6 +135,8 @@
"subtitleStylingDescription": "调整字幕外观",
"smallSkipDuration": "短跳过时长",
"largeSkipDuration": "长跳过时长",
"rewindOnResume": "恢复时回退",
"rewindOnResumeDescription": "恢复播放时回退此时长",
"secondsUnit": "${seconds} 秒",
"defaultSleepTimer": "默认睡眠定时器",
"minutesUnit": "${minutes} 分钟",
@@ -344,6 +346,10 @@
"exitFullscreenButton": "退出全屏",
"alwaysOnTopButton": "置顶窗口",
"rotationLockButton": "旋转锁定",
"lockScreen": "锁定屏幕",
"unlockScreen": "解锁屏幕",
"screenLockButton": "屏幕锁定",
"longPressToUnlock": "长按解锁",
"timelineSlider": "视频时间轴",
"volumeSlider": "音量调节",
"endsAt": "${time} 结束",
+18 -17
View File
@@ -3,6 +3,7 @@ import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
import 'package:flutter/gestures.dart';
import 'dart:io' show Platform, ProcessInfo;
import 'package:flutter/services.dart';
import 'package:window_manager/window_manager.dart';
import 'package:provider/provider.dart';
import 'package:flutter_svg/flutter_svg.dart';
@@ -152,7 +153,11 @@ Future<void> _bootstrapApp() async {
// Log app version and git commit at startup
final packageInfo = await PackageInfo.fromPlatform();
final commitSuffix = gitCommit.isNotEmpty ? ' (${gitCommit.substring(0, 7)})' : '';
appLogger.i('Plezy v${packageInfo.version}+${packageInfo.buildNumber}$commitSuffix');
String renderer = '';
if (Platform.isAndroid) {
renderer = ' [${await const MethodChannel('com.plezy/theme').invokeMethod<String>('getRenderer')}]';
}
appLogger.i('Plezy v${packageInfo.version}+${packageInfo.buildNumber}$commitSuffix$renderer');
// Initialize download storage service with settings
await DownloadStorageService.instance.initialize(settings);
@@ -184,10 +189,9 @@ Breadcrumb? _beforeBreadcrumb(Breadcrumb? breadcrumb, Hint _) {
final data = breadcrumb.data;
if (message == null && (data == null || data.isEmpty)) return breadcrumb;
return breadcrumb.copyWith(
message: message != null ? LogRedactionManager.redact(message) : null,
data: data?.map((k, v) => MapEntry(k, v is String ? LogRedactionManager.redact(v) : v)),
);
if (message != null) breadcrumb.message = LogRedactionManager.redact(message);
if (data != null) breadcrumb.data = data.map((k, v) => MapEntry(k, v is String ? LogRedactionManager.redact(v) : v));
return breadcrumb;
}
FutureOr<SentryEvent?> _beforeSend(SentryEvent event, Hint _) {
@@ -215,29 +219,26 @@ FutureOr<SentryEvent?> _beforeSend(SentryEvent event, Hint _) {
// Scrub Plex tokens and server URLs from exception messages
if (exceptions != null) {
exceptions = exceptions.map((e) {
for (final e in exceptions) {
final value = e.value;
if (value != null) {
return e.copyWith(value: LogRedactionManager.redact(value));
e.value = LogRedactionManager.redact(value);
}
return e;
}).toList();
}
}
// Scrub breadcrumb messages and data
var breadcrumbs = event.breadcrumbs;
final breadcrumbs = event.breadcrumbs;
if (breadcrumbs != null) {
breadcrumbs = breadcrumbs.map((b) {
for (final b in breadcrumbs) {
final message = b.message;
final data = b.data;
return b.copyWith(
message: message != null ? LogRedactionManager.redact(message) : null,
data: data?.map((k, v) => MapEntry(k, v is String ? LogRedactionManager.redact(v) : v)),
);
}).toList();
if (message != null) b.message = LogRedactionManager.redact(message);
if (data != null) b.data = data.map((k, v) => MapEntry(k, v is String ? LogRedactionManager.redact(v) : v));
}
}
return event.copyWith(exceptions: exceptions, breadcrumbs: breadcrumbs);
return event;
}
void _registerShaderLicenses() {
+22
View File
@@ -40,6 +40,28 @@ mixin GridFocusNodeMixin<T extends StatefulWidget> on State<T> {
}
}
/// Evict focus nodes far from [centerIndex], keeping at most [keepCount] around it.
void evictDistantFocusNodes(int centerIndex, {int keepCount = 200}) {
if (gridItemFocusNodes.length <= keepCount) return;
final halfKeep = keepCount ~/ 2;
final keepStart = centerIndex - halfKeep;
final keepEnd = centerIndex + halfKeep;
final keysToRemove = <int>[];
for (final key in gridItemFocusNodes.keys) {
if (key < keepStart || key > keepEnd) {
keysToRemove.add(key);
}
}
for (final key in keysToRemove) {
final node = gridItemFocusNodes.remove(key);
if (node != null && !node.hasFocus) {
node.dispose();
}
}
}
/// Dispose all grid-item focus nodes.
void disposeGridFocusNodes() {
for (final node in gridItemFocusNodes.values) {
+164 -73
View File
@@ -40,7 +40,7 @@ String physicalKeyLabel(PhysicalKeyboardKey key) {
final macLabel = _macKeyLabels[key.usbHidUsage];
if (macLabel != null) return macLabel;
}
return _knownKeyLabels[key.usbHidUsage] ?? key.debugName ?? 'Unknown';
return _keyLabels[key.usbHidUsage] ?? 'Unknown';
}
/// macOS-specific overrides for keys that have standard symbols.
@@ -70,60 +70,68 @@ const _macKeyLabels = <int, String>{
0x00000012: 'fn', // fn
};
const _knownKeyLabels = <int, String>{
0x00070004: 'A', // keyA
0x00070005: 'B', // keyB
0x00070006: 'C', // keyC
0x00070007: 'D', // keyD
0x00070008: 'E', // keyE
0x00070009: 'F', // keyF
0x0007000a: 'G', // keyG
0x0007000b: 'H', // keyH
0x0007000c: 'I', // keyI
0x0007000d: 'J', // keyJ
0x0007000e: 'K', // keyK
0x0007000f: 'L', // keyL
0x00070010: 'M', // keyM
0x00070011: 'N', // keyN
0x00070012: 'O', // keyO
0x00070013: 'P', // keyP
0x00070014: 'Q', // keyQ
0x00070015: 'R', // keyR
0x00070016: 'S', // keyS
0x00070017: 'T', // keyT
0x00070018: 'U', // keyU
0x00070019: 'V', // keyV
0x0007001a: 'W', // keyW
0x0007001b: 'X', // keyX
0x0007001c: 'Y', // keyY
0x0007001d: 'Z', // keyZ
0x0007001e: '1', // digit1
0x0007001f: '2', // digit2
0x00070020: '3', // digit3
0x00070021: '4', // digit4
0x00070022: '5', // digit5
0x00070023: '6', // digit6
0x00070024: '7', // digit7
0x00070025: '8', // digit8
0x00070026: '9', // digit9
0x00070027: '0', // digit0
0x00070028: 'Enter', // enter
0x00070029: 'Escape', // escape
0x0007002a: 'Backspace', // backspace
0x0007002b: 'Tab', // tab
0x0007002c: 'Space', // space
0x0007002d: '=', // equal
0x0007002e: '-', // minus
0x0007002f: '[', // bracketLeft
0x00070030: ']', // bracketRight
0x00070031: r'\', // backslash
0x00070033: ';', // semicolon
0x00070034: "'", // quote
0x00070035: '`', // backquote
0x00070036: ',', // comma
0x00070037: '.', // period
0x00070038: '/', // slash
0x00070039: 'CapsLock', // capsLock
/// Comprehensive key labels sourced from Flutter's PhysicalKeyboardKey._debugNames
/// (keyboard_key.g.dart, USB HID keyboard usage page 0x0007).
/// Common keys use short curated labels; the rest use Flutter's default names.
const _keyLabels = <int, String>{
// Letters
0x00070004: 'A',
0x00070005: 'B',
0x00070006: 'C',
0x00070007: 'D',
0x00070008: 'E',
0x00070009: 'F',
0x0007000a: 'G',
0x0007000b: 'H',
0x0007000c: 'I',
0x0007000d: 'J',
0x0007000e: 'K',
0x0007000f: 'L',
0x00070010: 'M',
0x00070011: 'N',
0x00070012: 'O',
0x00070013: 'P',
0x00070014: 'Q',
0x00070015: 'R',
0x00070016: 'S',
0x00070017: 'T',
0x00070018: 'U',
0x00070019: 'V',
0x0007001a: 'W',
0x0007001b: 'X',
0x0007001c: 'Y',
0x0007001d: 'Z',
// Digits
0x0007001e: '1',
0x0007001f: '2',
0x00070020: '3',
0x00070021: '4',
0x00070022: '5',
0x00070023: '6',
0x00070024: '7',
0x00070025: '8',
0x00070026: '9',
0x00070027: '0',
// Special keys
0x00070028: 'Enter',
0x00070029: 'Escape',
0x0007002a: 'Backspace',
0x0007002b: 'Tab',
0x0007002c: 'Space',
// Symbols
0x0007002d: '-',
0x0007002e: '=',
0x0007002f: '[',
0x00070030: ']',
0x00070031: r'\',
0x00070033: ';',
0x00070034: "'",
0x00070035: '`',
0x00070036: ',',
0x00070037: '.',
0x00070038: '/',
// Lock & function keys
0x00070039: 'Caps Lock',
0x0007003a: 'F1',
0x0007003b: 'F2',
0x0007003c: 'F3',
@@ -136,22 +144,105 @@ const _knownKeyLabels = <int, String>{
0x00070043: 'F10',
0x00070044: 'F11',
0x00070045: 'F12',
0x0007004a: 'Home', // home
0x0007004b: 'Page Up', // pageUp
0x0007004c: 'Delete', // delete
0x0007004d: 'End', // end
0x0007004e: 'Page Down', // pageDown
0x0007004f: 'Arrow Right', // arrowRight
0x00070050: 'Arrow Left', // arrowLeft
0x00070051: 'Arrow Down', // arrowDown
0x00070052: 'Arrow Up', // arrowUp
0x000700e0: 'Ctrl', // controlLeft
0x000700e1: 'Shift', // shiftLeft
0x000700e2: 'Alt', // altLeft
0x000700e3: 'Meta', // metaLeft
0x000700e4: 'Ctrl', // controlRight
0x000700e5: 'Shift', // shiftRight
0x000700e6: 'Alt', // altRight
0x000700e7: 'Meta', // metaRight
0x00000012: 'Fn', // fn
0x00070046: 'Print Screen',
0x00070047: 'Scroll Lock',
0x00070048: 'Pause',
0x00070049: 'Insert',
// Navigation
0x0007004a: 'Home',
0x0007004b: 'Page Up',
0x0007004c: 'Delete',
0x0007004d: 'End',
0x0007004e: 'Page Down',
0x0007004f: 'Arrow Right',
0x00070050: 'Arrow Left',
0x00070051: 'Arrow Down',
0x00070052: 'Arrow Up',
// Numpad
0x00070053: 'Num Lock',
0x00070054: 'Numpad /',
0x00070055: 'Numpad *',
0x00070056: 'Numpad -',
0x00070057: 'Numpad +',
0x00070058: 'Numpad Enter',
0x00070059: 'Numpad 1',
0x0007005a: 'Numpad 2',
0x0007005b: 'Numpad 3',
0x0007005c: 'Numpad 4',
0x0007005d: 'Numpad 5',
0x0007005e: 'Numpad 6',
0x0007005f: 'Numpad 7',
0x00070060: 'Numpad 8',
0x00070061: 'Numpad 9',
0x00070062: 'Numpad 0',
0x00070063: 'Numpad .',
0x00070064: 'Intl Backslash',
0x00070065: 'Context Menu',
0x00070066: 'Power',
0x00070067: 'Numpad =',
// Extended function keys
0x00070068: 'F13',
0x00070069: 'F14',
0x0007006a: 'F15',
0x0007006b: 'F16',
0x0007006c: 'F17',
0x0007006d: 'F18',
0x0007006e: 'F19',
0x0007006f: 'F20',
0x00070070: 'F21',
0x00070071: 'F22',
0x00070072: 'F23',
0x00070073: 'F24',
// Editing
0x00070074: 'Open',
0x00070075: 'Help',
0x00070077: 'Select',
0x00070079: 'Again',
0x0007007a: 'Undo',
0x0007007b: 'Cut',
0x0007007c: 'Copy',
0x0007007d: 'Paste',
0x0007007e: 'Find',
// Audio
0x0007007f: 'Volume Mute',
0x00070080: 'Volume Up',
0x00070081: 'Volume Down',
// Numpad extras
0x00070085: 'Numpad ,',
// International
0x00070087: 'Intl Ro',
0x00070088: 'Kana Mode',
0x00070089: 'Intl Yen',
0x0007008a: 'Convert',
0x0007008b: 'Non Convert',
0x00070090: 'Lang 1',
0x00070091: 'Lang 2',
0x00070092: 'Lang 3',
0x00070093: 'Lang 4',
0x00070094: 'Lang 5',
0x0007009b: 'Abort',
0x000700a3: 'Props',
// Numpad advanced
0x000700b6: 'Numpad (',
0x000700b7: 'Numpad )',
0x000700bb: 'Numpad Backspace',
0x000700d0: 'Numpad Memory Store',
0x000700d1: 'Numpad Memory Recall',
0x000700d2: 'Numpad Memory Clear',
0x000700d3: 'Numpad Memory Add',
0x000700d4: 'Numpad Memory Subtract',
0x000700d7: 'Numpad Sign Change',
0x000700d8: 'Numpad Clear',
0x000700d9: 'Numpad Clear Entry',
// Modifiers
0x000700e0: 'Ctrl',
0x000700e1: 'Shift',
0x000700e2: 'Alt',
0x000700e3: 'Meta',
0x000700e4: 'Ctrl',
0x000700e5: 'Shift',
0x000700e6: 'Alt',
0x000700e7: 'Meta',
// Fn
0x00000012: 'Fn',
};
+3 -3
View File
@@ -34,13 +34,13 @@ class LiveTvChannel {
factory LiveTvChannel.fromJson(Map<String, dynamic> json) {
return LiveTvChannel(
key: json['key'] as String? ?? json['ratingKey'] as String? ?? json['identifier'] as String? ?? json['channelIdentifier'] as String? ?? '',
identifier: json['identifier'] as String? ?? json['channelIdentifier'] as String?,
key: json['key'] as String? ?? json['ratingKey'] as String? ?? json['identifier'] as String? ?? json['id'] as String? ?? json['channelIdentifier'] as String? ?? '',
identifier: json['identifier'] as String? ?? json['id'] as String? ?? json['channelIdentifier'] as String?,
callSign: json['callSign'] as String?,
title: json['title'] as String? ?? json['callSign'] as String?,
thumb: json['thumb'] as String?,
art: json['art'] as String?,
number: json['number'] as String? ?? json['channelNumber'] as String? ?? json['channelVcn']?.toString(),
number: json['number'] as String? ?? json['channelNumber'] as String? ?? json['channelVcn']?.toString() ?? json['vcn']?.toString(),
hd: json['hd'] == true || json['hd'] == 1,
lineup: json['lineup'] as String?,
slug: json['slug'] as String?,
+15 -2
View File
@@ -39,7 +39,10 @@ class PlayerAndroid extends PlayerBase {
void handlePlayerEvent(String name, Map? data) {
// Handle Android-specific events
if (name == 'backend-switched') {
// Native player switched from ExoPlayer to MPV due to unsupported format
// Native player switched from ExoPlayer to MPV due to unsupported format.
// Clear stale ExoPlayer tracks so applyTrackSelectionWhenReady waits for
// mpv's track-list instead of immediately applying with ExoPlayer IDs.
clearTracks();
backendSwitchedController.add(null);
return;
}
@@ -89,7 +92,7 @@ class PlayerAndroid extends PlayerBase {
// ============================================
@override
Future<void> open(Media media, {bool play = true, bool isLive = false}) async {
Future<void> open(Media media, {bool play = true, bool isLive = false, List<SubtitleTrack>? externalSubtitles}) async {
if (disposed) return;
await _ensureInitialized();
setSeekable(false);
@@ -103,6 +106,11 @@ class PlayerAndroid extends PlayerBase {
'startPositionMs': media.start?.inMilliseconds ?? 0,
'autoPlay': play,
'isLive': isLive,
if (externalSubtitles != null && externalSubtitles.isNotEmpty)
'externalSubtitles': externalSubtitles
.where((s) => s.uri != null)
.map((s) => {'uri': s.uri, 'title': s.title, 'language': s.language})
.toList(),
});
}
@@ -243,6 +251,11 @@ class PlayerAndroid extends PlayerBase {
return (state.duration.inMilliseconds / 1000.0).toString();
case 'seekable':
return state.seekable ? 'yes' : 'no';
// Video frame rate - query from ExoPlayer stats
case 'container-fps':
final fpsStats = await getStats();
final fps = fpsStats['videoFps'];
return fps?.toString();
// Video dimensions - query from ExoPlayer stats
case 'width':
case 'dwidth':
+1 -1
View File
@@ -61,7 +61,7 @@ abstract class Player {
///
/// [media] - The media source to open.
/// [play] - Whether to start playback immediately (default: true).
Future<void> open(Media media, {bool play = true, bool isLive = false});
Future<void> open(Media media, {bool play = true, bool isLive = false, List<SubtitleTrack>? externalSubtitles});
/// Start or resume playback.
Future<void> play();
+29 -6
View File
@@ -225,9 +225,18 @@ abstract class PlayerBase with PlayerStreamControllersMixin implements Player {
}
}
if (trackList != null) {
final tracks = parseTrackList(trackList);
_state = _state.copyWith(tracks: tracks);
tracksController.add(tracks);
final result = parseTrackList(trackList);
_state = _state.copyWith(tracks: result.tracks);
tracksController.add(result.tracks);
// Derive selection from mpv's "selected" field in the track data.
// This is the source of truth and handles cases where aid/sid
// values don't match track IDs (e.g. "auto", "0", "no").
if (result.selectedAudioId != null) {
updateSelectedAudioTrack(result.selectedAudioId);
}
if (result.selectedSubtitleId != null) {
updateSelectedSubtitleTrack(result.selectedSubtitleId);
}
}
break;
@@ -384,18 +393,22 @@ abstract class PlayerBase with PlayerStreamControllersMixin implements Player {
};
}
/// Parse a track list from the platform into [Tracks].
Tracks parseTrackList(List trackList) {
/// Parse a track list from the platform into [Tracks] and selected track IDs.
({Tracks tracks, String? selectedAudioId, String? selectedSubtitleId}) parseTrackList(List trackList) {
final audioTracks = <AudioTrack>[];
final subtitleTracks = <SubtitleTrack>[];
String? selectedAudioId;
String? selectedSubtitleId;
for (final track in trackList) {
if (track is! Map) continue;
final type = track['type'] as String?;
final id = track['id']?.toString() ?? '';
final selected = track['selected'] as bool? ?? false;
if (type == 'audio') {
if (selected) selectedAudioId = id;
audioTracks.add(
AudioTrack(
id: id,
@@ -408,12 +421,15 @@ abstract class PlayerBase with PlayerStreamControllersMixin implements Player {
),
);
} else if (type == 'sub') {
if (selected) selectedSubtitleId = id;
subtitleTracks.add(
SubtitleTrack(
id: id,
title: track['title'] as String?,
language: track['lang'] as String?,
codec: track['codec'] as String?,
isDefault: track['default'] as bool? ?? false,
isForced: track['forced'] as bool? ?? false,
isExternal: track['external'] as bool? ?? false,
uri: track['external-filename'] as String?,
),
@@ -421,7 +437,7 @@ abstract class PlayerBase with PlayerStreamControllersMixin implements Player {
}
}
return Tracks(audio: audioTracks, subtitle: subtitleTracks);
return (tracks: Tracks(audio: audioTracks, subtitle: subtitleTracks), selectedAudioId: selectedAudioId, selectedSubtitleId: selectedSubtitleId);
}
/// Update the selected audio track.
@@ -470,6 +486,13 @@ abstract class PlayerBase with PlayerStreamControllersMixin implements Player {
_state = update(_state);
}
@protected
void clearTracks() {
const empty = Tracks();
_state = _state.copyWith(tracks: empty, track: const TrackSelection());
tracksController.add(empty);
}
@protected
void setSeekable(bool seekable) {
if (_state.seekable == seekable) return;
+1 -1
View File
@@ -91,7 +91,7 @@ class PlayerNative extends PlayerBase {
}
@override
Future<void> open(Media media, {bool play = true, bool isLive = false}) async {
Future<void> open(Media media, {bool play = true, bool isLive = false, List<SubtitleTrack>? externalSubtitles}) async {
if (disposed) return;
await _ensureInitialized();
setSeekable(false);
@@ -67,6 +67,7 @@ class _PairingScreenState extends State<PairingScreen> {
}
} catch (e) {
appLogger.e('Failed to join remote session', error: e);
if (!mounted) return;
setState(() {
_isConnecting = false;
_errorMessage = _parseErrorMessage(e.toString());
@@ -129,6 +130,7 @@ class _PairingScreenState extends State<PairingScreen> {
}
} catch (e) {
appLogger.e('Failed to join remote session', error: e);
if (!mounted) return;
_lastScannedCode = null; // Allow re-scanning
setState(() {
_isConnecting = false;
@@ -206,7 +208,7 @@ class _PairingScreenState extends State<PairingScreen> {
_handleQrCode(barcode!.rawValue!);
}
},
errorBuilder: (context, error, child) {
errorBuilder: (context, error) {
return Center(
child: Padding(
padding: const EdgeInsets.all(24.0),
+5 -2
View File
@@ -83,6 +83,7 @@ class _DiscoverScreenState extends State<DiscoverScreen>
Timer? _indicatorTimer;
final ValueNotifier<double> _indicatorProgress = ValueNotifier(0.0);
bool _isAutoScrollPaused = false;
bool _isTabVisible = true;
HiddenLibrariesProvider? _hiddenLibrariesProvider;
Set<String> _lastSeenHiddenKeys = {};
@@ -309,8 +310,8 @@ class _DiscoverScreenState extends State<DiscoverScreen>
@override
void didChangeAppLifecycleState(AppLifecycleState state) {
if (state == AppLifecycleState.resumed) {
// Restart auto-scroll when app becomes active again
if (!_isAutoScrollPaused) _startAutoScroll();
// Restart auto-scroll only if discover tab is visible
if (_isTabVisible && !_isAutoScrollPaused) _startAutoScroll();
// Refresh continue watching on mobile only
// (on desktop, "resumed" fires on every window focus gain)
if (Platform.isIOS || Platform.isAndroid) {
@@ -390,12 +391,14 @@ class _DiscoverScreenState extends State<DiscoverScreen>
@override
void onTabHidden() {
_isTabVisible = false;
_autoScrollTimer?.cancel();
_stopIndicatorProgress();
}
@override
void onTabShown() {
_isTabVisible = true;
if (!_isAutoScrollPaused) {
_startAutoScroll();
}
@@ -136,6 +136,7 @@ class DownloadsScreenState extends State<DownloadsScreen> with TickerProviderSta
Widget build(BuildContext context) {
return Scaffold(
body: CustomScrollView(
primary: false,
slivers: [
DesktopSliverAppBar(
title: _buildAppBarTitle(),
@@ -2,6 +2,7 @@ import 'package:flutter/material.dart';
import 'package:plezy/widgets/app_icon.dart';
import 'package:material_symbols_icons/symbols.dart';
import '../../models/plex_filter.dart';
import '../../utils/scroll_utils.dart';
import '../../widgets/app_bar_back_button.dart';
import '../../widgets/bottom_sheet_header.dart';
import '../../widgets/focusable_list_tile.dart';
@@ -38,6 +39,8 @@ class _FiltersBottomSheetState extends State<FiltersBottomSheet> {
static const int _maxCachedDisplayNames = 1000;
late List<PlexFilter> _sortedFilters;
late final FocusNode _initialFocusNode;
final _valuesFirstItemKey = GlobalKey();
final _valuesScrollController = ScrollController();
String _cacheKey(String filter, String value) => '${widget.serverId}:${widget.libraryKey}:$filter:$value';
@@ -51,6 +54,7 @@ class _FiltersBottomSheetState extends State<FiltersBottomSheet> {
@override
void dispose() {
_valuesScrollController.dispose();
_initialFocusNode.dispose();
super.dispose();
}
@@ -83,6 +87,15 @@ class _FiltersBottomSheetState extends State<FiltersBottomSheet> {
_filterValues = values;
_isLoadingValues = false;
});
// Scroll to selected value if any
final selectedValue = _tempSelectedFilters[filter.filter];
if (selectedValue != null) {
// +1 because index 0 is the "All" row
final idx = values.indexWhere((v) => _extractFilterValue(v.key, filter.filter) == selectedValue) + 1;
if (idx > 0) {
scrollToCurrentItem(_valuesScrollController, _valuesFirstItemKey, idx);
}
}
} catch (e) {
if (!mounted) return;
setState(() {
@@ -134,12 +147,14 @@ class _FiltersBottomSheetState extends State<FiltersBottomSheet> {
else
Expanded(
child: ListView.builder(
controller: _valuesScrollController,
padding: const EdgeInsets.symmetric(vertical: 8),
itemCount: _filterValues.length + 1,
itemBuilder: (context, index) {
if (index == 0) {
final isSelected = !_tempSelectedFilters.containsKey(_currentFilter!.filter);
return FocusableListTile(
key: _valuesFirstItemKey,
focusNode: _initialFocusNode,
title: Text(t.libraries.all),
selected: isSelected,
@@ -4,6 +4,7 @@ import 'package:material_symbols_icons/symbols.dart';
import '../../focus/dpad_navigator.dart';
import '../../focus/input_mode_tracker.dart';
import '../../models/plex_sort.dart';
import '../../utils/scroll_utils.dart';
import '../../widgets/bottom_sheet_header.dart';
import '../../widgets/focusable_list_tile.dart';
import '../../widgets/overlay_sheet.dart';
@@ -33,6 +34,8 @@ class _SortBottomSheetState extends State<SortBottomSheet> {
late PlexSort? _currentSort;
late bool _currentDescending;
late final FocusNode _initialFocusNode;
final _firstItemKey = GlobalKey();
final _scrollController = ScrollController();
@override
void initState() {
@@ -40,6 +43,15 @@ class _SortBottomSheetState extends State<SortBottomSheet> {
_currentSort = widget.selectedSort;
_currentDescending = widget.isSortDescending;
_initialFocusNode = FocusNode(debugLabel: 'SortBottomSheetInitialFocus');
// Scroll to selected item, then handle focus
final selectedIndex = widget.selectedSort != null
? widget.sortOptions.indexWhere((s) => s.key == widget.selectedSort!.key)
: -1;
if (selectedIndex > 0) {
scrollToCurrentItem(_scrollController, _firstItemKey, selectedIndex);
}
WidgetsBinding.instance.addPostFrameCallback((_) {
if (!mounted) return;
if (!InputModeTracker.isKeyboardMode(context)) return;
@@ -57,6 +69,7 @@ class _SortBottomSheetState extends State<SortBottomSheet> {
@override
void dispose() {
_scrollController.dispose();
_initialFocusNode.dispose();
super.dispose();
}
@@ -102,6 +115,7 @@ class _SortBottomSheetState extends State<SortBottomSheet> {
if (value != null) _handleSortSelect(value);
},
child: ListView.builder(
controller: _scrollController,
padding: const EdgeInsets.symmetric(vertical: 8),
itemCount: widget.sortOptions.length,
itemBuilder: (context, index) {
@@ -109,6 +123,7 @@ class _SortBottomSheetState extends State<SortBottomSheet> {
final isSelected = _currentSort?.key == sort.key;
return Focus(
key: index == 0 ? _firstItemKey : null,
canRequestFocus: false,
skipTraversal: true,
onKeyEvent: (node, event) {
@@ -3,6 +3,7 @@ import 'dart:async';
import 'package:flutter/material.dart';
import 'package:material_symbols_icons/symbols.dart';
import 'package:provider/provider.dart';
import 'package:cached_network_image/cached_network_image.dart';
import 'package:dio/dio.dart';
import '../../../focus/dpad_navigator.dart';
import '../../../focus/input_mode_tracker.dart';
@@ -12,9 +13,11 @@ import '../../../models/plex_filter.dart';
import '../../../models/plex_first_character.dart';
import '../../../models/plex_sort.dart';
import '../../../providers/settings_provider.dart';
import '../../../services/image_cache_service.dart';
import '../../../utils/error_message_utils.dart';
import '../../../utils/grid_size_calculator.dart';
import '../../../utils/layout_constants.dart';
import '../../../utils/plex_image_helper.dart';
import '../alpha_jump_bar.dart';
import '../alpha_jump_helper.dart';
import '../alpha_scroll_handle.dart';
@@ -118,6 +121,12 @@ class _LibraryBrowseTabState extends BaseLibraryTabState<PlexMetadata, LibraryBr
return;
}
}
// If neither the item nor its parents are loaded (evicted), the event
// was already filtered by DeletionAware's upstream check against
// deletionGlobalKeys/deletionRatingKeys, so this point is unreachable.
// The grid self-corrects when _fetchRange updates _totalSize from the
// server response on the next scroll.
}
/// Remove an item at [index] and shift all higher indices down by 1
@@ -166,7 +175,7 @@ class _LibraryBrowseTabState extends BaseLibraryTabState<PlexMetadata, LibraryBr
// Alpha jump bar state
List<PlexFirstCharacter> _firstCharacters = [];
AlphaJumpHelper _alphaHelper = AlphaJumpHelper(const []);
int _currentFirstVisibleIndex = 0;
final ValueNotifier<int> _currentFirstVisibleIndex = ValueNotifier<int>(0);
int _currentColumnCount = 1;
double _lastCrossAxisExtent = 0;
double _effectiveTopPadding = _gridTopPadding;
@@ -180,10 +189,16 @@ class _LibraryBrowseTabState extends BaseLibraryTabState<PlexMetadata, LibraryBr
// Incremented on each jump so that overlapping animations don't clobber each other.
int _jumpScrollGeneration = 0;
// Scroll activity tracking (for phone scroll handle)
bool _isScrollActive = false;
// Scroll activity tracking (for phone scroll handle and range-load gating)
final ValueNotifier<bool> _isScrollActive = ValueNotifier<bool>(false);
Timer? _scrollActivityTimer;
// Eager prefetch throttle
DateTime? _lastEagerPrefetch;
// Alpha bar update: throttle (leading edge) + trailing timer (ensures final position)
DateTime? _lastAlphaUpdate;
Timer? _alphaUpdateTimer;
// Pagination state
int _totalSize = 0;
final Map<int, PlexMetadata> _loadedItems = {};
@@ -193,6 +208,10 @@ class _LibraryBrowseTabState extends BaseLibraryTabState<PlexMetadata, LibraryBr
int _firstCharactersRequestId = 0;
static const int _fetchSize = 200;
Timer? _scrollIdleTimer;
Timer? _retryTimer;
int _retryCount = 0;
bool _rangeLoadScheduled = false;
bool _visibleRangeLoading = false;
// Focus nodes for filter chips
final FocusNode _groupingChipFocusNode = FocusNode(debugLabel: 'grouping_chip');
@@ -211,14 +230,18 @@ class _LibraryBrowseTabState extends BaseLibraryTabState<PlexMetadata, LibraryBr
@override
void dispose() {
_cancelToken?.cancel();
_retryTimer?.cancel();
_scrollActivityTimer?.cancel();
_scrollIdleTimer?.cancel();
_alphaUpdateTimer?.cancel();
_scrollController.removeListener(_onScrollChanged);
_scrollController.dispose();
_groupingChipFocusNode.dispose();
_filtersChipFocusNode.dispose();
_sortChipFocusNode.dispose();
_alphaJumpBarFocusNode.dispose();
_currentFirstVisibleIndex.dispose();
_isScrollActive.dispose();
disposeGridFocusNodes();
super.dispose();
}
@@ -309,11 +332,11 @@ class _LibraryBrowseTabState extends BaseLibraryTabState<PlexMetadata, LibraryBr
void _resetForFullReload() {
_scrollActivityTimer?.cancel();
_scrollIdleTimer?.cancel();
_isScrollActive = false;
_isScrollActive.value = false;
_hasJumpPin = false;
_isJumpScrolling = false;
_jumpScrollGeneration++;
_currentFirstVisibleIndex = 0;
_currentFirstVisibleIndex.value = 0;
// The browse tab state is kept alive across libraries, so ensure each
// library starts from top instead of inheriting the previous offset.
@@ -331,6 +354,7 @@ class _LibraryBrowseTabState extends BaseLibraryTabState<PlexMetadata, LibraryBr
Future<void> _loadContent() async {
// Cancel any pending request
_cancelToken?.cancel();
_retryTimer?.cancel();
_cancelToken = CancelToken();
// Use a generation counter for the filter/sort loading phase
final generation = ++_requestId;
@@ -357,8 +381,8 @@ class _LibraryBrowseTabState extends BaseLibraryTabState<PlexMetadata, LibraryBr
_selectedGrouping = _getDefaultGrouping();
_firstCharacters = [];
_alphaHelper = AlphaJumpHelper(const []);
_currentFirstVisibleIndex = 0;
});
_currentFirstVisibleIndex.value = 0;
try {
final storage = await StorageService.getInstance();
@@ -435,6 +459,7 @@ class _LibraryBrowseTabState extends BaseLibraryTabState<PlexMetadata, LibraryBr
Future<void> _loadItems() async {
final currentRequestId = ++_requestId;
_cancelToken?.cancel();
_retryTimer?.cancel();
_cancelToken = CancelToken();
setState(() {
@@ -458,7 +483,7 @@ class _LibraryBrowseTabState extends BaseLibraryTabState<PlexMetadata, LibraryBr
final result = await client.getLibraryContent(
widget.library.key,
start: 0,
size: _fetchSize,
size: _calculateInitialFetchSize(),
filters: filterParams,
cancelToken: _cancelToken,
);
@@ -490,15 +515,15 @@ class _LibraryBrowseTabState extends BaseLibraryTabState<PlexMetadata, LibraryBr
/// Fetch a range of items from the API and store them in the sparse map.
/// After a successful fetch, re-checks for remaining gaps in the visible range.
Future<void> _fetchRange(int start, int size) async {
Future<bool> _fetchRange(int start, int size) async {
// Clamp to totalSize
if (start >= _totalSize) return;
if (start >= _totalSize) return false;
final clampedSize = size.clamp(0, _totalSize - start);
if (clampedSize == 0) return;
if (clampedSize == 0) return false;
// Deduplicate: track every index in-flight to prevent overlapping fetches
final indices = List.generate(clampedSize, (i) => start + i);
if (indices.every((i) => _loadingRanges.contains(i) || _loadedItems.containsKey(i))) return;
if (indices.every((i) => _loadingRanges.contains(i) || _loadedItems.containsKey(i))) return true;
_loadingRanges.addAll(indices);
final currentRequestId = _requestId;
@@ -515,28 +540,31 @@ class _LibraryBrowseTabState extends BaseLibraryTabState<PlexMetadata, LibraryBr
cancelToken: _cancelToken,
);
if (currentRequestId != _requestId || !mounted) return;
if (currentRequestId != _requestId || !mounted) return false;
setState(() {
for (var i = 0; i < result.items.length; i++) {
_loadedItems[start + i] = result.items[i];
}
// Update totalSize in case it changed (e.g., items added/removed on server)
if (result.totalSize != _totalSize) {
_totalSize = result.totalSize;
}
});
// Re-check for remaining gaps in the visible range after this fetch
WidgetsBinding.instance.addPostFrameCallback((_) {
_retryCount = 0;
_prefetchImages(start, result.items);
return true;
} catch (e) {
if (e is DioException && e.type == DioExceptionType.cancel) return false;
_retryCount++;
final delay = Duration(milliseconds: 500 * (1 << _retryCount.clamp(0, 4)));
_retryTimer?.cancel();
_retryTimer = Timer(delay, () {
if (mounted && currentRequestId == _requestId) {
_loadVisibleRange();
}
});
} catch (e) {
// Silently ignore fetch errors for background range loads
// (the initial load handles errors with UI feedback)
if (e is DioException && e.type == DioExceptionType.cancel) return;
return false;
} finally {
_loadingRanges.removeAll(indices);
}
@@ -764,7 +792,7 @@ class _LibraryBrowseTabState extends BaseLibraryTabState<PlexMetadata, LibraryBr
void _navigateToGridNearScroll() {
if (_totalSize == 0 || _currentColumnCount < 1) return;
final row = _currentFirstVisibleIndex ~/ _currentColumnCount;
final row = _currentFirstVisibleIndex.value ~/ _currentColumnCount;
var targetIndex = ((row + 1) * _currentColumnCount - 1).clamp(0, _totalSize - 1);
// Find nearest loaded item — skeleton cards have no FocusNode
@@ -818,9 +846,7 @@ class _LibraryBrowseTabState extends BaseLibraryTabState<PlexMetadata, LibraryBr
/// The letter currently visible at the top of the grid, determined by
/// how many items we've scrolled past relative to the API's cumulative
/// firstCharacter counts.
String get _currentAlphaLetter {
return _alphaHelper.currentLetter(_currentFirstVisibleIndex);
}
String _alphaLetterFor(int index) => _alphaHelper.currentLetter(index);
/// Whether the alpha jump bar should be shown.
/// Only shown when sorting by title (titleSort) and not in folders mode.
@@ -872,9 +898,19 @@ class _LibraryBrowseTabState extends BaseLibraryTabState<PlexMetadata, LibraryBr
// Debounced scroll-idle handler: load visible range when scrolling settles
_scrollIdleTimer?.cancel();
_scrollIdleTimer = Timer(const Duration(milliseconds: 200), () {
if (mounted) _loadVisibleRange();
if (!mounted) return;
// Discard stale in-flight tracking from eager prefetch during scroll
// so _loadVisibleRange sees the full gap at the settled position.
_loadingRanges.clear();
_loadVisibleRange();
_evictDistantItems();
final firstVisible = _itemIndexFromScrollOffset(_scrollController.offset);
evictDistantFocusNodes(firstVisible);
});
// Eager prefetch: fetch data before scroll stops
_checkEagerPrefetch();
if (!_shouldShowAlphaJumpBar || _currentColumnCount < 1) return;
// During a jump animation, skip alpha bar processing to avoid flashing.
@@ -887,7 +923,17 @@ class _LibraryBrowseTabState extends BaseLibraryTabState<PlexMetadata, LibraryBr
_hasJumpPin = false;
}
_updateVisibleIndex();
// Throttle alpha bar updates to ~50fps, with a trailing-edge timer
// so the final scroll position always gets an update
final now = DateTime.now();
if (_lastAlphaUpdate == null || now.difference(_lastAlphaUpdate!) >= const Duration(milliseconds: 20)) {
_lastAlphaUpdate = now;
_updateVisibleIndex();
}
_alphaUpdateTimer?.cancel();
_alphaUpdateTimer = Timer(const Duration(milliseconds: 20), () {
if (mounted) _updateVisibleIndex();
});
}
/// Recompute the first-visible-index from the current scroll offset.
@@ -898,8 +944,8 @@ class _LibraryBrowseTabState extends BaseLibraryTabState<PlexMetadata, LibraryBr
// updates as soon as items with a new letter appear in that row.
final maxIndex = _totalSize > 0 ? _totalSize - 1 : 0;
final lastInRow = (firstInRow + _currentColumnCount - 1).clamp(0, maxIndex);
if (lastInRow != _currentFirstVisibleIndex) {
setState(() => _currentFirstVisibleIndex = lastInRow);
if (lastInRow != _currentFirstVisibleIndex.value) {
_currentFirstVisibleIndex.value = lastInRow;
}
}
@@ -932,7 +978,7 @@ class _LibraryBrowseTabState extends BaseLibraryTabState<PlexMetadata, LibraryBr
_hasJumpPin = true;
final clamped = targetIndex.clamp(0, _totalSize > 0 ? _totalSize - 1 : 0);
setState(() => _currentFirstVisibleIndex = clamped);
_currentFirstVisibleIndex.value = clamped;
_scrollToItemIndex(clamped);
}
@@ -1009,19 +1055,28 @@ class _LibraryBrowseTabState extends BaseLibraryTabState<PlexMetadata, LibraryBr
right: 0,
bottom: 0,
child: _isPhone(context)
? AlphaScrollHandle(
firstCharacters: _firstCharacters,
onJump: _jumpToIndex,
currentLetter: _currentAlphaLetter,
isScrolling: _isScrollActive,
? ValueListenableBuilder<int>(
valueListenable: _currentFirstVisibleIndex,
builder: (context, visibleIndex, _) => ValueListenableBuilder<bool>(
valueListenable: _isScrollActive,
builder: (context, scrolling, _) => AlphaScrollHandle(
firstCharacters: _firstCharacters,
onJump: _jumpToIndex,
currentLetter: _alphaLetterFor(visibleIndex),
isScrolling: scrolling,
),
),
)
: AlphaJumpBar(
firstCharacters: _firstCharacters,
onJump: _jumpToIndex,
currentLetter: _currentAlphaLetter,
focusNode: _alphaJumpBarFocusNode,
onNavigateLeft: _navigateToGridNearScroll,
onBack: _navigateToGridNearScroll,
: ValueListenableBuilder<int>(
valueListenable: _currentFirstVisibleIndex,
builder: (context, visibleIndex, _) => AlphaJumpBar(
firstCharacters: _firstCharacters,
onJump: _jumpToIndex,
currentLetter: _alphaLetterFor(visibleIndex),
focusNode: _alphaJumpBarFocusNode,
onNavigateLeft: _navigateToGridNearScroll,
onBack: _navigateToGridNearScroll,
),
),
),
],
@@ -1032,14 +1087,14 @@ class _LibraryBrowseTabState extends BaseLibraryTabState<PlexMetadata, LibraryBr
Widget _buildScrollableContent() {
return NotificationListener<ScrollNotification>(
onNotification: (notification) {
// Track scroll activity for phone scroll handle
// Track scroll activity for phone scroll handle and range-load gating
if (notification is ScrollStartNotification) {
if (!_isScrollActive) setState(() => _isScrollActive = true);
_isScrollActive.value = true;
_scrollActivityTimer?.cancel();
} else if (notification is ScrollEndNotification) {
_scrollActivityTimer?.cancel();
_scrollActivityTimer = Timer(const Duration(milliseconds: 100), () {
if (mounted) setState(() => _isScrollActive = false);
if (mounted) _isScrollActive.value = false;
});
}
return false;
@@ -1053,10 +1108,23 @@ class _LibraryBrowseTabState extends BaseLibraryTabState<PlexMetadata, LibraryBr
);
}
/// Self-healing: when a skeleton is rendered after scrolling stops,
/// ensure the visible range gets loaded even if the scroll-idle path missed it.
void _scheduleRangeLoad() {
if (_rangeLoadScheduled || _isScrollActive.value) return;
_rangeLoadScheduled = true;
WidgetsBinding.instance.addPostFrameCallback((_) {
_rangeLoadScheduled = false;
if (mounted) _loadVisibleRange();
});
}
/// Determine the visible range and fetch any unloaded items within it.
/// Covers the full visible area plus a buffer of _fetchSize/2 on each side,
/// then finds the first unloaded contiguous block and fetches it.
void _loadVisibleRange() {
/// Serialized: only one visible-range fetch runs at a time to prevent
/// concurrent calls from seeing each other's _loadingRanges and producing
/// tiny fetch sizes.
Future<void> _loadVisibleRange() async {
if (_visibleRangeLoading) return;
if (_totalSize == 0 || _currentColumnCount < 1 || !_scrollController.hasClients) return;
if (_lastCrossAxisExtent <= 0) return;
@@ -1064,7 +1132,6 @@ class _LibraryBrowseTabState extends BaseLibraryTabState<PlexMetadata, LibraryBr
final viewportHeight = _scrollController.position.viewportDimension;
final firstIndex = _itemIndexFromScrollOffset(offset);
// Calculate how many items fit in the viewport
final itemWidth = _lastCrossAxisExtent / _currentColumnCount;
final itemHeight = itemWidth / GridLayoutConstants.posterAspectRatio;
final rowHeight = itemHeight + GridLayoutConstants.mainAxisSpacing;
@@ -1073,12 +1140,10 @@ class _LibraryBrowseTabState extends BaseLibraryTabState<PlexMetadata, LibraryBr
final visibleRows = (viewportHeight / rowHeight).ceil() + 1;
final visibleCount = visibleRows * _currentColumnCount;
// Expand the visible range by a buffer on each side
final buffer = _fetchSize ~/ 2;
final rangeStart = (firstIndex - buffer).clamp(0, _totalSize);
final rangeEnd = (firstIndex + visibleCount + buffer).clamp(0, _totalSize);
// Find the first and last unloaded indices in the range
int? fetchStart;
int? fetchEnd;
for (var i = rangeStart; i < rangeEnd; i++) {
@@ -1089,10 +1154,155 @@ class _LibraryBrowseTabState extends BaseLibraryTabState<PlexMetadata, LibraryBr
}
if (fetchStart == null || fetchEnd == null) return;
final fetchSize = fetchEnd - fetchStart;
if (fetchSize <= 0) return;
_retryTimer?.cancel();
_visibleRangeLoading = true;
try {
final success = await _fetchRange(fetchStart, fetchEnd - fetchStart);
if (success && mounted) {
WidgetsBinding.instance.addPostFrameCallback((_) {
if (mounted) _loadVisibleRange();
});
}
} finally {
_visibleRangeLoading = false;
}
}
_fetchRange(fetchStart, fetchSize);
/// Eagerly prefetch data when approaching unloaded boundaries during scroll.
/// Throttled to at most once per 100ms to avoid spamming.
void _checkEagerPrefetch() {
if (_totalSize == 0 || _currentColumnCount < 1 || !_scrollController.hasClients) return;
if (_lastCrossAxisExtent <= 0) return;
final now = DateTime.now();
if (_lastEagerPrefetch != null && now.difference(_lastEagerPrefetch!) < const Duration(milliseconds: 100)) return;
final offset = _scrollController.offset;
final viewportHeight = _scrollController.position.viewportDimension;
final firstIndex = _itemIndexFromScrollOffset(offset);
final itemWidth = _lastCrossAxisExtent / _currentColumnCount;
final itemHeight = itemWidth / GridLayoutConstants.posterAspectRatio;
final rowHeight = itemHeight + GridLayoutConstants.mainAxisSpacing;
if (rowHeight <= 0) return;
final visibleRows = (viewportHeight / rowHeight).ceil() + 1;
final visibleCount = visibleRows * _currentColumnCount;
// Look 1 viewport ahead for unloaded items
final lookAheadStart = (firstIndex + visibleCount).clamp(0, _totalSize);
final lookAheadEnd = (lookAheadStart + visibleCount).clamp(0, _totalSize);
for (var i = lookAheadStart; i < lookAheadEnd; i++) {
if (!_loadedItems.containsKey(i) && !_loadingRanges.contains(i)) {
_lastEagerPrefetch = now;
_fetchRange(i, _fetchSize);
return;
}
}
// Check backward if nothing needed forward
final lookBehindStart = (firstIndex - visibleCount).clamp(0, _totalSize);
for (var i = firstIndex - 1; i >= lookBehindStart; i--) {
if (!_loadedItems.containsKey(i) && !_loadingRanges.contains(i)) {
_lastEagerPrefetch = now;
_fetchRange(i, _fetchSize);
return;
}
}
}
/// Compute initial fetch size based on viewport dimensions.
int _calculateInitialFetchSize() {
try {
final screenSize = MediaQuery.of(context).size;
final settingsProvider = context.read<SettingsProvider>();
final maxExtent = GridSizeCalculator.getMaxCrossAxisExtent(context, settingsProvider.libraryDensity);
final crossAxisSpacing = GridLayoutConstants.crossAxisSpacing;
final columnCount =
((screenSize.width + crossAxisSpacing) / (maxExtent + crossAxisSpacing)).ceil().clamp(1, 100);
final itemWidth = screenSize.width / columnCount;
final itemHeight = itemWidth / GridLayoutConstants.posterAspectRatio;
final rowHeight = itemHeight + GridLayoutConstants.mainAxisSpacing;
if (rowHeight <= 0) return _fetchSize;
final visibleRows = (screenSize.height / rowHeight).ceil() + 1;
final visibleCount = visibleRows * columnCount;
return (visibleCount * 3).clamp(100, 500);
} catch (_) {
return _fetchSize;
}
}
/// Evict loaded items far from the current viewport to bound memory usage.
static const int _maxLoadedItems = 500;
static const int _evictionThreshold = 600;
void _evictDistantItems() {
if (_loadedItems.length <= _evictionThreshold) return;
final centerIndex = _itemIndexFromScrollOffset(_scrollController.offset);
final halfKeep = _maxLoadedItems ~/ 2;
final keepStart = centerIndex - halfKeep;
final keepEnd = centerIndex + halfKeep;
_loadedItems.removeWhere((index, _) => index < keepStart || index > keepEnd);
}
/// Prefetch images for items near the viewport to reduce pop-in.
void _prefetchImages(int startIndex, List<PlexMetadata> items) {
if (!_scrollController.hasClients || _lastCrossAxisExtent <= 0 || _currentColumnCount < 1) return;
final offset = _scrollController.offset;
final viewportHeight = _scrollController.position.viewportDimension;
final firstVisible = _itemIndexFromScrollOffset(offset);
final itemWidth = _lastCrossAxisExtent / _currentColumnCount;
final itemHeight = itemWidth / GridLayoutConstants.posterAspectRatio;
final rowHeight = itemHeight + GridLayoutConstants.mainAxisSpacing;
if (rowHeight <= 0) return;
final visibleRows = (viewportHeight / rowHeight).ceil() + 1;
final visibleEnd = firstVisible + visibleRows * _currentColumnCount;
// Prefetch 2 rows beyond visible area
final prefetchEnd = visibleEnd + 2 * _currentColumnCount;
final client = getClientForLibrary();
final devicePixelRatio = PlexImageHelper.effectiveDevicePixelRatio(context);
for (var i = 0; i < items.length; i++) {
final index = startIndex + i;
if (index < firstVisible || index > prefetchEnd) continue;
final thumb = items[i].thumb;
if (thumb == null || thumb.isEmpty) continue;
final imageUrl = PlexImageHelper.getOptimizedImageUrl(
client: client,
thumbPath: thumb,
maxWidth: itemWidth,
maxHeight: itemHeight,
devicePixelRatio: devicePixelRatio,
enableTranscoding: PlexImageHelper.shouldTranscode(thumb),
imageType: ImageType.poster,
);
if (imageUrl.isEmpty) continue;
final scaledWidth = itemWidth * devicePixelRatio;
final scaledHeight = itemHeight * devicePixelRatio;
final (_, memHeight) = PlexImageHelper.getMemCacheDimensions(
displayWidth: scaledWidth.isFinite && scaledWidth > 0 ? scaledWidth.round() : 0,
displayHeight: scaledHeight.isFinite && scaledHeight > 0 ? scaledHeight.round() : 0,
);
precacheImage(
CachedNetworkImageProvider(
imageUrl,
cacheManager: PlexImageCacheManager.instance,
headers: const {'User-Agent': 'Plezy'},
maxHeight: memHeight,
),
context,
);
}
}
/// Whether the filters chip is visible
@@ -1277,6 +1487,7 @@ class _LibraryBrowseTabState extends BaseLibraryTabState<PlexMetadata, LibraryBr
// Show skeleton placeholder for unloaded items
if (item == null) {
_scheduleRangeLoad();
return const _SkeletonCard();
}
@@ -1307,32 +1518,32 @@ class _SkeletonCard extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Padding(
padding: const EdgeInsets.all(8),
return const Padding(
padding: EdgeInsets.all(8),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
// Poster area — matches the Expanded poster in _buildGridCard
Expanded(
child: ClipRRect(
borderRadius: const BorderRadius.all(Radius.circular(8)),
child: const SkeletonLoader(child: SizedBox.expand()),
borderRadius: BorderRadius.all(Radius.circular(8)),
child: SkeletonLoader(child: SizedBox.expand()),
),
),
const SizedBox(height: 4),
SizedBox(height: 4),
// Title bar
SkeletonLoader(
borderRadius: const BorderRadius.all(Radius.circular(4)),
child: const SizedBox(height: 13, width: double.infinity),
borderRadius: BorderRadius.all(Radius.circular(4)),
child: SizedBox(height: 13, width: double.infinity),
),
const SizedBox(height: 3),
SizedBox(height: 3),
// Subtitle bar
FractionallySizedBox(
alignment: Alignment.centerLeft,
widthFactor: 0.6,
child: SkeletonLoader(
borderRadius: const BorderRadius.all(Radius.circular(4)),
child: const SizedBox(height: 11),
borderRadius: BorderRadius.all(Radius.circular(4)),
child: SizedBox(height: 11),
),
),
],
+17 -2
View File
@@ -528,6 +528,21 @@ class _MainScreenState extends State<MainScreen> with RouteAware, WindowListener
_isShowingProfileSelection = false;
}
/// IndexedStack that disables tickers for offscreen children to prevent
/// animation controllers on non-visible tabs from scheduling frames.
Widget _buildTickerAwareStack() {
return IndexedStack(
index: _currentIndex,
children: [
for (var i = 0; i < _screens.length; i++)
TickerMode(
enabled: i == _currentIndex,
child: _screens[i],
),
],
);
}
List<Widget> _buildScreens(bool offline) {
return [
for (final tab in _getVisibleTabs(offline))
@@ -945,7 +960,7 @@ class _MainScreenState extends State<MainScreen> with RouteAware, WindowListener
node: _contentFocusScope,
// No autofocus - we control focus programmatically to prevent
// autofocus from stealing focus back after setState() rebuilds
child: IndexedStack(index: _currentIndex, children: _screens),
child: _buildTickerAwareStack(),
),
),
),
@@ -990,7 +1005,7 @@ class _MainScreenState extends State<MainScreen> with RouteAware, WindowListener
return OverlaySheetHost(
child: Scaffold(
body: IndexedStack(index: _currentIndex, children: _screens),
body: _buildTickerAwareStack(),
bottomNavigationBar: Column(
mainAxisSize: MainAxisSize.min,
children: [
+26 -23
View File
@@ -84,7 +84,7 @@ class _MediaDetailScreenState extends State<MediaDetailScreen>
late final ScrollController _scrollController;
final ScrollController _extrasScrollController = ScrollController();
bool _watchStateChanged = false;
double _scrollOffset = 0;
final ValueNotifier<double> _scrollOffset = ValueNotifier<double>(0);
// Inline season tabs
int _selectedSeasonIndex = 0;
@@ -348,14 +348,13 @@ class _MediaDetailScreenState extends State<MediaDetailScreen>
}
void _onScroll() {
setState(() {
_scrollOffset = _scrollController.offset;
});
_scrollOffset.value = _scrollController.offset;
}
@override
void dispose() {
_scrollController.dispose();
_scrollOffset.dispose();
_extrasScrollController.dispose();
_extrasFocusNode.dispose();
_playButtonFocusNode.dispose();
@@ -1205,7 +1204,7 @@ class _MediaDetailScreenState extends State<MediaDetailScreen>
final isAlways = flattenSeasons == flattenSeasonsAlways;
final isSingleSeason = flattenSeasons == flattenSeasonsSingleSeason;
final shouldShowEpisodesDirectly =
isAlways || seasonsWithServerId.length <= 1 || (isSingleSeason && seasonsWithServerId.length == 1);
isAlways || seasonsWithServerId.isEmpty || (isSingleSeason && seasonsWithServerId.length == 1);
// Create focus nodes for season tabs
_updateSeasonTabFocusNodes(seasonsWithServerId.length);
@@ -2532,24 +2531,28 @@ class _MediaDetailScreenState extends State<MediaDetailScreen>
top: 0,
left: 0,
right: 0,
child: IgnorePointer(
ignoring: _scrollOffset < 50,
child: AnimatedOpacity(
opacity: (_scrollOffset / 100).clamp(0.0, 1.0),
duration: const Duration(milliseconds: 150),
child: Container(
height: MediaQuery.of(context).padding.top + 58,
decoration: BoxDecoration(
gradient: LinearGradient(
begin: Alignment.topCenter,
end: Alignment.bottomCenter,
colors: [
Theme.of(context).scaffoldBackgroundColor.withValues(alpha: 0.8),
Theme.of(context).scaffoldBackgroundColor.withValues(alpha: 0.5),
Theme.of(context).scaffoldBackgroundColor.withValues(alpha: 0),
],
stops: const [0.0, 0.3, 1.0],
),
child: ValueListenableBuilder<double>(
valueListenable: _scrollOffset,
builder: (context, offset, child) => IgnorePointer(
ignoring: offset < 50,
child: AnimatedOpacity(
opacity: (offset / 100).clamp(0.0, 1.0),
duration: const Duration(milliseconds: 150),
child: child!,
),
),
child: Container(
height: MediaQuery.of(context).padding.top + 58,
decoration: BoxDecoration(
gradient: LinearGradient(
begin: Alignment.topCenter,
end: Alignment.bottomCenter,
colors: [
Theme.of(context).scaffoldBackgroundColor.withValues(alpha: 0.8),
Theme.of(context).scaffoldBackgroundColor.withValues(alpha: 0.5),
Theme.of(context).scaffoldBackgroundColor.withValues(alpha: 0),
],
stops: const [0.0, 0.3, 1.0],
),
),
),
@@ -1,4 +1,5 @@
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:material_symbols_icons/symbols.dart';
import 'package:provider/provider.dart';
import '../../models/plex_home_user.dart';
@@ -37,6 +38,11 @@ class _ProfileSwitchScreenState extends State<ProfileSwitchScreen> {
return PopScope(
canPop: !widget.requireSelection || _allowPop,
onPopInvokedWithResult: (didPop, _) {
if (!didPop && widget.requireSelection) {
SystemNavigator.pop();
}
},
child: Consumer<UserProfileProvider>(
builder: (context, userProvider, child) {
final users = userProvider.home?.users ?? [];
@@ -44,6 +50,7 @@ class _ProfileSwitchScreenState extends State<ProfileSwitchScreen> {
return FocusedScrollScaffold(
title: Text(t.screens.switchProfile),
automaticallyImplyLeading: !widget.requireSelection,
onBackPressed: widget.requireSelection ? () => SystemNavigator.pop() : null,
slivers: [
if (userProvider.isLoading)
const SliverFillRemaining(child: Center(child: CircularProgressIndicator()))
+1
View File
@@ -226,6 +226,7 @@ class _SearchScreenState extends State<SearchScreen> with Refreshable, FullRefre
return Scaffold(
body: SafeArea(
child: CustomScrollView(
primary: false,
slivers: [
DesktopSliverAppBar(title: Text(t.common.search), floating: true),
SliverToBoxAdapter(
+35 -1
View File
@@ -91,6 +91,7 @@ class _SettingsScreenState extends State<SettingsScreen> with FocusableTab {
static const _kMpvConfig = 'mpv_config';
static const _kSmallSkipDuration = 'small_skip_duration';
static const _kLargeSkipDuration = 'large_skip_duration';
static const _kRewindOnResume = 'rewind_on_resume';
static const _kDefaultSleepTimer = 'default_sleep_timer';
static const _kMaxVolume = 'max_volume';
static const _kDiscordRichPresence = 'discord_rich_presence';
@@ -122,6 +123,7 @@ class _SettingsScreenState extends State<SettingsScreen> with FocusableTab {
int _bufferSize = 0;
int _seekTimeSmall = 10;
int _seekTimeLarge = 30;
int _rewindOnResume = 0;
int _sleepTimerDuration = 30;
bool _rememberTrackSelections = true;
bool _clickVideoTogglesPlayback = false;
@@ -201,6 +203,7 @@ class _SettingsScreenState extends State<SettingsScreen> with FocusableTab {
_bufferSize = _settingsService.getBufferSize();
_seekTimeSmall = _settingsService.getSeekTimeSmall();
_seekTimeLarge = _settingsService.getSeekTimeLarge();
_rewindOnResume = _settingsService.getRewindOnResume();
_sleepTimerDuration = _settingsService.getSleepTimerDuration();
_rememberTrackSelections = _settingsService.getRememberTrackSelections();
_clickVideoTogglesPlayback = _settingsService.getClickVideoTogglesPlayback();
@@ -235,6 +238,7 @@ class _SettingsScreenState extends State<SettingsScreen> with FocusableTab {
body: Focus(
onKeyEvent: _handleKeyEvent,
child: CustomScrollView(
primary: false,
slivers: [
ExcludeFocus(child: CustomAppBar(title: Text(t.settings.title), pinned: true)),
SliverPadding(
@@ -674,7 +678,7 @@ class _SettingsScreenState extends State<SettingsScreen> with FocusableTab {
await _settingsService.setEnableHardwareDecoding(value);
},
),
if (Platform.isAndroid || Platform.isIOS || Platform.isMacOS)
if ((Platform.isAndroid && !PlatformDetector.isTV()) || Platform.isIOS || Platform.isMacOS)
SwitchListTile(
focusNode: _focusTracker.get(_kAutoPip),
secondary: const AppIcon(Symbols.picture_in_picture_alt_rounded, fill: 1),
@@ -794,6 +798,14 @@ class _SettingsScreenState extends State<SettingsScreen> with FocusableTab {
trailing: const AppIcon(Symbols.chevron_right_rounded, fill: 1),
onTap: () => _showSeekTimeLargeDialog(),
),
ListTile(
focusNode: _focusTracker.get(_kRewindOnResume),
leading: const AppIcon(Symbols.replay_rounded, fill: 1),
title: Text(t.settings.rewindOnResume),
subtitle: Text(t.settings.secondsUnit(seconds: _rewindOnResume.toString())),
trailing: const AppIcon(Symbols.chevron_right_rounded, fill: 1),
onTap: () => _showRewindOnResumeDialog(),
),
ListTile(
focusNode: _focusTracker.get(_kDefaultSleepTimer),
leading: const AppIcon(Symbols.bedtime_rounded, fill: 1),
@@ -1038,6 +1050,11 @@ class _SettingsScreenState extends State<SettingsScreen> with FocusableTab {
selectedPath = await safService.pickDirectory();
if (selectedPath != null) {
pathType = 'saf';
} else if (PlatformDetector.isTV()) {
if (mounted) {
showErrorSnackBar(context, t.settings.downloadLocationSelectError);
}
return;
}
} else {
// Use file_picker on desktop
@@ -1625,6 +1642,23 @@ class _SettingsScreenState extends State<SettingsScreen> with FocusableTab {
);
}
void _showRewindOnResumeDialog() {
_showNumericInputDialog(
title: t.settings.rewindOnResume,
labelText: t.settings.secondsLabel,
suffixText: t.settings.secondsShort,
min: 0,
max: 10,
currentValue: _rewindOnResume,
onSave: (value) async {
setState(() {
_rewindOnResume = value;
_settingsService.setRewindOnResume(value);
});
},
);
}
void _showSleepTimerDurationDialog() {
_showNumericInputDialog(
title: t.settings.defaultSleepTimer,
+171 -381
View File
@@ -42,7 +42,7 @@ import '../services/playback_progress_tracker.dart';
import '../services/offline_watch_sync_service.dart';
import '../services/settings_service.dart';
import '../services/sleep_timer_service.dart';
import '../services/track_selection_service.dart';
import '../services/track_manager.dart';
import '../services/ambient_lighting_service.dart';
import '../services/video_filter_manager.dart';
import '../services/video_pip_manager.dart';
@@ -57,9 +57,7 @@ import '../utils/player_utils.dart';
import '../utils/orientation_helper.dart';
import '../utils/platform_detector.dart';
import '../utils/provider_extensions.dart';
import '../utils/language_codes.dart';
import '../utils/snackbar_helper.dart';
import '../utils/track_label_builder.dart';
import '../utils/plex_url_helper.dart';
import '../utils/video_player_navigation.dart';
import '../widgets/overlay_sheet.dart';
@@ -150,10 +148,10 @@ class VideoPlayerScreenState extends State<VideoPlayerScreen> with WidgetsBindin
StreamSubscription<bool>? _completedSubscription;
StreamSubscription<dynamic>? _mediaControlSubscription;
StreamSubscription<bool>? _bufferingSubscription;
StreamSubscription<Tracks>? _trackLoadingSubscription;
StreamSubscription<Duration>? _positionSubscription;
StreamSubscription<void>? _playbackRestartSubscription;
StreamSubscription<void>? _backendSwitchedSubscription;
TrackManager? _trackManager;
StreamSubscription<PlayerLog>? _logSubscription;
StreamSubscription<void>? _sleepTimerSubscription;
StreamSubscription<bool>? _mediaControlsPlayingSubscription;
@@ -163,8 +161,6 @@ class VideoPlayerScreenState extends State<VideoPlayerScreen> with WidgetsBindin
StreamSubscription<Map<String, bool>>? _serverStatusSubscription;
bool _isReplacingWithVideo = false; // Flag to skip orientation restoration during video-to-video navigation
bool _isDisposingForNavigation = false;
bool _waitingForExternalSubsTrackSelection = false;
bool _isApplyingTrackSelection = false;
bool _isHandlingBack = false;
BifThumbnailService? _bifService;
@@ -204,7 +200,9 @@ class VideoPlayerScreenState extends State<VideoPlayerScreen> with WidgetsBindin
// App lifecycle state tracking
bool _wasPlayingBeforeInactive = false;
bool _hiddenForBackground = false;
bool _autoPipEnabled = false;
int _rewindOnResume = 0;
/// Whether to skip lifecycle actions because PiP is active or about to start.
/// iOS auto-PiP is system-initiated during the background transition, so
@@ -344,10 +342,9 @@ class VideoPlayerScreenState extends State<VideoPlayerScreen> with WidgetsBindin
// Don't pause - user may still be watching
break;
case AppLifecycleState.hidden:
// App is being hidden (user is switching away)
// Pause video since we don't support background playback (mobile only)
if (_shouldSkipForPip) break;
// Pause video on mobile (we don't support background playback)
if (PlatformDetector.isMobile(context)) {
if (_shouldSkipForPip) break;
if (player != null && _isPlayerInitialized) {
_wasPlayingBeforeInactive = player!.state.playing;
if (_wasPlayingBeforeInactive) {
@@ -356,6 +353,13 @@ class VideoPlayerScreenState extends State<VideoPlayerScreen> with WidgetsBindin
}
}
}
// Hide render layer to stop Vulkan present loop and gate native events
if (player != null && _isPlayerInitialized) {
player!.setVisible(false);
_hiddenForBackground = true;
_liveTimelineTimer?.cancel();
appLogger.d('Render layer hidden due to app being hidden');
}
break;
case AppLifecycleState.paused:
if (_shouldSkipForPip) break;
@@ -367,6 +371,15 @@ class VideoPlayerScreenState extends State<VideoPlayerScreen> with WidgetsBindin
appLogger.d('Media controls cleared and wakelock disabled due to app being paused/backgrounded');
break;
case AppLifecycleState.resumed:
// Restore render layer if it was hidden for background
if (_hiddenForBackground && player != null && _isPlayerInitialized) {
player!.setVisible(true);
_hiddenForBackground = false;
if (_liveSessionIdentifier != null) {
_startLiveTimelineUpdates();
}
appLogger.d('Render layer restored after app resumed');
}
// Restore media controls and wakelock when app is resumed
if (_isPlayerInitialized && mounted) {
unawaited(_restoreMediaControlsAfterResume());
@@ -378,35 +391,13 @@ class VideoPlayerScreenState extends State<VideoPlayerScreen> with WidgetsBindin
}
}
/// Converts a 2-letter code like "fr", "nl", "ca" to a Plex 3-letter code, or returns null if unknown
String? _iso6391ToPlex6392(String? code) {
if (code == null || code.isEmpty) return null;
// Takes the base "fr" from "fr-FR"
final lang = code.split('-').first.toLowerCase();
// Use LanguageCodes utility to get variations and find the 639-2 code
try {
final variations = LanguageCodes.getVariations(lang);
// The getVariations method returns all variations including 639-2 codes
// We need to find the 3-letter code from the variations
for (final variation in variations) {
if (variation.length == 3) {
return variation;
}
}
return null;
} catch (e) {
// If LanguageCodes is not initialized or fails, return null
return null;
}
}
Future<void> _initializePlayer() async {
try {
// Load buffer size from settings
final settingsService = await SettingsService.getInstance();
_videoPlayerNavigationEnabled = settingsService.getVideoPlayerNavigationEnabled();
_autoPipEnabled = settingsService.getAutoPip();
_rewindOnResume = settingsService.getRewindOnResume();
final bufferSizeMB = settingsService.getBufferSize();
final enableHardwareDecoding = settingsService.getEnableHardwareDecoding();
final debugLoggingEnabled = settingsService.getEnableDebugLogging();
@@ -632,10 +623,7 @@ class VideoPlayerScreenState extends State<VideoPlayerScreen> with WidgetsBindin
await _applyFrameRateMatching();
}
}
if (_waitingForExternalSubsTrackSelection) {
_waitingForExternalSubsTrackSelection = false;
_applyTrackSelection();
}
_trackManager?.onPlaybackRestart();
});
// Listen to position for completion detection (fallback for unreliable MPV events)
@@ -644,6 +632,12 @@ class VideoPlayerScreenState extends State<VideoPlayerScreen> with WidgetsBindin
// offline Android playback flows). Prevents a permanent loading spinner.
if (!_hasFirstFrame.value && position.inMilliseconds > 0) {
_hasFirstFrame.value = true;
// Apply frame rate matching here too, since this fallback may fire
// before playbackRestart (race condition with resume positions > 0)
if (Platform.isAndroid && settingsService.getMatchContentFrameRate()) {
_applyFrameRateMatching();
}
}
final duration = player!.state.duration;
@@ -675,6 +669,7 @@ class VideoPlayerScreenState extends State<VideoPlayerScreen> with WidgetsBindin
/// Apply frame rate matching on Android by setting the display refresh rate
/// to match the video content's frame rate.
int _frameRateRetries = 0;
Future<void> _applyFrameRateMatching() async {
if (player == null || !Platform.isAndroid) return;
@@ -682,10 +677,20 @@ class VideoPlayerScreenState extends State<VideoPlayerScreen> with WidgetsBindin
final fpsStr = await player!.getProperty('container-fps');
final fps = double.tryParse(fpsStr ?? '');
if (fps == null || fps <= 0) {
// ExoPlayer detects FPS from frame timestamps after ~8 rendered frames.
// STATE_READY fires before frames render, so retry until detection completes.
if (player is PlayerAndroid && _frameRateRetries < 10) {
_frameRateRetries++;
Future.delayed(const Duration(milliseconds: 500), () {
if (mounted && player != null) _applyFrameRateMatching();
});
return;
}
appLogger.d('Frame rate matching: No valid fps available ($fpsStr)');
return;
}
_frameRateRetries = 0;
final durationMs = player!.state.duration.inMilliseconds;
await player!.setVideoFrameRate(fps, durationMs);
@@ -713,29 +718,6 @@ class VideoPlayerScreenState extends State<VideoPlayerScreen> with WidgetsBindin
}
}
/// Add external subtitle tracks to the player
Future<void> _addExternalSubtitles(List<SubtitleTrack> externalSubtitles) async {
if (player == null || externalSubtitles.isEmpty) return;
appLogger.d('Adding ${externalSubtitles.length} external subtitle(s) to player');
for (final subtitleTrack in externalSubtitles) {
if (subtitleTrack.uri == null) continue;
try {
await player!.addSubtitleTrack(
uri: subtitleTrack.uri!,
title: subtitleTrack.title,
language: subtitleTrack.language,
select: false, // Don't auto-select
);
appLogger.d('Added external subtitle: ${subtitleTrack.title ?? subtitleTrack.uri}');
} catch (e) {
appLogger.w('Failed to add external subtitle: ${subtitleTrack.title ?? subtitleTrack.uri}', error: e);
}
}
}
/// Initialize the service layer
Future<void> _initializeServices() async {
if (!mounted || player == null) return;
@@ -777,7 +759,8 @@ class VideoPlayerScreenState extends State<VideoPlayerScreen> with WidgetsBindin
if (event is PlayEvent) {
appLogger.d('Media control: Play event received');
currentPlayer!.play();
_seekBackForRewind(currentPlayer!);
currentPlayer.play();
_wasPlayingBeforeInactive = false;
_updateMediaControlsPlaybackState();
} else if (event is PauseEvent) {
@@ -789,6 +772,7 @@ class VideoPlayerScreenState extends State<VideoPlayerScreen> with WidgetsBindin
if (currentPlayer!.state.playing) {
currentPlayer.pause();
} else {
_seekBackForRewind(currentPlayer);
currentPlayer.play();
_wasPlayingBeforeInactive = false;
}
@@ -950,15 +934,19 @@ class VideoPlayerScreenState extends State<VideoPlayerScreen> with WidgetsBindin
if (episodes.isEmpty) return;
// Sort by season then episode number, with Season 0 (Specials) at the end
// Sort by aired date, falling back to season/episode number
final sorted = List<PlexMetadata>.from(episodes)
..sort((a, b) {
final aIsSpecial = (a.parentIndex ?? 0) == 0;
final bIsSpecial = (b.parentIndex ?? 0) == 0;
if (aIsSpecial != bIsSpecial) return aIsSpecial ? 1 : -1;
final seasonCmp = (a.parentIndex ?? 0).compareTo(b.parentIndex ?? 0);
if (seasonCmp != 0) return seasonCmp;
return (a.index ?? 0).compareTo(b.index ?? 0);
final aDate = a.originallyAvailableAt ?? '';
final bDate = b.originallyAvailableAt ?? '';
if (aDate.isEmpty && bDate.isEmpty) {
final seasonCmp = (a.parentIndex ?? 0).compareTo(b.parentIndex ?? 0);
if (seasonCmp != 0) return seasonCmp;
return (a.index ?? 0).compareTo(b.index ?? 0);
}
if (aDate.isEmpty) return 1;
if (bDate.isEmpty) return -1;
return aDate.compareTo(bDate);
});
// Find current episode in the sorted list
@@ -1014,15 +1002,17 @@ class VideoPlayerScreenState extends State<VideoPlayerScreen> with WidgetsBindin
_livePlaybackStartTime = DateTime.now();
await player!.open(Media(streamUrl, headers: const {'Accept-Language': 'en'}), play: true, isLive: true);
_trackManager?.cacheExternalSubtitles(const []);
if (mounted) {
setState(() {
_availableVersions = [];
_currentMediaInfo = null;
_isPlayerInitialized = true;
});
_trackManager?.mediaInfo = null;
}
_startLiveTimelineUpdates();
} catch (e) {
appLogger.e('Failed to start live TV playback', error: e);
_sendLiveTimeline('stopped');
@@ -1059,8 +1049,9 @@ class VideoPlayerScreenState extends State<VideoPlayerScreen> with WidgetsBindin
// Open video through Player
if (result.videoUrl != null) {
// Reset first frame flag for new video
// Reset first frame flag and frame rate retry counter for new video
_hasFirstFrame.value = false;
_frameRateRetries = 0;
// Request audio focus before starting playback (Android)
// This causes other media apps (Spotify, podcasts, etc.) to pause
@@ -1088,13 +1079,16 @@ class VideoPlayerScreenState extends State<VideoPlayerScreen> with WidgetsBindin
'reconnect=1,reconnect_on_network_error=1,reconnect_streamed=1,reconnect_delay_max=600');
}
// If we have external subtitles, open paused to add them before playback starts.
// This prevents a race condition on Android where adding subtitle tracks
// during active playback can freeze the video decoder (issue #226).
final hasExternalSubs = result.externalSubtitles.isNotEmpty;
final isExoPlayer = player is PlayerAndroid;
// ExoPlayer: attach external subs at open time so it discovers
// them in a single prepare() — no media reload needed for selection.
// MPV (all platforms including Android): external subs added after open via sub-add.
await player!.open(
Media(result.videoUrl!, start: resumePosition, headers: plexHeaders),
play: !hasExternalSubs,
play: isExoPlayer || !hasExternalSubs,
externalSubtitles: isExoPlayer && hasExternalSubs ? result.externalSubtitles : null,
);
// Apply subtitle styling to ExoPlayer native layer (CaptionStyleCompat + libass font scale)
@@ -1186,25 +1180,41 @@ class VideoPlayerScreenState extends State<VideoPlayerScreen> with WidgetsBindin
}
}
// Add external subtitles while paused, then start playback
if (result.externalSubtitles.isNotEmpty) {
// Track manager: owns track selection, external subtitle loading, and server sync
_trackManager = TrackManager(
player: player!,
isActive: () => mounted && player != null,
getClient: () => _getClientForMetadata(context),
getProfileSettings: () => context.read<UserProfileProvider>().profileSettings,
waitForProfileSettings: _waitForProfileSettingsIfNeeded,
metadata: widget.metadata,
mediaInfo: _currentMediaInfo,
preferredAudioTrack: widget.preferredAudioTrack,
preferredSubtitleTrack: widget.preferredSubtitleTrack,
preferredSecondarySubtitleTrack: widget.preferredSecondarySubtitleTrack,
showMessage: (message, {duration}) {
if (mounted) showAppSnackBar(context, message, duration: duration);
},
);
// Store external subtitles for re-use after backend fallback
_trackManager!.cacheExternalSubtitles(result.externalSubtitles);
// MPV with external subs: add after open via sub-add,
// opened paused to avoid race condition (issue #226)
if (player is! PlayerAndroid && result.externalSubtitles.isNotEmpty) {
_hasFirstFrame.value = false;
_waitingForExternalSubsTrackSelection = true;
_trackManager!.waitingForExternalSubsTrackSelection = true;
try {
await _addExternalSubtitles(result.externalSubtitles);
await _trackManager!.addExternalSubtitles(result.externalSubtitles);
} finally {
await _resumeAfterSubtitleLoad();
await _trackManager!.resumeAfterSubtitleLoad();
}
} else {
_trackLoadingSubscription?.cancel();
_trackLoadingSubscription = player!.streams.tracks.listen((tracks) {
if (tracks.audio.isEmpty && tracks.subtitle.isEmpty) return;
_trackLoadingSubscription?.cancel();
_trackLoadingSubscription = null;
_applyTrackSelection();
});
// Android (subs attached at open time) or no external subs:
// apply once tracks are available
_trackManager!.applyTrackSelectionWhenReady();
}
}
} on PlaybackException catch (e) {
@@ -1220,27 +1230,6 @@ class VideoPlayerScreenState extends State<VideoPlayerScreen> with WidgetsBindin
}
}
/// Resume playback after external subtitles have been loaded (or failed to load).
Future<void> _resumeAfterSubtitleLoad() async {
if (player == null || !mounted) return;
await player!.play();
final pos = player!.state.position;
try {
await player!.seek(pos.inMilliseconds > 0 ? pos : Duration.zero);
} catch (e) {
appLogger.w('Non-critical seek after subtitle load failed', error: e);
}
// Fallback if playbackRestart doesn't fire
Future.delayed(const Duration(seconds: 3), () {
if (_waitingForExternalSubsTrackSelection && mounted) {
_waitingForExternalSubsTrackSelection = false;
_applyTrackSelection();
}
});
}
/// Start playback for offline/downloaded content
Future<PlaybackInitializationResult> _startOfflinePlayback() async {
final downloadProvider = context.read<DownloadProvider>();
@@ -1643,45 +1632,9 @@ class VideoPlayerScreenState extends State<VideoPlayerScreen> with WidgetsBindin
_companionRemoteProvider = null;
}
void _cycleSubtitleTrack() {
if (player == null) return;
final tracks = player!.state.tracks.subtitle.where((t) => t.id != 'auto').toList();
if (tracks.isEmpty) return;
void _cycleSubtitleTrack() => _trackManager?.cycleSubtitleTrack();
final current = player!.state.track.subtitle;
// tracks includes 'no' (off). Find current index and advance.
final currentIndex = tracks.indexWhere((t) => t.id == current?.id);
final nextIndex = (currentIndex + 1) % tracks.length;
final next = tracks[nextIndex];
player!.selectSubtitleTrack(next);
_onSubtitleTrackChanged(next);
if (mounted) {
final label = next.id == 'no'
? 'Subtitles: Off'
: 'Subtitles: ${TrackLabelBuilder.buildSubtitleLabel(title: next.title, language: next.language, codec: next.codec, index: nextIndex)}';
showAppSnackBar(context, label, duration: const Duration(seconds: 1));
}
}
void _cycleAudioTrack() {
if (player == null) return;
final tracks = player!.state.tracks.audio.where((t) => t.id != 'auto' && t.id != 'no').toList();
if (tracks.length <= 1) return;
final current = player!.state.track.audio;
final currentIndex = tracks.indexWhere((t) => t.id == current?.id);
final nextIndex = (currentIndex + 1) % tracks.length;
final next = tracks[nextIndex];
player!.selectAudioTrack(next);
_onAudioTrackChanged(next);
if (mounted) {
final label =
'Audio: ${TrackLabelBuilder.buildAudioLabel(title: next.title, language: next.language, codec: next.codec, channelsCount: next.channelsCount, index: nextIndex)}';
showAppSnackBar(context, label, duration: const Duration(seconds: 1));
}
}
void _cycleAudioTrack() => _trackManager?.cycleAudioTrack();
Future<void> _toggleFullscreen() async {
if (PlatformDetector.isMobile(context)) return;
@@ -1797,7 +1750,7 @@ class VideoPlayerScreenState extends State<VideoPlayerScreen> with WidgetsBindin
_errorSubscription?.cancel();
_mediaControlSubscription?.cancel();
_bufferingSubscription?.cancel();
_trackLoadingSubscription?.cancel();
_trackManager?.dispose();
_positionSubscription?.cancel();
_playbackRestartSubscription?.cancel();
_backendSwitchedSubscription?.cancel();
@@ -1923,6 +1876,10 @@ class VideoPlayerScreenState extends State<VideoPlayerScreen> with WidgetsBindin
}
void _onVideoCompleted(bool completed) async {
// Live TV streams are continuous — ignore spurious EOF events caused by
// inter-segment gaps in the chunked MKV transcode stream.
if (widget.isLive) return;
if (completed &&
_nextEpisode != null &&
!_showPlayNextDialog &&
@@ -1975,12 +1932,12 @@ class VideoPlayerScreenState extends State<VideoPlayerScreen> with WidgetsBindin
}
/// Handle notification when native player switched from ExoPlayer to MPV
void _onBackendSwitched() {
appLogger.i('Player backend switched from ExoPlayer to MPV (native fallback)');
Future<void> _onBackendSwitched() async {
if (mounted) {
showAppSnackBar(context, t.messages.switchingToCompatiblePlayer);
}
await _trackManager?.onBackendSwitched();
}
// OS Media Controls Integration
@@ -2003,6 +1960,12 @@ class VideoPlayerScreenState extends State<VideoPlayerScreen> with WidgetsBindin
);
}
Future<void> _seekBackForRewind(Player p) async {
if (_rewindOnResume <= 0) return;
final target = p.state.position - Duration(seconds: _rewindOnResume);
await p.seek(clampSeekPosition(p, target));
}
Future<void> _restoreMediaControlsAfterResume() async {
if (!_isPlayerInitialized || !mounted) return;
@@ -2024,6 +1987,7 @@ class VideoPlayerScreenState extends State<VideoPlayerScreen> with WidgetsBindin
if (_wasPlayingBeforeInactive) {
try {
await _seekBackForRewind(currentPlayer);
await currentPlayer.play();
appLogger.d('Video resumed after returning from inactive state');
} catch (e) {
@@ -2092,8 +2056,15 @@ class VideoPlayerScreenState extends State<VideoPlayerScreen> with WidgetsBindin
final state = player?.state.playing == true ? 'playing' : 'paused';
_sendLiveTimeline(state);
});
// Send initial heartbeat immediately
_sendLiveTimeline('playing');
// Delay initial heartbeat to let the transcode session stabilize.
// Sending time=0 immediately after player.open() causes the server
// to spawn a duplicate transcode job with offset=-1 that 404s.
Future.delayed(const Duration(seconds: 3), () {
if (_liveTimelineTimer != null) {
final state = player?.state.playing == true ? 'playing' : 'paused';
_sendLiveTimeline(state);
}
});
}
void _stopLiveTimelineUpdates() {
@@ -2154,7 +2125,7 @@ class VideoPlayerScreenState extends State<VideoPlayerScreen> with WidgetsBindin
final p = player!;
// FFmpeg HTTP protocol reconnection
await p.setProperty('stream-lavf-o',
'reconnect=1,reconnect_at_eof=1,reconnect_streamed=1,reconnect_on_network_error=1,reconnect_delay_max=30');
'reconnect=1,reconnect_streamed=1,reconnect_on_network_error=1,reconnect_delay_max=30');
// Demuxer: retry up to 1000 times on stream reload failures
await p.setProperty('demuxer-lavf-o', 'max_reload=1000');
await p.setProperty('force-seekable', 'no');
@@ -2347,203 +2318,11 @@ class VideoPlayerScreenState extends State<VideoPlayerScreen> with WidgetsBindin
}
}
/// Apply track selection using the TrackSelectionService
Future<void> _applyTrackSelection() async {
if (!mounted || player == null || _isApplyingTrackSelection) return;
Future<void> _onAudioTrackChanged(AudioTrack track) async => _trackManager?.onAudioTrackChanged(track);
_isApplyingTrackSelection = true;
try {
await _waitForProfileSettingsIfNeeded();
if (!mounted || player == null) return;
Future<void> _onSubtitleTrackChanged(SubtitleTrack track) async => _trackManager?.onSubtitleTrackChanged(track);
final profileSettings = context.read<UserProfileProvider>().profileSettings;
final settingsService = await SettingsService.getInstance();
if (!mounted || player == null) return;
final trackService = TrackSelectionService(
player: player!,
profileSettings: profileSettings,
metadata: widget.metadata,
plexMediaInfo: _currentMediaInfo,
);
await trackService.selectAndApplyTracks(
preferredAudioTrack: widget.preferredAudioTrack,
preferredSubtitleTrack: widget.preferredSubtitleTrack,
preferredSecondarySubtitleTrack: widget.preferredSecondarySubtitleTrack,
defaultPlaybackSpeed: settingsService.getDefaultPlaybackSpeed(),
onAudioTrackChanged: _onAudioTrackChanged,
onSubtitleTrackChanged: _onSubtitleTrackChanged,
);
} catch (e) {
appLogger.w('Failed to apply track selection', error: e);
} finally {
_isApplyingTrackSelection = false;
}
}
/// Rating key used for series/movie level language preferences.
String get _preferenceRatingKey {
return widget.metadata.isEpisode
? (widget.metadata.grandparentRatingKey ?? widget.metadata.ratingKey)
: widget.metadata.ratingKey;
}
/// Common guard checks for track change handlers.
/// Returns the part ID if all checks pass, or null if the change should be skipped.
Future<int?> _guardTrackChange() async {
final settings = await SettingsService.getInstance();
if (!settings.getRememberTrackSelections()) return null;
if (_currentMediaInfo == null) {
appLogger.w('No media info available, cannot save stream selection');
return null;
}
final partId = _currentMediaInfo!.getPartId();
if (partId == null) {
appLogger.w('No part ID available, cannot save stream selection');
}
return partId;
}
/// Save language preference and stream selection to the server.
Future<void> _saveTrackPreferences({
required int partId,
required String trackType,
String? languageCode,
int? streamID,
}) async {
try {
if (!mounted) return;
final client = _getClientForMetadata(context);
final ratingKey = _preferenceRatingKey;
final futures = <Future>[];
if (languageCode != null && (trackType == 'subtitle' || languageCode.isNotEmpty)) {
futures.add(
trackType == 'audio'
? client.setMetadataPreferences(ratingKey, audioLanguage: languageCode)
: client.setMetadataPreferences(ratingKey, subtitleLanguage: languageCode),
);
}
if (streamID != null) {
futures.add(
trackType == 'audio'
? client.selectStreams(partId, audioStreamID: streamID, allParts: true)
: client.selectStreams(partId, subtitleStreamID: streamID, allParts: true),
);
}
await Future.wait(futures);
appLogger.d('Successfully saved $trackType preferences (language + stream)');
} catch (e) {
appLogger.e('Failed to save $trackType preferences', error: e);
}
}
/// Match an mpv track against Plex tracks by language and title.
int? _matchTrackByAttributes<T>({
required String? mpvLanguage,
required String? mpvTitle,
required List<T> plexTracks,
required String? Function(T) getLanguageCode,
required String? Function(T) getDisplayTitle,
required String? Function(T) getTitle,
required int Function(T) getId,
}) {
final normalizedLang = _iso6391ToPlex6392(mpvLanguage);
for (final plexTrack in plexTracks) {
final matchLang = getLanguageCode(plexTrack) == normalizedLang;
final matchTitle = (mpvTitle == null || mpvTitle.isEmpty)
? true
: (getDisplayTitle(plexTrack) == mpvTitle || getTitle(plexTrack) == mpvTitle);
if (matchLang && matchTitle) {
return getId(plexTrack);
}
}
return null;
}
/// Handle audio track changes from the user - save both stream selection and language preference
Future<void> _onAudioTrackChanged(AudioTrack track) async {
final partId = await _guardTrackChange();
if (partId == null) return;
int? streamID = _matchTrackByAttributes(
mpvLanguage: track.language,
mpvTitle: track.title,
plexTracks: _currentMediaInfo!.audioTracks,
getLanguageCode: (t) => t.languageCode,
getDisplayTitle: (t) => t.displayTitle,
getTitle: (t) => t.title,
getId: (t) => t.id,
);
if (streamID != null) {
appLogger.d('Matched audio by lang/title: streamID $streamID');
} else {
final matchedPlex = findPlexTrackForMpvAudio(track, _currentMediaInfo!.audioTracks);
streamID = matchedPlex?.id;
if (streamID != null) {
appLogger.d('Matched audio by properties: streamID $streamID');
} else {
appLogger.e('Could not match audio track to any Plex track');
}
}
await _saveTrackPreferences(partId: partId, trackType: 'audio', languageCode: track.language, streamID: streamID);
}
/// Handle subtitle track changes from the user - save both stream selection and language preference
Future<void> _onSubtitleTrackChanged(SubtitleTrack track) async {
final partId = await _guardTrackChange();
if (partId == null) return;
String? languageCode;
int? streamID;
if (track.id == 'no') {
languageCode = 'none';
streamID = 0;
appLogger.i('User turned subtitles off, saving preference');
} else {
languageCode = track.language;
streamID = _matchTrackByAttributes(
mpvLanguage: track.language,
mpvTitle: track.title,
plexTracks: _currentMediaInfo!.subtitleTracks,
getLanguageCode: (t) => t.languageCode,
getDisplayTitle: (t) => t.displayTitle,
getTitle: (t) => t.title,
getId: (t) => t.id,
);
if (streamID != null) {
appLogger.d('Matched subtitle by lang/title: streamID $streamID');
} else {
final matchedPlex = findPlexTrackForMpvSubtitle(track, _currentMediaInfo!.subtitleTracks);
streamID = matchedPlex?.id;
if (streamID != null) {
appLogger.d('Matched subtitle by properties: streamID $streamID');
} else {
appLogger.e('Could not match subtitle track to any Plex track');
}
}
}
await _saveTrackPreferences(partId: partId, trackType: 'subtitle', languageCode: languageCode, streamID: streamID);
}
/// Handle secondary subtitle track changes - no server save needed, just preserve for episode navigation
void _onSecondarySubtitleTrackChanged(SubtitleTrack track) {
// Secondary subtitle preference is carried via player.state.track.secondarySubtitle
// which is automatically read during episode navigation. No additional state needed.
}
void _onSecondarySubtitleTrackChanged(SubtitleTrack track) => _trackManager?.onSecondarySubtitleTrackChanged(track);
/// Set flag to skip orientation restoration when replacing with another video
void setReplacingWithVideo() {
@@ -3141,43 +2920,54 @@ class VideoPlayerScreenState extends State<VideoPlayerScreen> with WidgetsBindin
);
},
),
// Watch Together: reconnecting to host overlay
Consumer<WatchTogetherProvider>(
builder: (context, provider, child) {
if (!provider.isWaitingForHostReconnect) return const SizedBox.shrink();
return Positioned(
bottom: 120,
left: 0,
right: 0,
child: Center(
child: Container(
padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 8),
decoration: const BoxDecoration(
color: Colors.black54,
borderRadius: BorderRadius.all(Radius.circular(20)),
),
child: Row(
mainAxisSize: MainAxisSize.min,
children: [
const SizedBox(
width: 14,
height: 14,
child: CircularProgressIndicator(strokeWidth: 2, color: Colors.white),
// Watch Together overlays (isolated from video surface repaints)
RepaintBoundary(
child: Stack(
children: [
// Watch Together: reconnecting to host overlay
Selector<WatchTogetherProvider, bool>(
selector: (_, provider) => provider.isWaitingForHostReconnect,
builder: (context, isWaiting, child) {
if (!isWaiting) return const SizedBox.shrink();
return Positioned(
bottom: 120,
left: 0,
right: 0,
child: Center(
child: Container(
padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 8),
decoration: const BoxDecoration(
color: Colors.black54,
borderRadius: BorderRadius.all(Radius.circular(20)),
),
child: Row(
mainAxisSize: MainAxisSize.min,
children: [
if (PlatformDetector.isTV())
const Icon(Symbols.sync_rounded, size: 14, color: Colors.white)
else
const SizedBox(
width: 14,
height: 14,
child: CircularProgressIndicator(strokeWidth: 2, color: Colors.white),
),
const SizedBox(width: 8),
Text(
t.watchTogether.reconnectingToHost,
style: const TextStyle(color: Colors.white, fontSize: 12),
),
],
),
),
const SizedBox(width: 8),
Text(
t.watchTogether.reconnectingToHost,
style: const TextStyle(color: Colors.white, fontSize: 12),
),
],
),
),
),
);
},
),
);
},
// Watch Together: participant join/leave notifications
const ParticipantNotificationOverlay(),
],
),
),
// Watch Together: participant join/leave notifications
const ParticipantNotificationOverlay(),
// Black overlay during exit (no spinner - just covers transparency)
ValueListenableBuilder<bool>(
valueListenable: _isExiting,
+2 -2
View File
@@ -1,4 +1,4 @@
import 'dart:isolate';
import '../utils/isolate_helper.dart';
import 'dart:typed_data';
import 'plex_client.dart';
@@ -76,7 +76,7 @@ class BifThumbnailService {
appLogger.w('BIF file too large (${bytes.length} bytes), skipping');
return;
}
_entries = await Isolate.run(() => _parseBifBytes(bytes));
_entries = await tryIsolateRun(() => _parseBifBytes(bytes));
} catch (e) {
appLogger.w('BIF download/parse failed', error: e);
}
@@ -1085,6 +1085,7 @@ class DownloadManagerService {
String? errorMessage,
String? currentFile,
}) {
if (_disposed) return;
_progressController.add(
DownloadProgress(
globalKey: globalKey,
@@ -1118,6 +1119,7 @@ class DownloadManagerService {
/// Emit progress update with artwork paths so DownloadProvider can sync
void _emitProgressWithArtwork(String globalKey, {String? thumbPath}) {
if (_disposed) return;
// Emit a progress update containing artwork path
// The status is preserved as downloading since artwork is just one step
_progressController.add(
@@ -1263,6 +1265,7 @@ class DownloadManagerService {
/// Emit deletion progress update
void _emitDeletionProgress(DeletionProgress progress) {
if (_disposed) return;
_deletionProgressController.add(progress);
}
+2 -2
View File
@@ -290,12 +290,12 @@ class KeyboardShortcutsService {
onPreviousChapter?.call();
break;
case 'speed_increase':
final newRateUp = (player.state.rate + 0.1).clamp(0.1, 3.0);
final newRateUp = (player.state.rate + 0.25).clamp(0.25, 3.0);
player.setRate(newRateUp);
_settingsService.setDefaultPlaybackSpeed(newRateUp);
break;
case 'speed_decrease':
final newRateDown = (player.state.rate - 0.1).clamp(0.1, 3.0);
final newRateDown = (player.state.rate - 0.25).clamp(0.25, 3.0);
player.setRate(newRateDown);
_settingsService.setDefaultPlaybackSpeed(newRateDown);
break;
+4 -4
View File
@@ -1,5 +1,5 @@
import 'dart:convert';
import 'dart:isolate';
import '../utils/isolate_helper.dart';
import 'package:drift/drift.dart';
@@ -42,7 +42,7 @@ class PlexApiCache {
final result = await (_db.select(_db.apiCache)..where((t) => t.cacheKey.equals(key))).getSingleOrNull();
if (result != null) {
return await Isolate.run(() => jsonDecode(result.data) as Map<String, dynamic>);
return await tryIsolateRun(() => jsonDecode(result.data) as Map<String, dynamic>);
}
return null;
}
@@ -50,7 +50,7 @@ class PlexApiCache {
/// Cache a response for an endpoint
Future<void> put(String serverId, String endpoint, Map<String, dynamic> data) async {
final key = _buildKey(serverId, endpoint);
final encoded = await Isolate.run(() => jsonEncode(data));
final encoded = await tryIsolateRun(() => jsonEncode(data));
await _db
.into(_db.apiCache)
.insertOnConflictUpdate(ApiCacheCompanion(cacheKey: Value(key), data: Value(encoded), cachedAt: Value(DateTime.now())));
@@ -145,7 +145,7 @@ class PlexApiCache {
if (entries.isEmpty) return {};
return await Isolate.run(() {
return await tryIsolateRun(() {
final result = <String, PlexMetadata>{};
for (final (serverId, ratingKey, rawData) in entries) {
try {
+41 -26
View File
@@ -1,6 +1,6 @@
import 'dart:async';
import 'dart:convert';
import 'dart:isolate';
import '../utils/isolate_helper.dart';
import 'dart:math';
import 'package:flutter/foundation.dart';
@@ -112,7 +112,7 @@ class ConnectionTestResult {
ConnectionTestResult({required this.success, required this.latencyMs, this.error});
}
// Top-level function required by compute()
// Top-level function required by tryIsolateRun()
String _decodeUtf8(List<int> bytes) {
return utf8.decode(bytes, allowMalformed: true);
}
@@ -158,7 +158,7 @@ class PlexClient {
ResponseBody responseBody,
) {
if (responseBytes.length > 50 * 1024) {
return compute(_decodeUtf8, responseBytes);
return tryIsolateRun(() => _decodeUtf8(responseBytes));
}
return utf8.decode(responseBytes, allowMalformed: true);
}
@@ -735,9 +735,7 @@ class PlexClient {
}
try {
final response = await networkCall();
if (cacheResponse && response.data != null) {
await _cache.put(serverId, cacheKey, response.data);
}
if (cacheResponse) await _cacheResponseData(cacheKey, response.data);
return parseResponse(response);
} catch (e) {
// On forceRefresh, still try cache as last resort on network error
@@ -763,12 +761,18 @@ class PlexClient {
if (cached != null) return parseCache(cached);
if (_offlineMode) return null;
final response = await networkCall();
if (cacheResponse && response.data != null) {
await _cache.put(serverId, cacheKey, response.data);
}
if (cacheResponse) await _cacheResponseData(cacheKey, response.data);
return parseResponse(response);
}
Future<void> _cacheResponseData(String cacheKey, dynamic data) async {
if (data is Map<String, dynamic>) {
await _cache.put(serverId, cacheKey, data);
} else if (data != null) {
appLogger.w('Unexpected response type for $cacheKey: ${data.runtimeType}');
}
}
/// Get first metadata JSON from response data
Map<String, dynamic>? _getFirstMetadataJsonFromData(Map<String, dynamic>? data) =>
PlexCacheParser.extractFirstMetadata(data);
@@ -989,7 +993,7 @@ class PlexClient {
final response = await _dio.get('/library/onDeck');
final sid = serverId;
final sname = serverName;
return await Isolate.run(() => _processOnDeckResponse(response.data as Map<String, dynamic>, sid, sname));
return await tryIsolateRun(() => _processOnDeckResponse(response.data as Map<String, dynamic>, sid, sname));
}
/// Get children of a metadata item (e.g., seasons for a show, episodes for a season)
@@ -1477,7 +1481,7 @@ class PlexClient {
);
final sid = serverId;
final sname = serverName;
return await Isolate.run(() => _processHubResponse(response.data as Map<String, dynamic>, sid, sname));
return await tryIsolateRun(() => _processHubResponse(response.data as Map<String, dynamic>, sid, sname));
} catch (e) {
appLogger.e('Failed to get library hubs: $e');
}
@@ -1492,7 +1496,7 @@ class PlexClient {
final response = await _dio.get('/hubs', queryParameters: {'count': limit, 'includeGuids': 1});
final sid = serverId;
final sname = serverName;
return await Isolate.run(() => _processHubResponse(response.data as Map<String, dynamic>, sid, sname));
return await tryIsolateRun(() => _processHubResponse(response.data as Map<String, dynamic>, sid, sname));
} catch (e) {
appLogger.e('Failed to get global hubs: $e');
}
@@ -1977,21 +1981,27 @@ class PlexClient {
String? startingEpisodeKey,
}) async {
try {
// Get machine identifier for building the URI
final machineId = config.machineIdentifier ?? await getMachineIdentifier();
if (machineId == null) {
throw Exception('Could not get server machine identifier');
}
// Build the URI for the show's episodes
final uri = 'server://$machineId/com.plexapp.plugins.library/library/metadata/$showRatingKey/children';
// When starting from a specific episode, use continuous mode
// This lets the server determine playback order (respects episodeSort)
if (startingEpisodeKey != null && shuffle == 0) {
final uri = 'server://$machineId/com.plexapp.plugins.library/library/metadata/$startingEpisodeKey';
return await createPlayQueue(
uri: uri,
type: 'video',
continuous: 1,
);
}
// Create the play queue with optional starting episode
final uri = 'server://$machineId/com.plexapp.plugins.library/library/metadata/$showRatingKey/children';
return await createPlayQueue(
uri: uri,
type: 'video',
shuffle: shuffle,
key: startingEpisodeKey != null ? '/library/metadata/$startingEpisodeKey' : null,
);
} catch (e) {
appLogger.e('Failed to create show play queue', error: e);
@@ -2206,14 +2216,9 @@ class PlexClient {
return dvrs.isNotEmpty;
}
/// Get EPG channels for a specific lineup
/// Get EPG channels using provider lineup endpoints (matches official Plex web client)
Future<List<LiveTvChannel>> getEpgChannels({String? lineup}) async {
final queryParams = <String, dynamic>{};
if (lineup != null) queryParams['lineup'] = lineup;
return _wrapListApiCall<LiveTvChannel>(() => _dio.get('/livetv/epg/channels', queryParameters: queryParams), (
response,
) {
List<LiveTvChannel> parseChannels(Response response) {
final container = _getMediaContainer(response);
if (container != null && container['Channel'] is List && (container['Channel'] as List).isNotEmpty) {
appLogger.d('EPG channel sample: ${(container['Channel'] as List).first}');
@@ -2228,7 +2233,6 @@ class PlexClient {
.where((ch) => ch.key.isNotEmpty)
.toList();
}
// Also check for Metadata key (some endpoints return channels there)
if (container != null && container['Metadata'] != null) {
return (container['Metadata'] as List)
.map(
@@ -2241,7 +2245,18 @@ class PlexClient {
}
appLogger.d('EPG channels: container keys=${container?.keys.toList()}, size=${container?['size']}');
return [];
}, 'Failed to get EPG channels');
}
final allChannels = <LiveTvChannel>[];
for (final provider in _providerEpg) {
try {
final response = await _dio.get('/${provider.identifier}/lineups/dvr/channels');
allChannels.addAll(parseChannels(response));
} catch (e) {
appLogger.e('Failed to get EPG channels from ${provider.identifier}', error: e);
}
}
return allChannels;
}
/// Return EPG providers (already parsed from /media/providers during initialization)
+3
View File
@@ -3,6 +3,7 @@ import 'dart:io';
import 'package:flutter/foundation.dart';
import 'package:saf_util/saf_util.dart';
import '../utils/platform_detector.dart';
import 'package:saf_util/saf_util_platform_interface.dart';
import 'package:saf_stream/saf_stream.dart';
@@ -22,6 +23,8 @@ class SafStorageService {
/// Returns the content:// URI or null if cancelled
Future<String?> pickDirectory() async {
if (!isAvailable) return null;
// SAF document picker is not available on Android TV
if (TvDetectionService.isTVSync()) return null;
try {
// Pick directory with persistent write permission
final doc = await _safUtil.pickDirectory(writePermission: true, persistablePermission: true);
+16 -81
View File
@@ -37,6 +37,7 @@ class SettingsService extends BaseSharedPreferencesService {
static const String _keyEpisodePosterMode = 'episode_poster_mode';
static const String _keySeekTimeSmall = 'seek_time_small';
static const String _keySeekTimeLarge = 'seek_time_large';
static const String _keyRewindOnResume = 'rewind_on_resume';
static const String _keyMediaVersionPreferences = 'media_version_preferences';
static const String _keyShowHeroSection = 'show_hero_section';
static const String _keyUseGlobalHubs = 'use_global_hubs';
@@ -286,6 +287,15 @@ class SettingsService extends BaseSharedPreferencesService {
return prefs.getInt(_keySeekTimeLarge) ?? 30; // Default: 30 seconds
}
// Rewind on Resume (in seconds, 0 = disabled)
Future<void> setRewindOnResume(int seconds) async {
await prefs.setInt(_keyRewindOnResume, seconds);
}
int getRewindOnResume() {
return prefs.getInt(_keyRewindOnResume) ?? 0; // Default: 0 (disabled)
}
// Sleep Timer Duration (in minutes)
Future<void> setSleepTimerDuration(int minutes) async {
await prefs.setInt(_keySleepTimerDuration, minutes);
@@ -596,8 +606,9 @@ class SettingsService extends BaseSharedPreferencesService {
.cast<HotKeyModifier>()
.toList();
// Try direct USB HID lookup first (new format), fall back to string parsing (backwards compat)
final key = _usbHidKeyMap[keyString] ?? _findKeyByString(keyString);
// Try parsing as USB HID code first (new format), fall back to string parsing (backwards compat)
final usbHidCode = int.tryParse(keyString, radix: 16);
final key = usbHidCode != null ? PhysicalKeyboardKey(usbHidCode) : _findKeyByString(keyString);
if (key != null) {
return HotKey(key: key, modifiers: modifiers.isNotEmpty ? modifiers : null);
}
@@ -607,82 +618,6 @@ class SettingsService extends BaseSharedPreferencesService {
return null;
}
// Unified map for USB HID codes to PhysicalKeyboardKey
static const _usbHidKeyMap = <String, PhysicalKeyboardKey>{
// Special keys
'0007002c': PhysicalKeyboardKey.space,
'0007002a': PhysicalKeyboardKey.backspace,
'0007004c': PhysicalKeyboardKey.delete,
'00070028': PhysicalKeyboardKey.enter,
'00070029': PhysicalKeyboardKey.escape,
'0007002b': PhysicalKeyboardKey.tab,
'00070039': PhysicalKeyboardKey.capsLock,
// Arrow keys
'00070050': PhysicalKeyboardKey.arrowLeft,
'00070052': PhysicalKeyboardKey.arrowUp,
'0007004f': PhysicalKeyboardKey.arrowRight,
'00070051': PhysicalKeyboardKey.arrowDown,
// Navigation keys
'0007004a': PhysicalKeyboardKey.home,
'0007004d': PhysicalKeyboardKey.end,
'0007004b': PhysicalKeyboardKey.pageUp,
'0007004e': PhysicalKeyboardKey.pageDown,
// Symbol keys
'0007002d': PhysicalKeyboardKey.equal,
'0007002e': PhysicalKeyboardKey.minus,
// Function keys
'0007003a': PhysicalKeyboardKey.f1,
'0007003b': PhysicalKeyboardKey.f2,
'0007003c': PhysicalKeyboardKey.f3,
'0007003d': PhysicalKeyboardKey.f4,
'0007003e': PhysicalKeyboardKey.f5,
'0007003f': PhysicalKeyboardKey.f6,
'00070040': PhysicalKeyboardKey.f7,
'00070041': PhysicalKeyboardKey.f8,
'00070042': PhysicalKeyboardKey.f9,
'00070043': PhysicalKeyboardKey.f10,
'00070044': PhysicalKeyboardKey.f11,
'00070045': PhysicalKeyboardKey.f12,
// Number keys
'00070027': PhysicalKeyboardKey.digit0,
'0007001e': PhysicalKeyboardKey.digit1,
'0007001f': PhysicalKeyboardKey.digit2,
'00070020': PhysicalKeyboardKey.digit3,
'00070021': PhysicalKeyboardKey.digit4,
'00070022': PhysicalKeyboardKey.digit5,
'00070023': PhysicalKeyboardKey.digit6,
'00070024': PhysicalKeyboardKey.digit7,
'00070025': PhysicalKeyboardKey.digit8,
'00070026': PhysicalKeyboardKey.digit9,
// Letter keys
'00070004': PhysicalKeyboardKey.keyA,
'00070005': PhysicalKeyboardKey.keyB,
'00070006': PhysicalKeyboardKey.keyC,
'00070007': PhysicalKeyboardKey.keyD,
'00070008': PhysicalKeyboardKey.keyE,
'00070009': PhysicalKeyboardKey.keyF,
'0007000a': PhysicalKeyboardKey.keyG,
'0007000b': PhysicalKeyboardKey.keyH,
'0007000c': PhysicalKeyboardKey.keyI,
'0007000d': PhysicalKeyboardKey.keyJ,
'0007000e': PhysicalKeyboardKey.keyK,
'0007000f': PhysicalKeyboardKey.keyL,
'00070010': PhysicalKeyboardKey.keyM,
'00070011': PhysicalKeyboardKey.keyN,
'00070012': PhysicalKeyboardKey.keyO,
'00070013': PhysicalKeyboardKey.keyP,
'00070014': PhysicalKeyboardKey.keyQ,
'00070015': PhysicalKeyboardKey.keyR,
'00070016': PhysicalKeyboardKey.keyS,
'00070017': PhysicalKeyboardKey.keyT,
'00070018': PhysicalKeyboardKey.keyU,
'00070019': PhysicalKeyboardKey.keyV,
'0007001a': PhysicalKeyboardKey.keyW,
'0007001b': PhysicalKeyboardKey.keyX,
'0007001c': PhysicalKeyboardKey.keyY,
'0007001d': PhysicalKeyboardKey.keyZ,
};
// Map for pattern-based key name matching (lowercase keys for case-insensitive matching)
static const _keyNameMap = <String, PhysicalKeyboardKey>{
'space': PhysicalKeyboardKey.space,
@@ -772,9 +707,8 @@ class SettingsService extends BaseSharedPreferencesService {
// Format: PhysicalKeyboardKey#ec9ed(usbHidUsage: "0x0007002c", debugName: "Space")
final usbHidMatch = RegExp(r'usbhidusage: "0x([0-9a-f]+)"').firstMatch(normalized);
if (usbHidMatch != null) {
final usbHidCode = usbHidMatch.group(1)!;
final key = _usbHidKeyMap[usbHidCode];
if (key != null) return key;
final code = int.tryParse(usbHidMatch.group(1)!, radix: 16);
if (code != null) return PhysicalKeyboardKey(code);
}
// Try direct name matches
@@ -1088,6 +1022,7 @@ class SettingsService extends BaseSharedPreferencesService {
bool getAutoPip() {
if (!Platform.isAndroid && !Platform.isIOS && !Platform.isMacOS) return false;
if (PlatformDetector.isTV()) return false;
// Default enabled on mobile, disabled on macOS
return prefs.getBool(_keyAutoPip) ?? !Platform.isMacOS;
}
+449
View File
@@ -0,0 +1,449 @@
import 'dart:async';
import '../mpv/mpv.dart';
import '../models/plex_media_info.dart';
import '../models/plex_metadata.dart';
import '../services/plex_client.dart';
import '../services/settings_service.dart';
import '../services/track_selection_service.dart';
import '../models/plex_user_profile.dart';
import '../utils/app_logger.dart';
import '../utils/content_utils.dart';
import '../utils/language_codes.dart';
import '../utils/track_label_builder.dart';
/// Manages track (audio + subtitle) lifecycle: external subtitle loading,
/// automatic track selection, server preference sync, and cycling.
///
/// Follows the same manager pattern as [VideoFilterManager]:
/// constructed with a [Player] + callbacks, mutated via public setters,
/// disposed when the player screen tears down.
class TrackManager {
final Player player;
/// Returns false once the owning widget is unmounted or disposed.
final bool Function() isActive;
/// Resolves the Plex API client for the current server.
final PlexClient Function() getClient;
/// Resolves the user's profile settings (may be null during loading).
final PlexUserProfile? Function() getProfileSettings;
/// Waits until profile settings are available (offline path).
final Future<void> Function() waitForProfileSettings;
/// Shows a transient message to the user (e.g., snackbar).
final void Function(String message, {Duration? duration})? showMessage;
// ── Mutable configuration (updated on episode navigation) ──────────
PlexMetadata metadata;
PlexMediaInfo? mediaInfo;
AudioTrack? preferredAudioTrack;
SubtitleTrack? preferredSubtitleTrack;
SubtitleTrack? preferredSecondarySubtitleTrack;
// ── Internal state ─────────────────────────────────────────────────
bool waitingForExternalSubsTrackSelection = false;
bool _isApplyingTrackSelection = false;
List<SubtitleTrack> _lastExternalSubtitles = const [];
StreamSubscription<Tracks>? _trackLoadingSubscription;
Timer? _subtitleFallbackTimer;
/// Cached external subtitles for re-use after backend fallback.
List<SubtitleTrack> get lastExternalSubtitles => _lastExternalSubtitles;
TrackManager({
required this.player,
required this.isActive,
required this.getClient,
required this.getProfileSettings,
required this.waitForProfileSettings,
required this.metadata,
this.mediaInfo,
this.preferredAudioTrack,
this.preferredSubtitleTrack,
this.preferredSecondarySubtitleTrack,
this.showMessage,
});
// ── External subtitles ─────────────────────────────────────────────
/// Cache external subtitles for backend fallback recovery.
void cacheExternalSubtitles(List<SubtitleTrack> externalSubtitles) {
_lastExternalSubtitles = externalSubtitles;
}
/// Add external subtitle tracks to the player one by one.
Future<void> addExternalSubtitles(List<SubtitleTrack> externalSubtitles) async {
if (externalSubtitles.isEmpty) return;
appLogger.d('Adding ${externalSubtitles.length} external subtitle(s) to player');
for (final subtitleTrack in externalSubtitles) {
if (subtitleTrack.uri == null) continue;
try {
await player.addSubtitleTrack(
uri: subtitleTrack.uri!,
title: subtitleTrack.title,
language: subtitleTrack.language,
select: false,
);
appLogger.d('Added external subtitle: ${subtitleTrack.title ?? subtitleTrack.uri}');
} catch (e) {
appLogger.w('Failed to add external subtitle: ${subtitleTrack.title ?? subtitleTrack.uri}', error: e);
}
}
}
/// Resume playback after external subtitles have been loaded (or failed).
/// Sets up a 3-second fallback in case playbackRestart doesn't fire.
Future<void> resumeAfterSubtitleLoad() async {
if (!isActive()) return;
try {
await player.play();
final pos = player.state.position;
try {
await player.seek(pos.inMilliseconds > 0 ? pos : Duration.zero);
} catch (e) {
appLogger.w('Non-critical seek after subtitle load failed', error: e);
}
} catch (e) {
// play() failed — clear the flag immediately since playbackRestart won't fire
appLogger.w('Resume after subtitle load failed, applying track selection directly', error: e);
waitingForExternalSubsTrackSelection = false;
applyTrackSelection();
return;
}
// Fallback if playbackRestart doesn't fire
_subtitleFallbackTimer?.cancel();
_subtitleFallbackTimer = Timer(const Duration(seconds: 3), () {
if (waitingForExternalSubsTrackSelection && isActive()) {
waitingForExternalSubsTrackSelection = false;
applyTrackSelection();
}
});
}
// ── Track selection ────────────────────────────────────────────────
/// Apply track selection once tracks are available.
/// If tracks are not yet loaded, subscribes to the stream.
void applyTrackSelectionWhenReady() {
final currentTracks = player.state.tracks;
if (currentTracks.audio.isNotEmpty || currentTracks.subtitle.isNotEmpty) {
applyTrackSelection();
} else {
_trackLoadingSubscription?.cancel();
_trackLoadingSubscription = player.streams.tracks.listen((tracks) {
if (tracks.audio.isEmpty && tracks.subtitle.isEmpty) return;
_trackLoadingSubscription?.cancel();
_trackLoadingSubscription = null;
applyTrackSelection();
});
}
}
/// Core track selection: delegates to [TrackSelectionService].
Future<void> applyTrackSelection() async {
if (!isActive() || _isApplyingTrackSelection) return;
_isApplyingTrackSelection = true;
try {
await waitForProfileSettings();
if (!isActive()) return;
final profileSettings = getProfileSettings();
final settingsService = await SettingsService.getInstance();
if (!isActive()) return;
final trackService = TrackSelectionService(
player: player,
profileSettings: profileSettings,
metadata: metadata,
plexMediaInfo: mediaInfo,
);
await trackService.selectAndApplyTracks(
preferredAudioTrack: preferredAudioTrack,
preferredSubtitleTrack: preferredSubtitleTrack,
preferredSecondarySubtitleTrack: preferredSecondarySubtitleTrack,
defaultPlaybackSpeed: settingsService.getDefaultPlaybackSpeed(),
onAudioTrackChanged: onAudioTrackChanged,
onSubtitleTrackChanged: onSubtitleTrackChanged,
);
} catch (e) {
appLogger.w('Failed to apply track selection', error: e);
} finally {
_isApplyingTrackSelection = false;
}
}
/// Called when playbackRestart fires — checks the flag and applies selection.
void onPlaybackRestart() {
if (waitingForExternalSubsTrackSelection) {
waitingForExternalSubsTrackSelection = false;
applyTrackSelection();
}
}
// ── Backend fallback ───────────────────────────────────────────────
/// Handle ExoPlayer → MPV backend switch: re-add external subs and reapply selection.
Future<void> onBackendSwitched() async {
appLogger.i('Player backend switched from ExoPlayer to MPV (native fallback)');
if (_lastExternalSubtitles.isNotEmpty) {
try {
await addExternalSubtitles(_lastExternalSubtitles);
} catch (e) {
appLogger.w('Failed to re-add external subtitles after backend switch', error: e);
}
}
if (!isActive()) return;
applyTrackSelectionWhenReady();
}
// ── Track cycling (remote/keyboard shortcuts) ──────────────────────
/// Cycle to the next subtitle track and save the preference.
void cycleSubtitleTrack() {
final tracks = player.state.tracks.subtitle.where((t) => t.id != 'auto').toList();
if (tracks.isEmpty) return;
final current = player.state.track.subtitle;
final currentIndex = tracks.indexWhere((t) => t.id == current?.id);
final nextIndex = (currentIndex + 1) % tracks.length;
final next = tracks[nextIndex];
player.selectSubtitleTrack(next);
onSubtitleTrackChanged(next);
if (isActive()) {
final label = next.id == 'no'
? 'Subtitles: Off'
: 'Subtitles: ${TrackLabelBuilder.buildSubtitleLabel(title: next.title, language: next.language, codec: next.codec, index: nextIndex)}';
showMessage?.call(label, duration: const Duration(seconds: 1));
}
}
/// Cycle to the next audio track and save the preference.
void cycleAudioTrack() {
final tracks = player.state.tracks.audio.where((t) => t.id != 'auto' && t.id != 'no').toList();
if (tracks.length <= 1) return;
final current = player.state.track.audio;
final currentIndex = tracks.indexWhere((t) => t.id == current?.id);
final nextIndex = (currentIndex + 1) % tracks.length;
final next = tracks[nextIndex];
player.selectAudioTrack(next);
onAudioTrackChanged(next);
if (isActive()) {
final label = 'Audio: ${TrackLabelBuilder.buildAudioLabel(title: next.title, language: next.language, codec: next.codec, channelsCount: next.channelsCount, index: nextIndex)}';
showMessage?.call(label, duration: const Duration(seconds: 1));
}
}
// ── Server preference sync ─────────────────────────────────────────
/// Handle audio track changes — save stream selection and language preference.
Future<void> onAudioTrackChanged(AudioTrack track) async {
final info = mediaInfo;
final partId = await _guardTrackChange(info);
if (partId == null || info == null) return;
int? streamID = _matchTrackByAttributes(
mpvLanguage: track.language,
mpvTitle: track.title,
plexTracks: info.audioTracks,
getLanguageCode: (t) => t.languageCode,
getDisplayTitle: (t) => t.displayTitle,
getTitle: (t) => t.title,
getId: (t) => t.id,
);
if (streamID != null) {
appLogger.d('Matched audio by lang/title: streamID $streamID');
} else {
final matchedPlex = findPlexTrackForMpvAudio(track, info.audioTracks);
streamID = matchedPlex?.id;
if (streamID != null) {
appLogger.d('Matched audio by properties: streamID $streamID');
} else {
appLogger.e('Could not match audio track to any Plex track');
}
}
await _saveTrackPreferences(partId: partId, trackType: 'audio', languageCode: track.language, streamID: streamID);
}
/// Handle subtitle track changes — save stream selection and language preference.
Future<void> onSubtitleTrackChanged(SubtitleTrack track) async {
final info = mediaInfo;
final partId = await _guardTrackChange(info);
if (partId == null) return;
String? languageCode;
int? streamID;
if (track.id == 'no') {
languageCode = 'none';
streamID = 0;
appLogger.i('User turned subtitles off, saving preference');
} else if (info != null) {
languageCode = track.language;
streamID = _matchTrackByAttributes(
mpvLanguage: track.language,
mpvTitle: track.title,
plexTracks: info.subtitleTracks,
getLanguageCode: (t) => t.languageCode,
getDisplayTitle: (t) => t.displayTitle,
getTitle: (t) => t.title,
getId: (t) => t.id,
);
if (streamID != null) {
appLogger.d('Matched subtitle by lang/title: streamID $streamID');
} else {
final matchedPlex = findPlexTrackForMpvSubtitle(track, info.subtitleTracks);
streamID = matchedPlex?.id;
if (streamID != null) {
appLogger.d('Matched subtitle by properties: streamID $streamID');
} else {
appLogger.e('Could not match subtitle track to any Plex track');
}
}
}
await _saveTrackPreferences(partId: partId, trackType: 'subtitle', languageCode: languageCode, streamID: streamID);
}
/// Handle secondary subtitle track changes — no server save needed.
void onSecondarySubtitleTrackChanged(SubtitleTrack track) {
// Secondary subtitle preference is carried via player.state.track.secondarySubtitle
// which is automatically read during episode navigation. No additional state needed.
}
// ── Private helpers ────────────────────────────────────────────────
/// Rating key used for series/movie level language preferences.
String get _preferenceRatingKey {
return metadata.isEpisode
? (metadata.grandparentRatingKey ?? metadata.ratingKey)
: metadata.ratingKey;
}
/// Common guard checks for track change handlers.
Future<int?> _guardTrackChange(PlexMediaInfo? info) async {
final settings = await SettingsService.getInstance();
if (!settings.getRememberTrackSelections()) return null;
if (info == null) {
appLogger.w('No media info available, cannot save stream selection');
return null;
}
final partId = info.getPartId();
if (partId == null) {
appLogger.w('No part ID available, cannot save stream selection');
}
return partId;
}
/// Save language preference and stream selection to the server.
Future<void> _saveTrackPreferences({
required int partId,
required String trackType,
String? languageCode,
int? streamID,
}) async {
try {
if (!isActive()) return;
final client = getClient();
final ratingKey = _preferenceRatingKey;
final futures = <Future>[];
if (languageCode != null && (trackType == 'subtitle' || languageCode.isNotEmpty)) {
futures.add(
trackType == 'audio'
? client.setMetadataPreferences(ratingKey, audioLanguage: languageCode)
: client.setMetadataPreferences(ratingKey, subtitleLanguage: languageCode),
);
}
if (streamID != null) {
futures.add(
trackType == 'audio'
? client.selectStreams(partId, audioStreamID: streamID, allParts: true)
: client.selectStreams(partId, subtitleStreamID: streamID, allParts: true),
);
}
await Future.wait(futures);
appLogger.d('Successfully saved $trackType preferences (language + stream)');
} catch (e) {
appLogger.e('Failed to save $trackType preferences', error: e);
}
}
/// Match an mpv track against Plex tracks by language and title.
int? _matchTrackByAttributes<T>({
required String? mpvLanguage,
required String? mpvTitle,
required List<T> plexTracks,
required String? Function(T) getLanguageCode,
required String? Function(T) getDisplayTitle,
required String? Function(T) getTitle,
required int Function(T) getId,
}) {
final normalizedLang = _iso6391ToPlex6392(mpvLanguage);
for (final plexTrack in plexTracks) {
final matchLang = getLanguageCode(plexTrack) == normalizedLang;
final matchTitle = (mpvTitle == null || mpvTitle.isEmpty)
? true
: (getDisplayTitle(plexTrack) == mpvTitle || getTitle(plexTrack) == mpvTitle);
if (matchLang && matchTitle) {
return getId(plexTrack);
}
}
return null;
}
/// Convert ISO 639-1 code (e.g. "fr") to Plex's 639-2 code (e.g. "fre").
static String? _iso6391ToPlex6392(String? code) {
if (code == null || code.isEmpty) return null;
final lang = code.split('-').first.toLowerCase();
try {
final variations = LanguageCodes.getVariations(lang);
for (final variation in variations) {
if (variation.length == 3) {
return variation;
}
}
return null;
} catch (e) {
return null;
}
}
/// Clean up subscriptions.
void dispose() {
_trackLoadingSubscription?.cancel();
_trackLoadingSubscription = null;
_subtitleFallbackTimer?.cancel();
_subtitleFallbackTimer = null;
}
}
+11 -4
View File
@@ -1,3 +1,5 @@
import 'dart:async';
import '../mpv/mpv.dart';
import '../models/plex_media_info.dart';
@@ -640,10 +642,15 @@ class TrackSelectionService {
Function(SubtitleTrack)? onSubtitleTrackChanged,
}) async {
// Wait for tracks to be loaded
int attempts = 0;
while (player.state.tracks.audio.isEmpty && player.state.tracks.subtitle.isEmpty && attempts < 100) {
await Future.delayed(const Duration(milliseconds: 100));
attempts++;
if (player.state.tracks.audio.isEmpty && player.state.tracks.subtitle.isEmpty) {
try {
await player.streams.tracks
.where((t) => t.audio.isNotEmpty || t.subtitle.isNotEmpty)
.first
.timeout(const Duration(seconds: 10));
} catch (_) {
// Timeout or stream closed — proceed with whatever state we have
}
}
if (player.disposed) return;
+1 -1
View File
@@ -16,7 +16,7 @@ import 'package:shared_preferences/shared_preferences.dart';
class UpdateService {
static final Logger _logger = Logger();
static const String _githubRepo = 'edde746/plezy';
static const String _feedUrl = 'https://github.com/edde746/plezy/releases/latest/download/appcast.xml';
static const String _feedUrl = 'https://cdn.jsdelivr.net/gh/edde746/plezy@appcast/appcast.xml';
// SharedPreferences keys
static const String _keySkippedVersion = 'update_skipped_version';
+14
View File
@@ -0,0 +1,14 @@
import 'dart:isolate';
/// Runs [computation] in a background isolate via [Isolate.run].
///
/// Falls back to synchronous execution when the isolate infrastructure is
/// unavailable (e.g. iOS killed background isolates while the app was
/// suspended).
Future<R> tryIsolateRun<R>(R Function() computation) async {
try {
return await Isolate.run(computation);
} on StateError {
return computation();
}
}
+16
View File
@@ -12,6 +12,22 @@ void scrollContextToCenter(BuildContext? context) {
});
}
/// Jump a vertical [ListView] so that [currentIndex] is visible.
///
/// Measures the first item (via [firstItemKey]) to get the real item height,
/// then scrolls to `currentIndex * itemHeight`, clamped to max extent.
/// Call once after the first build; the callback is a no-op if the key or
/// controller aren't ready yet.
void scrollToCurrentItem(ScrollController controller, GlobalKey firstItemKey, int currentIndex) {
WidgetsBinding.instance.addPostFrameCallback((_) {
if (!controller.hasClients) return;
final itemHeight = (firstItemKey.currentContext?.findRenderObject() as RenderBox?)?.size.height;
if (itemHeight == null) return;
final target = (currentIndex * itemHeight).clamp(0.0, controller.position.maxScrollExtent);
controller.jumpTo(target);
});
}
/// Scroll a horizontal list to center the item at the given index.
///
/// Assumes items are laid out with [leadingPadding] before the first item,
@@ -30,6 +30,21 @@ class WatchTogetherProvider with ChangeNotifier {
String _displayName = 'User';
String? _lastHandledCurrentPlaybackKey;
// Coalesce rapid-fire notifyListeners() calls into a single rebuild per frame.
// During Watch Together join, 4-5 notifications fire within milliseconds;
// this batches them into one rebuild to avoid overwhelming low-end devices.
bool _notifyScheduled = false;
@override
void notifyListeners() {
if (_notifyScheduled) return;
_notifyScheduled = true;
scheduleMicrotask(() {
_notifyScheduled = false;
super.notifyListeners();
});
}
// Host reconnect grace period
Timer? _hostReconnectTimer;
bool _isWaitingForHostReconnect = false;
@@ -316,10 +316,11 @@ class WatchTogetherSyncManager {
_clockOffset = 0;
_pendingPingTimestamp = null;
// Initial burst of 3 pings for fast convergence
// Initial burst of 2 pings for convergence, with wider spacing to reduce
// main-thread pressure during the join event storm
int burstCount = 0;
Timer.periodic(const Duration(milliseconds: 200), (timer) {
if (burstCount >= 3 || _player == null) {
Timer.periodic(const Duration(milliseconds: 500), (timer) {
if (burstCount >= 2 || _player == null) {
timer.cancel();
return;
}
@@ -7,6 +7,7 @@ import 'package:provider/provider.dart';
import '../../i18n/strings.g.dart';
import '../../utils/dialogs.dart';
import '../../utils/platform_detector.dart';
import '../../utils/snackbar_helper.dart';
import '../../widgets/overlay_sheet.dart';
import '../models/watch_session.dart';
@@ -85,10 +86,12 @@ class _SessionIndicator extends StatelessWidget {
children: [
// Sync indicator or group icon
if (isSyncing)
const SizedBox(
SizedBox(
width: 16,
height: 16,
child: CircularProgressIndicator(strokeWidth: 2, color: Colors.white),
child: PlatformDetector.isTV()
? const Icon(Symbols.sync_rounded, size: 16, color: Colors.white)
: const CircularProgressIndicator(strokeWidth: 2, color: Colors.white),
)
else
Icon(Symbols.group, size: 18, color: isHost ? theme.colorScheme.primary : Colors.white),
@@ -230,7 +233,13 @@ class _SessionMenuSheet extends StatelessWidget {
title: Text(p.displayName),
subtitle: p.isHost ? Text(t.watchTogether.host) : null,
trailing: p.isBuffering
? const SizedBox(width: 16, height: 16, child: CircularProgressIndicator(strokeWidth: 2))
? SizedBox(
width: 16,
height: 16,
child: PlatformDetector.isTV()
? const Icon(Symbols.hourglass_empty_rounded, size: 16)
: const CircularProgressIndicator(strokeWidth: 2),
)
: null,
dense: true,
contentPadding: EdgeInsets.zero,
@@ -388,10 +397,12 @@ class SyncingIndicator extends StatelessWidget {
child: Row(
mainAxisSize: MainAxisSize.min,
children: [
const SizedBox(
SizedBox(
width: 14,
height: 14,
child: CircularProgressIndicator(strokeWidth: 2, color: Colors.white),
child: PlatformDetector.isTV()
? const Icon(Symbols.sync_rounded, size: 14, color: Colors.white)
: const CircularProgressIndicator(strokeWidth: 2, color: Colors.white),
),
const SizedBox(width: 8),
Text(t.watchTogether.syncing, style: const TextStyle(color: Colors.white, fontSize: 12)),
+12 -1
View File
@@ -33,6 +33,11 @@ class FocusedScrollScaffold extends StatefulWidget {
/// Defaults to true.
final bool automaticallyImplyLeading;
/// Optional override for the back key handler.
/// When set, this callback is invoked instead of the default
/// [handleBackKeyNavigation] (which pops the current route).
final VoidCallback? onBackPressed;
const FocusedScrollScaffold({
super.key,
required this.title,
@@ -40,6 +45,7 @@ class FocusedScrollScaffold extends StatefulWidget {
this.actions,
this.pinned = true,
this.automaticallyImplyLeading = true,
this.onBackPressed,
});
@override
@@ -75,7 +81,12 @@ class _FocusedScrollScaffoldState extends State<FocusedScrollScaffold> {
return Focus(
canRequestFocus: false,
onKeyEvent: (_, event) => handleBackKeyNavigation(context, event),
onKeyEvent: (_, event) {
if (widget.onBackPressed != null) {
return handleBackKeyAction(event, widget.onBackPressed!);
}
return handleBackKeyNavigation(context, event);
},
child: FocusScope(
node: _scopeNode,
child: Scaffold(
@@ -63,10 +63,14 @@ class _HorizontalScrollWithArrowsState extends State<HorizontalScrollWithArrows>
}
final position = _scrollController.position;
setState(() {
_canScrollLeft = position.pixels > 0;
_canScrollRight = position.pixels < position.maxScrollExtent;
});
final newLeft = position.pixels > 0;
final newRight = position.pixels < position.maxScrollExtent;
if (newLeft != _canScrollLeft || newRight != _canScrollRight) {
setState(() {
_canScrollLeft = newLeft;
_canScrollRight = newRight;
});
}
}
void _animateScroll(double direction) {
+3 -3
View File
@@ -326,13 +326,13 @@ class HubSectionState extends State<HubSection> {
children: [
// Hub header (NOT focusable - titles should not be focusable)
Padding(
padding: const EdgeInsets.fromLTRB(8, 12, 8, 4),
padding: const EdgeInsets.fromLTRB(8, 2, 8, 2),
child: ExcludeFocus(
child: InkWell(
onTap: widget.hub.more ? () => _navigateToHubDetail(context) : null,
borderRadius: BorderRadius.circular(tokens(context).radiusSm),
child: Padding(
padding: const EdgeInsets.symmetric(horizontal: 4, vertical: 6),
padding: const EdgeInsets.symmetric(horizontal: 4, vertical: 2),
child: Row(
mainAxisSize: MainAxisSize.min,
children: [
@@ -440,7 +440,7 @@ class HubSectionState extends State<HubSection> {
controller: scrollController,
scrollDirection: Axis.horizontal,
clipBehavior: Clip.none,
padding: const EdgeInsets.symmetric(horizontal: 8, vertical: 4),
padding: const EdgeInsets.symmetric(horizontal: 8, vertical: 2),
itemCount: isKeyboardMode ? _totalItemCount : widget.hub.items.length,
itemBuilder: (context, index) {
final isItemFocused = hasFocus && index == _focusedIndex;
+17 -52
View File
@@ -172,14 +172,13 @@ class MediaCardState extends State<MediaCard> {
@override
Widget build(BuildContext context) {
final settingsProvider = context.watch<SettingsProvider>();
final ViewMode viewMode;
if (widget.forceListMode) {
viewMode = ViewMode.list;
} else if (widget.forceGridMode) {
viewMode = ViewMode.grid;
} else {
viewMode = settingsProvider.viewMode;
viewMode = context.select<SettingsProvider, ViewMode>((s) => s.viewMode);
}
final semanticLabel = _buildSemanticLabel();
@@ -195,7 +194,7 @@ class MediaCardState extends State<MediaCard> {
onLongPress: _showContextMenu,
onSecondaryTapDown: _storeTapPosition,
onSecondaryTap: _showContextMenu,
density: settingsProvider.libraryDensity,
density: context.select<SettingsProvider, LibraryDensity>((s) => s.libraryDensity),
isOffline: widget.isOffline,
localPosterPath: localPosterPath,
showServerName: widget.showServerName,
@@ -352,7 +351,7 @@ class _MediaCardList extends StatelessWidget {
final base = _basePosterWidth();
// For episodes with thumbnail mode, use wider width to maintain reasonable thumbnail size
if (item is PlexMetadata) {
final mode = context.watch<SettingsProvider>().episodePosterMode;
final mode = context.select<SettingsProvider, EpisodePosterMode>((s) => s.episodePosterMode);
if ((item as PlexMetadata).usesWideAspectRatio(mode)) {
return base * 1.6; // Wider for 16:9 thumbnails
}
@@ -364,7 +363,7 @@ class _MediaCardList extends StatelessWidget {
final base = _basePosterWidth();
// For episodes with thumbnail mode, use 16:9 aspect ratio
if (item is PlexMetadata) {
final mode = context.watch<SettingsProvider>().episodePosterMode;
final mode = context.select<SettingsProvider, EpisodePosterMode>((s) => s.episodePosterMode);
if ((item as PlexMetadata).usesWideAspectRatio(mode)) {
// 16:9: height = width * 9/16 = base * 1.6 * 9/16 = base * 0.9
return base * 0.9;
@@ -627,7 +626,7 @@ class _MediaCardList extends StatelessWidget {
],
// Summary (hidden when spoiler protection is active)
if (!(item is PlexMetadata &&
context.watch<SettingsProvider>().hideSpoilers &&
context.select<SettingsProvider, bool>((s) => s.hideSpoilers) &&
(item as PlexMetadata).shouldHideSpoiler) &&
item.summary != null) ...[
Text(
@@ -702,10 +701,10 @@ Widget _buildPosterImage(
localFilePath: localPosterPath,
);
} else if (item is PlexMetadata) {
final settingsProvider = context.watch<SettingsProvider>();
final episodePosterMode = settingsProvider.episodePosterMode;
final episodePosterMode = context.select<SettingsProvider, EpisodePosterMode>((s) => s.episodePosterMode);
final hideSpoilers = context.select<SettingsProvider, bool>((s) => s.hideSpoilers);
final shouldBlur =
settingsProvider.hideSpoilers &&
hideSpoilers &&
item.shouldHideSpoiler &&
episodePosterMode == EpisodePosterMode.episodeThumbnail;
posterUrl = item.posterThumb(mode: episodePosterMode, mixedHubContext: mixedHubContext);
@@ -842,7 +841,7 @@ class _MediaCardHelpers {
/// Builds watch progress overlay (checkmark for watched, progress bar for in-progress)
static Widget buildWatchProgress(BuildContext context, PlexMetadata metadata) {
final showUnwatchedCount = context.watch<SettingsProvider>().showUnwatchedCount;
final showUnwatchedCount = context.select<SettingsProvider, bool>((s) => s.showUnwatchedCount);
final hasActiveProgress =
metadata.viewOffset != null &&
@@ -1066,55 +1065,21 @@ class _ClickableTextState extends State<_ClickableText> {
}
}
/// Skeleton loader widget with subtle opacity pulse animation
class SkeletonLoader extends StatefulWidget {
/// Static skeleton placeholder with a fixed semi-transparent fill.
class SkeletonLoader extends StatelessWidget {
final Widget? child;
final BorderRadius? borderRadius;
const SkeletonLoader({super.key, this.child, this.borderRadius});
@override
State<SkeletonLoader> createState() => _SkeletonLoaderState();
}
class _SkeletonLoaderState extends State<SkeletonLoader> with SingleTickerProviderStateMixin {
late AnimationController _animationController;
late Animation<double> _animation;
@override
void initState() {
super.initState();
_animationController = AnimationController(duration: const Duration(milliseconds: 1500), vsync: this);
_animation = Tween<double>(
begin: 0.3,
end: 0.7,
).animate(CurvedAnimation(parent: _animationController, curve: Curves.easeInOut));
_animationController.repeat(reverse: true);
}
@override
void dispose() {
_animationController.dispose();
super.dispose();
}
@override
Widget build(BuildContext context) {
return AnimatedBuilder(
animation: _animation,
builder: (context, child) {
return Semantics(
label: "skeleton-loader",
identifier: "skeleton-loader",
child: Container(
decoration: BoxDecoration(
color: Theme.of(context).colorScheme.onSurface.withValues(alpha: _animation.value * 0.15),
borderRadius: widget.borderRadius ?? BorderRadius.circular(tokens(context).radiusSm),
),
child: widget.child,
),
);
},
return Container(
decoration: BoxDecoration(
color: Theme.of(context).colorScheme.onSurface.withValues(alpha: 0.075),
borderRadius: borderRadius ?? BorderRadius.circular(tokens(context).radiusSm),
),
child: child,
);
}
}
+11 -11
View File
@@ -582,17 +582,17 @@ class _OverlaySheetHostState extends State<OverlaySheetHost> with SingleTickerPr
canRequestFocus: false,
skipTraversal: true,
onKeyEvent: _handleKeyEvent,
child: AnimatedBuilder(
animation: _slideCurve,
builder: (context, child) {
final slideOffset = Offset.lerp(slideBegin, Offset.zero, _slideCurve.value)!;
return FractionalTranslation(
translation: slideOffset,
child: child,
);
},
child: Align(
alignment: _alignment,
child: Align(
alignment: _alignment,
child: AnimatedBuilder(
animation: _slideCurve,
builder: (context, child) {
final slideOffset = Offset.lerp(slideBegin, Offset.zero, _slideCurve.value)!;
return FractionalTranslation(
translation: slideOffset,
child: child,
);
},
child: Transform.translate(
offset: Offset(0, _dragOffset.clamp(0, double.infinity)),
child: SafeArea(
+13 -10
View File
@@ -7,7 +7,6 @@ import 'package:cached_network_image/cached_network_image.dart';
import '../services/image_cache_service.dart';
import '../../services/plex_client.dart';
import '../utils/plex_image_helper.dart';
import 'media_card.dart';
/// Set to `true` to blur all artwork (for store screenshots).
const kBlurArtwork = false;
@@ -350,21 +349,25 @@ class PlexOptimizedImage extends StatelessWidget {
alignment: alignment,
errorBuilder: (context, error, stackTrace) => _buildErrorWidget(context, error),
frameBuilder: (context, child, frame, wasSynchronouslyLoaded) {
if (wasSynchronouslyLoaded || frame != null) return child;
return _buildPlaceholder(context);
if (wasSynchronouslyLoaded) return child;
return AnimatedSwitcher(
duration: const Duration(milliseconds: 300),
child: frame != null
? child
: _buildPlaceholder(context),
);
},
);
}
Widget _buildPlaceholder(BuildContext _) {
return SizedBox(
Widget _buildPlaceholder(BuildContext context) {
return Container(
width: width,
height: height,
child: SkeletonLoader(
child: fallbackIcon != null
? Center(child: AppIcon(fallbackIcon!, fill: 1, size: 40, color: Colors.white54))
: null,
),
color: Theme.of(context).colorScheme.surfaceContainerHighest,
child: fallbackIcon != null
? Center(child: AppIcon(fallbackIcon!, fill: 1, size: 40, color: Colors.white54))
: null,
);
}
@@ -43,6 +43,7 @@ class TrackSelectionHelper {
required BuildContext context,
required bool isSelected,
required VoidCallback onTap,
Key? key,
FocusNode? focusNode,
VoidCallback? onLongPress,
VoidCallback? onSecondaryTap,
@@ -50,6 +51,7 @@ class TrackSelectionHelper {
}) {
return _buildSelectableTile(
context: context,
key: key,
label: 'Off',
isSelected: isSelected,
onTap: onTap,
@@ -66,6 +68,7 @@ class TrackSelectionHelper {
required String label,
required bool isSelected,
required VoidCallback onTap,
Key? key,
FocusNode? focusNode,
VoidCallback? onLongPress,
VoidCallback? onSecondaryTap,
@@ -73,6 +76,7 @@ class TrackSelectionHelper {
}) {
return _buildSelectableTile(
context: context,
key: key,
label: label,
isSelected: isSelected,
onTap: onTap,
@@ -103,6 +107,7 @@ class TrackSelectionHelper {
required String label,
required bool isSelected,
required VoidCallback onTap,
Key? key,
FocusNode? focusNode,
VoidCallback? onLongPress,
VoidCallback? onSecondaryTap,
@@ -117,6 +122,7 @@ class TrackSelectionHelper {
}
Widget tile = FocusableListTile(
key: key,
focusNode: focusNode,
title: Text(label, style: TextStyle(color: isSelected ? primaryColor : null)),
trailing: trailing,
@@ -13,11 +13,13 @@ class TrackControlsState {
final int audioSyncOffset;
final int subtitleSyncOffset;
final bool isRotationLocked;
final bool isScreenLocked;
final bool isFullscreen;
final bool isAlwaysOnTop;
final VoidCallback? onTogglePIPMode;
final VoidCallback? onCycleBoxFitMode;
final VoidCallback? onToggleRotationLock;
final VoidCallback? onToggleScreenLock;
final VoidCallback? onToggleFullscreen;
final VoidCallback? onToggleAlwaysOnTop;
final Function(int)? onSwitchVersion;
@@ -46,11 +48,13 @@ class TrackControlsState {
this.audioSyncOffset = 0,
this.subtitleSyncOffset = 0,
this.isRotationLocked = false,
this.isScreenLocked = false,
this.isFullscreen = false,
this.isAlwaysOnTop = false,
this.onTogglePIPMode,
this.onCycleBoxFitMode,
this.onToggleRotationLock,
this.onToggleScreenLock,
this.onToggleFullscreen,
this.onToggleAlwaysOnTop,
this.onSwitchVersion,
@@ -47,6 +47,6 @@ class BaseVideoControlSheet extends StatelessWidget {
);
}
return SizedBox(height: MediaQuery.of(context).size.height * 0.75, child: content);
return content;
}
}
@@ -13,6 +13,7 @@ import '../../../theme/mono_tokens.dart';
import '../../../utils/formatters.dart';
import '../../../utils/player_utils.dart';
import '../../../utils/provider_extensions.dart';
import '../../../utils/scroll_utils.dart';
import '../../../widgets/focusable_list_tile.dart';
import '../../../widgets/overlay_sheet.dart';
import 'base_video_control_sheet.dart';
@@ -40,6 +41,16 @@ class ChapterSheet extends StatefulWidget {
}
class _ChapterSheetState extends State<ChapterSheet> {
final _firstItemKey = GlobalKey();
final _scrollController = ScrollController();
bool _didInitialScroll = false;
@override
void dispose() {
_scrollController.dispose();
super.dispose();
}
Future<void> _handleChapterTap(Duration position) async {
final clamped = clampSeekPosition(widget.player, position);
await widget.player.seek(clamped);
@@ -86,7 +97,13 @@ class _ChapterSheetState extends State<ChapterSheet> {
child: Text(t.videoControls.noChaptersAvailable, style: TextStyle(color: tokens(context).textMuted)),
);
} else {
if (!_didInitialScroll && currentChapterIndex != null && currentChapterIndex > 0) {
_didInitialScroll = true;
scrollToCurrentItem(_scrollController, _firstItemKey, currentChapterIndex);
}
content = ListView.builder(
controller: _scrollController,
itemCount: widget.chapters.length,
itemBuilder: (context, index) {
final chapter = widget.chapters[index];
@@ -98,6 +115,7 @@ class _ChapterSheetState extends State<ChapterSheet> {
: null;
return FocusableListTile(
key: index == 0 ? _firstItemKey : null,
leading: chapter.thumb != null
? SizedBox(
width: 60,
@@ -8,21 +8,36 @@ import '../../../models/plex_metadata.dart';
import '../../../providers/playback_state_provider.dart';
import '../../../theme/mono_tokens.dart';
import '../../../utils/provider_extensions.dart';
import '../../../utils/scroll_utils.dart';
import '../../../widgets/focusable_list_tile.dart';
import '../../../widgets/overlay_sheet.dart';
import 'base_video_control_sheet.dart';
import '../../plex_optimized_image.dart';
const _kEstimatedItemHeight = 72.0;
const _kThumbWidth = 60.0;
const _kThumbHeight = 34.0;
/// Bottom sheet for viewing and navigating the play queue
class QueueSheet extends StatelessWidget {
class QueueSheet extends StatefulWidget {
final Function(PlexMetadata) onItemSelected;
const QueueSheet({super.key, required this.onItemSelected});
@override
State<QueueSheet> createState() => _QueueSheetState();
}
class _QueueSheetState extends State<QueueSheet> {
final _firstItemKey = GlobalKey();
final _scrollController = ScrollController();
bool _didInitialScroll = false;
@override
void dispose() {
_scrollController.dispose();
super.dispose();
}
@override
Widget build(BuildContext context) {
return Consumer<PlaybackStateProvider>(
@@ -36,13 +51,14 @@ class QueueSheet extends StatelessWidget {
child: Text(t.videoControls.noQueueItems, style: TextStyle(color: tokens(context).textMuted)),
);
} else {
// Find current index for initial scroll
final currentIndex = items.indexWhere((item) => item.playQueueItemID == currentItemID);
if (!_didInitialScroll && currentIndex > 0) {
_didInitialScroll = true;
scrollToCurrentItem(_scrollController, _firstItemKey, currentIndex);
}
content = ListView.builder(
controller: currentIndex > 0
? ScrollController(initialScrollOffset: currentIndex * _kEstimatedItemHeight)
: null,
controller: _scrollController,
itemCount: items.length,
itemBuilder: (context, index) {
final item = items[index];
@@ -50,6 +66,7 @@ class QueueSheet extends StatelessWidget {
final primaryColor = Theme.of(context).colorScheme.primary;
return FocusableListTile(
key: index == 0 ? _firstItemKey : null,
leading: _buildThumbnail(context, item, isCurrent),
title: Text(
item.title!,
@@ -71,7 +88,7 @@ class QueueSheet extends StatelessWidget {
),
trailing: isCurrent ? AppIcon(Symbols.play_circle_rounded, fill: 1, color: primaryColor) : null,
onTap: () {
onItemSelected(item);
widget.onItemSelected(item);
OverlaySheetController.of(context).close();
},
);
@@ -88,7 +105,7 @@ class QueueSheet extends StatelessWidget {
if (item.thumb == null) return null;
// Try to get client for thumbnails, may fail in offline mode
final client = _tryGetClient(context, item);
final client = context.tryGetClientForServer(item.serverId);
return SizedBox(
width: _kThumbWidth,
@@ -133,8 +150,4 @@ class QueueSheet extends StatelessWidget {
}
return item.mediaType.name;
}
static dynamic _tryGetClient(BuildContext context, PlexMetadata item) {
return context.tryGetClientForServer(item.serverId);
}
}
@@ -3,6 +3,7 @@ import 'package:material_symbols_icons/symbols.dart';
import '../../../mpv/mpv.dart';
import '../../../i18n/strings.g.dart';
import '../../../utils/scroll_utils.dart';
import '../../../utils/track_label_builder.dart';
import '../../../widgets/overlay_sheet.dart';
import 'base_video_control_sheet.dart';
@@ -125,7 +126,7 @@ class TrackSheet extends StatelessWidget {
}
}
class _AudioColumn extends StatelessWidget {
class _AudioColumn extends StatefulWidget {
final List<AudioTrack> tracks;
final TrackSelection selection;
final Player player;
@@ -140,18 +141,42 @@ class _AudioColumn extends StatelessWidget {
required this.showHeader,
});
@override
State<_AudioColumn> createState() => _AudioColumnState();
}
class _AudioColumnState extends State<_AudioColumn> {
final _firstItemKey = GlobalKey();
final _scrollController = ScrollController();
bool _didInitialScroll = false;
@override
void dispose() {
_scrollController.dispose();
super.dispose();
}
@override
Widget build(BuildContext context) {
final selectedId = selection.audio?.id ?? '';
final selectedId = widget.selection.audio?.id ?? '';
if (!_didInitialScroll) {
final selectedIndex = widget.tracks.indexWhere((t) => t.id == selectedId);
if (selectedIndex > 0) {
_didInitialScroll = true;
scrollToCurrentItem(_scrollController, _firstItemKey, selectedIndex);
}
}
return Column(
children: [
if (showHeader) _ColumnHeader(label: t.videoControls.audioLabel),
if (widget.showHeader) _ColumnHeader(label: t.videoControls.audioLabel),
Expanded(
child: ListView.builder(
itemCount: tracks.length,
controller: _scrollController,
itemCount: widget.tracks.length,
itemBuilder: (context, index) {
final track = tracks[index];
final track = widget.tracks[index];
final label = TrackLabelBuilder.buildAudioLabel(
title: track.title,
language: track.language,
@@ -161,11 +186,12 @@ class _AudioColumn extends StatelessWidget {
);
return TrackSelectionHelper.buildTrackTile<AudioTrack>(
context: context,
key: index == 0 ? _firstItemKey : null,
label: label,
isSelected: track.id == selectedId,
onTap: () {
player.selectAudioTrack(track);
onTrackChanged?.call(track);
widget.player.selectAudioTrack(track);
widget.onTrackChanged?.call(track);
OverlaySheetController.of(context).close();
},
);
@@ -177,7 +203,7 @@ class _AudioColumn extends StatelessWidget {
}
}
class _SubtitleColumn extends StatelessWidget {
class _SubtitleColumn extends StatefulWidget {
final List<SubtitleTrack> tracks;
final TrackSelection selection;
final Player player;
@@ -196,54 +222,80 @@ class _SubtitleColumn extends StatelessWidget {
required this.showHeader,
});
@override
State<_SubtitleColumn> createState() => _SubtitleColumnState();
}
class _SubtitleColumnState extends State<_SubtitleColumn> {
final _firstItemKey = GlobalKey();
final _scrollController = ScrollController();
bool _didInitialScroll = false;
@override
void dispose() {
_scrollController.dispose();
super.dispose();
}
@override
Widget build(BuildContext context) {
final selectedSub = selection.subtitle;
final secondarySub = selection.secondarySubtitle;
final selectedSub = widget.selection.subtitle;
final secondarySub = widget.selection.secondarySubtitle;
final isOffSelected = selectedSub == null || selectedSub.id == 'no';
final hasSecondary = supportsSecondary && secondarySub != null;
final hasSecondary = widget.supportsSecondary && secondarySub != null;
// +1 for "Off" row
final itemCount = tracks.length + 1;
final itemCount = widget.tracks.length + 1;
if (!_didInitialScroll && !isOffSelected) {
// +1 because index 0 is the "Off" row
final selectedIndex = widget.tracks.indexWhere((t) => t.id == selectedSub.id) + 1;
if (selectedIndex > 0) {
_didInitialScroll = true;
scrollToCurrentItem(_scrollController, _firstItemKey, selectedIndex);
}
}
return Column(
children: [
if (showHeader) _ColumnHeader(label: t.videoControls.subtitlesLabel),
if (widget.showHeader) _ColumnHeader(label: t.videoControls.subtitlesLabel),
Expanded(
child: ListView.builder(
controller: _scrollController,
itemCount: itemCount,
itemBuilder: (context, index) {
// "Off" row
if (index == 0) {
return TrackSelectionHelper.buildOffTile<SubtitleTrack>(
context: context,
key: _firstItemKey,
isSelected: isOffSelected,
onTap: () {
// Turning off primary also clears secondary
if (hasSecondary) {
player.selectSecondarySubtitleTrack(SubtitleTrack.off);
onSecondaryTrackChanged?.call(SubtitleTrack.off);
widget.player.selectSecondarySubtitleTrack(SubtitleTrack.off);
widget.onSecondaryTrackChanged?.call(SubtitleTrack.off);
}
player.selectSubtitleTrack(SubtitleTrack.off);
onTrackChanged?.call(SubtitleTrack.off);
widget.player.selectSubtitleTrack(SubtitleTrack.off);
widget.onTrackChanged?.call(SubtitleTrack.off);
OverlaySheetController.of(context).close();
},
onLongPress: supportsSecondary && hasSecondary
onLongPress: widget.supportsSecondary && hasSecondary
? () {
player.selectSecondarySubtitleTrack(SubtitleTrack.off);
onSecondaryTrackChanged?.call(SubtitleTrack.off);
widget.player.selectSecondarySubtitleTrack(SubtitleTrack.off);
widget.onSecondaryTrackChanged?.call(SubtitleTrack.off);
}
: null,
onSecondaryTap: supportsSecondary && hasSecondary
onSecondaryTap: widget.supportsSecondary && hasSecondary
? () {
player.selectSecondarySubtitleTrack(SubtitleTrack.off);
onSecondaryTrackChanged?.call(SubtitleTrack.off);
widget.player.selectSecondarySubtitleTrack(SubtitleTrack.off);
widget.onSecondaryTrackChanged?.call(SubtitleTrack.off);
}
: null,
);
}
final track = tracks[index - 1];
final track = widget.tracks[index - 1];
final isPrimary = !isOffSelected && track.id == selectedSub.id;
final isSecondary = hasSecondary && track.id == secondarySub.id;
final label = TrackLabelBuilder.buildSubtitleLabel(
@@ -255,7 +307,7 @@ class _SubtitleColumn extends StatelessWidget {
// Determine badge
Widget? badge;
if (supportsSecondary && hasSecondary) {
if (widget.supportsSecondary && hasSecondary) {
if (isPrimary) {
badge = TrackSelectionHelper.buildTrackBadge(context, 1);
} else if (isSecondary) {
@@ -271,34 +323,34 @@ class _SubtitleColumn extends StatelessWidget {
onTap: () {
// If tapping a track that is currently the secondary, clear secondary first
if (isSecondary) {
player.selectSecondarySubtitleTrack(SubtitleTrack.off);
onSecondaryTrackChanged?.call(SubtitleTrack.off);
widget.player.selectSecondarySubtitleTrack(SubtitleTrack.off);
widget.onSecondaryTrackChanged?.call(SubtitleTrack.off);
}
player.selectSubtitleTrack(track);
onTrackChanged?.call(track);
widget.player.selectSubtitleTrack(track);
widget.onTrackChanged?.call(track);
OverlaySheetController.of(context).close();
},
onLongPress: supportsSecondary
onLongPress: widget.supportsSecondary
? () {
if (isSecondary) {
// Already secondary — clear it
player.selectSecondarySubtitleTrack(SubtitleTrack.off);
onSecondaryTrackChanged?.call(SubtitleTrack.off);
widget.player.selectSecondarySubtitleTrack(SubtitleTrack.off);
widget.onSecondaryTrackChanged?.call(SubtitleTrack.off);
} else if (!isPrimary) {
// Set as secondary (don't close sheet so user sees badge update)
player.selectSecondarySubtitleTrack(track);
onSecondaryTrackChanged?.call(track);
widget.player.selectSecondarySubtitleTrack(track);
widget.onSecondaryTrackChanged?.call(track);
}
}
: null,
onSecondaryTap: supportsSecondary
onSecondaryTap: widget.supportsSecondary
? () {
if (isSecondary) {
player.selectSecondarySubtitleTrack(SubtitleTrack.off);
onSecondaryTrackChanged?.call(SubtitleTrack.off);
widget.player.selectSecondarySubtitleTrack(SubtitleTrack.off);
widget.onSecondaryTrackChanged?.call(SubtitleTrack.off);
} else if (!isPrimary) {
player.selectSecondarySubtitleTrack(track);
onSecondaryTrackChanged?.call(track);
widget.player.selectSecondarySubtitleTrack(track);
widget.onSecondaryTrackChanged?.call(track);
}
}
: null,
@@ -1,7 +1,9 @@
import 'dart:io';
import 'package:file_picker/file_picker.dart';
import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:plezy/widgets/app_icon.dart';
import 'package:material_symbols_icons/symbols.dart';
import 'package:path/path.dart' as path;
@@ -509,6 +511,17 @@ class _VideoSettingsSheetState extends State<VideoSettingsSheet> {
),
onTap: _togglePerformanceOverlay,
),
// Debug: Trigger MPV Fallback (Android ExoPlayer only)
if (kDebugMode && Platform.isAndroid && widget.player.playerType == 'exoplayer')
FocusableListTile(
leading: AppIcon(Symbols.swap_horiz_rounded, fill: 1, color: tokens(context).textMuted),
title: const Text('Trigger MPV Fallback'),
onTap: () {
const MethodChannel('com.plezy/exo_player').invokeMethod('triggerFallback');
OverlaySheetController.of(context).close();
},
),
],
);
}
+90 -5
View File
@@ -221,9 +221,13 @@ class _PlexVideoControlsState extends State<PlexVideoControls> with WindowListen
late final FocusNode _focusNode;
KeyboardShortcutsService? _keyboardService;
int _seekTimeSmall = 10; // Default, loaded from settings
int _rewindOnResume = 0; // Default, loaded from settings
int _audioSyncOffset = 0; // Default, loaded from settings
int _subtitleSyncOffset = 0; // Default, loaded from settings
bool _isRotationLocked = true; // Default locked (landscape only)
bool _isScreenLocked = false; // Touch lock during playback
bool _showLockIcon = false; // Whether to show the lock overlay icon
Timer? _lockIconTimer;
bool _clickVideoTogglesPlayback = false; // Default, loaded from settings
bool _isContentStripVisible = false; // Whether the swipe-up content strip is showing
@@ -553,6 +557,7 @@ class _PlexVideoControlsState extends State<PlexVideoControls> with WindowListen
if (mounted) {
setState(() {
_seekTimeSmall = settingsService.getSeekTimeSmall();
_rewindOnResume = settingsService.getRewindOnResume();
_audioSyncOffset = settingsService.getAudioSyncOffset();
_subtitleSyncOffset = settingsService.getSubtitleSyncOffset();
_isRotationLocked = settingsService.getRotationLocked();
@@ -661,6 +666,7 @@ class _PlexVideoControlsState extends State<PlexVideoControls> with WindowListen
widget.hasFirstFrame?.removeListener(_onFirstFrameReady);
_hideTimer?.cancel();
_feedbackTimer?.cancel();
_lockIconTimer?.cancel();
_autoSkipTimer?.cancel();
_skipButtonDismissTimer?.cancel();
_singleTapTimer?.cancel();
@@ -898,6 +904,38 @@ class _PlexVideoControlsState extends State<PlexVideoControls> with WindowListen
}
}
void _toggleScreenLock() {
final locking = !_isScreenLocked;
setState(() {
_isScreenLocked = locking;
if (locking) {
_showLockIcon = true;
}
});
if (locking) {
_hideControls();
_startLockIconHideTimer();
}
}
void _startLockIconHideTimer() {
_lockIconTimer?.cancel();
_lockIconTimer = Timer(const Duration(seconds: 3), () {
if (mounted) setState(() => _showLockIcon = false);
});
}
void _unlockScreen() {
setState(() {
_isScreenLocked = false;
_showLockIcon = false;
_showControls = true;
});
_lockIconTimer?.cancel();
widget.controlsVisible?.value = true;
_startHideTimer();
}
void _updateTrafficLightVisibility() async {
// When maximized or fullscreen, always keep traffic lights visible so the
// user can reach them without the controls-hide-on-mouse-leave race.
@@ -1048,6 +1086,7 @@ class _PlexVideoControlsState extends State<PlexVideoControls> with WindowListen
audioSyncOffset: _audioSyncOffset,
subtitleSyncOffset: _subtitleSyncOffset,
isRotationLocked: _isRotationLocked,
isScreenLocked: _isScreenLocked,
isFullscreen: _isFullscreen,
isAlwaysOnTop: _isAlwaysOnTop,
onTogglePIPMode: (_isPipSupported && !PlatformDetector.isTV())
@@ -1055,6 +1094,7 @@ class _PlexVideoControlsState extends State<PlexVideoControls> with WindowListen
: null,
onCycleBoxFitMode: widget.player.playerType != 'exoplayer' ? widget.onCycleBoxFitMode : null,
onToggleRotationLock: _toggleRotationLock,
onToggleScreenLock: _toggleScreenLock,
onToggleFullscreen: _toggleFullscreen,
onToggleAlwaysOnTop: onToggleAlwaysOnTop,
onSwitchVersion: _switchMediaVersion,
@@ -1167,6 +1207,15 @@ class _PlexVideoControlsState extends State<PlexVideoControls> with WindowListen
}
}
Future<void> _playOrPause() async {
if (!widget.player.state.playing && _rewindOnResume > 0) {
final target = widget.player.state.position - Duration(seconds: _rewindOnResume);
final clamped = clampSeekPosition(widget.player, target);
await widget.player.seek(clamped);
}
await widget.player.playOrPause();
}
/// Throttled seek for timeline slider - executes immediately then throttles to 200ms
void _throttledSeek(Duration position) => _seekThrottle([position]);
@@ -1179,7 +1228,7 @@ class _PlexVideoControlsState extends State<PlexVideoControls> with WindowListen
/// Handle tap in skip zone for desktop mode
void _handleTapInSkipZoneDesktop() {
if (widget.canControl && _clickVideoTogglesPlayback) {
widget.player.playOrPause();
_playOrPause();
}
_toggleControls();
@@ -1307,7 +1356,7 @@ class _PlexVideoControlsState extends State<PlexVideoControls> with WindowListen
// Always perform the single-click behavior immediately
if (widget.canControl && _clickVideoTogglesPlayback) {
widget.player.playOrPause();
_playOrPause();
} else {
_toggleControls();
}
@@ -1582,7 +1631,7 @@ class _PlexVideoControlsState extends State<PlexVideoControls> with WindowListen
// Handle play/pause globally - works regardless of focus
if (_isPlayPauseActivation(event)) {
widget.player.playOrPause();
_playOrPause();
_showControlsWithFocus(requestFocus: false);
return true; // Event handled, stop propagation
}
@@ -1773,7 +1822,7 @@ class _PlexVideoControlsState extends State<PlexVideoControls> with WindowListen
if (isPlayPauseKey) {
if (_videoPlayerNavigationEnabled || isMobile) {
if (_isPlayPauseActivation(event)) {
widget.player.playOrPause();
_playOrPause();
_showControlsWithFocus(requestFocus: _videoPlayerNavigationEnabled);
}
}
@@ -1805,7 +1854,7 @@ class _PlexVideoControlsState extends State<PlexVideoControls> with WindowListen
// Handle Select/Enter when controls are hidden: pause and show controls
// Only intercept if this Focus node itself has primary focus (not a descendant)
if (_isSelectKey(key) && !_showControls && _focusNode.hasPrimaryFocus) {
widget.player.playOrPause();
_playOrPause();
_showControlsWithFocus();
return KeyEventResult.handled;
}
@@ -2099,6 +2148,42 @@ class _PlexVideoControlsState extends State<PlexVideoControls> with WindowListen
left: 16,
child: IgnorePointer(child: PlayerPerformanceOverlay(player: widget.player)),
),
// Screen lock overlay - absorbs all touches when active
if (_isScreenLocked)
Positioned.fill(
child: GestureDetector(
behavior: HitTestBehavior.opaque,
onTap: () {
setState(() => _showLockIcon = true);
_startLockIconHideTimer();
},
onLongPress: _unlockScreen,
child: AnimatedOpacity(
opacity: _showLockIcon ? 1.0 : 0.0,
duration: const Duration(milliseconds: 200),
child: Center(
child: Container(
padding: const EdgeInsets.symmetric(horizontal: 20, vertical: 14),
decoration: BoxDecoration(
color: Colors.black.withValues(alpha: 0.6),
borderRadius: const BorderRadius.all(Radius.circular(28)),
),
child: Row(
mainAxisSize: MainAxisSize.min,
children: [
const AppIcon(Symbols.lock_rounded, fill: 1, color: Colors.white, size: 20),
const SizedBox(width: 8),
Text(
t.videoControls.longPressToUnlock,
style: const TextStyle(color: Colors.white, fontSize: 14, fontWeight: FontWeight.w500),
),
],
),
),
),
),
),
),
],
),
),
@@ -70,11 +70,13 @@ class TrackChapterControls extends StatelessWidget {
int get audioSyncOffset => trackControlsState.audioSyncOffset;
int get subtitleSyncOffset => trackControlsState.subtitleSyncOffset;
bool get isRotationLocked => trackControlsState.isRotationLocked;
bool get isScreenLocked => trackControlsState.isScreenLocked;
bool get isFullscreen => trackControlsState.isFullscreen;
bool get isAlwaysOnTop => trackControlsState.isAlwaysOnTop;
VoidCallback? get onTogglePIPMode => trackControlsState.onTogglePIPMode;
VoidCallback? get onCycleBoxFitMode => trackControlsState.onCycleBoxFitMode;
VoidCallback? get onToggleRotationLock => trackControlsState.onToggleRotationLock;
VoidCallback? get onToggleScreenLock => trackControlsState.onToggleScreenLock;
VoidCallback? get onToggleFullscreen => trackControlsState.onToggleFullscreen;
VoidCallback? get onToggleAlwaysOnTop => trackControlsState.onToggleAlwaysOnTop;
Function(int)? get onSwitchVersion => trackControlsState.onSwitchVersion;
@@ -404,6 +406,24 @@ class TrackChapterControls extends StatelessWidget {
buttonIndex++;
}
// Screen lock button (mobile only, not on TV)
if (isMobile && !PlatformDetector.isTV()) {
final currentIndex = buttonIndex;
buttons.add(
_buildTrackButton(
buttonIndex: currentIndex,
icon: Symbols.lock_rounded,
tooltip: t.videoControls.lockScreen,
semanticLabel: t.videoControls.screenLockButton,
tracks: tracks,
isMobile: isMobile,
isDesktop: isDesktop,
onPressed: onToggleScreenLock,
),
);
buttonIndex++;
}
// Always on top button (desktop only, not TV)
if (isDesktop && onToggleAlwaysOnTop != null) {
final currentIndex = buttonIndex;
+1
View File
@@ -13,6 +13,7 @@ list(APPEND FLUTTER_PLUGIN_LIST
)
list(APPEND FLUTTER_FFI_PLUGIN_LIST
jni
)
set(PLUGIN_BUNDLED_LIBRARIES)
+5 -20
View File
@@ -1,10 +1,6 @@
#include "my_application.h"
#include <flutter_linux/flutter_linux.h>
#ifdef GDK_WINDOWING_X11
#include <gdk/gdkx.h>
#endif
#include "flutter/generated_plugin_registrant.h"
#include "mpv/mpv_plugin.h"
@@ -22,23 +18,12 @@ static void my_application_activate(GApplication* application) {
GtkWindow* window =
GTK_WINDOW(gtk_application_window_new(GTK_APPLICATION(application)));
// Use a header bar when running in GNOME as this is the common style used
// by applications and is the setup most users will be using (e.g. Ubuntu
// desktop).
// If running on X and not using GNOME then just use a traditional title bar
// in case the window manager does more exotic layout, e.g. tiling.
// If running on Wayland assume the header bar will work (may need changing
// if future cases occur).
gboolean use_header_bar = TRUE;
#ifdef GDK_WINDOWING_X11
GdkScreen* screen = gtk_window_get_screen(window);
if (GDK_IS_X11_SCREEN(screen)) {
const gchar* wm_name = gdk_x11_screen_get_window_manager_name(screen);
if (g_strcmp0(wm_name, "GNOME Shell") != 0) {
use_header_bar = FALSE;
}
// Default to traditional titlebar. Set GTK_CSD=1 to use a header bar.
gboolean use_header_bar = FALSE;
const gchar* gtk_csd = g_getenv("GTK_CSD");
if (gtk_csd != nullptr && g_strcmp0(gtk_csd, "1") == 0) {
use_header_bar = TRUE;
}
#endif
if (use_header_bar) {
GtkHeaderBar* header_bar = GTK_HEADER_BAR(gtk_header_bar_new());
gtk_widget_show(GTK_WIDGET(header_bar));
@@ -13,7 +13,6 @@ import in_app_review
import mobile_scanner
import os_media_controls
import package_info_plus
import path_provider_foundation
import screen_retriever_macos
import sentry_flutter
import shared_preferences_foundation
@@ -33,7 +32,6 @@ func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) {
MobileScannerPlugin.register(with: registry.registrar(forPlugin: "MobileScannerPlugin"))
OsMediaControlsPlugin.register(with: registry.registrar(forPlugin: "OsMediaControlsPlugin"))
FPPPackageInfoPlusPlugin.register(with: registry.registrar(forPlugin: "FPPPackageInfoPlusPlugin"))
PathProviderPlugin.register(with: registry.registrar(forPlugin: "PathProviderPlugin"))
ScreenRetrieverMacosPlugin.register(with: registry.registrar(forPlugin: "ScreenRetrieverMacosPlugin"))
SentryFlutterPlugin.register(with: registry.registrar(forPlugin: "SentryFlutterPlugin"))
SharedPreferencesPlugin.register(with: registry.registrar(forPlugin: "SharedPreferencesPlugin"))
+22 -28
View File
@@ -11,22 +11,20 @@ PODS:
- FlutterMacOS (1.0.0)
- in_app_review (2.0.0):
- FlutterMacOS
- mobile_scanner (6.0.2):
- mobile_scanner (7.0.0):
- Flutter
- FlutterMacOS
- os_media_controls (0.0.1):
- FlutterMacOS
- package_info_plus (0.0.1):
- FlutterMacOS
- path_provider_foundation (0.0.1):
- Flutter
- FlutterMacOS
- screen_retriever_macos (0.0.1):
- FlutterMacOS
- Sentry/HybridSDK (8.46.0)
- sentry_flutter (8.14.2):
- Sentry/HybridSDK (8.58.0)
- sentry_flutter (9.15.0):
- Flutter
- FlutterMacOS
- Sentry/HybridSDK (= 8.46.0)
- Sentry/HybridSDK (= 8.58.0)
- shared_preferences_foundation (0.0.1):
- Flutter
- FlutterMacOS
@@ -34,25 +32,25 @@ PODS:
- sqflite_darwin (0.0.4):
- Flutter
- FlutterMacOS
- sqlite3 (3.51.1):
- sqlite3/common (= 3.51.1)
- sqlite3/common (3.51.1)
- sqlite3/dbstatvtab (3.51.1):
- sqlite3 (3.52.0):
- sqlite3/common (= 3.52.0)
- sqlite3/common (3.52.0)
- sqlite3/dbstatvtab (3.52.0):
- sqlite3/common
- sqlite3/fts5 (3.51.1):
- sqlite3/fts5 (3.52.0):
- sqlite3/common
- sqlite3/math (3.51.1):
- sqlite3/math (3.52.0):
- sqlite3/common
- sqlite3/perf-threadsafe (3.51.1):
- sqlite3/perf-threadsafe (3.52.0):
- sqlite3/common
- sqlite3/rtree (3.51.1):
- sqlite3/rtree (3.52.0):
- sqlite3/common
- sqlite3/session (3.51.1):
- sqlite3/session (3.52.0):
- sqlite3/common
- sqlite3_flutter_libs (0.0.1):
- Flutter
- FlutterMacOS
- sqlite3 (~> 3.51.1)
- sqlite3 (~> 3.52.0)
- sqlite3/dbstatvtab
- sqlite3/fts5
- sqlite3/math
@@ -75,10 +73,9 @@ DEPENDENCIES:
- file_picker (from `Flutter/ephemeral/.symlinks/plugins/file_picker/macos`)
- FlutterMacOS (from `Flutter/ephemeral`)
- in_app_review (from `Flutter/ephemeral/.symlinks/plugins/in_app_review/macos`)
- mobile_scanner (from `Flutter/ephemeral/.symlinks/plugins/mobile_scanner/macos`)
- mobile_scanner (from `Flutter/ephemeral/.symlinks/plugins/mobile_scanner/darwin`)
- os_media_controls (from `Flutter/ephemeral/.symlinks/plugins/os_media_controls/macos`)
- package_info_plus (from `Flutter/ephemeral/.symlinks/plugins/package_info_plus/macos`)
- path_provider_foundation (from `Flutter/ephemeral/.symlinks/plugins/path_provider_foundation/darwin`)
- screen_retriever_macos (from `Flutter/ephemeral/.symlinks/plugins/screen_retriever_macos/macos`)
- sentry_flutter (from `Flutter/ephemeral/.symlinks/plugins/sentry_flutter/macos`)
- shared_preferences_foundation (from `Flutter/ephemeral/.symlinks/plugins/shared_preferences_foundation/darwin`)
@@ -109,13 +106,11 @@ EXTERNAL SOURCES:
in_app_review:
:path: Flutter/ephemeral/.symlinks/plugins/in_app_review/macos
mobile_scanner:
:path: Flutter/ephemeral/.symlinks/plugins/mobile_scanner/macos
:path: Flutter/ephemeral/.symlinks/plugins/mobile_scanner/darwin
os_media_controls:
:path: Flutter/ephemeral/.symlinks/plugins/os_media_controls/macos
package_info_plus:
:path: Flutter/ephemeral/.symlinks/plugins/package_info_plus/macos
path_provider_foundation:
:path: Flutter/ephemeral/.symlinks/plugins/path_provider_foundation/darwin
screen_retriever_macos:
:path: Flutter/ephemeral/.symlinks/plugins/screen_retriever_macos/macos
sentry_flutter:
@@ -142,18 +137,17 @@ SPEC CHECKSUMS:
file_picker: 7584aae6fa07a041af2b36a2655122d42f578c1a
FlutterMacOS: d0db08ddef1a9af05a5ec4b724367152bb0500b1
in_app_review: 66e7680752b632d83f4f0e88b34d52ed303fbff4
mobile_scanner: 0e365ed56cad24f28c0fd858ca04edefb40dfac3
mobile_scanner: 9157936403f5a0644ca3779a38ff8404c5434a93
os_media_controls: c07c04c4afdf59dda0a3f398457a46823c4ce0ed
package_info_plus: f0052d280d17aa382b932f399edf32507174e870
path_provider_foundation: bb55f6dbba17d0dccd6737fe6f7f34fbd0376880
screen_retriever_macos: 452e51764a9e1cdb74b3c541238795849f21557f
Sentry: da60d980b197a46db0b35ea12cb8f39af48d8854
sentry_flutter: 27892878729f42701297c628eb90e7c6529f3684
Sentry: d587a8fe91ca13503ecd69a1905f3e8a0fcf61be
sentry_flutter: 8939e491bc1511868118c96cae47d945e6f69798
shared_preferences_foundation: 7036424c3d8ec98dfe75ff1667cb0cd531ec82bb
Sparkle: f4355f9ebbe9b7d932df4980d70f13922ac97b2a
sqflite_darwin: 20b2a3a3b70e43edae938624ce550a3cbf66a3d0
sqlite3: 8d708bc63e9f4ce48f0ad9d6269e478c5ced1d9b
sqlite3_flutter_libs: d13b8b3003f18f596e542bcb9482d105577eff41
sqlite3: a51c07cf16e023d6c48abd5e5791a61a47354921
sqlite3_flutter_libs: b3e120efe9a82017e5552a620f696589ed4f62ab
universal_gamepad: 8922f1f238f62d6847de887228976d5b572b57da
url_launcher_macos: f87a979182d112f911de6820aefddaf56ee9fbfd
wakelock_plus: 917609be14d812ddd9e9528876538b2263aaa03b
+60 -60
View File
@@ -21,22 +21,22 @@
/* End PBXAggregateTarget section */
/* Begin PBXBuildFile section */
0BAE8FC95BA6BEE8BE54E226 /* Pods_RunnerTests.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C288E870F896AD55006C19AF /* Pods_RunnerTests.framework */; };
28A54CB9141D0CB5BB3C2E50 /* Pods_Runner.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6F93D3355F7A242CE67311F7 /* Pods_Runner.framework */; };
331C80D8294CF71000263BE5 /* RunnerTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 331C80D7294CF71000263BE5 /* RunnerTests.swift */; };
335BBD1B22A9A15E00E9071D /* GeneratedPluginRegistrant.swift in Sources */ = {isa = PBXBuildFile; fileRef = 335BBD1A22A9A15E00E9071D /* GeneratedPluginRegistrant.swift */; };
33CC10F12044A3C60003C045 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 33CC10F02044A3C60003C045 /* AppDelegate.swift */; };
33CC10F62044A3C60003C045 /* MainMenu.xib in Resources */ = {isa = PBXBuildFile; fileRef = 33CC10F42044A3C60003C045 /* MainMenu.xib */; };
33CC11132044BFA00003C045 /* MainFlutterWindow.swift in Sources */ = {isa = PBXBuildFile; fileRef = 33CC11122044BFA00003C045 /* MainFlutterWindow.swift */; };
48A1C0CB0ECA2EA7D04EEF48 /* Pods_RunnerTests.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A1182D4EEFEC88235D8ECD2C /* Pods_RunnerTests.framework */; };
6AB6B0952EDB27C100EAC8DB /* MPVKit in Frameworks */ = {isa = PBXBuildFile; productRef = 6AB6B0942EDB27C100EAC8DB /* MPVKit */; };
6AC86ED72EA70B4C0067BC66 /* plezy.icon in Resources */ = {isa = PBXBuildFile; fileRef = 6AC86ED62EA70B4C0067BC66 /* plezy.icon */; };
6AD8B1612ED7B50000E9E1B4 /* MpvPlayerCore.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6AD8B1632ED7B50000E9E1B4 /* MpvPlayerCore.swift */; };
6AD8B1622ED7B50000E9E1B4 /* MpvPlayerPlugin.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6AD8B1642ED7B50000E9E1B4 /* MpvPlayerPlugin.swift */; };
B1D51A6A2F00110000000003 /* MpvPlayerCoreBase.swift in Sources */ = {isa = PBXBuildFile; fileRef = B1D51A6A2F00110000000004 /* MpvPlayerCoreBase.swift */; };
B1D51A6A2F00110000000007 /* MpvPlayerPluginShared.swift in Sources */ = {isa = PBXBuildFile; fileRef = B1D51A6A2F00110000000008 /* MpvPlayerPluginShared.swift */; };
6AD8B1662ED7B50000E9E1B5 /* WindowUtilsPlugin.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6AD8B1682ED7B50000E9E1B5 /* WindowUtilsPlugin.swift */; };
6AD8B1672ED7B50000E9E1B5 /* WindowDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6AD8B1692ED7B50000E9E1B5 /* WindowDelegate.swift */; };
6AD8B16A2ED7B50000E9E1B6 /* MpvPipController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6AD8B16B2ED7B50000E9E1B6 /* MpvPipController.swift */; };
DF7527C52F58F90C45939A79 /* Pods_Runner.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 81BACC65DEDF97C1CA1F025F /* Pods_Runner.framework */; };
B1D51A6A2F00110000000003 /* MpvPlayerCoreBase.swift in Sources */ = {isa = PBXBuildFile; fileRef = B1D51A6A2F00110000000004 /* MpvPlayerCoreBase.swift */; };
B1D51A6A2F00110000000007 /* MpvPlayerPluginShared.swift in Sources */ = {isa = PBXBuildFile; fileRef = B1D51A6A2F00110000000008 /* MpvPlayerPluginShared.swift */; };
/* End PBXBuildFile section */
/* Begin PBXContainerItemProxy section */
@@ -70,8 +70,8 @@
/* End PBXCopyFilesBuildPhase section */
/* Begin PBXFileReference section */
0914125761A3FFED904A420B /* Pods-RunnerTests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-RunnerTests.debug.xcconfig"; path = "Target Support Files/Pods-RunnerTests/Pods-RunnerTests.debug.xcconfig"; sourceTree = "<group>"; };
0BF4BB2D93DB27E23E7E5693 /* Pods-Runner.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.release.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"; sourceTree = "<group>"; };
10C0002C657183E0886559B6 /* Pods-RunnerTests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-RunnerTests.release.xcconfig"; path = "Target Support Files/Pods-RunnerTests/Pods-RunnerTests.release.xcconfig"; sourceTree = "<group>"; };
2BF8F34B75C7EEBFABBAFB4A /* Pods-Runner.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.debug.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"; sourceTree = "<group>"; };
331C80D5294CF71000263BE5 /* RunnerTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = RunnerTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
331C80D7294CF71000263BE5 /* RunnerTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RunnerTests.swift; sourceTree = "<group>"; };
333000ED22D3DE5D00554162 /* Warnings.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = Warnings.xcconfig; sourceTree = "<group>"; };
@@ -90,20 +90,20 @@
6AC86ED62EA70B4C0067BC66 /* plezy.icon */ = {isa = PBXFileReference; lastKnownFileType = folder.iconcomposer.icon; path = plezy.icon; sourceTree = "<group>"; };
6AD8B1632ED7B50000E9E1B4 /* MpvPlayerCore.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MpvPlayerCore.swift; sourceTree = "<group>"; };
6AD8B1642ED7B50000E9E1B4 /* MpvPlayerPlugin.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MpvPlayerPlugin.swift; sourceTree = "<group>"; };
B1D51A6A2F00110000000004 /* MpvPlayerCoreBase.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; name = MpvPlayerCoreBase.swift; path = ../shared/apple/MpvPlayer/MpvPlayerCoreBase.swift; sourceTree = SOURCE_ROOT; };
B1D51A6A2F00110000000008 /* MpvPlayerPluginShared.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; name = MpvPlayerPluginShared.swift; path = ../shared/apple/MpvPlayer/MpvPlayerPluginShared.swift; sourceTree = SOURCE_ROOT; };
6AD8B1682ED7B50000E9E1B5 /* WindowUtilsPlugin.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = WindowUtilsPlugin.swift; sourceTree = "<group>"; };
6AD8B1692ED7B50000E9E1B5 /* WindowDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = WindowDelegate.swift; sourceTree = "<group>"; };
6AD8B16B2ED7B50000E9E1B6 /* MpvPipController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MpvPipController.swift; sourceTree = "<group>"; };
6AD8B16C2ED7B50000E9E1B7 /* Runner-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Runner-Bridging-Header.h"; sourceTree = "<group>"; };
6E770EFFB2EDFFA0C566F238 /* Pods-Runner.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.debug.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"; sourceTree = "<group>"; };
6F93D3355F7A242CE67311F7 /* Pods_Runner.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Runner.framework; sourceTree = BUILT_PRODUCTS_DIR; };
7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = Release.xcconfig; sourceTree = "<group>"; };
81BACC65DEDF97C1CA1F025F /* Pods_Runner.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Runner.framework; sourceTree = BUILT_PRODUCTS_DIR; };
863E12C4C6A60FB467E55718 /* 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>"; };
8EBAA3429D388D3763D6B06B /* Pods-RunnerTests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-RunnerTests.debug.xcconfig"; path = "Target Support Files/Pods-RunnerTests/Pods-RunnerTests.debug.xcconfig"; sourceTree = "<group>"; };
9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = Debug.xcconfig; sourceTree = "<group>"; };
9B9AC1D995B9CED225415BEA /* 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>"; };
AE89312A44808FBB8B2C16DA /* Pods-RunnerTests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-RunnerTests.release.xcconfig"; path = "Target Support Files/Pods-RunnerTests/Pods-RunnerTests.release.xcconfig"; sourceTree = "<group>"; };
C288E870F896AD55006C19AF /* Pods_RunnerTests.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_RunnerTests.framework; sourceTree = BUILT_PRODUCTS_DIR; };
FD163DB087582522BD55DCAB /* Pods-RunnerTests.profile.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-RunnerTests.profile.xcconfig"; path = "Target Support Files/Pods-RunnerTests/Pods-RunnerTests.profile.xcconfig"; sourceTree = "<group>"; };
A1182D4EEFEC88235D8ECD2C /* Pods_RunnerTests.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_RunnerTests.framework; sourceTree = BUILT_PRODUCTS_DIR; };
B1D51A6A2F00110000000004 /* MpvPlayerCoreBase.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; name = MpvPlayerCoreBase.swift; path = ../shared/apple/MpvPlayer/MpvPlayerCoreBase.swift; sourceTree = SOURCE_ROOT; };
B1D51A6A2F00110000000008 /* MpvPlayerPluginShared.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; name = MpvPlayerPluginShared.swift; path = ../shared/apple/MpvPlayer/MpvPlayerPluginShared.swift; sourceTree = SOURCE_ROOT; };
B94440F7FE93A00B39D27ADF /* Pods-RunnerTests.profile.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-RunnerTests.profile.xcconfig"; path = "Target Support Files/Pods-RunnerTests/Pods-RunnerTests.profile.xcconfig"; sourceTree = "<group>"; };
DFD234339E4EACF84227E544 /* Pods-Runner.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.release.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"; sourceTree = "<group>"; };
/* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */
@@ -111,7 +111,7 @@
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
0BAE8FC95BA6BEE8BE54E226 /* Pods_RunnerTests.framework in Frameworks */,
48A1C0CB0ECA2EA7D04EEF48 /* Pods_RunnerTests.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -120,7 +120,7 @@
buildActionMask = 2147483647;
files = (
6AB6B0952EDB27C100EAC8DB /* MPVKit in Frameworks */,
DF7527C52F58F90C45939A79 /* Pods_Runner.framework in Frameworks */,
28A54CB9141D0CB5BB3C2E50 /* Pods_Runner.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -130,12 +130,12 @@
295400F6A94D53E806ED64A8 /* Pods */ = {
isa = PBXGroup;
children = (
6E770EFFB2EDFFA0C566F238 /* Pods-Runner.debug.xcconfig */,
0BF4BB2D93DB27E23E7E5693 /* Pods-Runner.release.xcconfig */,
9B9AC1D995B9CED225415BEA /* Pods-Runner.profile.xcconfig */,
0914125761A3FFED904A420B /* Pods-RunnerTests.debug.xcconfig */,
AE89312A44808FBB8B2C16DA /* Pods-RunnerTests.release.xcconfig */,
FD163DB087582522BD55DCAB /* Pods-RunnerTests.profile.xcconfig */,
2BF8F34B75C7EEBFABBAFB4A /* Pods-Runner.debug.xcconfig */,
DFD234339E4EACF84227E544 /* Pods-Runner.release.xcconfig */,
863E12C4C6A60FB467E55718 /* Pods-Runner.profile.xcconfig */,
8EBAA3429D388D3763D6B06B /* Pods-RunnerTests.debug.xcconfig */,
10C0002C657183E0886559B6 /* Pods-RunnerTests.release.xcconfig */,
B94440F7FE93A00B39D27ADF /* Pods-RunnerTests.profile.xcconfig */,
);
path = Pods;
sourceTree = "<group>";
@@ -168,7 +168,7 @@
331C80D6294CF71000263BE5 /* RunnerTests */,
33CC10EE2044A3C60003C045 /* Products */,
295400F6A94D53E806ED64A8 /* Pods */,
A25A237F70C8052CAABD850E /* Frameworks */,
F6FBDBA5A53C276F59BF3E7B /* Frameworks */,
);
sourceTree = "<group>";
};
@@ -231,11 +231,11 @@
path = MpvPlayer;
sourceTree = "<group>";
};
A25A237F70C8052CAABD850E /* Frameworks */ = {
F6FBDBA5A53C276F59BF3E7B /* Frameworks */ = {
isa = PBXGroup;
children = (
81BACC65DEDF97C1CA1F025F /* Pods_Runner.framework */,
C288E870F896AD55006C19AF /* Pods_RunnerTests.framework */,
6F93D3355F7A242CE67311F7 /* Pods_Runner.framework */,
A1182D4EEFEC88235D8ECD2C /* Pods_RunnerTests.framework */,
);
name = Frameworks;
sourceTree = "<group>";
@@ -247,7 +247,7 @@
isa = PBXNativeTarget;
buildConfigurationList = 331C80DE294CF71000263BE5 /* Build configuration list for PBXNativeTarget "RunnerTests" */;
buildPhases = (
CEDCA9B4C8CE113636A31DED /* [CP] Check Pods Manifest.lock */,
5AC82C270CCB245D9CDD34C7 /* [CP] Check Pods Manifest.lock */,
331C80D1294CF70F00263BE5 /* Sources */,
331C80D2294CF70F00263BE5 /* Frameworks */,
331C80D3294CF70F00263BE5 /* Resources */,
@@ -266,13 +266,13 @@
isa = PBXNativeTarget;
buildConfigurationList = 33CC10FB2044A3C60003C045 /* Build configuration list for PBXNativeTarget "Runner" */;
buildPhases = (
835BFBC4F69B434783C6907B /* [CP] Check Pods Manifest.lock */,
5E41E5A55F14C910C5BEEE03 /* [CP] Check Pods Manifest.lock */,
33CC10E92044A3C60003C045 /* Sources */,
33CC10EA2044A3C60003C045 /* Frameworks */,
33CC10EB2044A3C60003C045 /* Resources */,
33CC110E2044A8840003C045 /* Bundle Framework */,
3399D490228B24CF009A79C7 /* ShellScript */,
53E8C05D7685362D47C19320 /* [CP] Embed Pods Frameworks */,
38D3B21B4A8B8C7FF266779D /* [CP] Embed Pods Frameworks */,
);
buildRules = (
);
@@ -396,7 +396,7 @@
shellPath = /bin/sh;
shellScript = "\"$FLUTTER_ROOT\"/packages/flutter_tools/bin/macos_assemble.sh && touch Flutter/ephemeral/tripwire";
};
53E8C05D7685362D47C19320 /* [CP] Embed Pods Frameworks */ = {
38D3B21B4A8B8C7FF266779D /* [CP] Embed Pods Frameworks */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
@@ -413,29 +413,7 @@
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh\"\n";
showEnvVarsInLog = 0;
};
835BFBC4F69B434783C6907B /* [CP] Check Pods Manifest.lock */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputFileListPaths = (
);
inputPaths = (
"${PODS_PODFILE_DIR_PATH}/Podfile.lock",
"${PODS_ROOT}/Manifest.lock",
);
name = "[CP] Check Pods Manifest.lock";
outputFileListPaths = (
);
outputPaths = (
"$(DERIVED_FILE_DIR)/Pods-Runner-checkManifestLockResult.txt",
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n";
showEnvVarsInLog = 0;
};
CEDCA9B4C8CE113636A31DED /* [CP] Check Pods Manifest.lock */ = {
5AC82C270CCB245D9CDD34C7 /* [CP] Check Pods Manifest.lock */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
@@ -457,6 +435,28 @@
shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n";
showEnvVarsInLog = 0;
};
5E41E5A55F14C910C5BEEE03 /* [CP] Check Pods Manifest.lock */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputFileListPaths = (
);
inputPaths = (
"${PODS_PODFILE_DIR_PATH}/Podfile.lock",
"${PODS_ROOT}/Manifest.lock",
);
name = "[CP] Check Pods Manifest.lock";
outputFileListPaths = (
);
outputPaths = (
"$(DERIVED_FILE_DIR)/Pods-Runner-checkManifestLockResult.txt",
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n";
showEnvVarsInLog = 0;
};
/* End PBXShellScriptBuildPhase section */
/* Begin PBXSourcesBuildPhase section */
@@ -515,7 +515,7 @@
/* Begin XCBuildConfiguration section */
331C80DB294CF71000263BE5 /* Debug */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = 0914125761A3FFED904A420B /* Pods-RunnerTests.debug.xcconfig */;
baseConfigurationReference = 8EBAA3429D388D3763D6B06B /* Pods-RunnerTests.debug.xcconfig */;
buildSettings = {
BUNDLE_LOADER = "$(TEST_HOST)";
CURRENT_PROJECT_VERSION = 1;
@@ -530,7 +530,7 @@
};
331C80DC294CF71000263BE5 /* Release */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = AE89312A44808FBB8B2C16DA /* Pods-RunnerTests.release.xcconfig */;
baseConfigurationReference = 10C0002C657183E0886559B6 /* Pods-RunnerTests.release.xcconfig */;
buildSettings = {
BUNDLE_LOADER = "$(TEST_HOST)";
CURRENT_PROJECT_VERSION = 1;
@@ -545,7 +545,7 @@
};
331C80DD294CF71000263BE5 /* Profile */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = FD163DB087582522BD55DCAB /* Pods-RunnerTests.profile.xcconfig */;
baseConfigurationReference = B94440F7FE93A00B39D27ADF /* Pods-RunnerTests.profile.xcconfig */;
buildSettings = {
BUNDLE_LOADER = "$(TEST_HOST)";
CURRENT_PROJECT_VERSION = 1;
@@ -618,7 +618,7 @@
COMBINE_HIDPI_IMAGES = YES;
FRAMEWORK_SEARCH_PATHS = (
"$(inherited)",
"/System/Library/PrivateFrameworks",
/System/Library/PrivateFrameworks,
);
INFOPLIST_FILE = Runner/Info.plist;
LD_RUNPATH_SEARCH_PATHS = (
@@ -760,7 +760,7 @@
COMBINE_HIDPI_IMAGES = YES;
FRAMEWORK_SEARCH_PATHS = (
"$(inherited)",
"/System/Library/PrivateFrameworks",
/System/Library/PrivateFrameworks,
);
INFOPLIST_FILE = Runner/Info.plist;
LD_RUNPATH_SEARCH_PATHS = (
@@ -790,7 +790,7 @@
COMBINE_HIDPI_IMAGES = YES;
FRAMEWORK_SEARCH_PATHS = (
"$(inherited)",
"/System/Library/PrivateFrameworks",
/System/Library/PrivateFrameworks,
);
INFOPLIST_FILE = Runner/Info.plist;
LD_RUNPATH_SEARCH_PATHS = (
@@ -884,7 +884,7 @@
6AB6B0942EDB27C100EAC8DB /* MPVKit */ = {
isa = XCSwiftPackageProductDependency;
package = 6AB6B0932EDB27C100EAC8DB /* XCRemoteSwiftPackageReference "MPVKit" */;
productName = "MPVKit";
productName = MPVKit;
};
/* End XCSwiftPackageProductDependency section */
};
+1 -1
View File
@@ -33,7 +33,7 @@
<key>SUEnableAutomaticChecks</key>
<false/>
<key>SUFeedURL</key>
<string>https://github.com/edde746/plezy/releases/latest/download/appcast.xml</string>
<string>https://cdn.jsdelivr.net/gh/edde746/plezy@appcast/appcast.xml</string>
<key>SUPublicEDKey</key>
<string>q7t6eu1txRrqv1PeWDCRV95rFxnmD/D3GZWbUPMwUyU=</string>
</dict>

Some files were not shown because too many files have changed in this diff Show More