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: 15908
Joined: Tue Dec 31, 2002 12:25 pm
Location: south of sanity
Contact:

How to embed YouTube video clips into posts

Post by buksida » Wed May 26, 2010 10:20 am

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 8063 times
Then simply put your link between the two brackets:
[youtube][/youtube]
yt2.jpg
yt2.jpg (12.46 KiB) Viewed 8063 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
Get out there: On The Road Asia

User avatar
Super Joe
Rock Star
Rock Star
Posts: 4950
Joined: Fri Sep 22, 2006 1:43 pm

Re: How to embed video clips into posts

Post by Super Joe » Wed May 26, 2010 1:41 pm



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

User avatar
BaaBaa.
Addict
Addict
Posts: 8954
Joined: Wed Aug 23, 2006 5:41 pm
Location: leuk lap

Re: How to embed video clips into posts

Post by BaaBaa. » Wed May 26, 2010 3:54 pm

:lach:

That is class!

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

Re: How to embed video clips into posts

Post by Lev » Sat Apr 07, 2012 8:06 am

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: 5650
Joined: Fri Dec 27, 2002 9:14 am
Location: Hua Hin Forum

Re: How to embed YouTube video clips into posts

Post by Lev » Tue May 22, 2012 7:18 am

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 » Fri Dec 12, 2014 10:37 am

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

Mark

User avatar
huahin4ever
Professional
Professional
Posts: 475
Joined: Tue Jul 17, 2012 12:07 pm
Location: Hua Hin

Re: How to embed YouTube video clips into posts

Post by huahin4ever » Fri Dec 12, 2014 8:19 pm

So this works only for Youtube videos, or can we embed videos from other sites too?
"Two possibilities exist:
Either we are alone in the universe or we are not.
Both are equally terrifying."
Arthur C. Clarke

bsdk1960
Ace
Ace
Posts: 1383
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 » Fri Dec 12, 2014 8:37 pm



test

:cheers: :cheers:

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

Re: How to embed YouTube video clips into posts

Post by Big Boy » Fri Dec 12, 2014 9:01 pm

bsdk1960, that was almost right. Take s out of https and it would work.
League 1 - Plymouth Argyle....2 Gillingham....1 :dance: :dance: :dance: :dance:
Points 20; Position 22

bsdk1960
Ace
Ace
Posts: 1383
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 » Fri Dec 12, 2014 9:07 pm



thanks, I try again

:cheers: :cheers:

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

Re: How to embed YouTube video clips into posts

Post by Lev » Sat Dec 13, 2014 10:59 am

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
Addict
Addict
Posts: 6470
Joined: Sat Aug 29, 2009 10:21 am
Location: Back in God's Country

Re: How to embed YouTube video clips into posts

Post by pharvey » Sat Dec 13, 2014 3:34 pm

Lev wrote:The links must be clean.
As in what, sexual/graphic content or "IT terminology"?
"You've got to get your first tackle in early, even if it's late". Ray Gravell :wink:

User avatar
buksida
Moderator
Moderator
Posts: 15908
Joined: Tue Dec 31, 2002 12:25 pm
Location: south of sanity
Contact:

Re: How to embed YouTube video clips into posts

Post by buksida » Sat Dec 13, 2014 3:37 pm

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
Get out there: On The Road Asia

User avatar
Ratsima
Professional
Professional
Posts: 497
Joined: Tue Apr 23, 2013 6:53 am
Location: โคราช

Re: How to embed YouTube video clips into posts

Post by Ratsima » Mon Jan 25, 2016 12:16 pm

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: 30583
Joined: Fri Nov 04, 2005 7:36 pm
Location: Bon Kai

Re: How to embed YouTube video clips into posts

Post by Big Boy » Mon Jan 25, 2016 12:31 pm

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.
League 1 - Plymouth Argyle....2 Gillingham....1 :dance: :dance: :dance: :dance:
Points 20; Position 22

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest