Skip to content

Instantly share code, notes, and snippets.

@TooTallNate
Created February 21, 2013 09:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save TooTallNate/ad7ce486dc328d8f32b7 to your computer and use it in GitHub Desktop.
Save TooTallNate/ad7ce486dc328d8f32b7 to your computer and use it in GitHub Desktop.
var fs = require('fs');
var path = require('path');
var assert = require('assert');
var Decoder = require('./').Decoder;
var fixtures = path.resolve(__dirname, 'test', 'fixtures');
var fixture = path.resolve(fixtures, '320x240.ogv');
var decoder = new Decoder();
var input = fs.createReadStream(fixture);
var count = 0;
var expected = 2;
decoder.on('stream', function (stream) {
count++;
stream.resume();
});
decoder.on('finish', function () {
assert.equal(expected, count);
console.error('ALL GOOD!');
});
input.pipe(decoder);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment