How do you embed Youtube in a post?

by scarab @, Friday, March 29, 2013, 05:00 (4045 days ago)

- No text -

I tried pasting embed code by didn't see vid in preview

by scarab @, Friday, March 29, 2013, 05:01 (4045 days ago) @ scarab

- No text -

I tried pasting embed code by didn't see vid in preview

by Claude Errera @, Friday, March 29, 2013, 05:33 (4045 days ago) @ scarab

I don't think you can, with the stock code. Someone's going to have to extend it. (Always looking for volunteers, since I don't have time to look at it myself any time soon. :) )

Is there sample code?

by scarab @, Friday, March 29, 2013, 05:35 (4045 days ago) @ Claude Errera

I suspect that the answer is yes but where can I find it easily? If I can get it to work then I will burn Cody as a test ;-)

Is there sample code?

by Claude Errera @, Friday, March 29, 2013, 05:59 (4045 days ago) @ scarab

I suspect that the answer is yes but where can I find it easily? If I can get it to work then I will burn Cody as a test ;-)

lol - yes, the entire source code is available at mylittleforum.net.

However, it looks like it might be easier than I thought; gimme a few, I might have it live soon.

ooooo, burn Cody burn ;-)

by scarab @, Friday, March 29, 2013, 06:04 (4045 days ago) @ Claude Errera

Is there an evil grin smiley?

Okay. Partial solution.

by Claude Errera @, Friday, March 29, 2013, 06:53 (4045 days ago) @ Claude Errera

I tried to be all fancy and allow parameters and such... but my first cut didn't work. (I'm guessing my regex expression needs work. :) )

That's okay, though - there's a partial solution. It requires you not to be dumb, and I will NOT put a button up to use it (because it requires you not to be dumb).

To use it, you find the actual video code from a YouTube video. For example, the new Destiny Character Development vid is here:

http://www.youtube.com/watch?v=xKOY8zJx2Q4

the video code you need is

xKOY8zJx2Q4

You'd embed this with the following code:

[youtube]xKOY8zJx2Q4[/youtube]

You have no control over size, or any of that, and if you put garbage into the tags, you'll get garbage out... you're embedding an iFrame that YouTube will try and parse, so anything besides that actual identifying code (youtube.com, http, whatever) will cause the URL to fail.

One of these days when I have time I'll try and figure out where my expression went wrong, and we'll have a more flexible solution - but this should do for now. :)

Avatar

Okay. Partial solution.

by Schooly D, TSD Gaming Condo, TX, Friday, March 29, 2013, 07:28 (4045 days ago) @ Claude Errera

Where in the code did you attempt your solution? What file?

Avatar

I love regular expressions

by JDQuackers ⌂ @, McMurray, PA, Friday, March 29, 2013, 07:33 (4045 days ago) @ Schooly D

Lay it on me, Mr. Errerrerrera

Never mind. Solved it.

by Claude Errera @, Friday, March 29, 2013, 08:02 (4045 days ago) @ Schooly D

I left the original youtube shortcode alone, because some people might find it useful.

However, I added a second one: youtubefull

For this one, you use a URL. http, https, youtu.be, it doesn't matter; they should all work.

[youtubefull]http://www.youtube.com/watch?v=xKOY8zJx2Q4[/youtubefull]

You can add width and height parameters, too:

[youtubefull width=852 height=480]http://www.youtube.com/watch?v=xKOY8zJx2Q4[/youtubefull]

Hope this helps.

Avatar

Thanks Wu!

by RC ⌂, UK, Friday, March 29, 2013, 08:29 (4045 days ago) @ Claude Errera

I mean Claude. I mean... Mr. Errera.

I'm still not used to this...

Never mind. Solved it.

by scarab @, Friday, March 29, 2013, 09:58 (4045 days ago) @ Claude Errera

I downloaded a version of mylittleforum whose change log has this as it's latest entry: 2.3.1 (2012-12-01)

But I couldn't see any youtube code.

Are you using some sort of add-on package?

Never mind. Solved it.

by Claude Errera @, Friday, March 29, 2013, 11:03 (4045 days ago) @ scarab

I downloaded a version of mylittleforum whose change log has this as it's latest entry: 2.3.1 (2012-12-01)

But I couldn't see any youtube code.

Are you using some sort of add-on package?

I just wrote a new function to handle it. I guess that's an add-on. ;)

