diff options
| author | Jibon Costa <jiboncosta57@gmail.com> | 2020-04-01 13:33:59 +0600 |
|---|---|---|
| committer | Jibon Costa <jiboncosta57@gmail.com> | 2020-04-01 13:33:59 +0600 |
| commit | af776feee533e0d8244840c751b1a2254c1d432b (patch) | |
| tree | 431389a5bfae8ef25858d8db99c427503897380e /liveRTMP.js | |
| parent | 1b9b7e254aaba5fcb9ff3bbd79fa5613cdc406e4 (diff) | |
| download | bbb-recorder-af776feee533e0d8244840c751b1a2254c1d432b.tar.gz bbb-recorder-af776feee533e0d8244840c751b1a2254c1d432b.zip | |
live rtmp reconnect & google chrome use
Diffstat (limited to 'liveRTMP.js')
| -rw-r--r-- | liveRTMP.js | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/liveRTMP.js b/liveRTMP.js index 4e35857..7c83b23 100644 --- a/liveRTMP.js +++ b/liveRTMP.js @@ -3,7 +3,9 @@ const Xvfb = require('xvfb'); var exec = require('child_process').exec; const fs = require('fs'); var config = JSON.parse(fs.readFileSync("config.json", 'utf8')); -const homedir = require('os').homedir(); +const os = require('os'); +const homedir = os.homedir(); +const platform = os.platform(); const ffmpegServer = config.ffmpegServer + ":" + config.ffmpegServerPort + "/auth/" + config.auth; @@ -28,15 +30,22 @@ var options = { `--window-size=${width},${height}`, ], } +if(platform == "linux"){ + options.executablePath = "/usr/bin/google-chrome" +}else if(platform == "darwin"){ + options.executablePath = "/Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome" +} async function main() { try{ - xvfb.startSync() + if(platform == "linux"){ + xvfb.startSync() + } var url = process.argv[2], duration = process.argv[3], exportname = 'liveMeeting.webm' - if(!url){ url = 'http://tobiasahlin.com/spinkit/' } + if(!url){ url = 'https://www.mynaparrot.com/' } //if(!duration){ duration = 10 } const browser = await puppeteer.launch(options) @@ -92,8 +101,11 @@ async function main() { await page.waitForSelector('html.downloadComplete', {timeout: 0}) await page.close() await browser.close() - xvfb.stopSync() + if(platform == "linux"){ + xvfb.stopSync() + } + fs.unlinkSync(homedir + "/Downloads/liveMeeting.webm"); }catch(err) { |
