Explained: Embedding Youtube Videos on the forum

General discussion (space-sim gaming, astronomy, and sci-fi entertainment in general, etc.).
Viper
Captain
Captain
Posts: 1032
Joined: Wed Aug 03, 2011 8:41 pm
Location: Behind you

Explained: Embedding Youtube Videos on the forum

Post by Viper »

Hi all,

Youtube have changed their embedding code from the old 'object' code to the new 'iframe' code. A lot of forums and blogs seem to encounter problems using this new code, and it won't work on this forum either (at least not yet).
However, Vice has offered a solution for this, which I'll describe below.

Please note:
Since the embed code is HTML, the forum you are posting the video in needs to have HTML enabled for the video to show up. Check to the left of your reply box, where it says:

Message:
HTML is On
Smilies are On
BB Code is On
[img] Code is On

If it says 'HTML is Off', then embedding videos will not work on that forum.
For the forum sections that have HTML enabled, this is how it works:


> If you want to embed a video on this forum, copy the HTML code inside the code block below and paste it into your post (don't quote this post and copy the entire bbcode for the code block, but only the HTML code inside the code block!):

Code: Select all

<object width="853" height="480"><param name="movie" value="http://www.youtube.com/v/YOUBUEID&hl=en_US&fs=1"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/YOUTUBEID&hl=en_US&fs=1&rel=0" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="853" height="480"></embed></object>
Change the 'YOUTUBEID' labels (there's two) in the code above to the ID of your video and adjust the width and height values as desired.



> An example of how to use the video ID:
Let's say the url to your Youtube video is https://www.youtube.com/watch?v=SU8eKLFm6GE, then the red part would be your video ID.
Copy this video ID from the url and paste it into the code you copied from inside the code block above, replacing the 'YOUTUBEID' part, and those parts only.

The resulting code would look like:

Code: Select all

<object width="853" height="480"><param name="movie" value="http://www.youtube.com/v/SU8eKLFm6GE&hl=en_US&fs=1"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/SU8eKLFm6GE&hl=en_US&fs=1&rel=0" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="853" height="480"></embed></object>
Please note: The video will probably still not show up when previewing your post, but it will when the post is submitted.


~ Viper.

[Edited on 12-1-2012 by Viper]
Image
\"For he today who sheds his blood with me, shall be my brother\"
Kikoni
Lieutenant Jr. Grade
Lieutenant Jr. Grade
Posts: 87
Joined: Wed Sep 05, 2012 7:26 pm

Explained: Embedding Youtube Videos on the forum

Post by Kikoni »

Thanks for the heads up, Viper. Much appreciated.
Image
Image
▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬

▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬

▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬

▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬
\"For there will come a day, the sky no longer blue,
When man will waste away, having nothing to do.
They will look up so sombre at the stars in black:
Everything that they conquered and everything that they lack.\"
User avatar
Marvin
Global Moderator
Global Moderator
Posts: 13936
Joined: Wed Mar 04, 2009 5:47 am
Location: Fallon-Reno

Explained: Embedding Youtube Videos on the forum

Post by Marvin »

:cool: Viper, please add this thread to your Table of Contents.
Munshine
Lieutenant
Lieutenant
Posts: 256
Joined: Sat Jan 21, 2012 7:33 pm
Location: France

Explained: Embedding Youtube Videos on the forum

Post by Munshine »

Well I followed your instructions by adding a new video on this thread and it's not working at all. :(

[Edited on 11-30-2012 by Munshine]
Débutant francophone perdu dans l\'Evoverse et besoin d\'aide ?
>> Sujet sur RpgFrance > Sujet sur CanardPC <<
Viper
Captain
Captain
Posts: 1032
Joined: Wed Aug 03, 2011 8:41 pm
Location: Behind you

Explained: Embedding Youtube Videos on the forum

Post by Viper »

That's because you probably quoted my post and copied the code including the [ code ] and [ /code ] (without the spaces), which establish the 'Code' box, into your post.
If you edit your post, and remove the [ code ] at the beginning, and the [ /code ] at the end of it, it should work.

Good point though, I'll update the post above to clarify.
Image
\"For he today who sheds his blood with me, shall be my brother\"
Viper
Captain
Captain
Posts: 1032
Joined: Wed Aug 03, 2011 8:41 pm
Location: Behind you

Explained: Embedding Youtube Videos on the forum

Post by Viper »

Post updated.
If it's still not clear, let me know and I'll see if I can rephrase. English is not my first language.
From post: 149986, Topic: tid=10042, author=Marvin wrote::cool: Viper, please add this thread to your Table of Contents.
Will do.

[Edited on 12-1-2012 by Viper]
Image
\"For he today who sheds his blood with me, shall be my brother\"
Munshine
Lieutenant
Lieutenant
Posts: 256
Joined: Sat Jan 21, 2012 7:33 pm
Location: France

Explained: Embedding Youtube Videos on the forum

Post by Munshine »

Nope, sorry. Obviously in the first place, I copied and pasted the html code inside the bbcode manually or using the "insert code" option.

[Edited on 12-1-2012 by Munshine]
Débutant francophone perdu dans l\'Evoverse et besoin d\'aide ?
>> Sujet sur RpgFrance > Sujet sur CanardPC <<
Viper
Captain
Captain
Posts: 1032
Joined: Wed Aug 03, 2011 8:41 pm
Location: Behind you

Explained: Embedding Youtube Videos on the forum

Post by Viper »

Would you be so kind and post your video ID here please (or send it to me via u2u)? I'll have a look then.

Edit:
I have updated the code in the first post with the code used for my own video in the ENN thread and tested it successfully. There might have been a typo in the first piece of code.
Have a go with the new code.

[Edited on 12-1-2012 by Viper]
Image
\"For he today who sheds his blood with me, shall be my brother\"
Munshine
Lieutenant
Lieutenant
Posts: 256
Joined: Sat Jan 21, 2012 7:33 pm
Location: France

Explained: Embedding Youtube Videos on the forum

Post by Munshine »

:) Here we go:
<object width="560" height="384"><param name="movie" value="http://www.youtube.com/v/5uKD1ap5hsI&hl ... ram><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/5uKD1ap5hsI&hl ... fs=1&rel=0" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="560" height="384"></embed></object>


EDIT: Funny, I found out that you doesn't need the bbcode and that you could turn off it completely ("Turn BBCode off?" radiobox checked)


[Edited on 12-1-2012 by Munshine]
Débutant francophone perdu dans l\'Evoverse et besoin d\'aide ?
>> Sujet sur RpgFrance > Sujet sur CanardPC <<
Viper
Captain
Captain
Posts: 1032
Joined: Wed Aug 03, 2011 8:41 pm
Location: Behind you

Explained: Embedding Youtube Videos on the forum

Post by Viper »

Yes the code for embedding videos is all HTML. You don't need to turn bbcode off for it to work though, the forum supports both bbcode and HTML. By default both code types are enabled I think.
Image
\"For he today who sheds his blood with me, shall be my brother\"
Munshine
Lieutenant
Lieutenant
Posts: 256
Joined: Sat Jan 21, 2012 7:33 pm
Location: France

Explained: Embedding Youtube Videos on the forum

Post by Munshine »

Still it's amazing that it is working perfectly well on this thread and not on the specified thread. :o
Débutant francophone perdu dans l\'Evoverse et besoin d\'aide ?
>> Sujet sur RpgFrance > Sujet sur CanardPC <<
Viper
Captain
Captain
Posts: 1032
Joined: Wed Aug 03, 2011 8:41 pm
Location: Behind you

Explained: Embedding Youtube Videos on the forum

Post by Viper »

Yeah I just thought of something I totally forgot in the first place: not all forums have HTML enabled. The General Discussion forum you are trying to post in, is one of the forum that has it disabled. You can check this by looking to the left of your (quick) reply block, where it says:

Message:
HTML is On
Smilies are On
BB Code is On
[img] Code is On

If it says 'HTML is Off', it won't work since the embedding code is HTML. You could try sending Vice a u2u with the request to enable it on the forum you want to post the video in.

Sorry for the inconvenience I might have caused with not mentioning this in the first post, I totally forgot about it. I'll update the first post to mention this.
Image
\"For he today who sheds his blood with me, shall be my brother\"