Register - Login
Views: 86539185
Main - Memberlist - Active users - Calendar - Wiki - IRC Chat - Online users
Ranks - Rules/FAQ - JCS - Stats - Latest Posts - Color Chart - Smilies
10-20-17 05:17:00 PM

Jul - Meta - I don't think the youtube embed works anymore. New poll - New thread - Thread closed
Next newer thread | Next older thread
Xenesis
Actually a Doctor
Level: 90


Posts: 2297/2399
EXP: 7183572
For next: 5037

Since: 07-28-07
From: The Land of Kangaroos and Drop Bears

Since last post: 2 min.
Last activity: 2 min.

Posted on 08-23-15 09:08:46 PM Link
I uh, don't think the youtube embeds work anymore guys. Is this just something on my end? Because it's certainly just showing up yawning chasms on the forum where youtube players should be (See: http://jul.rustedlogic.net/thread.php?pid=441684&r=1#441684 )

Ehm
Member
Level: 46


Posts: 498/532
EXP: 677764
For next: 34010

Since: 06-13-09
From: Canada

Since last post: 144 days
Last activity: 101 days

Posted on 08-23-15 09:12:51 PM Link
Embeds show up fine for me. What browser are you using? Does this happen on all board themes?
FieryIce

Baby Mario
不知道该写什么
Level: 111


Posts: 3998/4085
EXP: 14835563
For next: 32797

Since: 12-17-08


Since last post: 5 days
Last activity: 2 days

Posted on 08-23-15 09:15:18 PM Link
Hm, it shows up just fine for me. But I had to recreate the old syntax since YouTube now uses iframes by default and those get filtered out here. I wonder if we could standardize it by getting a YouTube BBCode (like [youtube=vid])
Xenesis
Actually a Doctor
Level: 90


Posts: 2298/2399
EXP: 7183572
For next: 5037

Since: 07-28-07
From: The Land of Kangaroos and Drop Bears

Since last post: 2 min.
Last activity: 2 min.

Posted on 08-23-15 09:18:34 PM Link
Originally posted by Ehm
Embeds show up fine for me. What browser are you using? Does this happen on all board themes?


Doesn't appear on either the default board theme or this one. Using OSX 10.9 Mavericks/Firefox 40.2 at the moment (I just let it autoupdate)

Safari shows up placeholders with "missing plugin", which I assume is because I don't have flash installed (I normally use the HTML5 renderer)

Guess that explains it - I don't have flash, so it won't show the video frame.
StapleButter
Member
Level: 40


Posts: 137/460
EXP: 406661
For next: 34648

Since: 02-24-13
From: your dreams

Since last post: 4 days
Last activity: 4 days

Posted on 08-24-15 11:02:06 AM (last edited by StapleButter at 08-24-15 11:02:43 AM) Link
Those videos use the old Youtube embed code, which is Flash-only.


The new embed code supports the HTML5 player. The issue is that it uses <iframe> which is blocked.



edit- way to repeat what FieryIce said, wee
devin

Wart
i'm mima irl
Level: 103


Posts: 3176/3295
EXP: 11127276
For next: 344130

Since: 04-29-08
From: FL

Since last post: 14 days
Last activity: 1 day

Posted on 08-24-15 11:20:08 AM Link
Since Jul seems to be back under active development how hard would it be to add a [youtube] or such tag that adds a proper HTML5 player?
Sanqui
1580
🦉
Level: 73


Posts: 1382/1580
EXP: 3359538
For next: 126330

Since: 12-20-09
From: Czech Republic

Since last post: 12 hours
Last activity: 6 hours

Posted on 08-24-15 11:34:44 AM Link
Even better if the old embed pattern was detected in old posts and replaced with an iframe.

But honestly, I may be the only person who does this but I always open embedded videos in a new tab anyway, so if everybody just used links I'd be the happiest.
dotUser

Level: 83


Posts: 2137/2240
EXP: 5361758
For next: 70463

Since: 10-19-10


Since last post: 13 days
Last activity: 24 min.

Posted on 08-24-15 08:34:48 PM Link
Originally posted by Sanky
But honestly, I may be the only person who does this but I always open embedded videos in a new tab anyway, so if everybody just used links I'd be the happiest.


This entirely. It's unnecessary to have a player load if not everyone will actually use it.
FieryIce

Baby Mario
不知道该写什么
Level: 111


Posts: 3999/4085
EXP: 14835563
For next: 32797

Since: 12-17-08


Since last post: 5 days
Last activity: 2 days

Posted on 08-24-15 09:38:45 PM Link
This involves more but if we get a [youtube] BB code then we could also get an option on the user profile for what it resolves to: Link to video vs. iframe embed. Then everyone is happy and we get HTML5 videos too
Cuber456

Lantern Ghost
Don't mind me. Just passing through.
Level: 50


Posts: 621/750
EXP: 934610
For next: 12707

Since: 02-19-12
From: Everywhere at once.

Since last post: 1 day
Last activity: 22 hours

Posted on 08-24-15 10:31:12 PM Link
I've always found youtube embeds to be super clunky on Jul. I dislike that we need to use old embed code. Whenever I do it too, the embedded video never shows in the preview. It only shows up after I submit my post.

In comparison, look how easy it is to embed on TCRF. It's literally something similar to:

< youtube > unique video link/id < /youtube >

That's so much cleaner to me. IDK, perhaps this is just my experience.
RanAS
Member
Level: 30


Posts: 193/284
EXP: 159182
For next: 6687

Since: 10-10-14
From: Brazil

Since last post: 1 day
Last activity: 1 day

Posted on 06-25-16 04:41:00 PM (last edited by RanAS at 06-30-16 01:42:10 PM) Link
Bumping this because I'm trying to see if it's possible to implement the YouTube embed BBCode thing, so the awful old embed code isn't needed anymore. In theory, this will work like [youtube](video ID here)[/youtube]. All edits would be done to function.php on the GitHub page.

Of course, you guys probably know that I don't know PHP, so I'm left with guessing to see if this code even works. Because of that, I think it's a good idea to post this here before suggesting it on GitHub, so people can see if I made any mistakes with the code.

I would implement it using something like this at LINE 538:

$msg=preg_replace("'\[youtube\]^[a-zA-Z0-9_-]{11}$\[/youtube\]'si", '<iframe src=\"https://www.youtube.com/embed/\\1\" style=\"width:480;height:270;\" frameborder=\"0\" allowfullscreen></iframe>', $msg);


And replacing the filter at LINE 1297 with this:

$p=preg_replace("'<iframe(?! src=\"https://www.youtube.com/embed/)'si",'<<z>iframe',$p);

In order to ignore YouTube embed links.
Cuber456

Lantern Ghost
Don't mind me. Just passing through.
Level: 50


Posts: 677/750
EXP: 934610
For next: 12707

Since: 02-19-12
From: Everywhere at once.

Since last post: 1 day
Last activity: 22 hours

Posted on 06-28-16 08:11:23 PM Link
Well, anything that would allow for a single line of code to take the place of the old code would be beneficial. Embedding the video below took many lines. I mean, I did cheat using some other website to create the code. Still, kind of lame to add an extra step.

Something to think about as well, if a new way to post youtube videos is implemented without keeping backwards compatibility to the old code, you break old video links posted on Jul.


RanAS
Member
Level: 30


Posts: 195/284
EXP: 159182
For next: 6687

Since: 10-10-14
From: Brazil

Since last post: 1 day
Last activity: 1 day

Posted on 06-29-16 04:26:52 AM Link
Nothing is going to happen to the old YouTube embeds probably unless people decide to filter out <object> tags, which I ain't doing currently with that code. It kinda sucks that old embeds will just look crappy, but I think it would take even longer to actually replace them all with the new one.

And yes, if it works, it will be as simple as [youtube](video ID here)[/youtube] to implement the new HTML5 videos.
StapleButter
Member
Level: 40


Posts: 287/460
EXP: 406661
For next: 34648

Since: 02-24-13
From: your dreams

Since last post: 4 days
Last activity: 4 days

Posted on 06-29-16 04:55:06 AM Link
I also don't see the old embeds because I don't have Flash installed on this computer



The issue with implementing the new youtube code is how this kind of Acmlmboard does things:

1) run the bbcode/etc filters on the post content and layout
2) generate the HTML for the complete post
3) run the security filter on that HTML

