Page 3 of 4

Re: YouTube Mod

Posted: Tue Jun 05, 2007 9:20 pm
by Jens Gutzeit
Hello,

I've written a mod for embedding flash-videos of several sites (youtube, google video, sevenload, many more), too. You can test it and download the source on my test forum:

http://www.gutzeit.gooba.de/index.php

For the next version I'll cleanup the code a bit and add support for a direct conversion from urls to bbcode, just like the magic-url thing.

Currently the URL based video insertion works with:
Parsing of embed-code works with (nearly) any page which produces non-javascript-based embed codes with more or less valid HTML (the script fixes the most common HTML problems before trying to parse it).

Re: YouTube Mod

Posted: Wed Jun 13, 2007 8:34 pm
by custmguru®
Jens Gutzeit wrote:Hello,

I've written a mod for embedding flash-videos of several sites (youtube, google video, sevenload, many more), too. You can test it and download the source on my test forum:

http://www.gutzeit.gooba.de/index.php

For the next version I'll cleanup the code a bit and add support for a direct conversion from urls to bbcode, just like the magic-url thing.

Currently the URL based video insertion works with:
Parsing of embed-code works with (nearly) any page which produces non-javascript-based embed codes with more or less valid HTML (the script fixes the most common HTML problems before trying to parse it).
I like this one. it may not be the url submission everyone is asking for but it's clear on what it's asking for. I do understand though, some people are stupid and will not pay attention and there will be dead videos...

Re: YouTube Mod

Posted: Wed Jun 13, 2007 8:49 pm
by Jens Gutzeit
custmguru® wrote: I like this one. it may not be the url submission everyone is asking for but it's clear on what it's asking for. I do understand though, some people are stupid and will not pay attention and there will be dead videos...
URL-submission just like the magic URL thing is planned for the next release as an add-on. But there is one general problem with URL based flash-link-creation: Some sites (SiamTube as example, but better known ones, too) where you can't create the flash-link by the URL itself. Which would result in a scenario where you can use one method for s.th. around 80% of the pages and have to tell your users, they need to use a different method for the other pages. I do not think this is good usability. This is the reason for my mod being as it is: One box where you can enter both variants. If one doesn't work, try the other, but the task for the user, is the same and not 2 totaly different.

Re: YouTube Mod

Posted: Thu Nov 29, 2007 2:22 am
by stewaia
jorge89 wrote:I have obtained that it leaves mod youtube:

BBCode:

Code: Select all

[youtube]{TEXT}[/youtube]
Html:

Code: Select all

<object width="425" height="350">
   <param name="movie" value="http://www.youtube.com/v/{TEXT}"></param>
   <embed src="http://www.youtube.com/v/{TEXT}" type="application/x-shockwave-flash" wmode="transparent" width="425" height="350"></embed>
</object><br />
<a href="http://youtube.com/watch?v={TEXT}" target="_blank">Youtube</a><br />
Post:

Code: Select all

[youtube]FWOsbGP5Ox4[/youtube]
:D
I just wanted to say that out of all the codes I tried..This was the one that worked perfectly!!

Re: YouTube Mod

Posted: Tue Dec 11, 2007 6:33 am
by yexusbeliever
Is there one that can just allow us to use the full youtube link?

Re: YouTube Mod

Posted: Wed Apr 23, 2008 7:15 pm
by njharley

Code: Select all

[youtube]http://{TEXT1}youtube.com/watch?v={TEXT2}[/youtube]

Code: Select all

<object width="425" height="350"><param name="movie" value="http://{TEXT1}youtube.com/v/{TEXT2}"></param><param name="wmode" value="transparent"></param><embed src="http://{TEXT1}youtube.com/v/{TEXT2}" type="application/x-shockwave-flash" wmode="transparent" width="425" height="350"></embed></object>
This worked for me

Re: YouTube Mod

Posted: Fri Apr 25, 2008 2:38 am
by gowron
this one by njharley is perfect !

Thanks njharley !

Re: YouTube Mod

Posted: Thu Jan 15, 2009 11:28 am
by KennyF
Yup! That worked for me too.

Thanks man! 8-)

Re: YouTube Mod

Posted: Sun Jan 18, 2009 11:12 am
by Liphtier
njharley wrote:

Code: Select all

[youtube]http://{TEXT1}youtube.com/watch?v={TEXT2}[/youtube]

Code: Select all

<object width="425" height="350"><param name="movie" value="http://{TEXT1}youtube.com/v/{TEXT2}"></param><param name="wmode" value="transparent"></param><embed src="http://{TEXT1}youtube.com/v/{TEXT2}" type="application/x-shockwave-flash" wmode="transparent" width="425" height="350"></embed></object>
This worked for me
I tried and it didn't work. Actually I don't even understand how should it work.. :roll:
Meanwhile what I did is

Youtube:

BBCODE:

Code: Select all

[youtube]{URL}[/youtube]
HTML REPLACEMENT:

Code: Select all

<object width="425" height="350"><param name="movie" value="{URL}"></param><param name="wmode" value="transparent"></param><embed src="{URL}" type="application/x-shockwave-flash" wmode="transparent" width="425" height="350"></embed></object>
with this modification:
in "includes/bbcode.php" before lines 112 where:

Code: Select all

$message = preg_replace($preg['search'], $preg['replace'], $message);
put this:

Code: Select all

foreach($preg['search'] as $search) {
	if(strpos($search, 'youtube')) {
		$message = preg_replace_callback(
					$preg['search'],
					create_function(
						'$matches',
						'return str_replace("watch?v=", "v/", $matches[0]);'
					),
					$message
		);
	}
}

Re: YouTube Mod

Posted: Mon Jan 19, 2009 1:46 pm
by AcuteAngel
If you need to feed the URL of the video movie... try this MOD
http://www.phpbb.com/community/viewtopi ... 0&t=695525

That is for PhpBB3 board

Re: YouTube Mod

Posted: Mon Jan 19, 2009 3:30 pm
by Liphtier
Really coool :)

Re: YouTube Mod

Posted: Sun Dec 05, 2010 7:24 pm
by hleV
Here's the simple YouTube BBCode I just written.
Supports full address until the & symbol after the identifier, so people having such link:
http://youtube.com/watch?v=PABdx5Fjd7U&feature=related
must remove the &feature=related part.

Code: Select all

[youtube]{URL}={IDENTIFIER}[/youtube]

Code: Select all

<object type="application/x-shockwave-flash" data="http://youtube.com/v/{IDENTIFIER}" width="425" height="350">
<param name="movie" value="http://youtube.com/v/{IDENTIFIER}" />
<param name="wmode" value="transparent" />
</object>

Re: YouTube Mod

Posted: Sun Mar 13, 2011 11:05 am
by abcEzy
You's guys are all using the wrong embed code...

youtube have changed the way they do their embedding now.

just click on their embed link... COPY IT.

Code: Select all

<iframe title="YouTube video player" width="480" height="390" src="http://www.youtube.com/embed/ZqhKzMNTdZ4" frameborder="0" allowfullscreen></iframe>
ok.. now take out this ZqhKzMNTdZ4 from above, and change it to {TEXT} so it looks like this

Code: Select all

<iframe title="YouTube video player" width="480" height="390" src="http://www.youtube.com/embed/{TEXT}" frameborder="0" allowfullscreen></iframe>
simple.

Re: YouTube Mod

Posted: Sun Mar 13, 2011 1:02 pm
by 4_seven
iframe is not the best code-practice. here an example without any bbcode: http://www.phpbb.com/community/viewtopi ... #p12271215

Re: YouTube Mod

Posted: Mon Apr 18, 2011 7:42 am
by stevefoxnina
DualFusion wrote:I hope you know how to add bbcodes :P

Youtube:

BBCODE:

Code: Select all

[youtube]{TEXT}[/youtube]
HTML REPLACEMENT:

Code: Select all

<object width="425" height="350"><param name="movie" value="http://www.youtube.com/v/{TEXT}"></param><param name="wmode" value="transparent"></param><embed src="http://www.youtube.com/v/{TEXT}" type="application/x-shockwave-flash" wmode="transparent" width="425" height="350"></embed></object>
This method is currently working
http://d2lord.com/phpbb/viewtopic.php?f ... dd60676779

1)login to admin control panel
2) Click Posting,
3) Add New BB code
4) BBCode usage
[youtube]{SIMPLETEXT}[/youtube]
5)HTML replacement
<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>

6)Display on posting page (Tick)
7) go to your youtube video e.g.
http://www.youtube.com/watch?v=aM5rhOjBB_0
or
http://www.youtube.com/watch?v=VWdpH0Bd ... re=related

8) During posting click youtube button and copy and paste the video code after "=" and before "&"

or