From 5a9b99f31cdaa4b1e39f80cc8315fb2763744e66 Mon Sep 17 00:00:00 2001 From: Francis Lavoie Date: Sun, 28 Jun 2026 09:55:26 -0400 Subject: [PATCH] feat(video): low-latency live playback + 2-decimal latency readout Bump the native player to the low-latency build (Twitch prefetch-segment promotion + TARGETDURATION reload-cadence fix) which brings live latency from ~9s down to ~3s, matching desktop. Show the latency readout to two decimals for precise feedback. Co-Authored-By: Claude Opus 4.8 (1M context) --- lib/screens/channel/video/native_video_store.dart | 2 +- pubspec.lock | 6 +++--- pubspec.yaml | 8 ++++++-- 3 files changed, 10 insertions(+), 6 deletions(-) diff --git a/lib/screens/channel/video/native_video_store.dart b/lib/screens/channel/video/native_video_store.dart index e0b789bc..97692869 100644 --- a/lib/screens/channel/video/native_video_store.dart +++ b/lib/screens/channel/video/native_video_store.dart @@ -886,7 +886,7 @@ abstract class NativeVideoStoreBase } _highLatencyCount = 0; - final newLatency = '${rounded}s'; + final newLatency = '${seconds.toStringAsFixed(2)}s'; if (newLatency != _latency) { runInAction(() { _latency = newLatency; diff --git a/pubspec.lock b/pubspec.lock index 4f4b25b0..d9f09b46 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -101,9 +101,9 @@ packages: dependency: "direct main" description: path: "." - ref: frosty-patches - resolved-ref: "6460859318b7b44034fe44016cddff02d0bd4c0a" - url: "https://github.com/tommyxchow/flutter-native-video-player.git" + ref: background-playback + resolved-ref: d47ef9adb692fbe99ed4e3a00d9912cfe6b8ce3d + url: "https://github.com/francislavoie/flutter-native-video-player.git" source: git version: "0.4.11" boolean_selector: diff --git a/pubspec.yaml b/pubspec.yaml index 962a8bf4..7caecd43 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -78,8 +78,12 @@ dependencies: native_device_orientation: ^2.1.0 better_native_video_player: git: - url: https://github.com/tommyxchow/flutter-native-video-player.git - ref: frosty-patches + # TEMP: points at francislavoie's fork while developing the + # background-playback foreground service. Revert to + # tommyxchow/flutter-native-video-player @ frosty-patches once the + # change is merged upstream. Branch is based on the same pinned ref. + url: https://github.com/francislavoie/flutter-native-video-player.git + ref: background-playback dev_dependencies: flutter_test: