YouTube embedded videos "black bar" picture problem

Get help developing custom BBCodes or request one.
Puntadelanza
Registered User
Posts: 124
Joined: Thu Jul 03, 2003 10:48 am
Location: Spain
Contact:

Re: YouTube embedded videos "black bar" picture problem

Post by Puntadelanza » Fri Aug 19, 2016 2:56 pm

Thanks for your answer DavidIQ.

Providing more information:

phpbb version of my site: 3.1.9
My site: http://www.puntadelanza.net/Foro/phpBB3/

My old BBcode was like that:

Code: Select all

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

Code: Select all

<object width="640" height="385"><param name="movie" value="http://{TEXT1}youtube.com/v/{TEXT2}&version=2"></param><param name="wmode" value="transparent"></param><embed src="http://{TEXT1}youtube.com/v/{TEXT2}&version=2" type="application/x-shockwave-flash" wmode="transparent" width="640" height="385"></embed></object>

I went through ACP and changed my BBcode in the wat that JoshyPHP has posted:

Code: Select all

[youtube]{IDENTIFIER}[/youtube]

Code: Select all

<iframe width="640" height="360" src="https://www.youtube.com/embed/{IDENTIFIER}" frameborder="0" allowfullscreen></iframe>
But It did not work.
Not sure if because, all my videos are linked by http instead of https....
Not sure, but they are not working.
Do you have any clue on that issue?..... It will help a lot.




I was wandering about to attack php_post table in the database, with someting like that:

Code: Select all

UPDATE `phpbb_posts` SET `post_text` = REPLACE(`post_text`, '[youtube]http://www.youtube.com/watch?v=', '[youtube]');
I've try it with two diferent rows, and although the post is properly formated, the video is not showing properly. Is necessary to edit post (without doing anything) and saving, and then it works, but this is not a way to do it.... I have a lot of rows and posts.... no way....


Many thanks
Estrategia, táctica y sobre todo Combat Mission.
Punta de Lanza

User avatar
JoshyPHP
Code Contributor
Posts: 1008
Joined: Mon Jul 11, 2011 12:28 am

Re: YouTube embedded videos "black bar" picture problem

Post by JoshyPHP » Fri Aug 19, 2016 3:12 pm

Changing custom BBCodes is not retroactive. That definition will not work with your old posts because your old BBCode uses multiple different tokens.

You can probably modify your old BBCode to make it work with YouTube's current markup. Note that I do not recommend using this BBCode. The only YouTube BBCode I would recommend is the one you quoted, but that one will not work with your old posts without some manual maintenance.

Code: Select all

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

Code: Select all

<iframe width="640" height="360" src="https://www.youtube.com/embed/{IDENTIFIER}" frameborder="0" allowfullscreen></iframe>
I wrote the thing that does BBCodes in 3.2.

User avatar
DavidIQ
Customisations Team Leader
Customisations Team Leader
Posts: 17031
Joined: Thu Jan 06, 2005 1:30 pm
Location: Fishkill, NY
Name: David Colón
Contact:

Re: YouTube embedded videos "black bar" picture problem

Post by DavidIQ » Sun Aug 21, 2016 12:46 pm

^ what he said. If you keep your BBCode definition the same and just corrected the replacement then it should work fine retroactively. Otherwise I think you would just use the STK to reparse all posts.
Apply to become a Jr. Extension Validator
My extensions | In need of phpBB services? | Was I helpful today?
No unsolicited PMs unless you're planning on asking for paid help.

User avatar
3Di
Former Team Member
Posts: 13935
Joined: Mon Apr 04, 2005 11:09 pm
Location: Milan (IT) Frankfurt (DE)
Name: Marco
Contact:

Re: YouTube embedded videos "black bar" picture problem

Post by 3Di » Mon Aug 22, 2016 2:00 am

DavidIQ wrote:Otherwise I think you would just use the STK to reparse all posts.
STK isn't ready for 3.1.x though and the only reparser of BBcodes that I am aware of - for it - has been not yet relesed to the crowd, still a concept or some thing more.

Edit: sems like the OP posted into the wrong forum?
Puntadelanza wrote:Thanks for your answer DavidIQ.

Providing more information:

phpbb version of my site: 3.1.9
Please PM me only to request paid works. Thx.
Want to compensate me for my interest? Donate
My development's activity º PhpStorm's proud user
Extensions, Scripts, MOD porting, Update/Upgrades
👨‍🏫 | Take a tour to | The Studio | 👨‍🏫

Puntadelanza
Registered User
Posts: 124
Joined: Thu Jul 03, 2003 10:48 am
Location: Spain
Contact:

Re: YouTube embedded videos "black bar" picture problem

Post by Puntadelanza » Mon Aug 22, 2016 7:28 am

Thanks for your answers.

I did not keep my old BBCode configuration.
I preferr to update it and figure it how to change all my old posts.
I saw that STK is not release for 3.1.x versions... So I really do not know how to fix my old posts...
3Di wrote: Edit: sems like the OP posted into the wrong forum?
Puntadelanza wrote:Thanks for your answer DavidIQ.

Providing more information:

phpbb version of my site: 3.1.9
I do not understand what do you mean.... Sorry.

Many thanks.
Estrategia, táctica y sobre todo Combat Mission.
Punta de Lanza

User avatar
Lumpy Burgertushie
Registered User
Posts: 66496
Joined: Mon May 02, 2005 3:11 am
Contact:

Re: YouTube embedded videos "black bar" picture problem

Post by Lumpy Burgertushie » Mon Aug 22, 2016 3:32 pm

he means that you posted in the 3.0 support forum and you are running 3.1
the STK does not apply to 3.1 which is what much of this topic is discussing.


robert
I'm baaaaaccckkkk. still doing work on donation basis. PM your needs.

Premium phpBB 3.2 Styles by PlanetStyles.net

If a tree falls in the forest and nobody is there, does it make a sound?

User avatar
DavidIQ
Customisations Team Leader
Customisations Team Leader
Posts: 17031
Joined: Thu Jan 06, 2005 1:30 pm
Location: Fishkill, NY
Name: David Colón
Contact:

Re: YouTube embedded videos "black bar" picture problem

Post by DavidIQ » Mon Aug 22, 2016 5:09 pm

He's fine I think since there is no BBCode support forum for 3.1 as of yet.
Apply to become a Jr. Extension Validator
My extensions | In need of phpBB services? | Was I helpful today?
No unsolicited PMs unless you're planning on asking for paid help.

MegaMav
Registered User
Posts: 46
Joined: Sat Sep 08, 2007 2:55 pm

Re: YouTube embedded videos "black bar" picture problem

Post by MegaMav » Thu Aug 25, 2016 2:20 am

You can use my code. I dont mind.
This works with either URL or Share links.
It is updated as a replacement for the Youtube API Problem if you want to keep existing youtube tags that used full urls.

BBCode Usage

Code: Select all

[youtube]{URL}[/youtube]
HTML Replacement

Code: Select all

<script language="Javascript">
var a = '{URL}';
var temp = new Array();
var check = new Array();
check = a.match('//youtu\.be');

if(check)
{
temp = a.split('youtu.be/');
document.write('<iframe width="640" height="360" src="https://www.youtube.com/embed/' + temp[1] + '" frameborder="0" allowfullscreen></iframe>');
}
else
{
temp = a.split('?v=');
document.write('<iframe width="640" height="360" src="https://www.youtube.com/embed/' + temp[1] + '" frameborder="0" allowfullscreen></iframe>');
}
</script>
Help line

Code: Select all

Embeds YouTube Video: [youtube]SHARE LINK OR URL[/youtube]
Enjoy,

-Eric

WWu777
Registered User
Posts: 556
Joined: Tue Aug 14, 2007 12:40 pm
Contact:

Re: YouTube embedded videos "black bar" picture problem

Post by WWu777 » Thu Aug 25, 2016 2:04 pm

Darloup wrote:Thanks JoshyPHP, but your BBCode does not work on my forum. I get this:

Image

as you can check here: http://www.darloup.com/forum/viewtopic.php?f=11&t=2383
The code I'm using works with both http and https. Did you try it? Here it is again:

Field 1:

Code: Select all

[youtube]{TEXT1}youtube.com/watch?v={IDENTIFIER}{TEXT2}[/youtube]
Field 2:

Code: Select all

<iframe width="560" height="315" src="//www.youtube.com/embed/{IDENTIFIER}" frameborder="0" allowfullscreen></iframe>

Post Reply

Return to “Custom BBCode Development and Requests”