Compare commits
1 commit
main
...
krille/ena
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
4465fa24d9 |
11 changed files with 82 additions and 17 deletions
|
|
@ -1,5 +1,6 @@
|
||||||
import 'dart:async';
|
import 'dart:async';
|
||||||
import 'dart:io';
|
import 'dart:io';
|
||||||
|
import 'dart:math';
|
||||||
|
|
||||||
import 'package:flutter/foundation.dart';
|
import 'package:flutter/foundation.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
|
@ -334,7 +335,7 @@ class AudioPlayerState extends State<AudioPlayerWidget> {
|
||||||
? widget.color.withAlpha(128)
|
? widget.color.withAlpha(128)
|
||||||
: Colors.transparent,
|
: Colors.transparent,
|
||||||
max: maxPosition,
|
max: maxPosition,
|
||||||
value: currentPosition,
|
value: max(0, currentPosition),
|
||||||
onChanged: (position) => audioPlayer == null
|
onChanged: (position) => audioPlayer == null
|
||||||
? _startAction()
|
? _startAction()
|
||||||
: audioPlayer.seek(
|
: audioPlayer.seek(
|
||||||
|
|
|
||||||
|
|
@ -13,7 +13,6 @@ import 'package:fluffychat/utils/matrix_sdk_extensions/matrix_locals.dart';
|
||||||
import 'package:fluffychat/widgets/avatar.dart';
|
import 'package:fluffychat/widgets/avatar.dart';
|
||||||
import 'package:fluffychat/widgets/matrix.dart';
|
import 'package:fluffychat/widgets/matrix.dart';
|
||||||
import '../../../config/app_config.dart';
|
import '../../../config/app_config.dart';
|
||||||
import '../../../utils/platform_infos.dart';
|
|
||||||
import '../../../utils/url_launcher.dart';
|
import '../../../utils/url_launcher.dart';
|
||||||
import '../../bootstrap/bootstrap_dialog.dart';
|
import '../../bootstrap/bootstrap_dialog.dart';
|
||||||
import 'audio_player.dart';
|
import 'audio_player.dart';
|
||||||
|
|
@ -141,25 +140,15 @@ class MessageContent extends StatelessWidget {
|
||||||
case CuteEventContent.eventType:
|
case CuteEventContent.eventType:
|
||||||
return CuteContent(event);
|
return CuteContent(event);
|
||||||
case MessageTypes.Audio:
|
case MessageTypes.Audio:
|
||||||
if (PlatformInfos.isMobile ||
|
return AudioPlayerWidget(
|
||||||
PlatformInfos.isMacOS ||
|
event,
|
||||||
PlatformInfos.isWeb
|
color: textColor,
|
||||||
// Disabled until https://github.com/bleonard252/just_audio_mpv/issues/3
|
fontSize: fontSize,
|
||||||
// is fixed
|
);
|
||||||
// || PlatformInfos.isLinux
|
|
||||||
) {
|
|
||||||
return AudioPlayerWidget(
|
|
||||||
event,
|
|
||||||
color: textColor,
|
|
||||||
fontSize: fontSize,
|
|
||||||
);
|
|
||||||
}
|
|
||||||
return MessageDownloadContent(event, textColor);
|
|
||||||
case MessageTypes.Video:
|
case MessageTypes.Video:
|
||||||
return EventVideoPlayer(event);
|
return EventVideoPlayer(event);
|
||||||
case MessageTypes.File:
|
case MessageTypes.File:
|
||||||
return MessageDownloadContent(event, textColor);
|
return MessageDownloadContent(event, textColor);
|
||||||
|
|
||||||
case MessageTypes.Text:
|
case MessageTypes.Text:
|
||||||
case MessageTypes.Notice:
|
case MessageTypes.Notice:
|
||||||
case MessageTypes.Emote:
|
case MessageTypes.Emote:
|
||||||
|
|
|
||||||
|
|
@ -10,6 +10,7 @@ import 'package:flutter_gen/gen_l10n/l10n.dart';
|
||||||
import 'package:http/http.dart' as http;
|
import 'package:http/http.dart' as http;
|
||||||
import 'package:image_picker/image_picker.dart';
|
import 'package:image_picker/image_picker.dart';
|
||||||
import 'package:intl/intl.dart';
|
import 'package:intl/intl.dart';
|
||||||
|
import 'package:just_audio_media_kit/just_audio_media_kit.dart';
|
||||||
import 'package:matrix/encryption.dart';
|
import 'package:matrix/encryption.dart';
|
||||||
import 'package:matrix/matrix.dart';
|
import 'package:matrix/matrix.dart';
|
||||||
import 'package:provider/provider.dart';
|
import 'package:provider/provider.dart';
|
||||||
|
|
@ -216,6 +217,10 @@ class MatrixState extends State<Matrix> with WidgetsBindingObserver {
|
||||||
super.initState();
|
super.initState();
|
||||||
WidgetsBinding.instance.addObserver(this);
|
WidgetsBinding.instance.addObserver(this);
|
||||||
initMatrix();
|
initMatrix();
|
||||||
|
if (PlatformInfos.isLinux || PlatformInfos.isWindows) {
|
||||||
|
JustAudioMediaKit.ensureInitialized();
|
||||||
|
JustAudioMediaKit.title = AppConfig.applicationName;
|
||||||
|
}
|
||||||
if (PlatformInfos.isWeb) {
|
if (PlatformInfos.isWeb) {
|
||||||
initConfig().then((_) => initSettings());
|
initConfig().then((_) => initSettings());
|
||||||
} else {
|
} else {
|
||||||
|
|
|
||||||
|
|
@ -25,6 +25,7 @@ packageLicenseOverride:
|
||||||
latlong2: Apache-2.0
|
latlong2: Apache-2.0
|
||||||
platform_detect: Apache-2.0
|
platform_detect: Apache-2.0
|
||||||
rxdart: Apache-2.0
|
rxdart: Apache-2.0
|
||||||
|
just_audio_media_kit: Apache-2.0
|
||||||
|
|
||||||
# flutter's internal packages
|
# flutter's internal packages
|
||||||
flutter_driver: BSD-3-Clause
|
flutter_driver: BSD-3-Clause
|
||||||
|
|
|
||||||
|
|
@ -13,6 +13,7 @@
|
||||||
#include <flutter_secure_storage_linux/flutter_secure_storage_linux_plugin.h>
|
#include <flutter_secure_storage_linux/flutter_secure_storage_linux_plugin.h>
|
||||||
#include <flutter_webrtc/flutter_web_r_t_c_plugin.h>
|
#include <flutter_webrtc/flutter_web_r_t_c_plugin.h>
|
||||||
#include <handy_window/handy_window_plugin.h>
|
#include <handy_window/handy_window_plugin.h>
|
||||||
|
#include <media_kit_libs_linux/media_kit_libs_linux_plugin.h>
|
||||||
#include <pasteboard/pasteboard_plugin.h>
|
#include <pasteboard/pasteboard_plugin.h>
|
||||||
#include <record_linux/record_linux_plugin.h>
|
#include <record_linux/record_linux_plugin.h>
|
||||||
#include <sqlcipher_flutter_libs/sqlite3_flutter_libs_plugin.h>
|
#include <sqlcipher_flutter_libs/sqlite3_flutter_libs_plugin.h>
|
||||||
|
|
@ -41,6 +42,9 @@ void fl_register_plugins(FlPluginRegistry* registry) {
|
||||||
g_autoptr(FlPluginRegistrar) handy_window_registrar =
|
g_autoptr(FlPluginRegistrar) handy_window_registrar =
|
||||||
fl_plugin_registry_get_registrar_for_plugin(registry, "HandyWindowPlugin");
|
fl_plugin_registry_get_registrar_for_plugin(registry, "HandyWindowPlugin");
|
||||||
handy_window_plugin_register_with_registrar(handy_window_registrar);
|
handy_window_plugin_register_with_registrar(handy_window_registrar);
|
||||||
|
g_autoptr(FlPluginRegistrar) media_kit_libs_linux_registrar =
|
||||||
|
fl_plugin_registry_get_registrar_for_plugin(registry, "MediaKitLibsLinuxPlugin");
|
||||||
|
media_kit_libs_linux_plugin_register_with_registrar(media_kit_libs_linux_registrar);
|
||||||
g_autoptr(FlPluginRegistrar) pasteboard_registrar =
|
g_autoptr(FlPluginRegistrar) pasteboard_registrar =
|
||||||
fl_plugin_registry_get_registrar_for_plugin(registry, "PasteboardPlugin");
|
fl_plugin_registry_get_registrar_for_plugin(registry, "PasteboardPlugin");
|
||||||
pasteboard_plugin_register_with_registrar(pasteboard_registrar);
|
pasteboard_plugin_register_with_registrar(pasteboard_registrar);
|
||||||
|
|
|
||||||
|
|
@ -10,6 +10,7 @@ list(APPEND FLUTTER_PLUGIN_LIST
|
||||||
flutter_secure_storage_linux
|
flutter_secure_storage_linux
|
||||||
flutter_webrtc
|
flutter_webrtc
|
||||||
handy_window
|
handy_window
|
||||||
|
media_kit_libs_linux
|
||||||
pasteboard
|
pasteboard
|
||||||
record_linux
|
record_linux
|
||||||
sqlcipher_flutter_libs
|
sqlcipher_flutter_libs
|
||||||
|
|
|
||||||
56
pubspec.lock
56
pubspec.lock
|
|
@ -1018,6 +1018,14 @@ packages:
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "0.9.41"
|
version: "0.9.41"
|
||||||
|
just_audio_media_kit:
|
||||||
|
dependency: "direct main"
|
||||||
|
description:
|
||||||
|
name: just_audio_media_kit
|
||||||
|
sha256: "9f3517213dfc7bbaf6980656feb66c35600f114c7efc0b5b3f4476cd5c18b45e"
|
||||||
|
url: "https://pub.dev"
|
||||||
|
source: hosted
|
||||||
|
version: "2.0.6"
|
||||||
just_audio_platform_interface:
|
just_audio_platform_interface:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
|
|
@ -1162,6 +1170,30 @@ packages:
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "0.36.0"
|
version: "0.36.0"
|
||||||
|
media_kit:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: media_kit
|
||||||
|
sha256: "1f1deee148533d75129a6f38251ff8388e33ee05fc2d20a6a80e57d6051b7b62"
|
||||||
|
url: "https://pub.dev"
|
||||||
|
source: hosted
|
||||||
|
version: "1.1.11"
|
||||||
|
media_kit_libs_linux:
|
||||||
|
dependency: "direct main"
|
||||||
|
description:
|
||||||
|
name: media_kit_libs_linux
|
||||||
|
sha256: e186891c31daa6bedab4d74dcdb4e8adfccc7d786bfed6ad81fe24a3b3010310
|
||||||
|
url: "https://pub.dev"
|
||||||
|
source: hosted
|
||||||
|
version: "1.1.3"
|
||||||
|
media_kit_libs_windows_audio:
|
||||||
|
dependency: "direct main"
|
||||||
|
description:
|
||||||
|
name: media_kit_libs_windows_audio
|
||||||
|
sha256: c2fd558cc87b9d89a801141fcdffe02e338a3b21a41a18fbd63d5b221a1b8e53
|
||||||
|
url: "https://pub.dev"
|
||||||
|
source: hosted
|
||||||
|
version: "1.0.9"
|
||||||
meta:
|
meta:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
|
|
@ -1634,6 +1666,14 @@ packages:
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "0.28.0"
|
version: "0.28.0"
|
||||||
|
safe_local_storage:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: safe_local_storage
|
||||||
|
sha256: ede4eb6cb7d88a116b3d3bf1df70790b9e2038bc37cb19112e381217c74d9440
|
||||||
|
url: "https://pub.dev"
|
||||||
|
source: hosted
|
||||||
|
version: "1.0.2"
|
||||||
safe_url_check:
|
safe_url_check:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
|
|
@ -2063,6 +2103,14 @@ packages:
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "2.2.2"
|
version: "2.2.2"
|
||||||
|
universal_platform:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: universal_platform
|
||||||
|
sha256: "64e16458a0ea9b99260ceb5467a214c1f298d647c659af1bff6d3bf82536b1ec"
|
||||||
|
url: "https://pub.dev"
|
||||||
|
source: hosted
|
||||||
|
version: "1.1.0"
|
||||||
unorm_dart:
|
unorm_dart:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
|
|
@ -2071,6 +2119,14 @@ packages:
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "0.2.0"
|
version: "0.2.0"
|
||||||
|
uri_parser:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: uri_parser
|
||||||
|
sha256: "6543c9fd86d2862fac55d800a43e67c0dcd1a41677cb69c2f8edfe73bbcf1835"
|
||||||
|
url: "https://pub.dev"
|
||||||
|
source: hosted
|
||||||
|
version: "2.0.2"
|
||||||
url_launcher:
|
url_launcher:
|
||||||
dependency: "direct main"
|
dependency: "direct main"
|
||||||
description:
|
description:
|
||||||
|
|
|
||||||
|
|
@ -60,9 +60,12 @@ dependencies:
|
||||||
image_picker: ^1.1.0
|
image_picker: ^1.1.0
|
||||||
intl: any
|
intl: any
|
||||||
just_audio: ^0.9.39
|
just_audio: ^0.9.39
|
||||||
|
just_audio_media_kit: ^2.0.6
|
||||||
latlong2: ^0.9.1
|
latlong2: ^0.9.1
|
||||||
linkify: ^5.0.0
|
linkify: ^5.0.0
|
||||||
matrix: ^0.36.0
|
matrix: ^0.36.0
|
||||||
|
media_kit_libs_linux: ^1.1.3
|
||||||
|
media_kit_libs_windows_audio: ^1.0.9
|
||||||
mime: ^1.0.6
|
mime: ^1.0.6
|
||||||
native_imaging: ^0.1.1
|
native_imaging: ^0.1.1
|
||||||
opus_caf_converter_dart: ^1.0.1
|
opus_caf_converter_dart: ^1.0.1
|
||||||
|
|
|
||||||
|
|
@ -76,6 +76,7 @@ parts:
|
||||||
stage-packages:
|
stage-packages:
|
||||||
- libsecret-1-0
|
- libsecret-1-0
|
||||||
- libjsoncpp25
|
- libjsoncpp25
|
||||||
|
- libmpv-dev
|
||||||
|
|
||||||
slots:
|
slots:
|
||||||
dbus-svc:
|
dbus-svc:
|
||||||
|
|
|
||||||
|
|
@ -13,6 +13,7 @@
|
||||||
#include <flutter_secure_storage_windows/flutter_secure_storage_windows_plugin.h>
|
#include <flutter_secure_storage_windows/flutter_secure_storage_windows_plugin.h>
|
||||||
#include <flutter_webrtc/flutter_web_r_t_c_plugin.h>
|
#include <flutter_webrtc/flutter_web_r_t_c_plugin.h>
|
||||||
#include <geolocator_windows/geolocator_windows.h>
|
#include <geolocator_windows/geolocator_windows.h>
|
||||||
|
#include <media_kit_libs_windows_audio/media_kit_libs_windows_audio_plugin_c_api.h>
|
||||||
#include <pasteboard/pasteboard_plugin.h>
|
#include <pasteboard/pasteboard_plugin.h>
|
||||||
#include <permission_handler_windows/permission_handler_windows_plugin.h>
|
#include <permission_handler_windows/permission_handler_windows_plugin.h>
|
||||||
#include <record_windows/record_windows_plugin_c_api.h>
|
#include <record_windows/record_windows_plugin_c_api.h>
|
||||||
|
|
@ -36,6 +37,8 @@ void RegisterPlugins(flutter::PluginRegistry* registry) {
|
||||||
registry->GetRegistrarForPlugin("FlutterWebRTCPlugin"));
|
registry->GetRegistrarForPlugin("FlutterWebRTCPlugin"));
|
||||||
GeolocatorWindowsRegisterWithRegistrar(
|
GeolocatorWindowsRegisterWithRegistrar(
|
||||||
registry->GetRegistrarForPlugin("GeolocatorWindows"));
|
registry->GetRegistrarForPlugin("GeolocatorWindows"));
|
||||||
|
MediaKitLibsWindowsAudioPluginCApiRegisterWithRegistrar(
|
||||||
|
registry->GetRegistrarForPlugin("MediaKitLibsWindowsAudioPluginCApi"));
|
||||||
PasteboardPluginRegisterWithRegistrar(
|
PasteboardPluginRegisterWithRegistrar(
|
||||||
registry->GetRegistrarForPlugin("PasteboardPlugin"));
|
registry->GetRegistrarForPlugin("PasteboardPlugin"));
|
||||||
PermissionHandlerWindowsPluginRegisterWithRegistrar(
|
PermissionHandlerWindowsPluginRegisterWithRegistrar(
|
||||||
|
|
|
||||||
|
|
@ -10,6 +10,7 @@ list(APPEND FLUTTER_PLUGIN_LIST
|
||||||
flutter_secure_storage_windows
|
flutter_secure_storage_windows
|
||||||
flutter_webrtc
|
flutter_webrtc
|
||||||
geolocator_windows
|
geolocator_windows
|
||||||
|
media_kit_libs_windows_audio
|
||||||
pasteboard
|
pasteboard
|
||||||
permission_handler_windows
|
permission_handler_windows
|
||||||
record_windows
|
record_windows
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue