Commit fd62faf0 authored by Michael Murtaugh's avatar Michael Murtaugh

testing spawn/kill behaviour with cvlc

parent 2b738295
var io = require('socket.io-client'),
fs = require('fs'),
spawn = require('child_process').spawn,
player = undefined;
player = null;
var settings = JSON.parse(fs.readFileSync("settings.json", "utf8")),
serverbase = "http://"+settings.ipaddress+":"+settings.port,
socket = io.connect(serverbase);
......@@ -20,7 +20,7 @@ socket.on("collage", function (d) {
});
socket.on("collagegif", function (d) {
console.log("collagegif", d.src);
if (player) {
if (player !== null) {
player.kill();
player = null;
}
......
var spawn = require('child_process').spawn,
path = "output/collage20160305_114531.webm",
params = ['-loop', '0', path],
path = "collage/creatingcollage.mp4",
// params = ['-loop', '0', path],
params = ['--loop', path],
// params = ['-fs', '-loop', '0', path],
mplayer = spawn('mplayer', params);
// mplayer = spawn('mplayer', params);
player = spawn('cvlc', params);
mplayer.on("close", function (code) {
console.log("mplayer closed with code", code);
player.on("close", function (code) {
console.log("player closed with code", code);
});
// ok killing a spawned process doesn't seem to be a problem... moving on...
setTimeout(function () {
mplayer.kill();
player.kill();
setTimeout(function () {
mplayer.kill();
player.kill();
console.log("second kill");
setTimeout(function () {
console.log("that's all folks");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment