Make seeking work

master
Dario Ernst 10 years ago
parent 0cca6094fd
commit 31985a3e95

@ -5,6 +5,7 @@ var FS = require("q-io/fs");
// CONNECTIONS AND STUFF
var fifoPath = '/home/daddel9/.mpv-fifo';
var log = bunyan.createLogger({name: 'MpvRemote'});
// SETUP
@ -21,8 +22,15 @@ server.get(/\/client\/?.*/, restify.serveStatic({
// Mockup Methods
server.get('/seek/:time', function (req, res, next) {
log.info("Seeking "+req.params['time']+" now.");
res.send({'success':true});
return;
return FS.write( fifoPath, '{ "command": ["seek", "10"] }\n' )
.then(function () {
log.info("wrote seek 10 to "+fifoPath);
res.send({'success':true});
return next(false);
}, function(reason) {
log.info("failed because "+reason);
});
log.info("after then");
});
server.get('/seek/:time/:mode', function (req, res, next) {
log.info("Seeking "+req.params['time']+" with mode "+req.params['mode']+" now.");

Loading…
Cancel
Save