Sub6Resources / flutter_html

A Flutter widget for rendering static html as Flutter widgets (Will render over 80 different html tags!)
https://pub.dev/packages/flutter_html
MIT License
1.76k stars 815 forks source link

[BUG] Dispose the video when back to previous screen #1033

Closed AliKarimiENT closed 2 years ago

AliKarimiENT commented 2 years ago

Well, my problem is that when I play the video and after that, while video is playing I pop up the screen and back to the previous screen but the video still is playing. I want to dispose the video but don't know how to do it.

AliKarimiENT commented 2 years ago

Excuse me any one have read my bug

erickok commented 2 years ago

Have you tried 3.0.0-alpha2?

AliKarimiENT commented 2 years ago

Have you tried 3.0.0-alpha2?

No my version is ^2.2.1

AliKarimiENT commented 2 years ago

Have you tried 3.0.0-alpha2?

I updated to this version but the video doesn't appear and show nothing

AliKarimiENT commented 2 years ago

After loading widget showed, nothing appear please check it

erickok commented 2 years ago

Have you added the right dependency for video support? flutter_html_video

erickok commented 2 years ago

And added the custom render.

AliKarimiENT commented 2 years ago

I didn't add flutter_html_video I don't know how to add custom render

erickok commented 2 years ago

Please follow the instructions at https://github.com/Sub6Resources/flutter_html#flutter_html_video

AliKarimiENT commented 2 years ago

image

Could you please check this exception

AliKarimiENT commented 2 years ago

I added flutter_html_video: ^3.0.0-alpha.2 flutter_html: ^3.0.0-alpha.2 to pubspec.yaml when adding these renders this error occurs and before adding these lines everything is like before

erickok commented 2 years ago

No host specified in URI

What html are you using? Looks like there is an incomplete url.

AliKarimiENT commented 2 years ago

No host specified in URI

What html are you using? Looks like there is an incomplete url.

We have a text input in our admin panel. We receive HTML base data from API and get these data to HTML in flutter. The input contains text list video and also audio.

erickok commented 2 years ago

Ok but can you copy/paste here a bit of the html where the <video> tag appears?

AliKarimiENT commented 2 years ago

image image

<p><span style="color: rgb(255, 255, 255); font-family: Vazir; font-size: 12.8px; text-align: justify; background-color: rgb(51, 51, 51);"><br></span></p><div class="embed-container text-center"><video src="https://4ie.ir/storage/files/24/1189999687.mp4?autoplay=0" frameborder="0" width="70%" allowfullscreen="true" controls="true" class="text-center isMedia"></video><br></div><p><span style="font-family: Vazir; font-size: 12.8px; text-align: justify;">۲۹ شی‌ء استردادشده از فرانسه در موزه ملی ایران به نمایش گذاشته شد. قدمت این آثار از پنج‌ هزار سال پیش تا دوره اسلامی است.</span><br></p>
erickok commented 2 years ago

Ah that's a separate bug. You are using a %-based width but this is unsupported. We only allow exact values there. This is a limitation we should fix and/or at least not crash.

AliKarimiENT commented 2 years ago

So I will wait for this bug fixes and after that I will migrate to latest version Thanks for your support

aneeshjoshi commented 2 years ago

Please follow the instructions at https://github.com/Sub6Resources/flutter_html#flutter_html_video

I was having the same issue with video player not stopping when container widget had left the screen. I updated my pubspec.yaml flutter_html: ^3.0.0-alpha.3 flutter_html_video: ^3.0.0-alpha.4

and added the customRenders as per above instructions. Now the video will not show up at all.


boziyoung commented 1 year ago

image image

<p><span style="color: rgb(255, 255, 255); font-family: Vazir; font-size: 12.8px; text-align: justify; background-color: rgb(51, 51, 51);"><br></span></p><div class="embed-container text-center"><video src="https://4ie.ir/storage/files/24/1189999687.mp4?autoplay=0" frameborder="0" width="70%" allowfullscreen="true" controls="true" class="text-center isMedia"></video><br></div><p><span style="font-family: Vazir; font-size: 12.8px; text-align: justify;">۲۹ شی‌ء استردادشده از فرانسه در موزه ملی ایران به نمایش گذاشته شد. قدمت این آثار از پنج‌ هزار سال پیش تا دوره اسلامی است.</span><br></p>

Hi, bro , please could you tall me that what is you used "Rich editor" @AliKarimiENT