Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

snapstream

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

snapstream - npm Package Compare versions

Comparing version 1.0.0 to 1.0.2

4

examples/simple.js
var snapstream = require('..');
var getUserMedia = require('getusermedia');
var kgo = require('kgo');
var h = require('hyperscript');
kgo({
constraints: { video: true, audio: true }
constraints: { video: true, audio: false }
})

@@ -12,3 +13,4 @@ ('capture', ['constraints'], getUserMedia)

console.log('got image data: ', imageData, imageData.length);
document.body.appendChild(h('img', { src: imageData }));
})
.on('error', console.error.bind(console));

@@ -6,2 +6,3 @@ var attach = require('rtc-attach');

var canplay = require('canplay');
var snapvid = require('snapvid');

@@ -32,22 +33,5 @@ /**

('capture', ['renderable'], function(video) {
var canvas = getCachedCanvas(video);
var context = canvas.getContext('2d');
context.drawImage(video, 0, 0);
callback(null, canvas.toDataURL('image/jpeg'));
callback(null, snapvid(video, opts));
})
.on('error', callback);
};
function getCachedCanvas(video) {
var key = video.videoWidth + '|' + video.videoHeight;
var canvas = _cached[key];
if (! canvas) {
canvas = _cached[key] = document.createElement('canvas');
canvas.width = video.videoWidth;
canvas.height = video.videoHeight;
}
return canvas;
}
{
"name": "snapstream",
"version": "1.0.0",
"version": "1.0.2",
"description": "Capture base64 image data for an input MediaStream containing video track information",

@@ -28,7 +28,9 @@ "main": "index.js",

"kgo": "^1.2.0",
"rtc-attach": "^1.2.1"
"rtc-attach": "^1.2.1",
"snapvid": "^1.0.0"
},
"devDependencies": {
"getusermedia": "^1.0.0"
"getusermedia": "^1.0.0",
"hyperscript": "^1.4.3"
}
}

@@ -17,5 +17,6 @@ # snapstream

var kgo = require('kgo');
var h = require('hyperscript');
kgo({
constraints: { video: true, audio: true }
constraints: { video: true, audio: false }
})

@@ -26,2 +27,3 @@ ('capture', ['constraints'], getUserMedia)

console.log('got image data: ', imageData, imageData.length);
document.body.appendChild(h('img', { src: imageData }));
})

@@ -36,3 +38,3 @@ .on('error', console.error.bind(console));

Copyright (c) 2014 Damon Oehlman <damon.oehlman@gmail.com>
Copyright (c) 2015 Damon Oehlman <damon.oehlman@gmail.com>

@@ -39,0 +41,0 @@ Permission is hereby granted, free of charge, to any person obtaining

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc