Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add audio player v1 #679

Open
wants to merge 7 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
253 changes: 253 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,253 @@
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "flutter_chat_ui",
"request": "launch",
"type": "dart"
},
{
"name": "flyer_chat",
"cwd": "examples/flyer_chat",
"request": "launch",
"type": "dart"
},
{
"name": "flyer_chat (profile mode)",
"cwd": "examples/flyer_chat",
"request": "launch",
"type": "dart",
"flutterMode": "profile"
},
{
"name": "flyer_chat (release mode)",
"cwd": "examples/flyer_chat",
"request": "launch",
"type": "dart",
"flutterMode": "release"
},
{
"name": "cross_cache",
"cwd": "packages/cross_cache",
"request": "launch",
"type": "dart"
},
{
"name": "cross_cache (profile mode)",
"cwd": "packages/cross_cache",
"request": "launch",
"type": "dart",
"flutterMode": "profile"
},
{
"name": "cross_cache (release mode)",
"cwd": "packages/cross_cache",
"request": "launch",
"type": "dart",
"flutterMode": "release"
},
{
"name": "flutter_chat_core",
"cwd": "packages/flutter_chat_core",
"request": "launch",
"type": "dart"
},
{
"name": "flutter_chat_core (profile mode)",
"cwd": "packages/flutter_chat_core",
"request": "launch",
"type": "dart",
"flutterMode": "profile"
},
{
"name": "flutter_chat_core (release mode)",
"cwd": "packages/flutter_chat_core",
"request": "launch",
"type": "dart",
"flutterMode": "release"
},
{
"name": "flutter_chat_ui",
"cwd": "packages/flutter_chat_ui",
"request": "launch",
"type": "dart"
},
{
"name": "flutter_chat_ui (profile mode)",
"cwd": "packages/flutter_chat_ui",
"request": "launch",
"type": "dart",
"flutterMode": "profile"
},
{
"name": "flutter_chat_ui (release mode)",
"cwd": "packages/flutter_chat_ui",
"request": "launch",
"type": "dart",
"flutterMode": "release"
},
{
"name": "flyer_chat_audio_message",
"cwd": "packages/flyer_chat_audio_message",
"request": "launch",
"type": "dart"
},
{
"name": "flyer_chat_audio_message (profile mode)",
"cwd": "packages/flyer_chat_audio_message",
"request": "launch",
"type": "dart",
"flutterMode": "profile"
},
{
"name": "flyer_chat_audio_message (release mode)",
"cwd": "packages/flyer_chat_audio_message",
"request": "launch",
"type": "dart",
"flutterMode": "release"
},
{
"name": "flyer_chat_custom_message",
"cwd": "packages/flyer_chat_custom_message",
"request": "launch",
"type": "dart"
},
{
"name": "flyer_chat_custom_message (profile mode)",
"cwd": "packages/flyer_chat_custom_message",
"request": "launch",
"type": "dart",
"flutterMode": "profile"
},
{
"name": "flyer_chat_custom_message (release mode)",
"cwd": "packages/flyer_chat_custom_message",
"request": "launch",
"type": "dart",
"flutterMode": "release"
},
{
"name": "flyer_chat_file_message",
"cwd": "packages/flyer_chat_file_message",
"request": "launch",
"type": "dart"
},
{
"name": "flyer_chat_file_message (profile mode)",
"cwd": "packages/flyer_chat_file_message",
"request": "launch",
"type": "dart",
"flutterMode": "profile"
},
{
"name": "flyer_chat_file_message (release mode)",
"cwd": "packages/flyer_chat_file_message",
"request": "launch",
"type": "dart",
"flutterMode": "release"
},
{
"name": "flyer_chat_image_message",
"cwd": "packages/flyer_chat_image_message",
"request": "launch",
"type": "dart"
},
{
"name": "flyer_chat_image_message (profile mode)",
"cwd": "packages/flyer_chat_image_message",
"request": "launch",
"type": "dart",
"flutterMode": "profile"
},
{
"name": "flyer_chat_image_message (release mode)",
"cwd": "packages/flyer_chat_image_message",
"request": "launch",
"type": "dart",
"flutterMode": "release"
},
{
"name": "flyer_chat_location_message",
"cwd": "packages/flyer_chat_location_message",
"request": "launch",
"type": "dart"
},
{
"name": "flyer_chat_location_message (profile mode)",
"cwd": "packages/flyer_chat_location_message",
"request": "launch",
"type": "dart",
"flutterMode": "profile"
},
{
"name": "flyer_chat_location_message (release mode)",
"cwd": "packages/flyer_chat_location_message",
"request": "launch",
"type": "dart",
"flutterMode": "release"
},
{
"name": "flyer_chat_system_message",
"cwd": "packages/flyer_chat_system_message",
"request": "launch",
"type": "dart"
},
{
"name": "flyer_chat_system_message (profile mode)",
"cwd": "packages/flyer_chat_system_message",
"request": "launch",
"type": "dart",
"flutterMode": "profile"
},
{
"name": "flyer_chat_system_message (release mode)",
"cwd": "packages/flyer_chat_system_message",
"request": "launch",
"type": "dart",
"flutterMode": "release"
},
{
"name": "flyer_chat_text_message",
"cwd": "packages/flyer_chat_text_message",
"request": "launch",
"type": "dart"
},
{
"name": "flyer_chat_text_message (profile mode)",
"cwd": "packages/flyer_chat_text_message",
"request": "launch",
"type": "dart",
"flutterMode": "profile"
},
{
"name": "flyer_chat_text_message (release mode)",
"cwd": "packages/flyer_chat_text_message",
"request": "launch",
"type": "dart",
"flutterMode": "release"
},
{
"name": "flyer_chat_video_message",
"cwd": "packages/flyer_chat_video_message",
"request": "launch",
"type": "dart"
},
{
"name": "flyer_chat_video_message (profile mode)",
"cwd": "packages/flyer_chat_video_message",
"request": "launch",
"type": "dart",
"flutterMode": "profile"
},
{
"name": "flyer_chat_video_message (release mode)",
"cwd": "packages/flyer_chat_video_message",
"request": "launch",
"type": "dart",
"flutterMode": "release"
}
]
}
44 changes: 44 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,47 @@ Welcome to the next generation of Flutter Chat UI! ✨

💡 **Looking for the stable version?**
The v1 release is available on the [v1 branch](https://github.com/flyerhq/flutter_chat_ui/tree/v1).

## Platform-Specific Configuration for Audio Recording

To enable audio recording functionality, you need to configure permissions for both Android and iOS platforms.

### Android

1. **Add Permissions to `AndroidManifest.xml`:**

Add the following permissions to your `AndroidManifest.xml` file to allow microphone access and file writing:

```xml
<uses-permission android:name="android.permission.RECORD_AUDIO"/>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>
```

2. **Add Queries for Android 11 and above:**

If your app targets Android 11 (API level 30) or higher, add the following queries to allow access to certain actions:

```xml
<queries>
<intent>
<action android:name="android.intent.action.PROCESS_TEXT"/>
<data android:mimeType="text/plain"/>
</intent>
</queries>
```

### iOS

1. **Add Permissions to `Info.plist`:**

Add the following keys to your `Info.plist` file to request microphone access:

```xml
<key>NSMicrophoneUsageDescription</key>
<string>This app requires access to the microphone to record audio.</string>
<key>NSPhotoLibraryAddUsageDescription</key>
<string>This app requires access to save audio files.</string>
```

By following these steps, you can ensure that your app has the necessary permissions to record audio on both Android and iOS platforms.
6 changes: 6 additions & 0 deletions examples/flyer_chat/android/app/src/debug/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,10 @@
to allow setting breakpoints, to provide hot reload, etc.
-->
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.RECORD_AUDIO" />
<!-- Optional: Add this permission if you want to use bluetooth telephony device like headset/earbuds -->
<uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS" />
<!-- Optional: Add this permission if you want to save your recordings in public folders -->
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />

</manifest>
9 changes: 9 additions & 0 deletions examples/flyer_chat/android/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,4 +1,13 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
<uses-permission android:name="android.permission.RECORD_AUDIO"/>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>
<queries>
<intent>
<action android:name="android.intent.action.PROCESS_TEXT"/>
<data android:mimeType="text/plain"/>
</intent>
</queries>
<application
android:label="flyer_chat"
android:name="${applicationName}"
Expand Down
2 changes: 1 addition & 1 deletion examples/flyer_chat/ios/Podfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Uncomment this line to define a global platform for your project
# platform :ios, '12.0'
platform :ios, '12.0'

# CocoaPods analytics sends network stats synchronously affecting flutter build latency.
ENV['COCOAPODS_DISABLE_STATS'] = 'true'
Expand Down
20 changes: 19 additions & 1 deletion examples/flyer_chat/ios/Podfile.lock
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
PODS:
- audioplayers_darwin (0.0.1):
- Flutter
- Flutter (1.0.0)
- image_picker_ios (0.0.1):
- Flutter
Expand All @@ -7,14 +9,23 @@ PODS:
- path_provider_foundation (0.0.1):
- Flutter
- FlutterMacOS
- permission_handler_apple (9.3.0):
- Flutter
- record_darwin (1.0.0):
- Flutter

DEPENDENCIES:
- audioplayers_darwin (from `.symlinks/plugins/audioplayers_darwin/ios`)
- Flutter (from `Flutter`)
- image_picker_ios (from `.symlinks/plugins/image_picker_ios/ios`)
- isar_flutter_libs (from `.symlinks/plugins/isar_flutter_libs/ios`)
- path_provider_foundation (from `.symlinks/plugins/path_provider_foundation/darwin`)
- permission_handler_apple (from `.symlinks/plugins/permission_handler_apple/ios`)
- record_darwin (from `.symlinks/plugins/record_darwin/ios`)

EXTERNAL SOURCES:
audioplayers_darwin:
:path: ".symlinks/plugins/audioplayers_darwin/ios"
Flutter:
:path: Flutter
image_picker_ios:
Expand All @@ -23,13 +34,20 @@ EXTERNAL SOURCES:
:path: ".symlinks/plugins/isar_flutter_libs/ios"
path_provider_foundation:
:path: ".symlinks/plugins/path_provider_foundation/darwin"
permission_handler_apple:
:path: ".symlinks/plugins/permission_handler_apple/ios"
record_darwin:
:path: ".symlinks/plugins/record_darwin/ios"

SPEC CHECKSUMS:
audioplayers_darwin: 877d9a4d06331c5c374595e46e16453ac7eafa40
Flutter: e0871f40cf51350855a761d2e70bf5af5b9b5de7
image_picker_ios: c560581cceedb403a6ff17f2f816d7fea1421fc1
isar_flutter_libs: b69f437aeab9c521821c3f376198c4371fa21073
path_provider_foundation: 2b6b4c569c0fb62ec74538f866245ac84301af46
permission_handler_apple: 9878588469a2b0d0fc1e048d9f43605f92e6cec2
record_darwin: 3b1a8e7d5c0cbf45ad6165b4d83a6ca643d929c3

PODFILE CHECKSUM: 819463e6a0290f5a72f145ba7cde16e8b6ef0796
PODFILE CHECKSUM: 7be2f5f74864d463a8ad433546ed1de7e0f29aef

COCOAPODS: 1.15.2
Loading