Embedding youtube http or https

Get help developing custom BBCodes or request one.
Post Reply
TobyMac
Registered User
Posts: 47
Joined: Mon Jan 05, 2009 1:22 pm

Embedding youtube http or https

Post by TobyMac »

This may have already been posted somewhere or everyone except me may have already known this, but since I just spent about 3 hours trying to figure it out I figured I would post my problem and my solution just incase others have the same problem.

I was notified by some of my forum members that they could no longer embed Youtube videos.

I was able to identify that youtube url's starting with http:// embedded just fine but youtube url's starting with https:// would post as a link vs. embedding.

I have phpBB vs 3.0.11 installed

My original custom BBcode was:

Code: Select all

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

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>
I changed the 1st line to:

Code: Select all

[youtube]{IDENTIFIER}://www.youtube.com/watch?v={SIMPLETEXT}[/youtube]
Followed by:

Code: Select all

<object width="425" height="350"><param name="movie" value="{IDENTIFIER}://www.youtube.com/v/{SIMPLETEXT}"></param><param name="wmode" value="transparent"></param><embed src="{IDENTIFIER}://www.youtube.com/v/{SIMPLETEXT}" type="application/x-shockwave-flash" wmode="transparent" width="425" height="350"></embed></object>
And now both http://www.youtube.com and https://www.youtube.com videos embed

:D
Last edited by Oyabun1 on Thu May 09, 2013 2:21 am, edited 1 time in total.
Reason: Moved from Support
izamahmed
Registered User
Posts: 3
Joined: Thu May 09, 2013 3:06 am

Re: Embedding youtube http or https

Post by izamahmed »

good info.
thank you 8-)
gohannx
Registered User
Posts: 21
Joined: Sun Mar 03, 2013 11:49 pm

Re: Embedding youtube http or https

Post by gohannx »

Hi Toby,

Can you figure out too how to post facebook videos? It's no longer working on my end!

Much thanks,
hannx
TobyMac
Registered User
Posts: 47
Joined: Mon Jan 05, 2009 1:22 pm

Re: Embedding youtube http or https

Post by TobyMac »

gohannx, I didn't even know Facebook had videos - LOL - I'll see what I can figure out.

Try doing a search under 3.0x support forum as I am sure there are instructions posted some where.

If I am able to figure it out, I'll post back here.
MsIrey
Registered User
Posts: 144
Joined: Tue Sep 02, 2008 1:50 am
Location: Florida

Re: Embedding youtube http or https

Post by MsIrey »

Using your code and links provided, neither link works for me on my test forum
TobyMac
Registered User
Posts: 47
Joined: Mon Jan 05, 2009 1:22 pm

Re: Embedding youtube http or https

Post by TobyMac »

This works to allow fullscreen on my forum.

First line:

Code: Select all

[youtube]{IDENTIFIER}://www.youtube.com/watch?v={SIMPLETEXT}[/youtube]
The second line:

Code: Select all

<object width="560" height="315"><param name="movie" value="{IDENTIFIER}://www.youtube.com/v/{SIMPLETEXT}"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="{IDENTIFIER}://www.youtube.com/v/{SIMPLETEXT}" type="application/x-shockwave-flash" width="560" height="315" allowscriptaccess="always" allowfullscreen="true"></embed></object>

Third line:

Code: Select all

Copy and paste the URL for the video between the [youtube][/youtube] tags
User avatar
Mick
Support Team Member
Support Team Member
Posts: 26546
Joined: Fri Aug 29, 2008 9:49 am

Re: Embedding youtube http or https

Post by Mick »

gohannx wrote:Can you figure out too how to post facebook videos? It's no longer working on my end!
You need to start another topic in this forum, this topic is about YouTube, we prefer one subject one topic.
  • "The more connected we get the more alone we become" - Kyle Broflovski©
  • "The good news is hell is just the product of a morbid human imagination.
    The bad news is, whatever humans can imagine, they can usually create.
    " - Harmony Cobel
User avatar
kamaleon
Registered User
Posts: 555
Joined: Tue Sep 09, 2014 9:47 am
Location: Barcelona

Re: Embedding youtube http or https

Post by kamaleon »

Sorry wrong thread...
This is a test signature. I hope you love it :D
giarosenko
Registered User
Posts: 19
Joined: Tue Dec 02, 2014 7:44 pm

Re: Embedding youtube http or https

Post by giarosenko »

Hello, first of all nice community and i am glad i found it. Seaching on the forums and here, started to set up my own phpbb, but since i am not a rocket scientist.

TobyMac, can you explane little bit more where do i paste this code? I have figure out how to move/delete lines of code and do translations but it would be nice, if you would add upper of all codes the path of the files.

Thank you
giarosenko
User avatar
Lumpy Burgertushie
Registered User
Posts: 69224
Joined: Mon May 02, 2005 3:11 am
Contact:

Re: Embedding youtube http or https

Post by Lumpy Burgertushie »

this is about bbcodes for youtube videos in posts. you do not edit any files to do this.

you create bbcodes in the admin panel under the posting tab

in my opinion, the best youtube bbcode is as follows:

bbcode usage:

Code: Select all

[youtube]{TEXT}embed/{IDENTIFIER}{TEXT2}[/youtube]
html replacement:

Code: Select all

<iframe width="420" height="315" src="http://www.youtube.com/embed/{IDENTIFIER}" frameborder="2"></iframe>
help line:

Code: Select all

[youtube]copy and paste the iframe embed code here[/youtube]
the bbcode mentioned the posts above is the old style of embed code.
the current youtube embed code is using the iframe.

using this bbcode, the user simply clicks "embed" on the youtube page, then copies the provided iframe code,
then pastes it in the post inside the youtube bbcode tags. done.


robert
Premium phpBB 3.3 Styles by PlanetStyles.net

I am pleased to announce that I have completed the first item on my bucket list. I have the bucket.
User avatar
kamaleon
Registered User
Posts: 555
Joined: Tue Sep 09, 2014 9:47 am
Location: Barcelona

Re: Embedding youtube http or https

Post by kamaleon »

What about this post?

viewtopic.php?p=13839826

Isn't it better?
This is a test signature. I hope you love it :D
User avatar
Lumpy Burgertushie
Registered User
Posts: 69224
Joined: Mon May 02, 2005 3:11 am
Contact:

Re: Embedding youtube http or https

Post by Lumpy Burgertushie »

that is an extension for 3.1. you are posting in the 3.0 bbcodes topic.

that extension is a very good one but you must be using phpbb 3.1.2 to use it.
you can also still use the same bbcodes in 3.1 that you could use in 3.0

that is your choice.

the extension allows you to post videos from many different places without using bbcode, just post the url of the video into the post.

robert
Premium phpBB 3.3 Styles by PlanetStyles.net

I am pleased to announce that I have completed the first item on my bucket list. I have the bucket.
User avatar
kamaleon
Registered User
Posts: 555
Joined: Tue Sep 09, 2014 9:47 am
Location: Barcelona

Re: Embedding youtube http or https

Post by kamaleon »

Thanks, very clear :)
This is a test signature. I hope you love it :D
User avatar
Redbear
Registered User
Posts: 32
Joined: Wed Dec 24, 2014 3:13 pm

Re: Embedding youtube http or https

Post by Redbear »

Lumpy Burgertushie wrote:this is about bbcodes for youtube videos in posts. you do not edit any files to do this.

you create bbcodes in the admin panel under the posting tab

in my opinion, the best youtube bbcode is as follows:

bbcode usage:

Code: Select all

[youtube]{TEXT}embed/{IDENTIFIER}{TEXT2}[/youtube]
html replacement:

Code: Select all

<iframe width="420" height="315" src="http://www.youtube.com/embed/{IDENTIFIER}" frameborder="2"></iframe>
help line:

Code: Select all

[youtube]copy and paste the iframe embed code here[/youtube]
the bbcode mentioned the posts above is the old style of embed code.
the current youtube embed code is using the iframe.

using this bbcode, the user simply clicks "embed" on the youtube page, then copies the provided iframe code,
then pastes it in the post inside the youtube bbcode tags. done.


robert
Lumpy,
that was awesome..
works great for my forums !!
Post Reply

Return to “Custom BBCode Development and Requests”