diff --git a/src/config.ts b/src/config.ts index 09057a0..ba1bd48 100644 --- a/src/config.ts +++ b/src/config.ts @@ -21,6 +21,9 @@ export interface IConfig { /** Which channels/layers to put on the grid by default */ defaultRegions?: DefaultRegion[] + + /** If true, sends clear commands on startup */ + clearOnStartup?: boolean } export interface ChannelSetup { /** CasparCG channel number (starting on 1) */ diff --git a/src/imageProvider.ts b/src/imageProvider.ts index 02d4acf..44e93b5 100644 --- a/src/imageProvider.ts +++ b/src/imageProvider.ts @@ -101,12 +101,14 @@ export class ImageProvider { } } - // Reset casparCG channels on startup: - await Promise.all( - _.map(this.channelSetup, channel => { - return this.casparcg.clear(channel.channel) - }) - ) + if (config.clearOnStartup) { + // Reset casparCG channels on startup: + await Promise.all( + _.map(this.channelSetup, channel => { + return this.casparcg.clear(channel.channel) + }) + ) + } await this.initStreamsFromConfig() } reset () {