Page 1 of 2
TSR69
Banned
Posts: 14962
Location: Republic of the Seven United Provinces
Posted: Sat, 17th Nov 2012 21:05 Post subject: Thanks for embedding video
Back to top
Przepraszam
VIP Member
Posts: 14498
Location: Poland. New York.
Posted: Sat, 17th Nov 2012 21:09 Post subject:
Awesome! But how do you do that?
Back to top
Back to top
Przepraszam
VIP Member
Posts: 14498
Location: Poland. New York.
Posted: Sat, 17th Nov 2012 21:12 Post subject:
VIDEO
kewl, thought need to put some tags
<--- noob Last edited by Przepraszam on Sat, 17th Nov 2012 21:12; edited 1 time in total
Back to top
LeoNatan
☢ NFOHump Despot ☢
Posts: 73199
Location: Ramat Gan, Israel 🇮🇱
Posted: Sat, 17th Nov 2012 21:12 Post subject:
Back to top
LeoNatan
☢ NFOHump Despot ☢
Posts: 73199
Location: Ramat Gan, Israel 🇮🇱
Posted: Sat, 17th Nov 2012 21:12 Post subject:
Good, it doesn't work in sigs.
Back to top
Posted: Sat, 17th Nov 2012 21:22 Post subject:
Just need to paste the link ?
VIDEO
Back to top
ixigia
[Moderator] Consigliere
Posts: 65081
Location: Italy
Posted: Sat, 17th Nov 2012 21:28 Post subject:
VIDEO
Magic, it works!! Thanks Mrt
Back to top
Ankh
Posts: 23342
Location: Trelleborg
Back to top
BLaM!
VIP Member
Posts: 13818
Location: Germany
Posted: Sat, 17th Nov 2012 21:34 Post subject:
great stuff , tnx..
VIDEO
Back to top
[sYn]
[Moderator] Elitist
Posts: 8374
Posted: Sat, 17th Nov 2012 21:36 Post subject:
Back to top
Ankh
Posts: 23342
Location: Trelleborg
Posted: Sat, 17th Nov 2012 21:37 Post subject:
Back to top
Posted: Sun, 18th Nov 2012 14:33 Post subject:
The vids don't work for me. I see it embedded and the link is fine in the code, but it doesn't start.
Back to top
Posted: Sun, 18th Nov 2012 14:34 Post subject:
What browser? If it's Chrome, it might be a Pepper issue (the built-in Flash player for Chrome) -- you could either opt into the HMTL5 beta for Youtube, or go into about:plugins and disable Pepper/internal Flash and just use the external one.
Back to top
Posted: Sun, 18th Nov 2012 14:36 Post subject:
Back to top
Posted: Sun, 18th Nov 2012 14:36 Post subject:
Back to top
TSR69
Banned
Posts: 14962
Location: Republic of the Seven United Provinces
Back to top
Back to top
Posted: Sun, 18th Nov 2012 15:15 Post subject:
Is it technically possible to put the vids in spoilers automagically or to choose how big the preview should be? I'd like it to be smaller, would be great if I could choose a size.
Back to top
Raccoon
Posts: 3160
Location: Poland
Back to top
garus
VIP Member
Posts: 34200
Posted: Sun, 18th Nov 2012 17:41 Post subject:
snip Last edited by garus on Tue, 27th Aug 2024 21:55; edited 1 time in total
Back to top
Posted: Sun, 18th Nov 2012 19:26 Post subject:
it's still missing some links though
anyway, here's the code i wrote for the extension
if it's of any use - feel free to cannibalize
Code:
/* EMBED YOUTUBE LINKS */
if (getValue("embedYoutube") === "true"){
$('a').each(function(i, o){
var videoid = false;
if ($(this).attr('href') === undefined){
return;
}
if ($(this).attr('href').toLowerCase().indexOf('www.youtube.') !== -1 && $(this).attr('href').toLowerCase().indexOf('/watch?') !== -1){
videoid = $(this).attr('href').split('?')[1]; // only params
videoid = videoid.split('#')[0]; // discard hash
videoid = videoid.split('&'); // split params
videoid.forEach(function(o, i){ // find videoid
var sp = o.split('=');
if (sp[0] === 'v'){ // we found v=?? param, so we have our guy
videoid = sp[1];
return false;
}
return true;
});
} else if ($(this).attr('href').toLowerCase().indexOf('youtu.be') !== -1){
videoid = $(this).attr('href').split('?')[0]; // only before params
videoid = videoid.split('/');
videoid = videoid[videoid.length - 1]; // only last url bit
}
if (videoid !== false){
var embedstring;
if (getValue("embedYoutubeNewstyle") === "true"){
embedstring = '<br/><iframe width="640" height="360" src="http://www.youtube.com/embed/' + videoid + '" frameborder="0" allowfullscreen></iframe><br/>';
} else {
embedstring = '<br/><object width="640" height="360"><param name="movie" value="http://www.youtube.com/v/' + videoid + '?version=3&hl=en_GB"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/' + videoid + '?version=3&hl=en_GB" type="application/x-shockwave-flash" width="640" height="360" allowscriptaccess="always" allowfullscreen="true"></embed></object><br/>';
}
if (getValue("embedYoutubeButtons") === "true"){
(function(that, embedstring){
var youtubebutton = $('<button>').html('embed').css('padding', '0').click(function(){
$(this).replaceWith(embedstring);
});
$(that).after(youtubebutton);
})(this, embedstring);
} else {
$(this).after(embedstring);
}
}
});
}
here with syntax hilight Last edited by shole on Sun, 18th Nov 2012 19:27; edited 1 time in total
Back to top
Posted: Sun, 18th Nov 2012 19:26 Post subject:
Back to top
garus
VIP Member
Posts: 34200
Posted: Sun, 18th Nov 2012 19:37 Post subject:
snip Last edited by garus on Tue, 27th Aug 2024 21:55; edited 1 time in total
Back to top
Raccoon
Posts: 3160
Location: Poland
Back to top
Posted: Sun, 18th Nov 2012 19:41 Post subject:
yea but preferrably this would be all on serverside
it's a bad idea to embed stuff without asking to begin with
it really slows down browsing
Back to top
garus
VIP Member
Posts: 34200
Posted: Sun, 18th Nov 2012 19:41 Post subject:
snip Last edited by garus on Tue, 27th Aug 2024 21:55; edited 1 time in total
Back to top
BLaM!
VIP Member
Posts: 13818
Location: Germany
Posted: Sun, 18th Nov 2012 20:27 Post subject:
TSR69 wrote: Works here with latest flash player (also with and an older version) in IE9 and IE9 x64:
Kept it functional for some Flash game.
Back to top
[mrt]
[Admin] Code Monkey
Posts: 1342
Posted: Mon, 19th Nov 2012 16:48 Post subject:
Guys, there's a youtube humpgrade coming that will allow you to,
- set your preferred youtube video size in threads,
- completely turn off embedding
- enable semi-embeds, that show a placeholder where the video will load if you activate/click the button inside
just-to-let-you-know-before-you-do-anything© teey
Back to top
ixigia
[Moderator] Consigliere
Posts: 65081
Location: Italy
Posted: Mon, 19th Nov 2012 17:04 Post subject:
That's perfect Thanks again for your hard work!
Back to top
Page 1 of 2
All times are GMT + 1 Hour