From f41790d6319db8a4129bc275a7453674384bda5b Mon Sep 17 00:00:00 2001 From: Daniel Ponte Date: Wed, 14 Aug 2024 16:02:33 -0400 Subject: [PATCH] Squashed commit of the following: commit 56ec3e3c53226b8b0c969b602d933bb88d073ebf Author: Daniel Ponte Date: Wed Aug 14 15:49:50 2024 -0400 Fix exception in just_audio_media_kit commit c80625d07eaee753fd29173537bbc72f6b3be9db Author: Daniel Ponte Date: Wed Aug 14 15:37:25 2024 -0400 Fix justaudio commit b7af6f28bbdcc5f517c5d4a5c003f41502a0af24 Author: Daniel Ponte Date: Wed Aug 14 14:44:18 2024 -0400 use justaudio only commit 87d535494379f92ba0ccb5479f87fa6b890513ed Author: Daniel Ponte Date: Wed Aug 14 14:36:58 2024 -0400 Multiple audio drivers commit 1e6b0d04392ada4106a5c5c8fad0c3404608dc4c Author: Daniel Ponte Date: Wed Aug 14 14:08:14 2024 -0400 Fix on macos commit 47cca3e3c07f8d40d502e7468f796bf9b4182341 Author: Daniel Ponte Date: Wed Aug 14 13:10:12 2024 -0400 osx --- Makefile | 2 + lib/controller/play.dart | 60 ++++- lib/main.dart | 1 + linux/flutter/generated_plugin_registrant.cc | 8 +- linux/flutter/generated_plugins.cmake | 3 +- macos/Flutter/GeneratedPluginRegistrant.swift | 6 +- macos/Podfile.lock | 16 +- macos/Runner.xcodeproj/project.pbxproj | 10 +- macos/Runner/DebugProfile.entitlements | 4 +- patches/just_audio_media_kit.patch | 35 +++ pubspec.lock | 220 ++++++++++++------ pubspec.yaml | 8 +- .../flutter/generated_plugin_registrant.cc | 6 +- windows/flutter/generated_plugins.cmake | 3 +- 14 files changed, 284 insertions(+), 98 deletions(-) create mode 100644 patches/just_audio_media_kit.patch diff --git a/Makefile b/Makefile index 9f8570d..85f1847 100644 --- a/Makefile +++ b/Makefile @@ -1,3 +1,5 @@ proto: protoc -I protobuf/ --dart_out=lib/pb protobuf/stillbox.proto google/protobuf/timestamp.proto +patch: + dart run patch_package apply diff --git a/lib/controller/play.dart b/lib/controller/play.dart index 1a030bf..68c25e3 100644 --- a/lib/controller/play.dart +++ b/lib/controller/play.dart @@ -1,20 +1,57 @@ -import 'dart:typed_data'; +import 'package:flutter/services.dart'; +import 'package:just_audio/just_audio.dart' as justaudio; +import 'package:just_audio_media_kit/just_audio_media_kit.dart'; +//import 'package:audioplayers/audioplayers.dart' as auplay; +//import 'dart:io' show Platform; -import 'package:audioplayers/audioplayers.dart'; import '../pb/stillbox.pb.dart'; +abstract class AudioDriver { + Future play(Call call); +} + class Player { - final player = AudioPlayer(); - Player(); - Future play(Call call) { - // TODO make a queue - return player.play(BytesSource(Uint8List.fromList(call.audio))); + late AudioDriver driver; + Player() { +// if (Platform.isMacOS || Platform.isIOS) { + driver = JustAudioDriver(); +// } else { +// driver = AudioPlayersDriver(); +// } } + + Future play(Call call) { + return driver.play(call); + } + // TODO make a queue } /* -for just_audio (add just_audio and just_audio_linux) -class CallBytesSource extends StreamAudioSource { +class AudioPlayersDriver implements AudioDriver { + final player = auplay.AudioPlayer(); + + @override + Future play(Call call) { + return player.play(auplay.BytesSource(Uint8List.fromList(call.audio))); + } +} +*/ + +class JustAudioDriver implements AudioDriver { + final player = justaudio.AudioPlayer(); + + JustAudioDriver() { + JustAudioMediaKit.ensureInitialized(); + } + + @override + Future play(Call call) async { + player.setAudioSource(CallBytesSource(call)); + return player.play(); + } +} + +class CallBytesSource extends justaudio.StreamAudioSource { late Uint8List _buffer; final Call _call; @@ -25,9 +62,9 @@ class CallBytesSource extends StreamAudioSource { CallBytesSource._(this._call, this._buffer) : super(tag: 'CallBytesSource'); @override - Future request([int? start, int? end]) async { + Future request([int? start, int? end]) async { // Returning the stream audio response with the parameters - return StreamAudioResponse( + return justaudio.StreamAudioResponse( sourceLength: _buffer.length, contentLength: (end ?? _buffer.length) - (start ?? 0), offset: start ?? 0, @@ -36,4 +73,3 @@ class CallBytesSource extends StreamAudioSource { ); } } -*/ \ No newline at end of file diff --git a/lib/main.dart b/lib/main.dart index dabd575..b74e191 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -24,6 +24,7 @@ class CallsApp extends StatelessWidget { ), darkTheme: ThemeData( brightness: Brightness.dark, + scaffoldBackgroundColor: Colors.black, ), themeMode: ThemeMode.dark, home: const CallsHome(), diff --git a/linux/flutter/generated_plugin_registrant.cc b/linux/flutter/generated_plugin_registrant.cc index 14a06d2..1c10bb6 100644 --- a/linux/flutter/generated_plugin_registrant.cc +++ b/linux/flutter/generated_plugin_registrant.cc @@ -6,14 +6,14 @@ #include "generated_plugin_registrant.h" -#include #include +#include void fl_register_plugins(FlPluginRegistry* registry) { - g_autoptr(FlPluginRegistrar) audioplayers_linux_registrar = - fl_plugin_registry_get_registrar_for_plugin(registry, "AudioplayersLinuxPlugin"); - audioplayers_linux_plugin_register_with_registrar(audioplayers_linux_registrar); g_autoptr(FlPluginRegistrar) flutter_secure_storage_linux_registrar = fl_plugin_registry_get_registrar_for_plugin(registry, "FlutterSecureStorageLinuxPlugin"); flutter_secure_storage_linux_plugin_register_with_registrar(flutter_secure_storage_linux_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); } diff --git a/linux/flutter/generated_plugins.cmake b/linux/flutter/generated_plugins.cmake index 188af9f..adbd864 100644 --- a/linux/flutter/generated_plugins.cmake +++ b/linux/flutter/generated_plugins.cmake @@ -3,11 +3,12 @@ # list(APPEND FLUTTER_PLUGIN_LIST - audioplayers_linux flutter_secure_storage_linux + media_kit_libs_linux ) list(APPEND FLUTTER_FFI_PLUGIN_LIST + media_kit_native_event_loop ) set(PLUGIN_BUNDLED_LIBRARIES) diff --git a/macos/Flutter/GeneratedPluginRegistrant.swift b/macos/Flutter/GeneratedPluginRegistrant.swift index ae73647..7b76bcf 100644 --- a/macos/Flutter/GeneratedPluginRegistrant.swift +++ b/macos/Flutter/GeneratedPluginRegistrant.swift @@ -5,12 +5,14 @@ import FlutterMacOS import Foundation -import audioplayers_darwin +import audio_session import flutter_secure_storage_macos +import just_audio import path_provider_foundation func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) { - AudioplayersDarwinPlugin.register(with: registry.registrar(forPlugin: "AudioplayersDarwinPlugin")) + AudioSessionPlugin.register(with: registry.registrar(forPlugin: "AudioSessionPlugin")) FlutterSecureStoragePlugin.register(with: registry.registrar(forPlugin: "FlutterSecureStoragePlugin")) + JustAudioPlugin.register(with: registry.registrar(forPlugin: "JustAudioPlugin")) PathProviderPlugin.register(with: registry.registrar(forPlugin: "PathProviderPlugin")) } diff --git a/macos/Podfile.lock b/macos/Podfile.lock index 085d79b..211b683 100644 --- a/macos/Podfile.lock +++ b/macos/Podfile.lock @@ -1,33 +1,39 @@ PODS: - - audioplayers_darwin (0.0.1): + - audio_session (0.0.1): - FlutterMacOS - flutter_secure_storage_macos (6.1.1): - FlutterMacOS - FlutterMacOS (1.0.0) + - just_audio (0.0.1): + - FlutterMacOS - path_provider_foundation (0.0.1): - Flutter - FlutterMacOS DEPENDENCIES: - - audioplayers_darwin (from `Flutter/ephemeral/.symlinks/plugins/audioplayers_darwin/macos`) + - audio_session (from `Flutter/ephemeral/.symlinks/plugins/audio_session/macos`) - flutter_secure_storage_macos (from `Flutter/ephemeral/.symlinks/plugins/flutter_secure_storage_macos/macos`) - FlutterMacOS (from `Flutter/ephemeral`) + - just_audio (from `Flutter/ephemeral/.symlinks/plugins/just_audio/macos`) - path_provider_foundation (from `Flutter/ephemeral/.symlinks/plugins/path_provider_foundation/darwin`) EXTERNAL SOURCES: - audioplayers_darwin: - :path: Flutter/ephemeral/.symlinks/plugins/audioplayers_darwin/macos + audio_session: + :path: Flutter/ephemeral/.symlinks/plugins/audio_session/macos flutter_secure_storage_macos: :path: Flutter/ephemeral/.symlinks/plugins/flutter_secure_storage_macos/macos FlutterMacOS: :path: Flutter/ephemeral + just_audio: + :path: Flutter/ephemeral/.symlinks/plugins/just_audio/macos path_provider_foundation: :path: Flutter/ephemeral/.symlinks/plugins/path_provider_foundation/darwin SPEC CHECKSUMS: - audioplayers_darwin: dcad41de4fbd0099cb3749f7ab3b0cb8f70b810c + audio_session: dea1f41890dbf1718f04a56f1d6150fd50039b72 flutter_secure_storage_macos: 59459653abe1adb92abbc8ea747d79f8d19866c9 FlutterMacOS: 8f6f14fa908a6fb3fba0cd85dbd81ec4b251fb24 + just_audio: 9b67ca7b97c61cfc9784ea23cd8cc55eb226d489 path_provider_foundation: 2b6b4c569c0fb62ec74538f866245ac84301af46 PODFILE CHECKSUM: 236401fc2c932af29a9fcf0e97baeeb2d750d367 diff --git a/macos/Runner.xcodeproj/project.pbxproj b/macos/Runner.xcodeproj/project.pbxproj index f76426c..31ab828 100644 --- a/macos/Runner.xcodeproj/project.pbxproj +++ b/macos/Runner.xcodeproj/project.pbxproj @@ -269,7 +269,6 @@ 33CC10EC2044A3C60003C045 = { CreatedOnToolsVersion = 9.2; LastSwiftMigration = 1100; - ProvisioningStyle = Automatic; SystemCapabilities = { com.apple.Sandbox = { enabled = 1; @@ -571,10 +570,13 @@ ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CLANG_ENABLE_MODULES = YES; CODE_SIGN_ENTITLEMENTS = Runner/DebugProfile.entitlements; + CODE_SIGN_IDENTITY = "Apple Development"; CODE_SIGN_STYLE = Automatic; COMBINE_HIDPI_IMAGES = YES; DEVELOPMENT_TEAM = HPWYU9LLXA; INFOPLIST_FILE = Runner/Info.plist; + INFOPLIST_KEY_CFBundleDisplayName = Calls; + INFOPLIST_KEY_LSApplicationCategoryType = "public.app-category.utilities"; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", "@executable_path/../Frameworks", @@ -704,10 +706,13 @@ ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CLANG_ENABLE_MODULES = YES; CODE_SIGN_ENTITLEMENTS = Runner/DebugProfile.entitlements; + CODE_SIGN_IDENTITY = "Apple Development"; CODE_SIGN_STYLE = Automatic; COMBINE_HIDPI_IMAGES = YES; DEVELOPMENT_TEAM = HPWYU9LLXA; INFOPLIST_FILE = Runner/Info.plist; + INFOPLIST_KEY_CFBundleDisplayName = Calls; + INFOPLIST_KEY_LSApplicationCategoryType = "public.app-category.utilities"; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", "@executable_path/../Frameworks", @@ -725,10 +730,13 @@ ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CLANG_ENABLE_MODULES = YES; CODE_SIGN_ENTITLEMENTS = Runner/Release.entitlements; + CODE_SIGN_IDENTITY = "Apple Development"; CODE_SIGN_STYLE = Automatic; COMBINE_HIDPI_IMAGES = YES; DEVELOPMENT_TEAM = HPWYU9LLXA; INFOPLIST_FILE = Runner/Info.plist; + INFOPLIST_KEY_CFBundleDisplayName = Calls; + INFOPLIST_KEY_LSApplicationCategoryType = "public.app-category.utilities"; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", "@executable_path/../Frameworks", diff --git a/macos/Runner/DebugProfile.entitlements b/macos/Runner/DebugProfile.entitlements index d769771..db2db33 100644 --- a/macos/Runner/DebugProfile.entitlements +++ b/macos/Runner/DebugProfile.entitlements @@ -11,6 +11,8 @@ com.apple.security.network.client keychain-access-groups - + + $(AppIdentifierPrefix)me.dynatron.calls + diff --git a/patches/just_audio_media_kit.patch b/patches/just_audio_media_kit.patch new file mode 100644 index 0000000..07f226d --- /dev/null +++ b/patches/just_audio_media_kit.patch @@ -0,0 +1,35 @@ +diff -ruN /tmp/just_audio_media_kit/lib/mediakit_player.dart /home/dponte/.pub-cache/hosted/pub.dev/just_audio_media_kit-2.0.5/lib/mediakit_player.dart +--- /tmp/just_audio_media_kit/lib/mediakit_player.dart 2024-08-14 15:47:51.698551487 -0400 ++++ /home/dponte/.pub-cache/hosted/pub.dev/just_audio_media_kit-2.0.5/lib/mediakit_player.dart 2024-08-14 15:48:02.401944337 -0400 +@@ -35,8 +35,11 @@ + /// [LoadRequest.initialPosition] or [seek] request before [Player.play] was called and/or finished loading. + Duration? _setPosition; + +- Media get _currentMedia => +- _player.state.playlist.medias[_player.state.playlist.index]; ++ Media? get _currentMedia { ++ var medias = _player.state.playlist.medias; ++ if (medias.isEmpty) return null; ++ return medias[_player.state.playlist.index]; ++ } + + MediaKitPlayer(super.id) { + _player = Player( +@@ -57,7 +60,7 @@ + + _streamSubscriptions = [ + _player.stream.duration.listen((duration) { +- if (_currentMedia.extras?['overrideDuration'] != null) return; ++ if (_currentMedia?.extras?['overrideDuration'] != null) return; + + _processingState = ProcessingStateMessage.ready; + if (_setPosition != null && duration.inSeconds > 0) { +@@ -111,7 +114,7 @@ + _currentIndex = playlist.index; + } + _updatePlaybackEvent( +- duration: _currentMedia.extras?['overrideDuration']); ++ duration: _currentMedia?.extras?['overrideDuration']); + }), + _player.stream.playlistMode.listen((playlistMode) { + _dataController.add( diff --git a/pubspec.lock b/pubspec.lock index 903227a..298c4c5 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -1,6 +1,14 @@ # Generated by pub # See https://dart.dev/tools/pub/glossary#lockfile packages: + archive: + dependency: transitive + description: + name: archive + sha256: cb6a278ef2dbb298455e1a713bda08524a175630ec643a242c399c932a0a1f7d + url: "https://pub.dev" + source: hosted + version: "3.6.1" async: dependency: transitive description: @@ -9,62 +17,14 @@ packages: url: "https://pub.dev" source: hosted version: "2.11.0" - audioplayers: - dependency: "direct main" - description: - name: audioplayers - sha256: c05c6147124cd63e725e861335a8b4d57300b80e6e92cea7c145c739223bbaef - url: "https://pub.dev" - source: hosted - version: "5.2.1" - audioplayers_android: + audio_session: dependency: transitive description: - name: audioplayers_android - sha256: b00e1a0e11365d88576320ec2d8c192bc21f1afb6c0e5995d1c57ae63156acb5 + name: audio_session + sha256: "343e83bc7809fbda2591a49e525d6b63213ade10c76f15813be9aed6657b3261" url: "https://pub.dev" source: hosted - version: "4.0.3" - audioplayers_darwin: - dependency: transitive - description: - name: audioplayers_darwin - sha256: "3034e99a6df8d101da0f5082dcca0a2a99db62ab1d4ddb3277bed3f6f81afe08" - url: "https://pub.dev" - source: hosted - version: "5.0.2" - audioplayers_linux: - dependency: "direct main" - description: - name: audioplayers_linux - sha256: "60787e73fefc4d2e0b9c02c69885402177e818e4e27ef087074cf27c02246c9e" - url: "https://pub.dev" - source: hosted - version: "3.1.0" - audioplayers_platform_interface: - dependency: transitive - description: - name: audioplayers_platform_interface - sha256: "365c547f1bb9e77d94dd1687903a668d8f7ac3409e48e6e6a3668a1ac2982adb" - url: "https://pub.dev" - source: hosted - version: "6.1.0" - audioplayers_web: - dependency: transitive - description: - name: audioplayers_web - sha256: "22cd0173e54d92bd9b2c80b1204eb1eb159ece87475ab58c9788a70ec43c2a62" - url: "https://pub.dev" - source: hosted - version: "4.1.0" - audioplayers_windows: - dependency: transitive - description: - name: audioplayers_windows - sha256: "9536812c9103563644ada2ef45ae523806b0745f7a78e89d1b5fb1951de90e1a" - url: "https://pub.dev" - source: hosted - version: "3.1.0" + version: "0.1.21" boolean_selector: dependency: transitive description: @@ -101,10 +61,10 @@ packages: dependency: transitive description: name: crypto - sha256: ff625774173754681d66daaf4a448684fb04b78f902da9cb3d308c19cc5e8bab + sha256: "1dceb0cf05cb63a7852c11560060e53ec2f182079a16ced6f4395c5b0875baf8" url: "https://pub.dev" source: hosted - version: "3.0.3" + version: "3.0.4" cupertino_icons: dependency: "direct main" description: @@ -129,14 +89,6 @@ packages: url: "https://pub.dev" source: hosted version: "2.1.3" - file: - dependency: transitive - description: - name: file - sha256: "5fc22d7c25582e38ad9a8515372cd9a93834027aacf1801cf01164dac0ffa08c" - url: "https://pub.dev" - source: hosted - version: "7.0.0" fixnum: dependency: "direct main" description: @@ -240,6 +192,14 @@ packages: url: "https://pub.dev" source: hosted version: "4.0.2" + image: + dependency: transitive + description: + name: image + sha256: "2237616a36c0d69aef7549ab439b833fb7f9fb9fc861af2cc9ac3eedddd69ca8" + url: "https://pub.dev" + source: hosted + version: "4.2.0" js: dependency: transitive description: @@ -248,6 +208,38 @@ packages: url: "https://pub.dev" source: hosted version: "0.6.7" + just_audio: + dependency: "direct main" + description: + name: just_audio + sha256: ee50602364ba83fa6308f5512dd560c713ec3e1f2bc75f0db43618f0d82ef71a + url: "https://pub.dev" + source: hosted + version: "0.9.39" + just_audio_media_kit: + dependency: "direct main" + description: + name: just_audio_media_kit + sha256: "7f57d317fafa04cb3e70b924e8f632ffb7eca7a97a369e1e44738ed89fbd5da1" + url: "https://pub.dev" + source: hosted + version: "2.0.5" + just_audio_platform_interface: + dependency: transitive + description: + name: just_audio_platform_interface + sha256: "0243828cce503c8366cc2090cefb2b3c871aa8ed2f520670d76fd47aa1ab2790" + url: "https://pub.dev" + source: hosted + version: "4.3.0" + just_audio_web: + dependency: transitive + description: + name: just_audio_web + sha256: "0edb481ad4aa1ff38f8c40f1a3576013c3420bf6669b686fe661627d49bc606c" + url: "https://pub.dev" + source: hosted + version: "0.4.11" leak_tracker: dependency: transitive description: @@ -280,6 +272,14 @@ packages: url: "https://pub.dev" source: hosted version: "4.0.0" + logging: + dependency: transitive + description: + name: logging + sha256: "623a88c9594aa774443aa3eb2d41807a48486b5613e67599fb4c41c0ad47c340" + url: "https://pub.dev" + source: hosted + version: "1.2.0" matcher: dependency: transitive description: @@ -296,6 +296,38 @@ packages: url: "https://pub.dev" source: hosted version: "0.11.1" + media_kit: + dependency: transitive + description: + name: media_kit + sha256: "3289062540e3b8b9746e5c50d95bd78a9289826b7227e253dff806d002b9e67a" + url: "https://pub.dev" + source: hosted + version: "1.1.10+1" + 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" + media_kit_native_event_loop: + dependency: "direct main" + description: + name: media_kit_native_event_loop + sha256: a605cf185499d14d58935b8784955a92a4bf0ff4e19a23de3d17a9106303930e + url: "https://pub.dev" + source: hosted + version: "1.0.8" meta: dependency: transitive description: @@ -312,6 +344,14 @@ packages: url: "https://pub.dev" source: hosted version: "1.0.0" + patch_package: + dependency: "direct main" + description: + name: patch_package + sha256: ade4baf6e726395435e1d74cfe035978cf089024663e479e80fbe6c9d94b90a3 + url: "https://pub.dev" + source: hosted + version: "0.0.8" path: dependency: transitive description: @@ -368,6 +408,14 @@ packages: url: "https://pub.dev" source: hosted version: "2.3.0" + petitparser: + dependency: transitive + description: + name: petitparser + sha256: c15605cd28af66339f8eb6fbe0e541bfe2d1b72d5825efc6598f3e0a31b9ad27 + url: "https://pub.dev" + source: hosted + version: "6.0.2" platform: dependency: transitive description: @@ -400,6 +448,22 @@ packages: url: "https://pub.dev" source: hosted version: "6.1.2" + rxdart: + dependency: transitive + description: + name: rxdart + sha256: "5c3004a4a8dbb94bd4bf5412a4def4acdaa12e12f269737a5751369e12d1a962" + url: "https://pub.dev" + source: hosted + 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" sky_engine: dependency: transitive description: flutter @@ -449,10 +513,10 @@ packages: dependency: transitive description: name: synchronized - sha256: "539ef412b170d65ecdafd780f924e5be3f60032a1128df156adad6c5b373d558" + sha256: a824e842b8a054f91a728b783c177c1e4731f6b124f9192468457a8913371255 url: "https://pub.dev" source: hosted - version: "3.1.0+1" + version: "3.2.0" term_glyph: dependency: transitive description: @@ -477,6 +541,22 @@ packages: url: "https://pub.dev" source: hosted version: "1.3.2" + universal_platform: + dependency: transitive + description: + name: universal_platform + sha256: "64e16458a0ea9b99260ceb5467a214c1f298d647c659af1bff6d3bf82536b1ec" + url: "https://pub.dev" + source: hosted + version: "1.1.0" + uri_parser: + dependency: transitive + description: + name: uri_parser + sha256: "6543c9fd86d2862fac55d800a43e67c0dcd1a41677cb69c2f8edfe73bbcf1835" + url: "https://pub.dev" + source: hosted + version: "2.0.2" uuid: dependency: transitive description: @@ -505,10 +585,10 @@ packages: dependency: transitive description: name: web - sha256: d43c1d6b787bf0afad444700ae7f4db8827f701bc61c255ac8d328c6f4d52062 + sha256: "97da13628db363c635202ad97068d47c5b8aa555808e7a9411963c533b449b27" url: "https://pub.dev" source: hosted - version: "1.0.0" + version: "0.5.1" web_socket: dependency: transitive description: @@ -541,6 +621,14 @@ packages: url: "https://pub.dev" source: hosted version: "1.0.4" + xml: + dependency: transitive + description: + name: xml + sha256: b015a8ad1c488f66851d762d3090a21c600e479dc75e68328c52774040cf9226 + url: "https://pub.dev" + source: hosted + version: "6.5.0" sdks: dart: ">=3.5.0 <4.0.0" flutter: ">=3.22.0" diff --git a/pubspec.yaml b/pubspec.yaml index ac00848..7cb70bc 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -40,10 +40,14 @@ dependencies: protobuf: ^3.1.0 web_socket_channel: ^3.0.1 provider: ^6.1.2 - audioplayers: ^5.2.1 flutter_secure_storage: ^9.2.2 http: ^1.2.2 - audioplayers_linux: ^3.1.0 + just_audio: ^0.9.37 + just_audio_media_kit: ^2.0.5 + media_kit_libs_linux: any + media_kit_libs_windows_audio: any + media_kit_native_event_loop: ^1.0.8 + patch_package: ^0.0.8 dev_dependencies: flutter_test: diff --git a/windows/flutter/generated_plugin_registrant.cc b/windows/flutter/generated_plugin_registrant.cc index 5f23188..67e32e3 100644 --- a/windows/flutter/generated_plugin_registrant.cc +++ b/windows/flutter/generated_plugin_registrant.cc @@ -6,12 +6,12 @@ #include "generated_plugin_registrant.h" -#include #include +#include void RegisterPlugins(flutter::PluginRegistry* registry) { - AudioplayersWindowsPluginRegisterWithRegistrar( - registry->GetRegistrarForPlugin("AudioplayersWindowsPlugin")); FlutterSecureStorageWindowsPluginRegisterWithRegistrar( registry->GetRegistrarForPlugin("FlutterSecureStorageWindowsPlugin")); + MediaKitLibsWindowsAudioPluginCApiRegisterWithRegistrar( + registry->GetRegistrarForPlugin("MediaKitLibsWindowsAudioPluginCApi")); } diff --git a/windows/flutter/generated_plugins.cmake b/windows/flutter/generated_plugins.cmake index 1164d9f..c2a091d 100644 --- a/windows/flutter/generated_plugins.cmake +++ b/windows/flutter/generated_plugins.cmake @@ -3,11 +3,12 @@ # list(APPEND FLUTTER_PLUGIN_LIST - audioplayers_windows flutter_secure_storage_windows + media_kit_libs_windows_audio ) list(APPEND FLUTTER_FFI_PLUGIN_LIST + media_kit_native_event_loop ) set(PLUGIN_BUNDLED_LIBRARIES)