The King .gif's days are numbered, long hail .webm

kevm3

follower of Jesus
Supporter
Joined
May 2, 2012
Messages
16,301
Reputation
5,575
Daps
83,600
Here is how to get webms to work as if they were embedded. i believe anders made the original for Chrome and it was ported to firefox by ekim over there. This is a port of the neogaf greasemonkey script with a few key modifications


This rendition removes the 'controls' and the video starts playing when you hover over it and to pause the video, click on it. Let me know what sort of behavior you'd like and i'll try to put it in (start image on click vs on hover, bring the controls back, etc.).

Now to get this to work:
install the greasemonkey extension for firefox


go to new user script. You will be shown a prompt to fill in information. Just fill in the information as follows:

Name: WebM The Coli
Namespace: http://www.thecoli.com/
Description: Embed webm
Includes: http://www.thecoli.com/*

Then an editor will pop up. Hit enter to put the cursor on a blank line and paste this in after the 'header':

Code:
'use strict';

function main()
{

var videos = document.querySelectorAll('a'),
  link, video;

for (var i = 0; i < videos.length; i++)
{
  link = videos[i].href;
  if (link.indexOf('.webm') === link.length - 5 || link.indexOf('.mp4') === link.length - 4)
  {
  video = document.createElement('video');
  video.src = link;
  video.autoplay = false;
  video.loop = true;
  video.muted = true;
  video.width = '720';
  video.controls= false;


  videos[i].parentNode.replaceChild(video, videos[i]);
  }
}



  var vid = document.getElementsByTagName("video");
  for(var i=0; i < vid.length; i++)
  {


  vid[i].onmouseover = vid[i].play;
  vid[i].onclick = vid[i].pause;

  }

}
window.onload = main;
 
Last edited:

kevm3

follower of Jesus
Supporter
Joined
May 2, 2012
Messages
16,301
Reputation
5,575
Daps
83,600
I wouldn't really call this a replacement for gifs since autoplaying all of these videos will put your cpu through a grinder.
 
Last edited:

newworldafro

DeeperThanRapBiggerThanHH
Bushed
Joined
May 3, 2012
Messages
50,920
Reputation
5,122
Daps
114,961
Reppin
In the Silver Lining
I like it, that pixel quality is magnificent..... but I wish it came with a default volume off button when opening. So if you want to hear it you can, but I prefer not having to hear it out right when I'm just opening a gif, cause you never know where I might be and some ridiculous shiit comes out of my phone or computer.. :beli: .... don't need that brehs ... :huhldup:
 

Maude

Superstar
Supporter
Joined
Mar 4, 2014
Messages
4,599
Reputation
3,210
Daps
19,637
Reppin
The Midwest
if implementation that disables audio becomes available then we'll look into it...
you can manually disable audio and set the video to loop and autoplay. no automatic options thought.
gifs are still better and easier to use.
 

cook

Banned
Joined
Dec 31, 1969
Messages
0
Reputation
11,286
Daps
48,012
you can manually disable audio and set the video to loop and autoplay. no automatic options thought.
gifs are still better and easier to use.

is that done on a server level or done to each webm file?
 

kevm3

follower of Jesus
Supporter
Joined
May 2, 2012
Messages
16,301
Reputation
5,575
Daps
83,600
I uploaded the script so you can install it much more easily. Go here and cilck install:
This is the original version (hover to start, click to stop, audio turned off, controls turned off, looping turned on) This version makes things more gif-like if you don't want to see those ugly controls whenever you start the video
http://userscripts.org/scripts/show/458829

This is the version with the controls turned on:
(hover to start, controls (volume, fast forward through the vid, ) is on, audio turned off by default but can be enabled)
http://userscripts.org/scripts/show/459166


You have to have greasemonkey and then go to one of those links and click install, I'm going to try to make this into an official firefox extension so you can edit which options you want
 
Last edited:
Top