This is How to Simply Embed ANY Youtube & Google Video

Get help with installation and running phpBB 3.0.x here. Please do not post bug reports, feature requests, or MOD-related questions here.
Get Involved
Forum rules
END OF SUPPORT: 1 January 2017 (announcement)
User avatar
Frodosringfinger
Registered User
Posts: 226
Joined: Mon Oct 16, 2006 1:45 am
Location: Maryland

Re: This is How to Simply Embed ANY Youtube & Google Video

Post by Frodosringfinger »

I figured it out. Make the custom BB codes in PHPBB3 as seen below.

YOUTUBE:
BB Code:

Code: Select all

[youtube]<object width="425" height="{NUMBER}"><param name="movie" value="http://www.youtube.com/v/{SIMPLETEXT}"></param><param name="wmode" value="transparent"></param><embed src="http://www.youtube.com/v/{SIMPLETEXT}" type="application/x-shockwave-flash" wmode="transparent" width="425" height="{NUMBER}"></embed></object>[/youtube]

HTML Replacement:

Code: Select all

<object width="425" height="{NUMBER}"><param name="movie" value="http://www.youtube.com/v/{SIMPLETEXT}"></param><param name="wmode" value="transparent"></param><embed src="http://www.youtube.com/v/{SIMPLETEXT}" type="application/x-shockwave-flash" wmode="transparent" width="425" height="{NUMBER}"></embed></object>
This allows you to embed youtube videos just like you used to. Just copy the EMBED code off the actual youtube page and paste it within the [youtube][/youtube]


GOOGLE VIDEO:
BB Code:

Code: Select all

[googlevideo]<embed style="width:400px; height:326px;" id="VideoPlayback" type="application/x-shockwave-flash" src="http://video.google.com/googleplayer.swf?docId={SIMPLETEXT}&hl=en" flashvars=""> </embed>[/googlevideo]
HTML Replacement:

Code: Select all

<embed style="width:400px; height:326px;" id="VideoPlayback" type="application/x-shockwave-flash" src="http://video.google.com/googleplayer.swf?docId={SIMPLETEXT}&hl=en" flashvars=""> </embed>
Just copy the EMBED code from the actual Google Video page and past it within the [googlevideo][/googlevideo]
Last edited by Frodosringfinger on Thu Aug 30, 2007 5:04 am, edited 1 time in total.
ganni
Registered User
Posts: 7
Joined: Thu Aug 02, 2007 11:27 am

Re: This is How to Simply Embed ANY Youtube & Google Video

Post by ganni »

terminon wrote:The following works for me perfectly in phpBB3 RC4, both in preview and in post. No core mods.

BBCode usage

Code: Select all

[youtube]http://www.youtube.com/watch?v={SIMPLETEXT}[/youtube]
HTML replacement

Code: Select all

<object width="425" height="350"><param name="movie" value="http://www.youtube.com/v/{SIMPLETEXT}"></param><param name="wmode" value="transparent"></param><embed src="http://www.youtube.com/v/{SIMPLETEXT}" type="application/x-shockwave-flash" wmode="transparent" width="425" height="350"></embed></object>
Usage example

Code: Select all

[youtube]http://www.youtube.com/watch?v=-xEzGIuY7kw[/youtube]
It really works. Great!!! :D :D
willink
Registered User
Posts: 2
Joined: Sun Aug 12, 2007 1:28 am

Re: This is How to Simply Embed ANY Youtube & Google Video

Post by willink »

What is the exact name/location of the file that this code needs to be added to. I'm a bit of a newbie with this. Thanks!
User avatar
IBBoard
Registered User
Posts: 543
Joined: Wed May 25, 2005 9:02 pm
Location: Worcestershire, UK
Contact:

Re: This is How to Simply Embed ANY Youtube & Google Video

Post by IBBoard »

Almost all of these are just "BBCode"/"HTML Replacement" ones, so they're not in a file but in the ACP. Look in the BBCode section and there's an option to add new BBCodes (much better than phpBB2, which did need you to hack files).
willink
Registered User
Posts: 2
Joined: Sun Aug 12, 2007 1:28 am

Re: This is How to Simply Embed ANY Youtube & Google Video

Post by willink »

IBBoard wrote:Almost all of these are just "BBCode"/"HTML Replacement" ones, so they're not in a file but in the ACP. Look in the BBCode section and there's an option to add new BBCodes (much better than phpBB2, which did need you to hack files).
I'm still running phpbb2. What files do I need to mod?
User avatar
IBBoard
Registered User
Posts: 543
Joined: Wed May 25, 2005 9:02 pm
Location: Worcestershire, UK
Contact:

Re: This is How to Simply Embed ANY Youtube & Google Video

Post by IBBoard »

Well these are all phpBB3 BBCodes (hence the forum) and so they won't work with phpBB2 since the patterns (like "{URL}") were only introduced in phpBB3.

There should be other MODs designed for phpBB2 around somewhere, although I've never looked for a Google/YouTube one.
Omarvelous
Registered User
Posts: 232
Joined: Mon Jun 25, 2007 2:24 am

Re: This is How to Simply Embed ANY Youtube & Google Video

Post by Omarvelous »

terminon wrote:Do it like CoD4Board's example, like so:

BBCode

Code: Select all

[youtube]http://{URL}youtube.com/watch?v={SIMPLETEXT}[/youtube]
HTML Replacement

Code: Select all

<object width="425" height="350"><param name="movie" value="http://www.youtube.com/v/{SIMPLETEXT}"></param><param name="wmode" value="transparent"></param><embed src="http://www.youtube.com/v/{SIMPLETEXT}" type="application/x-shockwave-flash" wmode="transparent" width="425" height="350"></embed></object>
This works for me using both http://www.youtube.com/watch?v=... or http://youtube.com/watch?v=...

