Issue
This data is coming from API in json and value is coming in html tag. Flutter is not Sported Html audio tag so please suggest me something to archive this.
"message": "<div class='border-bottom pb-1'>Audio Recording</div><table class='table mt-1 border mb-0 table-hover table-border bg-white table-sm table_format'>\n <tbody><tr>\n <td class='font-small-1'><audio class=\"player\" src=\"https://sr.rity.com/vr/fetchsound/?callid=7fefab-65f7-41-baa5-49a69e33\" preload=\"metadata\" controls></audio></td>\n
I am using this 2 plugins:-
flutter_html_all: ^3.0.0-alpha.5
flutter_widget_from_html_core: ^0.10.3
and here is the flutter code:-
child: HtmlWidget( _activityList.message?.toString() ?? "" ),
Solution
flutter_widget_from_html_core
doesn't support audio, this is mentioned in pub.dev:
These tags requires flutter_widget_from_html:
- AUDIO
- IFRAME
- SVG
- VIDEO
You will need to install the other package:
flutter pub add flutter_widget_from_html
...then import it
import 'package:flutter_widget_from_html/flutter_widget_from_html.dart';
Optionally, you can tidy up pubspec by removing unused packages:
flutter pub remove flutter_html_all
flutter pub remove flutter_widget_from_html_core
Answered By - mrpaint
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.