Welcome to the Question2Answer Q&A. There's also a demo if you just want to try it out.
+2 votes
1.3k views
in Q2A Core by

I'm trying to embed a youtube video in an answer on v1.3.1.

I extracted the URL from the code generated by youtube (bolded):

<iframe title="YouTube video player" width="480" height="390" src="http://www.youtube.com/embed/W8r-tXRLazs?rel=0" frameborder="0" allowfullscreen></iframe>

 

And pasted it as Flash in WYSIWYG editor.

Still, video isn't shown.

Any ideas as for what I must be missing here? Thanks :)

3 Answers

+2 votes
by

Test test adawdawdawd

You need to post only "http://www.youtube.com/v/GWGFh5S4RfQ" part (link with /v/)

So i gues it work only using old youtube embed code.

Test using new youtube embed code:

by
Thanks a lot! Works like charm :) What was it with that format of the link (the "/v/")?  How can I instruct my visitors as for how can THEY embed links in THEIR answers? Cheers!
by
You need say that you need to replace "/watch?v=" with "/v/" in youtube link and post in flash section. I think for now it's the only solution.
+1 vote
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
0 votes
by

If possible do the cleanup without URL parameters:

http://www.youtube.com/watch?feature=related&v=9Xzt1uMuWlQ&gl=XX

by
Hm.  Okay, I'll look into it, thanks for the tip.
...