In fact, you can even use http://ilikebluecheez.youtube.com/watch?v=... ;)
Not sure why it won't work for me.... i'll try again...

Ok... THIS works however...

Code: Select all

[youtube]{URL}youtube.com/watch?v={SIMPLETEXT}[/youtube]
minus the http://
Jaz
Registered User
Posts: 59
Joined: Fri Apr 05, 2002 11:53 am
Location: Norfolk, UK

Re: This is How to Simply Embed ANY Youtube & Google Video

Post by Jaz »

I've tried every which way to get this to work on RC4 but no go.

The post just looks like after it's submitted.

The HTML replacement is obviously not working in this case for some reason on my board.

I've tried clearing and recompiling the template cache, clearing my internet cache and just about every other suggestion that has been made on the various YouTube BBCode threads but nope, nada, zilch.

Incidentally I added the spoiler BBCode and it worked like a dream - it must be something to do with the particular HTML tag (object or embed or whatever) that is not being treated correctly.

Can anyone suggest why this is or how to fix it as it's driving me nuts.

Thanks.
RVI-bx
Registered User
Posts: 2
Joined: Tue Aug 21, 2007 12:38 am

Re: This is How to Simply Embed ANY Youtube & Google Video

Post by RVI-bx »

leozak wrote:I'm working on the code for previewing posts so that the Youtube video will appear.

*EDIT*

What this code does is 2 things:
- It alters the submitted text so that the Youtube code will work.
- Reverts it back to the original unaltered form so that it gets displayed in the textbox, for editing purposes.

For the Youtube video to appear in post previews, do the following:

OPEN posting.php

LOCATE:

Code: Select all

// Preview
if (!sizeof($error) && $preview)
{
ADD AFTER:

Code: Select all

	$message_parser->message = str_replace("watch?v=", 'v/', $message_parser->message);
-------------------------------------------------------------

LOCATE:

Code: Select all

$filename_data = $message_parser->filename_data;

ADD AFTER:

Code: Select all


$message_parser->message = str_replace("youtube.com/v/", 'youtube.com/watch?v=', $message_parser->message);
SAVE AND REPLACE.
@Leozak

Indeed, leozak, it works like a charm with the Universal (English - www . youtube..... ) version. But for
local Youtube sites doesn't.At the moment, there are 9 (without the english www . youtube ) local sites.Like you could see in the folowing photo,

Image

the given link, for example, is

Code: Select all

http://fr.youtube.com/watch?v=-sGii3PSeCI
For some reason, it doesn't work on post message, until i put http://www.youtube.com/watch?v=-sGii3PSeCI in the message.So i did the str_replace trick parser for all the 9 versions of site,so all the fr.youtube will become www . youtube an so on for all the other local adresses.It could be also just youtube.com instead of www . youtube,but it's not a 100% working variant.
As you are the owner of this little modification, and 'cause the credits goes to you, I leave to you the post of new mod for the str_replace command. ;)
Until a PhpBB3 version of Advanced BBCode Box ( http://www.phpbb.com/community/viewtopi ... 6&t=511968 ) let's say..... hoooray !
Have a nice day.
Last edited by RVI-bx on Tue Aug 21, 2007 1:39 am, edited 1 time in total.
User avatar
Crykit
Registered User
Posts: 17
Joined: Sat Aug 11, 2007 12:08 am
Location: Rifle City, KY USA

Place Webpages in your posts.

Post by Crykit »

This is also ones of the Advanced BBcode features from the old MOD.

I posted it in the MOD Discussion Area first, here is the link http://www.phpbb.com/community/viewtopi ... 2#p3166309

It will bring back the code for showing webpages in your posts via the iframe element.

BBcode Usage:

Code: Select all

[web] {URL} [/web]
HTML replacement:

Code: Select all

<center><iframe src="{URL}" width="750" height="450"><a href="{URL}" target="new" style="color:dark red">{TEXT}</a></iframe></center> 
Example:

Code: Select all

[web]http://someurl.com[/web]

You change the size and colors to whatever suits your needs/likes.
Crykit

"Give me a place to stand, and I shall move the Earth." -- Archimedes
bugss
Registered User
Posts: 9
Joined: Fri Aug 24, 2007 11:19 pm

Re: This is How to Simply Embed ANY Youtube & Google Video

Post by bugss »

I tried so many times and none of these steps helped. Do I need to change anything in the settings of the forum?
carsounds
Registered User
Posts: 2
Joined: Thu Aug 30, 2007 6:04 pm

Re: This is How to Simply Embed ANY Youtube & Google Video

Post by carsounds »

it do not work for me why what do i need to do ???????
do i need to update to 3.0 ?????
carsounds
Registered User
Posts: 2
Joined: Thu Aug 30, 2007 6:04 pm

Re: This is How to Simply Embed ANY Youtube & Google Video

Post by carsounds »

ok i see now you can not do it unless you got 3.0 update to 3.0 then you can do it in works fine
Arnold Layne
Registered User
Posts: 75
Joined: Sat Aug 25, 2007 2:04 am

Re: This is How to Simply Embed ANY Youtube & Google Video

Post by Arnold Layne »

can anyone do this for rc5?
User avatar
karlsemple
Former Team Member
Posts: 39802
Joined: Mon Nov 01, 2004 8:54 am
Location: Hereford, UK
Contact:

Re: This is How to Simply Embed ANY Youtube & Google Video

Post by karlsemple »

Arnold Layne wrote:can anyone do this for rc5?

do what?
Image
Locked

Return to “[3.0.x] Support Forum”