singerdmx / flutter-quill

Rich text editor for Flutter
https://pub.dev/packages/flutter_quill
MIT License
2.58k stars 835 forks source link

Videos get stuck when trying to play them after inserting a new video in flutter web #2236

Open AronJorge opened 1 month ago

AronJorge commented 1 month ago

Is there an existing issue for this?

Flutter Quill version

flutter_quill: ^10.6.2

Steps to reproduce

  1. click on insert video
  2. Open the dialog to paste a link
  3. Add / paste a link from youtube
  4. The video is displayed in the editor
  5. Click on the play icon

https://github.com/user-attachments/assets/3b06208a-fc4b-46b9-9ca1-ad05e6107420

Expected results

When you click on the video play icon, the video should start playing directly inside the editor without errors or interruptions.

Actual results

  1. The user clicks on “insert video”.
  2. A dialog opens to paste a link.
  3. The user adds or pastes a link from a YouTube video.
  4. The video is displayed correctly in the editor.

When clicking on the play icon, the video does not play. There is no functional response from the embedded player, indicating a possible failure to load the video or to integrate the player within the editor.

Code sample

Code sample ```dart [Paste your code here] ```

Additional Context

Screenshots / Video demonstration [Upload media here]
Logs ```console [Paste your logs here] ```
EchoEllet commented 1 month ago

Thank you for the report. Can you share the log if there are exceptions/errors?

AronJorge commented 1 month ago

The bug does not show error in logs

https://github.com/user-attachments/assets/1e1361a5-83d5-4d85-8e0e-5efa8ad11f55

EchoEllet commented 1 month ago

Can you try the debug console of your browser? Right-click, then Inspect, and see the Console.

image

Also keep in mind loading YouTube videos is currently not supported on non-web platforms by default, we do plan to either drop support of the web too or indicate that loading YouTube videos is only supported on the web (can use experimental property to implement your own solution).

EchoEllet commented 1 month ago

In general loading platform views, especially web elements (it uses <iframe>) on the Flutter web app is not ideal and has performance and stability issues. Have some bugs as well.

This is not an issue of Flutter Quill though we could improve the implementation with workarounds or completely remove it from the default.