Skip to content

Commit

Permalink
Introduce RS_INPUTSTREAM environment variable
Browse files Browse the repository at this point in the history
  • Loading branch information
ioppermann committed May 9, 2019
1 parent 52a6446 commit 6587bd6
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
8 changes: 8 additions & 0 deletions conf/live.json
Original file line number Diff line number Diff line change
Expand Up @@ -322,6 +322,14 @@
"defaultValue": "false",
"required": false,
"description": "Enables HTTPS support for admin interface and embeddable player."
},
{
"name": "RS_INPUTSTREAM",
"alias": [],
"type": "string",
"defaultValue": "",
"required": false,
"description": "Automatically start pulling from this stream on a fresh Restreamer installation."
}
]
}
8 changes: 8 additions & 0 deletions src/classes/RestreamerData.js
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,14 @@ class RestreamerData {
'repeatToOptionalOutput': 'stop'
}
};

// Set stream source and start streaming on a fresh installation
if(process.env.RS_INPUTSTREAM != '') {
defaultStructure.addresses.srcAddress = process.env.RS_INPUTSTREAM;
defaultStructure.states.repeatToLocalNginx.type = 'connected';
defaultStructure.userActions.repeatToLocalNginx = 'start';
}

logger.debug(`Error reading "v1.db": ${error.toString()}`);
if (!fs.existsSync(dbPath)) {
fs.mkdirSync(dbPath);
Expand Down

0 comments on commit 6587bd6

Please sign in to comment.