Page 1 of 1

YouTube tag

Posted: 26 Oct 2012 20:37
by XeryusTC
The YouTube tag doesn't work if your URL isn't of a specific format. Even just using https instead of http makes it break, it also doesn't like it if you have parameters in the URL (which I can understand). Could you fix it so it at least accepts https Owen? Pretty please, with a cherry on top :)

Re: YouTube tag

Posted: 29 Oct 2012 09:59
by orudge
Not with any great ease, unfortunately - specifically, not without breaking all existing [youtube] tags. I could change it so that you just had to enter [youtube]youtube_id[/youtube], but as I say, that would break all existing references. I'd have to run a search and replace on every post in the forum DB to fix that, which I'd probably prefer not to do.

It may be possible to at least make it accept the 's' in 'https', but I'd have to do some experimenting with that.

Re: YouTube tag

Posted: 29 Oct 2012 13:49
by XeryusTC
Well, my main 'problem' is that it doesn't accept the s in https, so if you could fix that it would be very nice. That it doesn't accept parameters isn't that bad IMO, just a minor inconvenience.

Re: YouTube tag

Posted: 31 Oct 2012 20:31
by Pyoro
Shouldn't be too difficult; something like this maybe?
[youtube]{IDENTIFIER2}://www.youtube.com/watch?v={IDENTIFIER1}[/youtube]

<object width="425" height="344"><param name="movie" value="{IDENTIFIER2}://www.youtube.com/v/{IDENTIFIER1}&rel=en& ... ram><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="{IDENTIFIER2}://www.youtube.com/v/{IDENTIFIER1}&rel=en& ... 2=0xd4d4d4" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="425" height="344"></embed></object>

Re: YouTube tag

Posted: 15 Feb 2013 23:54
by ChillCore
I was just about to report this ...
May as well give this thread a little bump instead of making a new topic.

Re: YouTube tag

Posted: 19 Feb 2013 11:03
by orudge
HTTPS:



Gopher:



The youtube tag now always links to http://, but accepts anything://www.youtube.com/. I could make it link to https, but for the moment I'll stick to http.

Re: YouTube tag

Posted: 19 Feb 2013 12:47
by jonty-comp
That's certainly an improvement, but could you make it protocol-relative? I've got SSL Enforcer turned on and Google Chrome blocks the youtube embeds as they come from an external non-secure domain. As per http://paulirish.com/2010/the-protocol-relative-url/ you can replace the "http://" or "https://" with just "//" and any browser that supports RFC standards (read: anything from the last 15 years except IE6, and I bet youtube embeds don't work in that anyway) will request the embed using the same protocol that the page was loaded as. It's rather clever. :D

Re: YouTube tag

Posted: 19 Feb 2013 15:30
by orudge
Ah yes, I forgot about //. Well, I've done that now.

The Google ads will still give you a warning though I'm afraid (if you're not using evil ad-blocking software) as, in their infinite wisdom, Google still haven't provided a secure version of their adverts yet.

Re: YouTube tag

Posted: 19 Feb 2013 15:48
by jonty-comp
Perfect. :) Pity about Google's JavaScript, but presumably as more sites go SSL-enabled they'll sort it out at their end.

Re: YouTube tag

Posted: 19 Feb 2013 22:51
by ChillCore
Thank you. :)

Re: YouTube tag

Posted: 25 Feb 2013 03:59
by kamnet
Can this also be modified to support YouTube's newer http://youtu.be/ shortcut links?

Re: YouTube tag

Posted: 25 Feb 2013 11:44
by orudge
Unfortunately not, not with any great ease at least. I'm not sure if they would even work in an embed tag.