-
-
Notifications
You must be signed in to change notification settings - Fork 893
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
Video player, audio track doesn't stop[BUG] #752
Comments
Duplicate of #610. We do have a PR for this but we are hesitant to merge that because we would like to handle disposing the controllers on our own without needing a dispose method |
Hello @tneotia, is there any workaround to fix this? or how can we handle disposing on our own? |
The only current solution is to make a git dependency on my PR (#622) using the branch name and my fork URL. However it currently isn't merged with the latest changes so you will be missing out on some bug fixes or features. When you get the pubspec configured then you can do: late final Html htmlWidget;
final String htmlData = '<p>html data</p>';
//dispose is especially important when using <video> or <audio> in your HTML code
@override
void dispose() {
htmlWidget.dispose();
super.dispose();
}
@override
Widget build(BuildContext context) {
return new Scaffold(
appBar: AppBar(
title: Text('flutter_html Usage'),
centerTitle: true,
),
body: SingleChildScrollView(
child: htmlWidget = Html(
data: htmlData, //required
//other parameters here
),
),
);
} to properly dispose audio. |
Nice, thanks for your help @tneotia |
No problem, if you do try it out please let me know if it actually works because I wasn't able to reproduce the issue. |
|
The method 'dispose' isn't defined for the type 'Html'. (Documentation)Try correcting the name to the name of an existing method, or definingsmethod named 'dispose'. |
您好,您解决了吗?我这里发生意外. |
我不清楚我这次请教会不会有回答,请与我联系,谢谢大佬。 |
Yes, the fix from #622 is not yet merged due to being a public API change. As stated before, you may use the specific branch/commit if you really need it right now. |
Describe the bug:
playback of video/audio doesn't stop when widget disposed
Example
https://github.com/yeras-is/video_error
Expected behavior:
playback stop when widget dispose
Device details and Flutter/Dart/
flutter_html
versions:flutter_html - 2.1.0
devices= [
android emulator
,Samsung A80
,iOS simulator
,Iphone 11
]Flutter doctor
Used HTML
The text was updated successfully, but these errors were encountered: