YouTube embedding

Open discussion about any topic, as long as you abide by the rules of course!
User avatar
Eraser
Posts: 19177
Joined: Fri Dec 01, 2000 8:00 am

YouTube embedding

Post by Eraser »

Since there's still people who do not know how to embed YouTube videos here on Q3W, I thought I'd make a little helper script for that.

So what you can do is add this piece of script below to your bookmarks:

Code: Select all

javascript:function fixYouTubeEmbedding(){for(var d=document.getElementsByTagName("textarea"),f=null,e=0;e<d.length;e++)"message"==d[e].name&&(f=d[e]);if(null==f)alert("Textarea not found. Are you on the right page?");else{for(var d=f.value,i=d.split("\n"),g=0;g<i.length;g++)for(var j=i[g].split(" "),e=0;e<j.length;e++){var a=j[e];if(0<=a.indexOf("youtube.com/watch?")){var c=a.indexOf("v="),b=a.indexOf("&",c);-1==b&&(b=a.indexOf(" ",c));-1==b&&(b=a.length);var c=a.substring(c+2,b),b=a.indexOf("youtube.com/watch"),
h=a.indexOf(" ",b);-1==h&&(h=a.length);b=a.substring(b,h);c=a.replace(b,"youtube.com/v/"+c);c="[flash=480,360]"+c+"[/flash]";d=d.replace(a,c)}}f.value=d}}fixYouTubeEmbedding();
This is done as follows:

Internet Explorer
Click the little star at the top right of the screen. In the popup, click the downward arrow next to "add to favorites" and select "add to favorites bar". A bookmark to the current page will be added to the favorites bar. Right click that bookmark and select "properties". Now replace the text in the "shortcut" input field with the code posted above. You can also right-click it and select "rename" to give it a proper name.

Firefox
Right click the bookmark toolbar and click "new bookmark". Give it a name and in the "location" input field, paste the code posted above.

Chrome
Hit the little star in the location bar and then click the "edit" button in the popup that appears. Give the bookmark a different name and paste the code posted above in the URL input field.

Now whenever you want to post an embedded YouTube video, simply type your post and paste the full YouTube URL in your post in the location where you want it to be embedded. Then hit the bookmark you just added and the script will format the URL so that it's embedded. Then hit the submit button to post your message.
Last edited by Eraser on Mon May 14, 2012 1:59 pm, edited 2 times in total.
DTS
Posts: 2879
Joined: Thu Jul 13, 2000 7:00 am

Re: YouTube embedding

Post by DTS »

All they need to do is quote someone to see how it's done; fuck'n nerd.
User avatar
Eraser
Posts: 19177
Joined: Fri Dec 01, 2000 8:00 am

Re: YouTube embedding

Post by Eraser »

Yes indeed.
HM-PuFFNSTuFF
Posts: 14376
Joined: Thu Mar 01, 2001 8:00 am

Re: YouTube embedding

Post by HM-PuFFNSTuFF »

fuck off [flash=480,360]nerds

http://www.youtube.com/v/ZHh0V7UjVXI[/flash]
HM-PuFFNSTuFF
Posts: 14376
Joined: Thu Mar 01, 2001 8:00 am

Re: YouTube embedding

Post by HM-PuFFNSTuFF »

great script
HM-PuFFNSTuFF
Posts: 14376
Joined: Thu Mar 01, 2001 8:00 am

Re: YouTube embedding

Post by HM-PuFFNSTuFF »

hello jerry (cough [flash=480,360]cough)

http://www.youtube.com/v/obxfuFrUTzg[/flash]
HM-PuFFNSTuFF
Posts: 14376
Joined: Thu Mar 01, 2001 8:00 am

Re: YouTube embedding

Post by HM-PuFFNSTuFF »

it's still borked jerry!
HM-PuFFNSTuFF
Posts: 14376
Joined: Thu Mar 01, 2001 8:00 am

Re: YouTube embedding

Post by HM-PuFFNSTuFF »

one more time
User avatar
Eraser
Posts: 19177
Joined: Fri Dec 01, 2000 8:00 am

Re: YouTube embedding

Post by Eraser »

Don't get your panties in a knot. It's fixed now.
HM-PuFFNSTuFF
Posts: 14376
Joined: Thu Mar 01, 2001 8:00 am

Re: YouTube embedding

Post by HM-PuFFNSTuFF »

JERRY!!
Eraser wrote:Don't get your panties in a knot. It's fixed now.
obsidian
Posts: 10970
Joined: Mon Feb 04, 2002 8:00 am

Re: YouTube embedding

Post by obsidian »

Maybe it would be easier just to fix the Flash embed forum plugin?
[size=85][url=http://gtkradiant.com]GtkRadiant[/url] | [url=http://q3map2.robotrenegade.com]Q3Map2[/url] | [url=http://q3map2.robotrenegade.com/docs/shader_manual/]Shader Manual[/url][/size]
User avatar
Eraser
Posts: 19177
Joined: Fri Dec 01, 2000 8:00 am

Re: YouTube embedding

Post by Eraser »

Sure, give me admin priviliges and I'll do it. Actually, FTP access to the PHP scripts is what you'd need.
Last edited by Eraser on Mon May 14, 2012 4:29 pm, edited 1 time in total.
xer0s
Posts: 12447
Joined: Sat Feb 10, 2001 8:00 am

Re: YouTube embedding

Post by xer0s »

Sure, why don't we give you our bank account numbers while we're at it...
DTS
Posts: 2879
Joined: Thu Jul 13, 2000 7:00 am

Re: YouTube embedding

Post by DTS »

:olo: "Hey I wrote a script can I have the website and forums now?"
User avatar
Eraser
Posts: 19177
Joined: Fri Dec 01, 2000 8:00 am

Re: YouTube embedding

Post by Eraser »

xer0s wrote:Sure, why don't we give you our bank account numbers while we're at it...
Yeah, why don't you.
I was saying things in jest because we certainly shouldn't expect our exalted admins to do anything about it.
User avatar
seremtan
Posts: 36015
Joined: Wed Nov 19, 2003 8:00 am

Re: YouTube embedding

Post by seremtan »

pretty sure the only one on here who needs this is Whiskey and his "360x240 for everything" mentality
Plan B
Posts: 3599
Joined: Thu Jan 11, 2001 8:00 am

Re: YouTube embedding

Post by Plan B »

^lol

Meh, I just post youtubes in the "what are you listening to" thread.
And then just quote the previous post, and edit until not borked.

Appreciate the effort, though.
Don't let Debbie Downy types like dts get you down.
User avatar
Transient
Posts: 11357
Joined: Fri Feb 09, 2001 8:00 am

Re: YouTube embedding

Post by Transient »

The fullscreen button doesn't even work, so why bother embedding? I always click the YouTube link anyway, so might as well just post a link to the video instead of embedding. :shrug:
[quote="YourGrandpa"]I'm satisfied with voicing my opinion and moving on.[/quote]
obsidian
Posts: 10970
Joined: Mon Feb 04, 2002 8:00 am

Re: YouTube embedding

Post by obsidian »

[size=85][url=http://gtkradiant.com]GtkRadiant[/url] | [url=http://q3map2.robotrenegade.com]Q3Map2[/url] | [url=http://q3map2.robotrenegade.com/docs/shader_manual/]Shader Manual[/url][/size]
Dark Metal
Posts: 5496
Joined: Sun Feb 20, 2000 8:00 am

Re: YouTube embedding

Post by Dark Metal »

Lots of upset nerds in this thread.
[WYD]
Tsakali
Posts: 7175
Joined: Thu Mar 02, 2000 8:00 am

Re: YouTube embedding

Post by Tsakali »

i always have to quote and edit to add vids... yes the code is simple...yes I never seem to remember it.
User avatar
plained
Posts: 16366
Joined: Thu Jun 13, 2002 7:00 am

Re: YouTube embedding

Post by plained »

Eraser wrote: our exalted admins
well done thats how i feel i do ey

i exalt them plenty!
it is about time!
User avatar
Whiskey 7
Posts: 9709
Joined: Sat Jul 21, 2001 7:00 am

Re: YouTube embedding

Post by Whiskey 7 »

seremtan wrote:pretty sure the only one on here who needs this is Whiskey and his "360x240 for everything" mentality

Hey, steady on!
I do that to fit the videos. I used to make 'em bigger :grr:
Thought I was doing the right thing making them smaller :smirk: :smirk:
Dark Metal wrote:Lots of upset nerds in this thread.
FYI I have a word doc on my desktop (for years) and just cut and past or substitute the right stuff :!:

Cop this :)



NOTE: 640 390

Code: Select all

[flash=640,390]http://www.youtube.com/v/e2Innx3puNI&[/flash]    



Code: Select all

[flash=320,190]http://www.youtube.com/v/e2Innx3puNI&[/flash]       


Note: 320 190

Never tried smaller >:)


Code: Select all

[flash=160,9]http://www.youtube.com/v/e2Innx3puNI&[/flash]       
[color=#FFBF00]Physicist [/color][color=#FF4000]of[/color] [color=#0000FF]Q3W[/color]
User avatar
Transient
Posts: 11357
Joined: Fri Feb 09, 2001 8:00 am

Re: YouTube embedding

Post by Transient »

BLAST YOU
[quote="YourGrandpa"]I'm satisfied with voicing my opinion and moving on.[/quote]
HM-PuFFNSTuFF
Posts: 14376
Joined: Thu Mar 01, 2001 8:00 am

Re: YouTube embedding

Post by HM-PuFFNSTuFF »

Post Reply