From 98b2c1faa886a20695343b54bac1b2b6f85b3579 Mon Sep 17 00:00:00 2001 From: Florrie Date: Thu, 31 May 2018 00:01:05 -0300 Subject: Seek controls --- index.js | 54 ------------------------------------------------------ 1 file changed, 54 deletions(-) (limited to 'index.js') diff --git a/index.js b/index.js index 5f592df..6a3c8f8 100644 --- a/index.js +++ b/index.js @@ -15,61 +15,7 @@ process.on('unhandledRejection', error => { process.exit(1) }) -class InternalApp extends EventEmitter { - constructor() { - super() - this.player = null - } - - async setup() { - this.player = await getPlayer() - } - - async startPlaying(arg) { - this.player.playFile(await this.download(arg)) - } - - stopPlaying() { - this.player.kill() - } - - seekAhead(seconds) { - this.player.seekAhead(seconds) - } - - seekBehind(seconds) { - this.player.seekBehind(seconds) - } - - togglePause() { - this.player.togglePause() - } - - download(arg) { - return getDownloaderFor(arg)(arg) - } -} - async function main() { - /* - const internalApp = new InternalApp() - await internalApp.setup() - - await internalApp.startPlaying('http://billwurtz.com/cable-television.mp3') - await new Promise(r => setTimeout(r, 2000)) - internalApp.togglePause() - await new Promise(r => setTimeout(r, 1000)) - internalApp.togglePause() - await new Promise(r => setTimeout(r, 2000)) - internalApp.stopPlaying() - */ - - /* - for (const item of require('./flat.json').items) { - await internalApp.download(item.downloaderArg) - } - */ - const interfacer = new CommandLineInterfacer() const size = await interfacer.getScreenSize() -- cgit 1.3.0-6-gf8a5