diff --git a/.flutter-plugins b/.flutter-plugins deleted file mode 100644 index 733fa3f..0000000 --- a/.flutter-plugins +++ /dev/null @@ -1,22 +0,0 @@ -# This is a generated file; do not edit or check into version control. -file_picker=/Users/Bram/.pub-cache/hosted/pub.dev/file_picker-5.3.0/ -flutter_plugin_android_lifecycle=/Users/Bram/.pub-cache/hosted/pub.dev/flutter_plugin_android_lifecycle-2.0.15/ -flutter_sound=/Users/Bram/.pub-cache/hosted/pub.dev/flutter_sound-9.2.13/ -flutter_sound_web=/Users/Bram/.pub-cache/hosted/pub.dev/flutter_sound_web-9.2.13/ -image_picker=/Users/Bram/.pub-cache/hosted/pub.dev/image_picker-0.8.7+5/ -image_picker_android=/Users/Bram/.pub-cache/hosted/pub.dev/image_picker_android-0.8.6+15/ -image_picker_for_web=/Users/Bram/.pub-cache/hosted/pub.dev/image_picker_for_web-2.1.12/ -image_picker_ios=/Users/Bram/.pub-cache/hosted/pub.dev/image_picker_ios-0.8.7+4/ -path_provider=/Users/Bram/.pub-cache/hosted/pub.dev/path_provider-2.0.15/ -path_provider_android=/Users/Bram/.pub-cache/hosted/pub.dev/path_provider_android-2.0.27/ -path_provider_foundation=/Users/Bram/.pub-cache/hosted/pub.dev/path_provider_foundation-2.2.3/ -path_provider_linux=/Users/Bram/.pub-cache/hosted/pub.dev/path_provider_linux-2.1.10/ -path_provider_windows=/Users/Bram/.pub-cache/hosted/pub.dev/path_provider_windows-2.1.6/ -permission_handler=/Users/Bram/.pub-cache/hosted/pub.dev/permission_handler-10.2.0/ -permission_handler_android=/Users/Bram/.pub-cache/hosted/pub.dev/permission_handler_android-10.2.1/ -permission_handler_apple=/Users/Bram/.pub-cache/hosted/pub.dev/permission_handler_apple-9.0.8/ -permission_handler_windows=/Users/Bram/.pub-cache/hosted/pub.dev/permission_handler_windows-0.1.2/ -video_player=/Users/Bram/.pub-cache/hosted/pub.dev/video_player-2.6.1/ -video_player_android=/Users/Bram/.pub-cache/hosted/pub.dev/video_player_android-2.4.8/ -video_player_avfoundation=/Users/Bram/.pub-cache/hosted/pub.dev/video_player_avfoundation-2.4.6/ -video_player_web=/Users/Bram/.pub-cache/hosted/pub.dev/video_player_web-2.0.16/ diff --git a/.github/workflows/flutter.yml b/.github/workflows/flutter.yml new file mode 100644 index 0000000..697a146 --- /dev/null +++ b/.github/workflows/flutter.yml @@ -0,0 +1,14 @@ +name: Iconica Standard Component CI Workflow +# Workflow Caller version: 2.0.0 + +on: + pull_request: + workflow_dispatch: + +jobs: + call-global-iconica-workflow: + uses: Iconica-Development/.github/.github/workflows/component-ci.yml@master + secrets: inherit + permissions: write-all + with: + subfolder: "." diff --git a/.gitignore b/.gitignore index fa0c788..b912244 100644 --- a/.gitignore +++ b/.gitignore @@ -29,3 +29,4 @@ migrate_working_dir/ .packages build/ .flutter-plugins-dependencies +.flutter-plugins \ No newline at end of file diff --git a/README.md b/README.md index d95101d..17beab1 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,10 @@ [![style: effective dart](https://img.shields.io/badge/style-effective_dart-40c4ff.svg)](https://github.com/tenhobi/effective_dart) -Flutter package which adds a dialog to pick various types of media +# Flutter Media Picker + +Flutter package which adds a dialog to pick various types of media. + +![Media Picker GIF](flutter_media_picker.gif) ## Setup diff --git a/example/ios/Podfile b/example/ios/Podfile index 88359b2..ee8a03c 100644 --- a/example/ios/Podfile +++ b/example/ios/Podfile @@ -37,5 +37,14 @@ end post_install do |installer| installer.pods_project.targets.each do |target| flutter_additional_ios_build_settings(target) + target.build_configurations.each do |config| + config.build_settings['GCC_PREPROCESSOR_DEFINITIONS'] ||= [ + '$(inherited)', + ## dart: PermissionGroup.camera + 'PERMISSION_CAMERA=1', + ## dart: PermissionGroup.microphone + 'PERMISSION_MICROPHONE=1', + ] + end end end diff --git a/example/ios/Podfile.lock b/example/ios/Podfile.lock index fd46eb8..c6d2c29 100644 --- a/example/ios/Podfile.lock +++ b/example/ios/Podfile.lock @@ -45,9 +45,9 @@ PODS: - FlutterMacOS - permission_handler_apple (9.0.4): - Flutter - - SDWebImage (5.15.5): - - SDWebImage/Core (= 5.15.5) - - SDWebImage/Core (5.15.5) + - SDWebImage (5.18.3): + - SDWebImage/Core (= 5.18.3) + - SDWebImage/Core (5.18.3) - SwiftyGif (5.4.4) - video_player_avfoundation (0.0.1): - Flutter @@ -57,7 +57,7 @@ DEPENDENCIES: - Flutter (from `Flutter`) - flutter_sound (from `.symlinks/plugins/flutter_sound/ios`) - image_picker_ios (from `.symlinks/plugins/image_picker_ios/ios`) - - path_provider_foundation (from `.symlinks/plugins/path_provider_foundation/ios`) + - path_provider_foundation (from `.symlinks/plugins/path_provider_foundation/darwin`) - permission_handler_apple (from `.symlinks/plugins/permission_handler_apple/ios`) - video_player_avfoundation (from `.symlinks/plugins/video_player_avfoundation/ios`) @@ -79,7 +79,7 @@ EXTERNAL SOURCES: image_picker_ios: :path: ".symlinks/plugins/image_picker_ios/ios" path_provider_foundation: - :path: ".symlinks/plugins/path_provider_foundation/ios" + :path: ".symlinks/plugins/path_provider_foundation/darwin" permission_handler_apple: :path: ".symlinks/plugins/permission_handler_apple/ios" video_player_avfoundation: @@ -92,13 +92,13 @@ SPEC CHECKSUMS: Flutter: f04841e97a9d0b0a8025694d0796dd46242b2854 flutter_sound: c60effa2a350fb977885f0db2fbc4c1ad5160900 flutter_sound_core: 26c10e5832e76aaacfae252d8925232281c486ae - image_picker_ios: b786a5dcf033a8336a657191401bfdf12017dabb - path_provider_foundation: c68054786f1b4f3343858c1e1d0caaded73f0be9 + image_picker_ios: 4a8aadfbb6dc30ad5141a2ce3832af9214a705b5 + path_provider_foundation: eaf5b3e458fc0e5fbb9940fb09980e853fe058b8 permission_handler_apple: 44366e37eaf29454a1e7b1b7d736c2cceaeb17ce - SDWebImage: fd7e1a22f00303e058058278639bf6196ee431fe + SDWebImage: 96e0c18ef14010b7485210e92fac888587ebb958 SwiftyGif: 93a1cc87bf3a51916001cf8f3d63835fb64c819f - video_player_avfoundation: e489aac24ef5cf7af82702979ed16f2a5ef84cff + video_player_avfoundation: 81e49bb3d9fb63dccf9fa0f6d877dc3ddbeac126 -PODFILE CHECKSUM: ef19549a9bc3046e7bb7d2fab4d021637c0c58a3 +PODFILE CHECKSUM: ec189f8a09ab520123e6b3244bb0eb78d2d25fd7 -COCOAPODS: 1.12.0 +COCOAPODS: 1.13.0 diff --git a/example/ios/Runner.xcodeproj/project.pbxproj b/example/ios/Runner.xcodeproj/project.pbxproj index f81a772..1787bfb 100644 --- a/example/ios/Runner.xcodeproj/project.pbxproj +++ b/example/ios/Runner.xcodeproj/project.pbxproj @@ -155,7 +155,7 @@ 97C146E61CF9000F007C117D /* Project object */ = { isa = PBXProject; attributes = { - LastUpgradeCheck = 1300; + LastUpgradeCheck = 1430; ORGANIZATIONNAME = ""; TargetAttributes = { 97C146ED1CF9000F007C117D = { @@ -204,6 +204,7 @@ files = ( ); inputPaths = ( + "${TARGET_BUILD_DIR}/${INFOPLIST_PATH}", ); name = "Thin Binary"; outputPaths = ( @@ -357,6 +358,7 @@ ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CLANG_ENABLE_MODULES = YES; CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; + DEVELOPMENT_TEAM = 7496HVVQKN; ENABLE_BITCODE = NO; INFOPLIST_FILE = Runner/Info.plist; LD_RUNPATH_SEARCH_PATHS = ( @@ -526,6 +528,7 @@ ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CLANG_ENABLE_MODULES = YES; CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; + DEVELOPMENT_TEAM = 7496HVVQKN; ENABLE_BITCODE = NO; INFOPLIST_FILE = Runner/Info.plist; LD_RUNPATH_SEARCH_PATHS = ( @@ -589,6 +592,7 @@ ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CLANG_ENABLE_MODULES = YES; CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; + DEVELOPMENT_TEAM = 7496HVVQKN; ENABLE_BITCODE = NO; INFOPLIST_FILE = Runner/Info.plist; LD_RUNPATH_SEARCH_PATHS = ( diff --git a/example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme b/example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme index c87d15a..a6b826d 100644 --- a/example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme +++ b/example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme @@ -1,6 +1,6 @@ + NSPhotoLibraryUsageDescription + This app requires access to the photo library. + NSMicrophoneUsageDescription + This app does not require access to the microphone. + NSCameraUsageDescription + This app requires access to the camera. + CADisableMinimumFrameDurationOnPhone + CFBundleDevelopmentRegion $(DEVELOPMENT_LANGUAGE) CFBundleDisplayName diff --git a/example/pubspec.lock b/example/pubspec.lock index 7bcd660..1e8b517 100644 --- a/example/pubspec.lock +++ b/example/pubspec.lock @@ -37,10 +37,10 @@ packages: dependency: transitive description: name: collection - sha256: "4a07be6cb69c84d677a6c3096fcf960cc3285a8330b4603e0d463d15d9bd934c" + sha256: f092b211a4319e98e5ff58223576de6c2803db36221657b46c82574721240687 url: "https://pub.dev" source: hosted - version: "1.17.1" + version: "1.17.2" cross_file: dependency: transitive description: @@ -147,7 +147,7 @@ packages: path: ".." relative: true source: path - version: "0.6.1" + version: "0.6.2" flutter_plugin_android_lifecycle: dependency: transitive description: @@ -258,10 +258,10 @@ packages: dependency: transitive description: name: intl - sha256: a3715e3bc90294e971cb7dc063fbf3cd9ee0ebf8604ffeafabd9e6f16abbdbe6 + sha256: "3bc132a9dbce73a7e4a21a17d06e1878839ffbf975568bc875c60537824b0c4d" url: "https://pub.dev" source: hosted - version: "0.18.0" + version: "0.18.1" js: dependency: transitive description: @@ -290,18 +290,18 @@ packages: dependency: transitive description: name: matcher - sha256: "6501fbd55da300384b768785b83e5ce66991266cec21af89ab9ae7f5ce1c4cbb" + sha256: "1803e76e6653768d64ed8ff2e1e67bea3ad4b923eb5c56a295c3e634bad5960e" url: "https://pub.dev" source: hosted - version: "0.12.15" + version: "0.12.16" material_color_utilities: dependency: transitive description: name: material_color_utilities - sha256: d92141dc6fe1dad30722f9aa826c7fbc896d021d792f80678280601aff8cf724 + sha256: "9528f2f296073ff54cb9fee677df673ace1218163c3bc7628093e7eed5203d41" url: "https://pub.dev" source: hosted - version: "0.2.0" + version: "0.5.0" meta: dependency: transitive description: @@ -471,10 +471,10 @@ packages: dependency: transitive description: name: source_span - sha256: dd904f795d4b4f3b870833847c461801f6750a9fa8e61ea5ac53f9422b31f250 + sha256: "53e943d4206a5e30df338fd4c6e7a077e02254531b138a15aec3bd143c1a8b3c" url: "https://pub.dev" source: hosted - version: "1.9.1" + version: "1.10.0" stack_trace: dependency: transitive description: @@ -519,10 +519,10 @@ packages: dependency: transitive description: name: test_api - sha256: eb6ac1540b26de412b3403a163d919ba86f6a973fe6cc50ae3541b80092fdcfb + sha256: "75760ffd7786fffdfb9597c35c5b27eaeec82be8edfb6d71d32651128ed7aab8" url: "https://pub.dev" source: hosted - version: "0.5.1" + version: "0.6.0" typed_data: dependency: transitive description: @@ -587,6 +587,14 @@ packages: url: "https://pub.dev" source: hosted version: "2.0.16" + web: + dependency: transitive + description: + name: web + sha256: dc8ccd225a2005c1be616fe02951e2e342092edf968cf0844220383757ef8f10 + url: "https://pub.dev" + source: hosted + version: "0.1.4-beta" win32: dependency: transitive description: @@ -604,5 +612,5 @@ packages: source: hosted version: "1.0.0" sdks: - dart: ">=3.0.0-417 <4.0.0" + dart: ">=3.1.0-185.0.dev <4.0.0" flutter: ">=3.3.0" diff --git a/MediaPickerGifNew.gif b/flutter_media_picker.gif similarity index 100% rename from MediaPickerGifNew.gif rename to flutter_media_picker.gif diff --git a/lib/src/service/audio_service.dart b/lib/src/service/audio_service.dart index 6ae6024..cce8f1f 100644 --- a/lib/src/service/audio_service.dart +++ b/lib/src/service/audio_service.dart @@ -12,12 +12,9 @@ import 'package:path_provider/path_provider.dart'; import 'package:permission_handler/permission_handler.dart'; class MediaPickerAudioService implements AudioService { - final FlutterSoundRecorder _recorder = FlutterSoundRecorder( - logLevel: Level.debug, - ); - final FlutterSoundPlayer _player = FlutterSoundPlayer( - logLevel: Level.nothing, - ); + late FlutterSoundRecorder _recorder; + late FlutterSoundPlayer _player; + Directory? _directory; @override @@ -37,6 +34,10 @@ class MediaPickerAudioService implements AudioService { throw RecordingPermissionException('Microphone permission not granted'); } + _recorder = FlutterSoundRecorder( + logLevel: Level.debug, + ); + _recorder.openRecorder(); if (_recorder.isRecording) { await _recorder.resumeRecorder(); @@ -56,6 +57,9 @@ class MediaPickerAudioService implements AudioService { @override void playAudio(Uint8List audio) { + _player = FlutterSoundPlayer( + logLevel: Level.debug, + ); _recorder.closeRecorder(); _player.openPlayer(); _player.startPlayer( diff --git a/lib/video_player/video_player_web.dart b/lib/video_player/video_player_web.dart index d8c65db..20db1e3 100644 --- a/lib/video_player/video_player_web.dart +++ b/lib/video_player/video_player_web.dart @@ -12,6 +12,6 @@ class VideoPlayerWrapper { Future getController(Uint8List video) async { final blob = Blob([video]); final url = Url.createObjectUrlFromBlob(blob); - return VideoPlayerController.network(url); + return VideoPlayerController.networkUrl(Uri.parse(url)); } } diff --git a/pubspec.yaml b/pubspec.yaml index 5f87caf..b761270 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,6 +1,6 @@ name: flutter_media_picker description: A new Flutter package project. -version: 0.6.2 +version: 0.6.3 homepage: https://github.com/Iconica-Development/flutter_media_picker publish_to: "none"