fixed flickering when starting videos
This commit is contained in:
parent
043b2c54aa
commit
72bcf6d4e7
10 changed files with 294 additions and 279 deletions
|
@ -14,6 +14,10 @@ All notable changes to this project will be documented in this file.
|
||||||
- target Android 14 (API 34)
|
- target Android 14 (API 34)
|
||||||
- upgraded Flutter to stable v3.10.6
|
- upgraded Flutter to stable v3.10.6
|
||||||
|
|
||||||
|
### Fixed
|
||||||
|
|
||||||
|
- flickering when starting videos
|
||||||
|
|
||||||
## <a id="v1.8.9"></a>[v1.8.9] - 2023-06-04
|
## <a id="v1.8.9"></a>[v1.8.9] - 2023-06-04
|
||||||
|
|
||||||
### Changed
|
### Changed
|
||||||
|
|
|
@ -33,7 +33,11 @@ class VideoSubtitles extends StatelessWidget {
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
final videoDisplaySize = entry.videoDisplaySize(controller.sarNotifier.value);
|
return ValueListenableBuilder<double?>(
|
||||||
|
valueListenable: controller.sarNotifier,
|
||||||
|
builder: (context, sar, child) {
|
||||||
|
final videoDisplaySize = entry.videoDisplaySize(sar);
|
||||||
|
|
||||||
return IgnorePointer(
|
return IgnorePointer(
|
||||||
child: Consumer<Settings>(
|
child: Consumer<Settings>(
|
||||||
builder: (context, settings, child) {
|
builder: (context, settings, child) {
|
||||||
|
@ -272,6 +276,8 @@ class VideoSubtitles extends StatelessWidget {
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
},
|
||||||
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -52,9 +52,8 @@ class _VideoViewState extends State<VideoView> {
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return StreamBuilder<VideoStatus>(
|
return StreamBuilder<VideoStatus>(
|
||||||
stream: controller.statusStream,
|
stream: controller.statusStream,
|
||||||
builder: (context, snapshot) {
|
builder: (context, snapshot) => controller.isReady ? controller.buildPlayerWidget(context) : const SizedBox(),
|
||||||
return controller.isReady ? controller.buildPlayerWidget(context) : const SizedBox();
|
);
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// not called when looping
|
// not called when looping
|
||||||
|
|
|
@ -445,16 +445,6 @@ class _AvesMagnifierState extends State<AvesMagnifier> with TickerProviderStateM
|
||||||
child: widget.child,
|
child: widget.child,
|
||||||
);
|
);
|
||||||
|
|
||||||
// `Matrix4.scale` uses dynamic typing and can throw `UnimplementedError` on wrong types
|
|
||||||
final double effectiveScale = (applyScale ? scale : null) ?? 1.0;
|
|
||||||
child = Transform(
|
|
||||||
transform: Matrix4.identity()
|
|
||||||
..translate(position.dx, position.dy)
|
|
||||||
..scale(effectiveScale),
|
|
||||||
alignment: basePosition,
|
|
||||||
child: child,
|
|
||||||
);
|
|
||||||
|
|
||||||
return MagnifierGestureDetector(
|
return MagnifierGestureDetector(
|
||||||
hitDetector: this,
|
hitDetector: this,
|
||||||
onScaleStart: onScaleStart,
|
onScaleStart: onScaleStart,
|
||||||
|
@ -464,17 +454,29 @@ class _AvesMagnifierState extends State<AvesMagnifier> with TickerProviderStateM
|
||||||
onDoubleTap: onDoubleTap,
|
onDoubleTap: onDoubleTap,
|
||||||
child: Padding(
|
child: Padding(
|
||||||
padding: widget.viewportPadding,
|
padding: widget.viewportPadding,
|
||||||
child: LayoutBuilder(builder: (context, constraints) {
|
child: LayoutBuilder(
|
||||||
controller.setScaleBoundaries((controller.scaleBoundaries ?? ScaleBoundaries.zero).copyWith(
|
builder: (context, constraints) {
|
||||||
|
final boundaries = (controller.scaleBoundaries ?? ScaleBoundaries.zero).copyWith(
|
||||||
allowOriginalScaleBeyondRange: widget.allowOriginalScaleBeyondRange,
|
allowOriginalScaleBeyondRange: widget.allowOriginalScaleBeyondRange,
|
||||||
minScale: widget.minScale,
|
minScale: widget.minScale,
|
||||||
maxScale: widget.maxScale,
|
maxScale: widget.maxScale,
|
||||||
initialScale: widget.initialScale,
|
initialScale: widget.initialScale,
|
||||||
viewportSize: constraints.biggest,
|
viewportSize: constraints.biggest,
|
||||||
contentSize: widget.contentSize.isEmpty == false ? widget.contentSize : constraints.biggest,
|
contentSize: widget.contentSize.isEmpty == false ? widget.contentSize : constraints.biggest,
|
||||||
));
|
);
|
||||||
return child;
|
controller.setScaleBoundaries(boundaries);
|
||||||
}),
|
|
||||||
|
// `Matrix4.scale` uses dynamic typing and can throw `UnimplementedError` on wrong types
|
||||||
|
final double effectiveScale = (applyScale ? scale : null) ?? 1.0;
|
||||||
|
return Transform(
|
||||||
|
transform: Matrix4.identity()
|
||||||
|
..translate(position.dx, position.dy)
|
||||||
|
..scale(effectiveScale),
|
||||||
|
alignment: basePosition,
|
||||||
|
child: child,
|
||||||
|
);
|
||||||
|
},
|
||||||
|
),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
|
|
|
@ -5,10 +5,10 @@ packages:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: _flutterfire_internals
|
name: _flutterfire_internals
|
||||||
sha256: a742f71d7f3484253a623b30e19256aa4668ecbb3de6ad1beb0bcf8d4777ecd8
|
sha256: "5dce45a06d386358334eb1689108db6455d90ceb0d75848d5f4819283d4ee2b8"
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "1.3.3"
|
version: "1.3.4"
|
||||||
async:
|
async:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
|
@ -68,10 +68,10 @@ packages:
|
||||||
dependency: "direct main"
|
dependency: "direct main"
|
||||||
description:
|
description:
|
||||||
name: firebase_core
|
name: firebase_core
|
||||||
sha256: a4a99204da264a0aa9d54a332ea0315ce7b0768075139c77abefe98093dd98be
|
sha256: "2e9324f719e90200dc7d3c4f5d2abc26052f9f2b995d3b6626c47a0dfe1c8192"
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "2.14.0"
|
version: "2.15.0"
|
||||||
firebase_core_platform_interface:
|
firebase_core_platform_interface:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
|
@ -92,18 +92,18 @@ packages:
|
||||||
dependency: "direct main"
|
dependency: "direct main"
|
||||||
description:
|
description:
|
||||||
name: firebase_crashlytics
|
name: firebase_crashlytics
|
||||||
sha256: "398012cf7838f8a373a25da65dd62fc3a3f4abe4b5f886caa634952c3387dce3"
|
sha256: "3607b46342537f98df18b130b6f5ab25cee6981a3a782e1a7b121d04dfea3caa"
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "3.3.3"
|
version: "3.3.4"
|
||||||
firebase_crashlytics_platform_interface:
|
firebase_crashlytics_platform_interface:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: firebase_crashlytics_platform_interface
|
name: firebase_crashlytics_platform_interface
|
||||||
sha256: "39dfcc9a5ddfaa0588ad67f1016174dd9e19f6b31f592b8641bd559399567592"
|
sha256: c63abeb87b18f6e6d4bf6bb3977f15d2d9281a049d93fe098e83e56dcbf7da06
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "3.6.3"
|
version: "3.6.4"
|
||||||
flutter:
|
flutter:
|
||||||
dependency: "direct main"
|
dependency: "direct main"
|
||||||
description: flutter
|
description: flutter
|
||||||
|
|
|
@ -212,10 +212,10 @@ packages:
|
||||||
dependency: "direct main"
|
dependency: "direct main"
|
||||||
description:
|
description:
|
||||||
name: google_maps_flutter_platform_interface
|
name: google_maps_flutter_platform_interface
|
||||||
sha256: "308f0af138fa78e8224d598d46ca182673874d0ef4d754b7157c073b5b4b8e0d"
|
sha256: cd310faa7fba3df10ab3f852719f832eaa223e4b315ac46af986572d1cec222f
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "2.2.7"
|
version: "2.3.0"
|
||||||
google_maps_flutter_web:
|
google_maps_flutter_web:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
|
|
|
@ -383,9 +383,11 @@ class IjkVideoController extends AvesVideoController {
|
||||||
return ValueListenableBuilder<double?>(
|
return ValueListenableBuilder<double?>(
|
||||||
valueListenable: sarNotifier,
|
valueListenable: sarNotifier,
|
||||||
builder: (context, sar, child) {
|
builder: (context, sar, child) {
|
||||||
|
if (sar == null) return const SizedBox();
|
||||||
|
|
||||||
// derive DAR (Display Aspect Ratio) from SAR (Storage Aspect Ratio), if any
|
// derive DAR (Display Aspect Ratio) from SAR (Storage Aspect Ratio), if any
|
||||||
// e.g. 960x536 (~16:9) with SAR 4:3 should be displayed as ~2.39:1
|
// e.g. 960x536 (~16:9) with SAR 4:3 should be displayed as ~2.39:1
|
||||||
final dar = entry.displayAspectRatio * (sar ?? 1);
|
final dar = entry.displayAspectRatio * sar;
|
||||||
return FijkView(
|
return FijkView(
|
||||||
player: _instance,
|
player: _instance,
|
||||||
fit: FijkFit(
|
fit: FijkFit(
|
||||||
|
|
|
@ -207,9 +207,11 @@ class MpvVideoController extends AvesVideoController {
|
||||||
return ValueListenableBuilder<double?>(
|
return ValueListenableBuilder<double?>(
|
||||||
valueListenable: sarNotifier,
|
valueListenable: sarNotifier,
|
||||||
builder: (context, sar, child) {
|
builder: (context, sar, child) {
|
||||||
|
if (sar == null) return const SizedBox();
|
||||||
|
|
||||||
// derive DAR (Display Aspect Ratio) from SAR (Storage Aspect Ratio), if any
|
// derive DAR (Display Aspect Ratio) from SAR (Storage Aspect Ratio), if any
|
||||||
// e.g. 960x536 (~16:9) with SAR 4:3 should be displayed as ~2.39:1
|
// e.g. 960x536 (~16:9) with SAR 4:3 should be displayed as ~2.39:1
|
||||||
final dar = entry.displayAspectRatio * (sar ?? 1);
|
final dar = entry.displayAspectRatio * sar;
|
||||||
return Video(
|
return Video(
|
||||||
controller: _controller,
|
controller: _controller,
|
||||||
fill: Colors.transparent,
|
fill: Colors.transparent,
|
||||||
|
|
|
@ -173,7 +173,7 @@ packages:
|
||||||
description:
|
description:
|
||||||
path: media_kit
|
path: media_kit
|
||||||
ref: main
|
ref: main
|
||||||
resolved-ref: "6d0f0401b8d87596a6167fd629912cff92003edc"
|
resolved-ref: a1a1d14c5f920442898f22ea61dc9e357a671112
|
||||||
url: "https://github.com/alexmercerind/media_kit"
|
url: "https://github.com/alexmercerind/media_kit"
|
||||||
source: git
|
source: git
|
||||||
version: "1.0.2"
|
version: "1.0.2"
|
||||||
|
@ -182,7 +182,7 @@ packages:
|
||||||
description:
|
description:
|
||||||
path: media_kit_libs_android_video
|
path: media_kit_libs_android_video
|
||||||
ref: main
|
ref: main
|
||||||
resolved-ref: "6d0f0401b8d87596a6167fd629912cff92003edc"
|
resolved-ref: a1a1d14c5f920442898f22ea61dc9e357a671112
|
||||||
url: "https://github.com/alexmercerind/media_kit"
|
url: "https://github.com/alexmercerind/media_kit"
|
||||||
source: git
|
source: git
|
||||||
version: "1.2.0"
|
version: "1.2.0"
|
||||||
|
@ -191,7 +191,7 @@ packages:
|
||||||
description:
|
description:
|
||||||
path: media_kit_native_event_loop
|
path: media_kit_native_event_loop
|
||||||
ref: main
|
ref: main
|
||||||
resolved-ref: "6d0f0401b8d87596a6167fd629912cff92003edc"
|
resolved-ref: a1a1d14c5f920442898f22ea61dc9e357a671112
|
||||||
url: "https://github.com/alexmercerind/media_kit"
|
url: "https://github.com/alexmercerind/media_kit"
|
||||||
source: git
|
source: git
|
||||||
version: "1.0.6"
|
version: "1.0.6"
|
||||||
|
@ -200,7 +200,7 @@ packages:
|
||||||
description:
|
description:
|
||||||
path: media_kit_video
|
path: media_kit_video
|
||||||
ref: main
|
ref: main
|
||||||
resolved-ref: "6d0f0401b8d87596a6167fd629912cff92003edc"
|
resolved-ref: a1a1d14c5f920442898f22ea61dc9e357a671112
|
||||||
url: "https://github.com/alexmercerind/media_kit"
|
url: "https://github.com/alexmercerind/media_kit"
|
||||||
source: git
|
source: git
|
||||||
version: "1.0.2"
|
version: "1.0.2"
|
||||||
|
|
32
pubspec.lock
32
pubspec.lock
|
@ -13,10 +13,10 @@ packages:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: _flutterfire_internals
|
name: _flutterfire_internals
|
||||||
sha256: a742f71d7f3484253a623b30e19256aa4668ecbb3de6ad1beb0bcf8d4777ecd8
|
sha256: "5dce45a06d386358334eb1689108db6455d90ceb0d75848d5f4819283d4ee2b8"
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "1.3.3"
|
version: "1.3.4"
|
||||||
analyzer:
|
analyzer:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
|
@ -365,10 +365,10 @@ packages:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: firebase_core
|
name: firebase_core
|
||||||
sha256: a4a99204da264a0aa9d54a332ea0315ce7b0768075139c77abefe98093dd98be
|
sha256: "2e9324f719e90200dc7d3c4f5d2abc26052f9f2b995d3b6626c47a0dfe1c8192"
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "2.14.0"
|
version: "2.15.0"
|
||||||
firebase_core_platform_interface:
|
firebase_core_platform_interface:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
|
@ -389,18 +389,18 @@ packages:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: firebase_crashlytics
|
name: firebase_crashlytics
|
||||||
sha256: "398012cf7838f8a373a25da65dd62fc3a3f4abe4b5f886caa634952c3387dce3"
|
sha256: "3607b46342537f98df18b130b6f5ab25cee6981a3a782e1a7b121d04dfea3caa"
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "3.3.3"
|
version: "3.3.4"
|
||||||
firebase_crashlytics_platform_interface:
|
firebase_crashlytics_platform_interface:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: firebase_crashlytics_platform_interface
|
name: firebase_crashlytics_platform_interface
|
||||||
sha256: "39dfcc9a5ddfaa0588ad67f1016174dd9e19f6b31f592b8641bd559399567592"
|
sha256: c63abeb87b18f6e6d4bf6bb3977f15d2d9281a049d93fe098e83e56dcbf7da06
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "3.6.3"
|
version: "3.6.4"
|
||||||
flex_color_picker:
|
flex_color_picker:
|
||||||
dependency: "direct main"
|
dependency: "direct main"
|
||||||
description:
|
description:
|
||||||
|
@ -620,10 +620,10 @@ packages:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: google_maps_flutter_platform_interface
|
name: google_maps_flutter_platform_interface
|
||||||
sha256: "308f0af138fa78e8224d598d46ca182673874d0ef4d754b7157c073b5b4b8e0d"
|
sha256: cd310faa7fba3df10ab3f852719f832eaa223e4b315ac46af986572d1cec222f
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "2.2.7"
|
version: "2.3.0"
|
||||||
google_maps_flutter_web:
|
google_maps_flutter_web:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
|
@ -1206,10 +1206,10 @@ packages:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: shared_preferences_foundation
|
name: shared_preferences_foundation
|
||||||
sha256: b046999bf0ff58f04c364491bb803dcfa8f42e47b19c75478f53d323684a8cc1
|
sha256: f39696b83e844923b642ce9dd4bd31736c17e697f6731a5adf445b1274cf3cd4
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "2.3.1"
|
version: "2.3.2"
|
||||||
shared_preferences_linux:
|
shared_preferences_linux:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
|
@ -1484,10 +1484,10 @@ packages:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: url_launcher_macos
|
name: url_launcher_macos
|
||||||
sha256: "91ee3e75ea9dadf38036200c5d3743518f4a5eb77a8d13fda1ee5764373f185e"
|
sha256: "1c4fdc0bfea61a70792ce97157e5cc17260f61abbe4f39354513f39ec6fd73b1"
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "3.0.5"
|
version: "3.0.6"
|
||||||
url_launcher_platform_interface:
|
url_launcher_platform_interface:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
|
@ -1596,10 +1596,10 @@ packages:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: xdg_directories
|
name: xdg_directories
|
||||||
sha256: ee1505df1426458f7f60aac270645098d318a8b4766d85fde75f76f2e21807d1
|
sha256: e0b1147eec179d3911f1f19b59206448f78195ca1d20514134e10641b7d7fbff
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "1.0.0"
|
version: "1.0.1"
|
||||||
xml:
|
xml:
|
||||||
dependency: "direct main"
|
dependency: "direct main"
|
||||||
description:
|
description:
|
||||||
|
|
Loading…
Reference in a new issue