-
-
Notifications
You must be signed in to change notification settings - Fork 859
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
[QUESTION] How I can get src from the audio/video tags ? #766
Comments
See https://github.com/Sub6Resources/flutter_html/blob/master/lib/src/replaced_element.dart#L368-L374 for how we do it, you can apply the same approach in your |
What version of flutter_html are you on? You should get the render context, which contains the full html node, including the |
I tried with your solution reference but still unable to get src, here is my code
|
I am using the |
@aniketsongara can you try this code inside final sources = <String?>[
if (context.tree.element.attributes['src'] != null) context.tree.element.attributes['src'],
...ReplacedElement.parseMediaSources(context.tree.element.children),
];
if (sources.isEmpty) return Container();
final String? source = sources.first;
//return widget here using source as src |
@tneotia Thanks It's working, but what is wrong in above sample code ?? |
Your HTML looks like this: <audio controls>
<source src="some_src" type="audio/mp3">
</audio> So when you override <audio controls src="some_src"/> Then your sample code would work. But because you have the nested source tag instead of the |
I want the source(src) value from the below audio tag
I was trying to get it using
customRender
in Html package but not able to get it.here is what I am trying
The text was updated successfully, but these errors were encountered: