Page 3 of 3

Re: YouTube embedded videos "black bar" picture problem

Posted: Fri Aug 19, 2016 2:56 pm
by Puntadelanza
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

Re: YouTube embedded videos "black bar" picture problem

Posted: Fri Aug 19, 2016 3:12 pm
by JoshyPHP
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>

Re: YouTube embedded videos "black bar" picture problem

Posted: Sun Aug 21, 2016 12:46 pm
by DavidIQ
^ 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.

Re: YouTube embedded videos "black bar" picture problem

Posted: Mon Aug 22, 2016 2:00 am
by 3Di
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

Re: YouTube embedded videos "black bar" picture problem

Posted: Mon Aug 22, 2016 7:28 am
by Puntadelanza
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.

Re: YouTube embedded videos "black bar" picture problem

Posted: Mon Aug 22, 2016 3:32 pm
by Lumpy Burgertushie
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

Re: YouTube embedded videos "black bar" picture problem

Posted: Mon Aug 22, 2016 5:09 pm
by DavidIQ
He's fine I think since there is no BBCode support forum for 3.1 as of yet.

Re: YouTube embedded videos "black bar" picture problem

Posted: Thu Aug 25, 2016 2:20 am
by MegaMav
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

Re: YouTube embedded videos "black bar" picture problem

Posted: Thu Aug 25, 2016 2:04 pm
by WWu777
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>