How to embed YouTube video clips into posts

Help us improve the forum! Make a suggestion for the board or ask questions here. This area is also for forum announcements.
User avatar
buksida
Moderator
Moderator
Posts: 22475
Joined: Tue Dec 31, 2002 12:25 pm
Location: south of sanity

How to embed YouTube video clips into posts

Post by buksida »

Since people are still adding video content via manual links I'll do a quick post showing you how to embed them.

The first thing you need to do is get your clip link, it will be direct from YouTube for example:


When you're ready to insert it into your post click the YouTube button:
yt1.jpg
yt1.jpg (47.08 KiB) Viewed 9127 times
Then simply put your link between the two brackets:
[youtube][/youtube]
yt2.jpg
yt2.jpg (12.46 KiB) Viewed 9127 times
Click submit and your video will be embedded. All you need is the YouTube link and v=random code identifier. You can even embed videos from other websites if you can find this link to the original on YouTube, it is usually in one of these places:
yt3.jpg
Who is the happier man, he who has braved the storm of life and lived or he who has stayed securely on shore and merely existed? - Hunter S Thompson
User avatar
Super Joe
Rock Star
Rock Star
Posts: 4929
Joined: Fri Sep 22, 2006 1:43 pm

Re: How to embed video clips into posts

Post by Super Joe »



Oh yeah works easy thanks, sure I did the same the thing the other day but couldn't get it to work.

I can show off now, but you should never show off in a boxing ring as this bloke found out :tsk:

SJ
BaaBaa.
Addict
Addict
Posts: 8620
Joined: Wed Aug 23, 2006 5:41 pm
Location: leuk lap

Re: How to embed video clips into posts

Post by BaaBaa. »

:lach:

That is class!
User avatar
Lev
Forum Admin
Forum Admin
Posts: 5576
Joined: Fri Dec 27, 2002 9:14 am
Location: Hua Hin Forum

Re: How to embed video clips into posts

Post by Lev »

A quick reminder about this thread as people are still using links to Youtube videos when we have the capacity to embed them into posts.
User avatar
Lev
Forum Admin
Forum Admin
Posts: 5576
Joined: Fri Dec 27, 2002 9:14 am
Location: Hua Hin Forum

Re: How to embed YouTube video clips into posts

Post by Lev »

Bumping this again and now stickying it - please can we embed the videos in post and not link to YouTube direct, it saves people going off site.

The function is so simple to use.

Note: It will sometimes not work if the '&feature=related' tag is included, please only use the clean YouTube video link.
R19si
Novice
Novice
Posts: 1
Joined: Thu Dec 11, 2014 11:32 am

How to embed YouTube video clips into posts

Post by R19si »

Thanks for that info. Thats not good. I wonder how long its been like that?

Mark
User avatar
huahin4ever
Ace
Ace
Posts: 1076
Joined: Tue Jul 17, 2012 12:07 pm
Location: Hua Hin

Re: How to embed YouTube video clips into posts

Post by huahin4ever »

So this works only for Youtube videos, or can we embed videos from other sites too?
YNWA
bsdk1960
Ace
Ace
Posts: 1471
Joined: Mon Jul 16, 2012 2:21 pm
Location: hua hin/frederiksberg DK.

Re: How to embed YouTube video clips into posts

Post by bsdk1960 »



test

:cheers: :cheers:
User avatar
Big Boy
Moderator
Moderator
Posts: 44949
Joined: Fri Nov 04, 2005 7:36 pm
Location: Bon Kai

Re: How to embed YouTube video clips into posts

Post by Big Boy »

bsdk1960, that was almost right. Take s out of https and it would work.
Championship Plymouth Argyle 0 - 1 Preston NE :cry: :cry: :cry: :cry:

Points 41; Position 18
bsdk1960
Ace
Ace
Posts: 1471
Joined: Mon Jul 16, 2012 2:21 pm
Location: hua hin/frederiksberg DK.

Re: How to embed YouTube video clips into posts

Post by bsdk1960 »



thanks, I try again

:cheers: :cheers:
User avatar
Lev
Forum Admin
Forum Admin
Posts: 5576
Joined: Fri Dec 27, 2002 9:14 am
Location: Hua Hin Forum

Re: How to embed YouTube video clips into posts

Post by Lev »

huahin4ever wrote:So this works only for Youtube videos, or can we embed videos from other sites too?
Only Youtube.

It wont work with '&feature=related'
It wont work with https
It wont work with youtu.be

The links must be clean.
User avatar
pharvey
Moderator
Moderator
Posts: 13699
Joined: Sat Aug 29, 2009 10:21 am
Location: Sir Fynwy - God's Country

Re: How to embed YouTube video clips into posts

Post by pharvey »

Lev wrote:The links must be clean.
As in what, sexual/graphic content or "IT terminology"?
"Hope is a good thing, maybe the best of things" - Yma o Hyd.
User avatar
buksida
Moderator
Moderator
Posts: 22475
Joined: Tue Dec 31, 2002 12:25 pm
Location: south of sanity

Re: How to embed YouTube video clips into posts

Post by buksida »

I think clean means without any of the stuff mentioned in the post.
Who is the happier man, he who has braved the storm of life and lived or he who has stayed securely on shore and merely existed? - Hunter S Thompson
User avatar
Ratsima
Ace
Ace
Posts: 1141
Joined: Tue Apr 23, 2013 6:53 am
Location: โคราช

Re: How to embed YouTube video clips into posts

Post by Ratsima »

I think it's pretty silly that the forum only works with "clean" YouTube links when the code to take any valid link and convert it to a clean link is really easy and really basic. After all, we have computers so that people won't have to sweat the details. The following code will take a valid YouTube URL (short or long) and extract the video ID (the 11 character code after the "v=" or at the end of a short URL:

Code: Select all

	$ytshorturl = 'youtu.be/';
	$ytlongurl = 'www.youtube.com/watch?v=';
	if (strpos($url,$ytshorturl) !== false)
		{
    		$url = str_replace($ytshorturl, $ytlongurl, $url);
		}
	parse_str( parse_url( $url, PHP_URL_QUERY ), $my_array_of_vars );
	$v = $my_array_of_vars['v'];
I know, a bit silly to convert a short URL into a long URL just to extract the video ID, but it seemed the best way to illustrate what's going on.

If you want the complete URL instead of just the video ID, you can substitute this for the last line in the code above:

Code: Select all

$url = "http://www.youtube.com/watch?v=".$my_array_of_vars['v'];
I threw up a very simple and mostly untested web page to demonstrate this. If you find a problem, let me know:

http://www.mgnewman.com/youtube.php

Note: Some people seem to be under the impression that the stuff that appears after the video ID in a YouTube URL is somehow Apple specific. This is not the case.
User avatar
Big Boy
Moderator
Moderator
Posts: 44949
Joined: Fri Nov 04, 2005 7:36 pm
Location: Bon Kai

Re: How to embed YouTube video clips into posts

Post by Big Boy »

Ratsima wrote:Note: Some people seem to be under the impression that the stuff that appears after the video ID in a YouTube URL is somehow Apple specific. This is not the case.
I must say, as somebody who fixes several of these links daily, I've only ever seen youtu.be/ from Apple users - I stand corrected.
Championship Plymouth Argyle 0 - 1 Preston NE :cry: :cry: :cry: :cry:

Points 41; Position 18
Post Reply