From 87215a808382aee7d86537e78b4f18458e303d5d Mon Sep 17 00:00:00 2001 From: peter Date: Fri, 12 Aug 2022 08:27:36 +0000 Subject: [PATCH] add stream stage toggle option --- HELP.md | 5 ++++- index.js | 11 ++++++++++- package.json | 2 +- 3 files changed, 15 insertions(+), 3 deletions(-) diff --git a/HELP.md b/HELP.md index c0f692c..d7e7986 100644 --- a/HELP.md +++ b/HELP.md @@ -26,4 +26,7 @@ Retrieve the 'Video Mode', 'Quality' and 'Platform' options from device Add support for custom streaming profiles ## Version 1.0.5 -Add help text \ No newline at end of file +Add help text + +## Version 1.0.6 +Add streaming control 'Toggle' option diff --git a/index.js b/index.js index 76ee145..054a031 100644 --- a/index.js +++ b/index.js @@ -438,6 +438,7 @@ instance.prototype.actions = function () { choices: [ { id: 'Start', label: 'Start' }, { id: 'Stop', label: 'Stop' }, + { id: 'Toggle', label: 'Toggle' }, ], }, ], @@ -505,7 +506,15 @@ instance.prototype.action = function (action) { var cmd if (action.action === 'stream') { - cmd = 'STREAM STATE:\nAction: ' + action.options.stream_control + '\n\n' + if (action.options.stream_control === 'Toggle') { + if (self.streaming === 'Streaming') { + cmd = 'STREAM STATE:\nAction: Stop\n\n' + } else { + cmd = 'STREAM STATE:\nAction: Start\n\n' + } + } else { + cmd = 'STREAM STATE:\nAction: ' + action.options.stream_control + '\n\n' + } self.log('debug', cmd) } diff --git a/package.json b/package.json index fdfe5d1..164f712 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "bmd-webpresenterhd", - "version": "1.0.5", + "version": "1.0.6", "api_version": "1.0.0", "keywords": [ "Streaming", "Web Encoder", "Livestream"