Version: 1.3.5, by Fangs404
Developer Last Online: Sep 2019
Category: BB Code Enhancements -
Version: 3.7.x
Rating:
Released: 10-21-2008
Last Update: Never
Installs: 80
Re-useable Code Translations
No support by the author.
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:
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:
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.
Show Your Support
This modification may not be copied, reproduced or published elsewhere without author's permission.
It's working just fine for me. It's an issue on your end. Check that you have the latest version of Flash and that you have no conflicting FF extensions (check AdBlock or NoScript).
I have changed it to "Video Error - Check here to make sure you have added it correctly."
This takes them to the FAQ so they can see the example etc.
Ok heres my idea I hope you are able to do it.
Instead of "Borked" could you make it so its an actual link to the correct video on youtube that opens in a new window? This way if the embedding fails on a site like it has mine a few times then it would show a link to video instead.
I have changed it to "Video Error - Check here to make sure you have added it correctly."
This takes them to the FAQ so they can see the example etc.
Ok heres my idea I hope you are able to do it.
Instead of "Borked" could you make it so its an actual link to the correct video on youtube that opens in a new window? This way if the embedding fails on a site like it has mine a few times then it would show a link to video instead.
"If no video is showing it could have been added incorrectly or there could be a technical issue.
Click here to view the video on youtube's site. (links to youtube and the correct video)
If you have added this video click here to make sure you have added it correctly. " (links to FAQ about youtube tag and example)
Of course the above would all be worded how you wish as I am just giving rough examples
It says a lot more than one word but it would stop us all coming back here asking whats the problem especially for human error.
I would think you could do this pretty easily but what do I know
Thanks for saying you liked the idea I hope at some point in the future you have some time to give it a try.
Something went wrong. Please make sure you added the video correctly. Click <a href="misc.php?do=bbcode">here</a> to see how YouTube videos should be embedded. There could also be a technical issue that's not your fault. Click <a href="http://www.youtube.com/watch?v={param}">here</a> to view the video on YouTube's site. If this link doesn't work, you did something wrong.
Thanks for the recommendation. Hopefully this'll save some headaches.
Also I made both links open in seperate windows as this suits me but may not suit others
Thanks once again.
Code:
<object type="application/x-shockwave-flash" data="http://www.youtube.com/v/{param}&fs=1" width="644" height="390"><param name="movie" value="http://www.youtube.com/v/{param}&fs=1" /><param name="allowFullScreen" value="true" /><param name="allowScriptAccess" value="always" />Something went wrong. Please make sure you added the video correctly. Click <a href="misc.php?do=bbcode#youtube" target="_blank">here</a> to see how YouTube videos should be embedded. There could also be a technical issue that's not your fault. Click <a href="http://www.youtube.com/watch?v={param}" target="_blank">here</a> to view the video on YouTube's site. If this link doesn't work, you did something wrong.</object>
Unfortunately, it appears that YouTube has removed the ability to embed HQ and HD videos using the &fmt=22 trick. As a result, I'm going to remove the youtubehd tag from my script.