- SnowblindFatal
- Jan 7, 2011
-
|
Hey, I know I used to have an addon (or maybe some script extension package?) that showed the title and a preview of video links posted wherever. I can't remember what it was, though, and google isn't producing too good results. Any help?
|
#
¿
Jun 14, 2015 16:17
|
|
- Adbot
-
ADBOT LOVES YOU
|
|
#
¿
Sep 15, 2024 13:44
|
|
- SnowblindFatal
- Jan 7, 2011
-
|
In SA, I have the user option "Show video embedded in posts with the [video] tag?" set to No and use 2 scripts.
One I wrote to replace text Youtube links with thumbnails so I get the video preview without using the resources of an embedded player for every link (handy when the same video is quoted a dozen times on a single page.
code:// ==UserScript==
// @name SA YT Links Thumbed
// @namespace [url]http://*.somethingawful.com[/url]
// @description Uses YT links to show thumbnails
// @include [url]http://forums.somethingawful.com/*[/url]
// @version 0.1
// @grant none
// ==/UserScript==
var vidList = document.getElementsByClassName('bbtag_video');
for (var i = 0; i < vidList.length; i++) {
var p = /^.*youtube\.com\/watch\?v=([a-zA-Z0-9_-]{11}).*$/;
var vidId = (vidList[i].innerHTML.match(p));
if (vidId[1] == false) continue;
var image = document.createElement('img');
image.setAttribute('src', 'http://img.youtube.com/vi/' + vidId[1] + '/hqdefault.jpg');
vidList[i].innerHTML = '';
vidList[i].appendChild(image);
}
The other script is Youtube Link Title which embeds a floating video player (for numerous streaming sites) when you click a video link.
This setup works really well. Just the way I wanted it to.
Thanks! This seems exactly what I'm looking for. Too bad the link seems to be dead at the moment. I'll have to check it out later.
Where do you put these scripts to make them run automatically after page load?
|
#
¿
Jun 15, 2015 14:16
|
|
- SnowblindFatal
- Jan 7, 2011
-
|
Yeah, I got it now, thanks! Everything's working perfectly.
|
#
¿
Jun 16, 2015 13:46
|
|