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

Can't get thumbUrl when send video in iOS #2023

Open
1 task done
anhdo9797 opened this issue Sep 11, 2024 · 3 comments
Open
1 task done

Can't get thumbUrl when send video in iOS #2023

anhdo9797 opened this issue Sep 11, 2024 · 3 comments
Labels
bug Something isn't working

Comments

@anhdo9797
Copy link

Which packages are you using?

stream_chat_flutter

On what platforms did you experience the issue?

iOS

What version are you using?

8.0.0

What happened?

I'm having trouble loading thumbnails after successfully uploading videos.

This is my code send video attachment

Future<void> _attachmentImageCallback(List<String> paths) async {
    List<Attachment> attachments = [];

    await Future.wait(paths.map((path) async {
      final uri = Uri.parse(path);
      File file = File(uri.path);

      final fileSize = await file.length();

      final attach = Attachment(
        type: AttachmentType.video,
        file: AttachmentFile(
          size: fileSize,
          path: file.path,
        ),
      );

      if (attach != null) {
        attachments.add(attach);
      }
    }).toList());

    if (attachments.isNotEmpty) {
      await controller.channel.value?.sendMessage(
        Message(
          attachments: attachments,
        ),
      );
    }
  }

The thumbnail appears as
iOS
image

android
image

Debug console


════════ Exception caught by image resource service ════════════════════════════
The following HttpExceptionWithStatus was thrown resolving an image codec:
HttpException: Invalid statusCode: 404, uri = https://singapore.stream-io-cdn.com/1300380/images/f4dc0cb8-1337-4a08-91e6-00049c9760e9.575BEFAF-EA88-4FDE-B68A-113EDA8A5A3F_L0.MOV.jpg?Key-Pair-****

Steps to reproduce

**My code sent attachment**


 Future<void> _attachmentImageCallback(List<String> paths) async {
    List<Attachment> attachments = [];

    await Future.wait(paths.map((path) async {
      final uri = Uri.parse(path);
      File file = File(uri.path);

      final fileSize = await file.length();

      final attach = Attachment(
        type: AttachmentType.video,
        file: AttachmentFile(
          size: fileSize,
          path: file.path,
        ),
      );

      if (attach != null) {
        attachments.add(attach);
      }
    }).toList());

    if (attachments.isNotEmpty) {
      await controller.channel.value?.sendMessage(
        Message(
          attachments: attachments,
        ),
      );
    }
  }


### Supporting info to reproduce

_No response_

### Relevant log output

```shell
════════ Exception caught by image resource service ════════════════════════════
The following HttpExceptionWithStatus was thrown resolving an image codec:
HttpException: Invalid statusCode: 404, uri = https://singapore.stream-io-cdn.com/1300380/images/f4dc0cb8-1337-4a08-91e6-00049c9760e9.575BEFAF-EA88-4FDE-B68A-113EDA8A5A3F_L0.MOV.jpg?Key-Pair-****


### Flutter analyze output

_No response_

### Flutter doctor output

```shell
[✓] Flutter (Channel stable, 3.19.6, on macOS 14.4 23E214 darwin-arm64, locale en-VN)
    • Flutter version 3.19.6 on channel stable at /Users/phuocanh/fvm/versions/3.19.6
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 54e66469a9 (5 months ago), 2024-04-17 13:08:03 -0700
    • Engine revision c4cd48e186
    • Dart version 3.3.4
    • DevTools version 2.31.1

[!] Android toolchain - develop for Android devices (Android SDK version 35.0.0)
    • Android SDK at /Users/phuocanh/Library/Android/sdk
    ✗ cmdline-tools component is missing
      Run `path/to/sdkmanager --install "cmdline-tools;latest"`
      See https://developer.android.com/studio/command-line for more details.
    ✗ Android license status unknown.
      Run `flutter doctor --android-licenses` to accept the SDK licenses.
      See https://flutter.dev/docs/get-started/install/macos#android-setup for more details.

[✓] Xcode - develop for iOS and macOS (Xcode 15.4)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Build 15F31d
    • CocoaPods version 1.15.2

[✓] Chrome - develop for the web
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Android Studio (version 2024.1)
    • Android Studio at /Applications/Android Studio.app/Contents
    • Flutter plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build 17.0.11+0-17.0.11b1207.24-11852314)

[✓] VS Code (version 1.92.2)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 3.96.0

[✓] Connected device (5 available)
    • SM N950U1 (mobile) • ce0917199897c0390d7e                 • android-arm64  • Android 9 (API 28)
    • PhuocAnh (mobile)  • 00008101-0019254814D8001E            • ios            • iOS 17.3 21D50
    • iPhone 12 (mobile) • EAC2D893-F9F4-4E69-AD9E-8F8DF0BBA8B8 • ios            • com.apple.CoreSimulator.SimRuntime.iOS-16-0 (simulator)
    • macOS (desktop)    • macos                                • darwin-arm64   • macOS 14.4 23E214 darwin-arm64
    • Chrome (web)       • chrome                               • web-javascript • Google Chrome 128.0.6613.120

[✓] Network resources
    • All expected network resources are available.

! Doctor found issues in 1 category.

Code of Conduct

  • I agree to follow this project's Code of Conduct
@anhdo9797 anhdo9797 added the bug Something isn't working label Sep 11, 2024
Copy link

github-actions bot commented Oct 1, 2024

This issue is stale because it has been open for 20 days with no activity.

@github-actions github-actions bot added the Stale label Oct 1, 2024
Copy link

github-actions bot commented Oct 8, 2024

This issue was closed because it has been inactive for 7 days since being marked as stale.

@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Oct 8, 2024
@deven98 deven98 reopened this Oct 10, 2024
@github-actions github-actions bot removed the Stale label Oct 10, 2024
@anhdo9797
Copy link
Author

Can someone help me?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants