Register Members List Search Today's Posts Mark Forums Read

Reply
 
Mod Options
Auto Youtube Link-Converter Details »
Auto Youtube Link-Converter
Mod Version: 1.4, by Disasterpiece (Coder) Disasterpiece is offline
Developer Last Online: Dec 2017 I like it Show Printable Version Email this Page

vB Version: 4.1.2 Rating: (82 votes - 4.88 average) Installs: 787
Released: 01 Apr 2011 Last Update: 23 May 2011 Downloads: 3665
Not Supported Uses Plugins Re-usable Code  

So basically this is a total easy-to-implement plugin, which converts standard youtube links to video-embeds on the fly without urging users to use the video-button because I think it is unnecessary.


On post display, the plugin checks if the post contains at least 1 youtube link in the form of

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

and converts them using the default vB video bbcode parser.

Code can be modified to fit your needs, altough there shouldn't be much to add.
If you're the special performance-freak, I'm curious if you can enhance data/query-performance. So let me know if you do.

INSTALL:

- Download attached XML File and import it as an addon.


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.


Now every post containing youtube-links should display the embedded video instead.
Works with any number of youtube-links and any kind of text surrounding them.

Let me know if you have trouble/questions.

Download Now

Only licensed members can download files, Click Here for more information.

Show Your Support

  • To receive notifications regarding updates -> Click to Mark as Installed.
  • If you like this modification support the author by donating.
  • This modification may not be copied, reproduced or published elsewhere without author's permission.
  #256  
Old 08 Jul 2016, 15:47
Disasterpiece's Avatar
Disasterpiece Disasterpiece is offline
 
Join Date: Apr 2007
Hi,

Conflicts may come from any conflicting javascript includes, like for example different jqueries or anything else really. Hard to say without js-console output.

Mod upgrade likely won't happen, as I don't have access to/interest in vb at this point.
Reply With Quote
  #257  
Old 10 Oct 2016, 04:47
Daniel's Avatar
Daniel Daniel is offline
 
Join Date: Jul 2005
Real name: Daniel
How can I get this working in the blogs section too?
__________________
Daniel
Reply With Quote
  #258  
Old 15 Oct 2016, 04:06
bosanci28's Avatar
bosanci28 bosanci28 is offline
 
Join Date: Feb 2008
Works in vb4.2.3
Thanks.
Reply With Quote
  #259  
Old 05 Feb 2017, 09:21
mobster46 mobster46 is offline
 
Join Date: Dec 2016
How I can png link convert?
Reply With Quote
  #260  
Old 06 Feb 2017, 08:30
dirkji dirkji is offline
 
Join Date: Nov 2006
Since last week all YouTube embeds show up as black boxes on IE. Chrome and Firefox work fine. Does anyone have an idea what's causing this?
Reply With Quote
  #261  
Old 07 Feb 2017, 12:28
alexm's Avatar
alexm alexm is offline
 
Join Date: Apr 2005
Originally Posted by dirkji View Post
Since last week all YouTube embeds show up as black boxes on IE. Chrome and Firefox work fine. Does anyone have an idea what's causing this?
I think it is in the vBulletin template 'bbcode_video' (it's nothing to do with this mod). If you change //www to https://www IE should work. I just did the same to my vBulletin 4.2.3 and looked here first!

edit: Now it doesn't work again

edit2: It's something weird with IE debugger, when I open Developer Tools and then refresh it opens the Youtube fine!

Last edited by alexm; 07 Feb 2017 at 12:51.
Reply With Quote
  #262  
Old 08 Feb 2017, 09:51
dirkji dirkji is offline
 
Join Date: Nov 2006
Originally Posted by alexm View Post
edit2: It's something weird with IE debugger, when I open Developer Tools and then refresh it opens the Youtube fine!
Yes, I noticed that as well.

When I change:

<meta http-equiv="X-UA-Compatible" content="IE=9">

to

<meta http-equiv="X-UA-Compatible" content="IE=Edge">

the videos work fine, but then my image uploader stops functioning.

Any other ideas?
Reply With Quote
  #263  
Old 09 Feb 2017, 07:57
dirkji dirkji is offline
 
Join Date: Nov 2006
It seems to have fixed itself, probably an IE update...
Reply With Quote
  #264  
Old 15 Sep 2017, 21:55
IggyP IggyP is offline
 
Join Date: May 2012
hmm...noticed ipad mini retina not showing the embeds...any ideas of that? i see in the notes it was meant to be working on at least some form of tablet..

in fact is there a simply all around better version of this? seems like there would be, just didnt see it yet...better to not use flash at all isnt that possible by now?


EDIT:
i removed the flash part of the code....it now loads the embeds into posts....but if you try to play them, it redirects to youtube...anyone know what is the better replace code than this for mobile?

<a href="http://www.youtube.com/watch?v=%1$s">
YouTube Video:<br /><img src="http://img.youtube.com/vi/%1$s/0.jpg" width="480" height="360" alt="Click here to view on youtube" /></a>

Last edited by IggyP; 15 Sep 2017 at 22:16.
Reply With Quote
  #265  
Old 15 Sep 2017, 23:00
IggyP IggyP is offline
 
Join Date: May 2012
got it...

<iframe id="ytplayer" type="text/html" width="640" height="360"
src="https://www.youtube.com/embed/%1$s"
frameborder="0"></iframe>
Reply With Quote
  #266  
Old 16 Sep 2017, 00:01
djbaxter djbaxter is offline
 
Join Date: Aug 2006
Location: Ottawa, Canada
Posting just for my own clarification the solution from IggyP above...

FIND near line 130 in XML file:


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.


REPLACE with:


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.


Note: This sort of works for iPad. However, it leaves a lot of empty white space with a thumbnail and the fallback link to view on Youtube near the bottom of the post.

On iPhone, it just creates a lot of empty white space, although the video is viewable if I switch to desktop or iPad.

Did I do something incorrectly?

Last edited by djbaxter; 16 Sep 2017 at 00:25.
Reply With Quote
  #267  
Old 16 Sep 2017, 01:49
IggyP IggyP is offline
 
Join Date: May 2012
its just a simple code i found as alternate to the flash...i didnt try it by mobile on phone size, but perhaps its the size settings in the code? i wanted to keep it sort of big for "mobile" tablet but of course phones maybe thats a problem? hmm


theres other options that can be added as well of course.. >> https://developers.google.com/youtube/player_parameters


also this quote from the source: which suggests the sizes 240 and 135 instead of what i used..fwiw...

Use the iframe-embedded version of the player instead of the Flash one. The embedded version is smart enough to render the appropriate player based on the device (ie, it may render the Flash version for phones like the Android that support it, or the HTML5 version for iPhone).
<iframe
width="240" height="135"
src="http://www.youtube.com/embed/videoid"
frameborder="0" allowfullscreen>
</iframe>
EDIT: fwiw, testing with an s5 and ipad mini retina i cannot reproduce, seems to work proper and scale and everything but thats not necessarily saying much

EDIT2: also dont forget this mod has options....so dont really need to hack the xml

Last edited by IggyP; 16 Sep 2017 at 02:36.
Reply With Quote
  #268  
Old 17 Sep 2017, 00:19
djbaxter djbaxter is offline
 
Join Date: Aug 2006
Location: Ottawa, Canada
Originally Posted by IggyP View Post
EDIT2: also dont forget this mod has options....so dont really need to hack the xml
D'oh!

And that explains why it wasn't working for me. When I go to the options, it still has the old Flash code.

Going to try editing that now.
Reply With Quote
  #269  
Old 17 Sep 2017, 00:52
djbaxter djbaxter is offline
 
Join Date: Aug 2006
Location: Ottawa, Canada
And your original fix when I edit it in options works just fine. I tweaked the fallback it just a little for formatting so now the complete contents of the mobile text box in Options looks like this:


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

Thank you, IggyP, both for the fix and for helping me through my D'Oh! moment.
Reply With Quote
  #270  
Old 14 May 2018, 15:32
alexm's Avatar
alexm alexm is offline
 
Join Date: Apr 2005
Iíve got a problem... over the last 2 weeks (maybe longer!) videos appear as a black window if you use IE11. What it appears to be is:


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

in headinclude.

If you remove it Youtube embeds correctly... but unless you have this added then people canít press enter if they have anything but simple text turned on.

I donít know whether it is IEís fault or YouTubeís fault (probably IE )... does anyone else have this problem?

Alex
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Mod Options

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


New To Site? Need Help?

All times are GMT. The time now is 23:58.

Layout Options | Width: Wide Color: