Welcome to the Question2Answer Q&A. There's also a demo if you just want to try it out.
+4 votes
2.6k views
in Q2A Core by
I would like to be able embed a Youtube video into an answer, is this possible? Thank you in advance for your help.

2 Answers

0 votes
by

Yes, you can. You click 'Embed' on YouTube, extract out the URL from the src="..." tag, then click the Flash button in Q2A's rich text editor and paste in the URL. Example:

by
Er... actually it looks like you can't, because the Flash is being filtered out by the htmLawed library that Q2A uses. This can probably be fixed by modifying the parameters passed to htmLawed in the qa_sanitize_html(...) function in qa-base.php.
by
Gideon, would you please provide me with a specific example on what parameter to modify?

Thanks
by
For now I'm afraid you'll have to look at the htmLawed documentation, although I will try to fix this in a future version:

http://www.bioinformatics.org/phplabware/internal_utilities/htmLawed/htmLawed_README.htm
by
Fixed. Thanks for fix :)
by
Hy maby I't would be nicer to implement this http://www.9lessons.info/2010/06/facebook-like-extracting-url-data-with.html
How can wee do that,
Thanks ?
0 votes
by
edited by
The new YouTube code doesn't work because HTMLawed won't allow iframes.  Line 157 in qa-include/qa-base.php has to be changed to:

                        'elements' => '*+iframe+embed+object',

and then it works :)

EDIT: or just use this plugin:

https://github.com/NoahY/q2a-embed

http://www.question2answer.org/qa/8015/how-about-an-automatic-video-embed-plugin-youtube-only
...