kopia lustrzana https://gitlab.com/mysocialportal/relatica
Fix media_kit player startup quirks with new version
rodzic
5f7a45954f
commit
da6183d7bb
|
@ -21,7 +21,11 @@ class MediaKitAvControl extends StatefulWidget {
|
|||
|
||||
class _MediaKitAvControlState extends State<MediaKitAvControl> {
|
||||
static final _logger = Logger('$MediaKitAvControl');
|
||||
final player = Player();
|
||||
final Player player = Player(
|
||||
configuration: const PlayerConfiguration(
|
||||
logLevel: MPVLogLevel.warn,
|
||||
),
|
||||
);
|
||||
VideoController? controller;
|
||||
var needToOpen = true;
|
||||
|
||||
|
@ -78,8 +82,17 @@ class _MediaKitAvControlState extends State<MediaKitAvControl> {
|
|||
Widget build(BuildContext context) {
|
||||
print('Building MediaKit Control');
|
||||
if (controller == null) {
|
||||
return const Center(
|
||||
child: CircularProgressIndicator(),
|
||||
return Container(
|
||||
width: widget.width,
|
||||
height: widget.height,
|
||||
color: Colors.black12,
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: const [
|
||||
CircularProgressIndicator(),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
|
|
|
@ -2,6 +2,7 @@ import 'package:device_preview/device_preview.dart';
|
|||
import 'package:flutter/foundation.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:logging/logging.dart';
|
||||
import 'package:media_kit/media_kit.dart';
|
||||
import 'package:multi_trigger_autocomplete/multi_trigger_autocomplete.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
|
||||
|
@ -26,6 +27,7 @@ import 'utils/old_android_letsencrypte_cert.dart';
|
|||
|
||||
void main() async {
|
||||
WidgetsFlutterBinding.ensureInitialized();
|
||||
MediaKit.ensureInitialized();
|
||||
// await dotenv.load(fileName: '.env');
|
||||
const enablePreview = false;
|
||||
Logger.root.level = Level.FINER;
|
||||
|
|
16
pubspec.lock
16
pubspec.lock
|
@ -717,6 +717,14 @@ packages:
|
|||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "0.0.5+1"
|
||||
media_kit_libs_android_video:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
name: media_kit_libs_android_video
|
||||
sha256: "76fa95350b472f9dc163dd11e0145133c2e05456c06d0febb4e189922a68bd3c"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "1.0.0"
|
||||
media_kit_libs_ios_video:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
|
@ -773,14 +781,6 @@ packages:
|
|||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "1.8.0"
|
||||
metadata_fetch:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
name: metadata_fetch
|
||||
sha256: "2c79e69e71cbb051041da6a8a9dd3df0617db84482ab3f36b4952ff779b7580e"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "0.4.1"
|
||||
mime:
|
||||
dependency: transitive
|
||||
description:
|
||||
|
|
16
pubspec.yaml
16
pubspec.yaml
|
@ -26,14 +26,14 @@ dependencies:
|
|||
image_picker: ^0.8.6
|
||||
logging: ^1.1.0
|
||||
markdown: ^7.0.1
|
||||
media_kit: ^0.0.3
|
||||
media_kit_libs_ios_video: ^1.0.2
|
||||
media_kit_libs_linux: ^1.0.1
|
||||
media_kit_libs_macos_video: ^1.0.2
|
||||
media_kit_libs_windows_video: ^1.0.1
|
||||
media_kit_native_event_loop: ^1.0.2
|
||||
media_kit_video: ^0.0.4
|
||||
metadata_fetch: ^0.4.1
|
||||
media_kit: ^0.0.5 # Primary package.
|
||||
media_kit_video: ^0.0.6 # For video rendering.
|
||||
media_kit_native_event_loop: ^1.0.3 # Support for higher number of concurrent instances & better performance.
|
||||
media_kit_libs_windows_video: ^1.0.2 # Windows package for video native libraries.
|
||||
media_kit_libs_android_video: ^1.0.0 # Android package for video native libraries.
|
||||
media_kit_libs_macos_video: ^1.0.4 # macOS package for video native libraries.
|
||||
media_kit_libs_ios_video: ^1.0.4 # iOS package for video native libraries.
|
||||
media_kit_libs_linux: ^1.0.2 # GNU/Linux dependency package. metadata_fetch: ^0.4.1
|
||||
multi_trigger_autocomplete: ^0.1.1
|
||||
network_to_file_image: ^4.0.1
|
||||
path: ^1.8.2
|
||||
|
|
Ładowanie…
Reference in New Issue