• Hey, guest user. Hope you're enjoying NeoGAF! Have you considered registering for an account? Come join us and add your take to the daily discourse.

NeoGAF, welcome to .webm - the FUTURE (of burning out your CPU)

We need to update the NeoGaf Webm extension in chrome to not auto play so users with CPU utilization issues don't have their system melt. Once we get site wide support for .webm embedding with no autoplay, webm will absolutely dominte gif.
 

TheSeks

Blinded by the luminous glory that is David Bowie's physical manifestation.
We need to update the NeoGaf Webm extension in chrome to not auto play so users with CPU utilization issues don't have their system melt. Once we get site wide support for .webm embedding with no autoplay, webm will absolutely dominte gif.

Andy's working on that.

Though I seem to have a bug that loads the .webm's a la Youtube all at the same time.

Not sure if that's script related or how the browser works with video media, but it's kinda annoying. I've set them to play when I want to view the media/click-play but I'd like to wait for them to load instead of them all loading. I may not want to see some of them so them buffering themselves is pointless.

And is it possible to loop it forever like gif?

Yes. Right-click and then "loop"

But it's too CPU intense to do that for all of them.
 

ThatObviousUser

ὁ αἴσχιστος παῖς εἶ
WebM for NeoGAF 1.2



Unfortunately it may take a bit:

zdvlcvN.png


To get it faster, you might be able to go to chrome://extensions, enable Developer mode, and click "Update extensions now."

VtLN7lh.png


Let me know if there are any bugs, this is my first brush with the Chrome sync API (your choices on the option page will sync across all your desktop installations of Chrome.)

It does seem like Opera supports this API too, so whenever that version of the extension is approved it will also feature this options page.

lgpyXTf.png
 
Let me know if there are any bugs, this is my first brush with the Chrome sync API (your choices on the option page will sync across all your desktop installations of Chrome.)

It does seem like Opera supports this API too, so whenever that version of the extension is approved it will also feature this options page.

lgpyXTf.png

Fantastic work Andrex, thank you. Will download when available. The other Javascript modifications didn't work for me even after I rebooted chrome.

Edit: Had to enable developer mode to change the code I guess, because that did the trick will stick with the fix until 1.2 come out thanks again!
 

ThatObviousUser

ὁ αἴσχιστος παῖς εἶ
Yo, can I try to reverse-engineer this for Firefox folk?

A lot of it is Chrome-specific unfortunately.

Code:
'use strict';

chrome.storage.sync.get({
  autoplay: true,
  clickToPlay: false,
  constrainVideos: true,
  pixelsWide: 500
}, function(items) {
  var videos = document.querySelectorAll('.post a'),
    link, video;

  for (var i = 0; i < videos.length; i++) {
    link = videos[i].href;
    if (link.indexOf('.webm') === link.length - 5) {
      video = document.createElement('video');
      video.src = link;
      video.autoplay = items.autoplay;
      video.controls = items.clickToPlay;
      video.loop = true;
      video.muted = true;
      
      if (items.constrainVideos) {
        video.width = items.pixelsWide;
      }
      
      if (items.clickToPlay) {
        video.onclick = function() {
          video.play();
        };
      }
      
      videos[i].parentNode.replaceChild(video, videos[i]);
    }
  }
});

^ The updated code.

Code:
'use strict';

function saveOptions() {
  var autoplay = document.getElementById('autoplay').checked;
  var clickToPlay = document.getElementById('click-to-play').checked;
  var constrainVideos = document.getElementById('constrain-videos').checked;
  var pixelsWide = document.getElementById('pixels-wide').value;
  
  chrome.storage.sync.set({
    autoplay: autoplay,
    clickToPlay: clickToPlay,
    constrainVideos: constrainVideos,
    pixelsWide: pixelsWide
  }, function() {
    var save = document.getElementById('save');
    save.textContent = 'Saving...';
    save.disabled = true;
    setTimeout(function() {
      save.textContent = 'Saved';
      save.disabled = false;
    }, 750);
  });
}

function restoreOptions() {
  chrome.storage.sync.get({
    autoplay: true,
    clickToPlay: false,
    constrainVideos: true,
    pixelsWide: 500
  }, function(items) {
    document.getElementById('autoplay').checked = items.autoplay;
    document.getElementById('click-to-play').checked = items.clickToPlay;
    document.getElementById('constrain-videos').checked = items.constrainVideos;
    document.getElementById('pixels-wide').value = items.pixelsWide;
  });
}

document.addEventListener('DOMContentLoaded', restoreOptions);
document.getElementById('save').onclick = saveOptions;
document.getElementById('constrain-videos').onclick = function(event) {
  document.getElementById('pixels-wide').disabled = !this.checked;
};

^ Options page code. Not gonna post the HTML cause it's kinda big.
 

Quasar

Member
So heres a related question for tech heads.

Some mobile chips like Tegra 4/5 have VP8 hardware decode support, I'm wondering do any desktop or laptop GPU's have that?
 

Griss

Member
Holy god, I was only on the page for about 10 seconds and I thought my laptop was going to melt!

ABORT! ABORT!
 
Not very difficult. I could give it a shot if you want.
Does it have to be website-specific? I was asking around at the IGN boards, and a mod asked if it could be made into an official xenforo plugin so it could be implemented for a more widespread audience.
 

Lebon14

Member
I would like to also add that webm would be good for game footage loops and that we should keep GIFs for the lol stuff such as the hype material. I think somebody mentionned that or something along those lines earlier.
 
Went into my local appdata folder and checked out the extension, it looks like I already have version 1.2 but it still doesnt pause videos by default. Even after reloading chrome.
 

wmlk

Member
Not very difficult. I could give it a shot if you want.

How about resizing when you click? The HD becomes downsampled from its native resolution.

Also, love that you have Jun/Barry from Pokémon Platinum as your avatar. :)
 
I spent forever doing this one, so I'm posting it dammit! Sorry it's so huge

http://a.pomf.se/dsubhc.webm

2 things:

1. How do I crop fraps.com out of the image w/out stretching? (handbrake or XMedia please)
2. We should decide as a community a hard file size limit for 30fps, 60fps, and 120fps webm videos, for mobile users of course (as GIF replacements). Anyone know 4chan's limit?

Thanks jediyoshi
 

ThatObviousUser

ὁ αἴσχιστος παῖς εἶ
Yeah, I'm gonna pass. Feel free to make your own script, and I'll move mine aside (it's basically all your code anyway. :v)

I'll be looking into the official Firefox extension docs tomorrow.

Is it possible to constrain webm by height as well?

Yes, it is possible and I will add that option.

Does it have to be website-specific? I was asking around at the IGN boards, and a mod asked if it could be made into an official xenforo plugin so it could be implemented for a more widespread audience.

It doesn't have to be website specific, but it would require an "all websites" permission which is kind of scary for some people. Also, it's possible it could break some websites as the WebM video might "break out" of whatever container the link was in.

How about resizing when you click? The HD becomes downsampled from its native resolution.

Looking into a good way to do that.

Also, love that you have Jun/Barry from Pokémon Platinum as your avatar. :)

Since 2008. Cheers. :)
 
Top Bottom