Some AB1.x versions used a Javascript link for PM deletion. There was a hack in the security filter to preserve that link from getting filtered out.

A youtube tag implementation would require a similar hack.

a) in the bbcode filter, turn all youtube tags into a uniform representation (for example, [youtube]video ID[/youtube])
b) at the end of the security filter, turn said representation into the final HTML, ensuring it's not exploitable
dotUser

Level: 83


Posts: 2166/2240
EXP: 5361758
For next: 70463

Since: 10-19-10


Since last post: 13 days
Last activity: 24 min.

Posted on 06-29-16 09:41:09 AM Link
Originally posted by StapleButter
b) at the end of the security filter, turn said representation into the final HTML, ensuring it's not exploitable


Fortunately youtube video IDs are actually fairly strict things. And it shouldn't be too hard to make sure the ID is a sane one. It's just... Time.

It's always the time involved to make it work..
StapleButter
Member
Level: 40


Posts: 289/460
EXP: 406661
For next: 34648

Since: 02-24-13
From: your dreams

Since last post: 4 days
Last activity: 4 days

Posted on 06-30-16 10:45:29 AM Link
Not that hard, actually. [a-zA-Z0-9-_]{11} is a regex that matches valid youtube video IDs.
RanAS
Member
Level: 30


Posts: 197/284
EXP: 159182
For next: 6687

Since: 10-10-14
From: Brazil

Since last post: 1 day
Last activity: 1 day

Posted on 06-30-16 01:41:04 PM Link
Originally posted by StapleButter
Not that hard, actually. [a-zA-Z0-9-_]{11} is a regex that matches valid youtube video IDs.

The suggested code uses ^[a-zA-Z0-9_-]{11}$. I assume there's a difference on how both work. I would try to confirm it to see if that is the correct code, with the extra symbols, but there are so many conflicting sources it's a little confusing.
Xkeeper






Posted on 07-08-16 01:17:43 PM Link
In a regex, ^ and $ anchor it (to the start and end respectively). So "^butts" would only match "butts are tests", and not "peaches look like butts"

I haven't done the pull req yet because (given that it's a fairly big change) I've wanted to test it. of course you can probably guess that i'm very good at being punctual about this
RanAS
Member
Level: 30


Posts: 198/284
EXP: 159182
For next: 6687

Since: 10-10-14
From: Brazil

Since last post: 1 day
Last activity: 1 day

Posted on 07-09-16 07:05:58 AM Link
Ah, that makes sense.

About the pull request thing, no problem really. Given that A. I know next to nothing about PHP and B. security problems are possible, I can very easily understand.

That said, I'm still looking at the code to see if I missed anything, or where things could go wrong, and I don't think I see any. If this is how Acmlmboard works:
Originally posted by StapleButter
1) run the bbcode/etc filters on the post content and layout
2) generate the HTML for the complete post
3) run the security filter on that HTML

Then everything should be safe I think. The first line detects the BBCode and converts it to the HTML, and at the security filter an exception is made to the HTML that contains <iframe src="https://www.youtube.com/embed/[etc...] and only that can pass the filter, so that should work unless \\1 doesn't catch the video ID for some reason? srcdoc can't be abused, because the filters catch anything in it either way (tested it).
Xkeeper






Posted on 12-22-16 11:35:04 PM Link
This has been fixed thanks to RanAS's pull request and my fix to it.
Next newer thread | Next older thread
Jul - Meta - I don't think the youtube embed works anymore. New poll - New thread - Thread closed




Rusted Logic

Acmlmboard - commit 2f1bc75 [2017-08-27]
©2000-2017 Acmlm, Xkeeper, Inuyasha, et al.

31 database queries, 7 query cache hits.
Query execution time: 0.131649 seconds
Script execution time: 0.015222 seconds
Total render time: 0.146871 seconds