Oh you! :-)

by scarab @, Friday, March 29, 2013, 13:43 (4045 days ago) @ Claude Errera

- No text -

Can't we get a button for it? You being so clever and all.

by scarab @, Friday, March 29, 2013, 14:11 (4045 days ago) @ Claude Errera
edited by scarab, Friday, March 29, 2013, 14:20

Claude can't do buttons. His hands are too big. That's why he wears the Velcro strips.

If Claude tells you that's because he was once a male stripper he's ly - actually he's not lying but he's not telling the whole truth.

Can't we get a button for it? You being so clever and all.

by Claude Errera @, Friday, March 29, 2013, 17:48 (4045 days ago) @ scarab

Claude can't do buttons. His hands are too big. That's why he wears the Velcro strips.

If Claude tells you that's because he was once a male stripper he's ly - actually he's not lying but he's not telling the whole truth.

I would starve to death if I had to make my money as a male stripper.

I can look into the button thing - but that looked far more complicated than the actual function. :)

(The list is pretty big right now - this is kinda far down. Schooly might beat me to it, which would be awesome. :) )

"Maverick's supersonic...I'll be there in 30 seconds." - sc

by scarab @, Saturday, March 30, 2013, 00:19 (4045 days ago) @ Claude Errera

I would starve to death if I had to make my money as a male stripper.

The irony is that you'd probably be paid in buttons!

I can look into the button thing - but that looked far more complicated than the actual function. :)

There must be a programming law about that because it's usually true that GUI is more complicated than functionality.

(The list is pretty big right now - this is kinda far down. Schooly might beat me to it, which would be awesome. :) )

Maverick to the rescue. The iceman has gone totally defensive...

Edit - Doh! Title truncated schooly to sc

Avatar

Testing the code...

by UnrealCh13f @, San Luis Obispo, CA, Friday, March 29, 2013, 15:11 (4045 days ago) @ Claude Errera

I left the original youtube shortcode alone, because some people might find it useful.

However, I added a second one: youtubefull

For this one, you use a URL. http, https, youtu.be, it doesn't matter; they should all work.

[youtubefull]http://www.youtube.com/watch?v=xKOY8zJx2Q4[/youtubefull]

You can add width and height parameters, too:

[youtubefull width=852 height=480]http://www.youtube.com/watch?v=xKOY8zJx2Q4[/youtubefull]

Hope this helps.

edit: AWESOME!

Okay. Partial solution.

by Claude Errera @, Friday, March 29, 2013, 08:16 (4045 days ago) @ Schooly D

Where in the code did you attempt your solution? What file?

Should have replied to this:

includes/functions.inc.php

I created a do_bbcode_youtube function, then called it with addCode.

Avatar

Okay. Partial solution.

by Schooly D, TSD Gaming Condo, TX, Friday, March 29, 2013, 08:35 (4045 days ago) @ Claude Errera

Where in the code did you attempt your solution? What file?


Should have replied to this:

includes/functions.inc.php

I created a do_bbcode_youtube function, then called it with addCode.

Damn it. That's what I was doing before you called it off. I know you made me look through the code myself to slow me down and prevent me from becoming DBO's Code Czar.

Okay. Partial solution.

by Beckx, Friday, March 29, 2013, 12:16 (4045 days ago) @ Claude Errera

it requires you not to be dumb

If DBO ever gets tag lines, this has to be the first one.

Nice to meet you in person Saturday. I still can't believe I approached a human being in the real world and said "Hi, I'm...uh...Beckx." It's very possible that's a sign I'll fail the youtube code requirements.

Avatar

Okay. Partial solution.

by SonofMacPhisto @, Friday, April 05, 2013, 13:15 (4038 days ago) @ Beckx

it requires you not to be dumb


If DBO ever gets tag lines, this has to be the first one.

Nice to meet you in person Saturday. I still can't believe I approached a human being in the real world and said "Hi, I'm...uh...Beckx." It's very possible that's a sign I'll fail the youtube code requirements.

If we ever meet, I will refuse to call you anything but 'Beckx' or 'Beck.' :)

Okay. Partial solution.

by Beckx, Saturday, April 06, 2013, 08:08 (4037 days ago) @ SonofMacPhisto

LOL. Only if I can call you "Somp" :)

Back to the forum index
RSS Feed of thread