vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.7 Template Modifications (https://vborg.vbsupport.ru/forumdisplay.php?f=229)
-   -   BB Code Enhancements - YouTube BB Code (W3C-compliant!) (https://vborg.vbsupport.ru/showthread.php?t=194246)

Fangs404 10-21-2008 10:00 PM

YouTube BB Code (W3C-compliant!)
 
I searched for a decent YouTube BB code tag here, but every single one of them uses the embed tag, which is an illegal XHTML tag. I set out to find a way to create a W3C-compliant YouTube BB code tag, and this is what you see here.

Title: YouTube
BB Code Tag Name: youtube
Replacement:
HTML Code:

<object type="application/x-shockwave-flash" data="http://www.youtube.com/v/{param}&fs=1&hd=1" width="644" height="390"><param name="movie" value="http://www.youtube.com/v/{param}&fs=1&hd=1" /><param name="allowFullScreen" value="true" /><param name="allowScriptAccess" value="always" /><a href="http://www.youtube.com/watch?v={param}">http://www.youtube.com/watch?v={param}</a></object>
Example: [youtube]zlfKdbWwruY[/youtube]
Description: Embed a YouTube video. You <b>only</b> put the video ID in between the BB code tags (<b>NOT</b> the full URL!). Embedding <b>must</b> be enabled for the video!
Use Option: No
Image: https://vborg.vbsupport.ru/external/2009/01/66.jpg

Important Note!
A link to the YouTube video is displayed if the YouTube video fails to load. There are a variety of reasons this might occur:

- You didn't properly enter the video ID between the BB code tags.
- You don't have the latest version of Flash.
- You are using Firefox and have a conflicting extension (AdBlock, NoScript, a Greasemonkey script, etc).
- The video doesn't allow embedding.
- You have some other problem on your end (corrupt browser install, spyware, virus, etc.).
- YouTube is currently having a problem.

lucky51 10-22-2008 10:52 AM

yes working thanks

SPARKS MAN 10-22-2008 04:00 PM

thanks a lot i try it

Janfri 10-23-2008 06:07 PM

Thanks a lot. Perfectly valid XHTML transitional. I have tried many bb codes for youtube, but this is the only one I have found that works with XHTML! Thank you very much!!!

gundrik 10-24-2008 04:47 PM

bro, works perfrectly! finally someone who can easily explain how to do this! A+++++++

Barakat 10-25-2008 09:07 AM

yap the same as iam useing in my codes ,,,,

https://vborg.vbsupport.ru/showthread.php?t=189497

thanks ,

Gleedo 10-26-2008 10:21 AM

Good stuff, works a treat :)

Thanks

Fangs404 10-26-2008 05:20 PM

Quote:

Originally Posted by the stig (Post 1653210)
Is this the same mod where I can just post a youtube embeded link and it turns into a video screen?

It sure is (except you don't post the full URL - just the video ID).

EWGF 10-26-2008 06:49 PM

Very nice :D

Two times smaller than my previous code and your BORKED note is good to know too.

ShawneyJ 10-28-2008 08:30 AM

cool ta ;)

Fangs404 10-29-2008 05:55 AM

Quote:

Originally Posted by the stig (Post 1654264)
Is there a mod where you can just enter the youtube link from the browser address bar (i.e. http://www.youtube.com/watch?v=sm1IfqVofNA) and it turns into a video screen in the post?

https://vborg.vbsupport.ru/showthread.php?t=193151 supposedly does it, but several of the comments don't look too good. Plus, his code isn't W3C compliant.

Masiello 10-31-2008 01:49 PM

Thanks a lot men :)

TheLastSuperman 11-02-2008 12:04 AM

Thanks :D

Fangs404 12-13-2008 05:48 AM

I just updated this to include a new tag (youtubehd) which enables embedding YouTube's new HD mode.

Fangs404 12-13-2008 09:00 PM

And I just updated it once more to add support for HQ mode (which is better than regular but worse than HD).

SuperTaz 12-15-2008 01:06 AM

Thank you. :D

Keesa 12-25-2008 12:19 PM

Installed the HQ version so far. Not sure I have ever seen an HQ video yet

Daryn 12-26-2008 01:07 AM

Most of the HD videos I see on youtube are at 1280x720. The HD tag embeds at 630x380. Changing the size in the embed code seems to work, but is there anything else to change to get the full size in an embed?

the stig 12-31-2008 03:39 AM

BREAKING NEWS:

I don't know if YouTube did any tweaking or not, but if you put the embed code from a youtube video between [Youtube] embed code [/YouTube] now, it embeds the video perfectly as well. One of our member just did it and I was shocked. Just wanted to let you guys know ;). I have double checked the fact that my html IS turned off.

Vaupell 01-01-2009 11:05 AM

Installed and working, except when using the "botton" feature it adds spaces around
the video id, so you manually have to remove the extra spaces for it to work.

makes this

[youtubehd]
bIgslPPC1BA
[/youtubehd]

instead of [youtubehd]bIgslPPC1BA[/youtubehd]

Tx again.

But nice and installed. .

Phaedrus 01-02-2009 06:07 AM

Would this work with other video sites, just setting the {param} differently?

Dingo14 01-02-2009 09:01 PM

does anyone know if this draws on your server bandwidth to run the youtube videos like this just curious thanks

Fangs404 01-11-2009 07:31 PM

Quote:

Originally Posted by Daryn (Post 1693729)
Most of the HD videos I see on youtube are at 1280x720. The HD tag embeds at 630x380. Changing the size in the embed code seems to work, but is there anything else to change to get the full size in an embed?

I checked the size that YouTube actually uses (which isn't easily done since YouTube has a really complicated embedding scheme involving JavaScripts - I just took a screenshot and measured it), and it's actually not true 720p. YouTube displays at 858x508 for some odd reason, so that's what I'll alter the script to use.

Quote:

Originally Posted by Vaupell (Post 1698434)
Installed and working, except when using the "botton" feature it adds spaces around
the video id, so you manually have to remove the extra spaces for it to work.

makes this

[youtubehd]
bIgslPPC1BA
[/youtubehd]

instead of [youtubehd]bIgslPPC1BA[/youtubehd]

Tx again.



But nice and installed. .

I don't see this problem. When I hit the button, it just displays , no spaces or new lines. Glad you like it, though. :)

Quote:

Originally Posted by Dingo14 (Post 1699704)
does anyone know if this draws on your server bandwidth to run the youtube videos like this just curious thanks

No, it doesn't use any bandwidth from your server.

Quote:

Originally Posted by Phaedrus (Post 1699059)
Would this work with other video sites, just setting the {param} differently?

It's not quite that straightforward, but most video sites have embedding code. Just alter the URL before/after the {param} and it should work. I've already modified the same code for Vimeo.

dismas 01-13-2009 06:26 AM

Does this, or any, embedded YouTube code make it so that "mature content" videos either can't be screened or have it so that the end user has to confirm that they are of age?

Phaedrus 01-13-2009 07:09 PM

Quote:

Originally Posted by Fangs404 (Post 1708883)
It's not quite that straightforward, but most video sites have embedding code. Just alter the URL before/after the {param} and it should work. I've already modified the same code for Vimeo.

Well, yeah, and you'd have to use different tags, but I can see what you mean.

Excellent. I think I'll do this rather than the passive hack.

See if I can get people used to it by disabling the other hack in other forums...

Fangs404 01-14-2009 02:02 AM

I just tested it, and it appears that this does get by the age filter. The video I tried played just fine and didn't ask for an birthday or anything.

Chrakker 01-14-2009 01:52 PM

I always can NOT drop down the Thread Tools Menue ever when a post has been made with a Video in it ;S
IS that a bug?
had to uninstall it, because of that ;S

Fangs404 01-14-2009 03:06 PM

That's definitely not a bug with my BBCode. It's just a simple object HTML. It sounds like a browser bug on your end or maybe a bug with your template.

M3xital 01-14-2009 07:49 PM

Hi,
Thanks a lot, it works great!

Gweebs 01-15-2009 09:27 AM

Having problems with the youtube button image in the post a reply box. It works if I use a url from another site, but can't get it to link from my site (probably doing something wrong).

Also in FireFox it just shows the text and not a button (wrap [youtube] tags around text).
Probably because there's a prob with the image button.

Anyway, help!!!

Shaliza 01-15-2009 11:40 AM

Such a small enhancement, but so useful. Makes things easier!

Fangs404 01-16-2009 07:31 AM

Quote:

Originally Posted by Gweebs (Post 1713175)
Having problems with the youtube button image in the post a reply box. It works if I use a url from another site, but can't get it to link from my site (probably doing something wrong).

Also in FireFox it just shows the text and not a button (wrap [youtube] tags around text).
Probably because there's a prob with the image button.

Anyway, help!!!

Can you give me an example of how you're trying to use the command? You aren't putting the entire YouTube link in between the tags, right? As for why the button isn't showing up, it sounds like you have the image path wrong in the BBCode manager.

Also, please hit "Mark as Installed" to let me know that you're actually using it.

JackRock 01-17-2009 04:32 AM

I feel a little noob-ish on this, but where do I actually enter that code? I've installed other mods before, but had never had to do one like this, and I'm delving into VB for the first time in earnest as an admin.

Digital Jedi 01-17-2009 04:44 AM

Quote:

Originally Posted by JackRock (Post 1715410)
I feel a little noob-ish on this, but where do I actually enter that code? I've installed other mods before, but had never had to do one like this, and I'm delving into VB for the first time in earnest as an admin.

You enter it in as a New BBCode in your Custom BBCode Manager.

JackRock 01-17-2009 07:08 PM

Quote:

Originally Posted by Digital Jedi (Post 1715417)
You enter it in as a New BBCode in your Custom BBCode Manager.

THANK YOU! It's like the ONE area I hadn't explored in the ACP. installed

jlew24asu 01-17-2009 08:00 PM

can someone please explain to me the whole "BORKED" thing?

Fangs404 01-18-2009 01:39 AM

Quote:

Originally Posted by jlew24asu (Post 1716106)
can someone please explain to me the whole "BORKED" thing?

If you see BORKED, it means that there's something wrong with your setup (your local setup). Maybe you don't have the latest version of flash. Maybe you have a funky Firefox extension installed. It just means something is preventing the flash video from being displayed on your machine.

PHILIPS-08 01-18-2009 04:59 AM

thanx alot mate cool mod

jlew24asu 01-18-2009 03:36 PM

Quote:

Originally Posted by Fangs404 (Post 1716376)
If you see BORKED, it means that there's something wrong with your setup (your local setup). Maybe you don't have the latest version of flash. Maybe you have a funky Firefox extension installed. It just means something is preventing the flash video from being displayed on your machine.

thanks. that stinks. I dont know what could possibly be the issue. I have the latest flash version, and maybe a few FF plugins, but if I can see it on youtube's site, I dont know what would prevent me from posting it on my forum.

Fangs404 01-18-2009 05:22 PM

Quote:

Originally Posted by jlew24asu (Post 1716907)
thanks. that stinks. I dont know what could possibly be the issue. I have the latest flash version, and maybe a few FF plugins, but if I can see it on youtube's site, I dont know what would prevent me from posting it on my forum.

Which FF extensions do you have? Try disabling all of them and then see if it works. Does it work in IE?


All times are GMT. The time now is 07:46 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01605 seconds
  • Memory Usage 1,828KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)bbcode_html_printable
  • (13)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (40)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete