CPCWiki forum

General Category => CPCWiki Discussion => Topic started by: Gryzor on 13:59, 09 May 15

Title: Youtube Embedding - please read!
Post by: Gryzor on 13:59, 09 May 15
Ok, so it seems Youtube is changing their API and embedding in many cases does not/will not work. So I had to find another solution.


Beginning today (erm, actually, yesterday) you can't just paste the video link for it to be auto-embedded as video. Instead, you'll have to use the BBCode button in the button bar above the text field. It's the third-from-last button, the one with -guessed it?- the YouTube logo on it. Or, of course, you could input the BBCode manually.


You can actually do more stuff now:


Code: [Select]

[youtube]{youtube link}[/youtube]
[youtube width=x height=y]{youtube link}[/youtube]
[yt]{youtube ID}[/yt]
[yt {parameters}]{youtube ID}[/yt]
[yt_user]{username}[/yt_user]
[yt_user {parameters}]{username}[/yt_user]
[yt_search]{search query}[/yt_search]
[yt_search {parameters}]{search query}[/yt_search]



where width and height is specified by x and y.  If width and height aren't specified, default size is 640x400.


The yt_user bbcode will show videos by the specified YouTube username.


The yt_search bbcode will show videos matching the provided search phrase.


This mod should be able to display a valid YouTube video when passing URLs, and more.  For example, all of the following will display the YouTube video at hxxp://www.yxxtube.com/v/fA4cphzsjn8:


[attachimg=1]



Optional parameters and values for all YouTube bbcodes are:
If you don't want YT links to appear as embedded videos, There is a new option under Profile => Look and Layout called Show YouTube videos as a link.  Checking this box makes the mod create links instead of embedded videos in your post.

That's all. Please enjoy - and report any issues!
Title: Re: Youtube Embedding - please read!
Post by: Gryzor on 20:46, 11 May 15
Anyone tried it? Any issues?
Title: Re: Youtube Embedding - please read!
Post by: ronaldo on 00:15, 12 May 15
I have used it before reading this notice and had no issue at all. It worked flawleslly :) (The only thing I can think of right now is that pressing youtube button without something selected gives you the openning youtube tag, but not the closing).

[youtube]https://www.youtube.com/watch?v=Bt9zSfinwFA[/youtube]
Title: Re: Youtube Embedding - please read!
Post by: Gryzor on 09:48, 12 May 15
Does it? For me the YT button inserts both tags properly... what browser are you using?


Thanks :)
Title: Re: Youtube Embedding - please read!
Post by: alex76gr on 09:55, 12 May 15
I never liked embedded YT videos on forum pages.
It saves time for sure but bloats the page and increases the loading times.
If all fails, just throw a hyperlink and you are done! :D

Title: Re: Youtube Embedding - please read!
Post by: Gryzor on 09:58, 12 May 15
Yeah, but others (like me) don't like opening new pages. Loading time should be marginally affected since the elements load asynchronously - the web page loads independently of YT requests.


You could do like me - install a flash blocker that requires you to click on a Flash element to activate it.


Also, read the OP - you can disable embedding for your profile.
Title: Re: Youtube Embedding - please read!
Post by: ronaldo on 23:05, 12 May 15
Does it? For me the YT button inserts both tags properly... what browser are you using?

Thanks :)

I'm using firefox 37.0.2 on a Manjaro Linux :).
Title: Re: Youtube Embedding - please read!
Post by: Gryzor on 10:04, 13 May 15
I'm using firefox 37.0.2 on a Manjaro Linux :) .


Well, I'm not familiar with Killimanjaro or whatever, but I can confirm the bug with FF (38.0.5 here). I have reported it to the dev, let's see... thanks for reporting :)