How to embed YouTube video clips into posts
How to embed YouTube video clips into posts
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: Then simply put your link between the two brackets:
[youtube][/youtube]
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:
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: Then simply put your link between the two brackets:
[youtube][/youtube]
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:
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
Re: How to embed video clips into posts
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
SJ
Re: How to embed video clips into posts
That is class!
Re: How to embed video clips into posts
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.
Re: How to embed YouTube video clips into posts
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.
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.
How to embed YouTube video clips into posts
Thanks for that info. Thats not good. I wonder how long its been like that?
Mark
Mark
- huahin4ever
- Ace
- Posts: 1094
- Joined: Tue Jul 17, 2012 12:07 pm
- Location: Hua Hin
Re: How to embed YouTube video clips into posts
So this works only for Youtube videos, or can we embed videos from other sites too?
YNWA
Re: How to embed YouTube video clips into posts
bsdk1960, that was almost right. Take s out of https and it would work.
Championship Plymouth Argyle 3 - 2 Sunderland
Points 5; Position 16
Points 5; Position 16
Re: How to embed YouTube video clips into posts
thanks, I try again
Re: How to embed YouTube video clips into posts
Only Youtube.huahin4ever wrote:So this works only for Youtube videos, or can we embed videos from other sites too?
It wont work with '&feature=related'
It wont work with https
It wont work with youtu.be
The links must be clean.
- pharvey
- Moderator
- Posts: 14752
- Joined: Sat Aug 29, 2009 10:21 am
- Location: Sir Fynwy - God's Country
Re: How to embed YouTube video clips into posts
As in what, sexual/graphic content or "IT terminology"?Lev wrote:The links must be clean.
"Hope is a good thing, maybe the best of things" - Yma o Hyd.
Re: How to embed YouTube video clips into posts
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
Re: How to embed YouTube video clips into posts
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:
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:
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.
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'];
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'];
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.
Re: How to embed YouTube video clips into posts
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.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.
Championship Plymouth Argyle 3 - 2 Sunderland
Points 5; Position 16
Points 5; Position 16