SplitmediaLabsLimited / xjs

XSplit JS Framework. Make plugins for XSplit Broadcaster, quickly and easily.
Other
39 stars 11 forks source link

Unable to pause and unpause local recording #204

Closed ravenjohn closed 4 years ago

ravenjohn commented 6 years ago

Issue

xjs.Output.unpauseLocalRecording() and xjs.Output.pauseLocalRecording() is not working.

Version

Proposal

After investigating the source code, I found out that the pauseRecording and unpauseRecording calls are missing the output name when being called.

Currently:

245 |            exec('CallHost', 'pauseRecording');
...
275 |            exec('CallHost', 'unpauseRecording');

See output.ts#L245 and output.ts#L275.

Should be:

245 |            exec('CallHost', 'pauseRecording', 'Local Recording');
...
275 |            exec('CallHost', 'unpauseRecording', 'Local Recording');

Code can be improved by declaring Local Recording as a constant/static string.

SML-MeSo commented 6 years ago

Upon rechecking, it is because pauseRecording and unpauseRecording are indeed instance methods, and can only be called on an Output object with a name of Local Recording. This may merit a discussion, since we cannot simply add Local Recording statically because it may not be installed in the user's XBC outputs. Or maybe we can, we just error out or reject when recording is called when not installed. Again, merits a discussion. :)

mikeybanez commented 6 years ago

Yes, those two methods are, for now, instance methods for Output instances. However, I think our previous experience with recording-based plugins has shown us some edge cases to consider.

It is impossible to totally remove the Local Recording plugin; the plugin store does not allow this. So you can assume that the plugin is always there, but it could be potentially unconfigured for new users. I think it was stated in JIRA (XBCPLUGINS-1014) that an unconfigured local recording plugin will not appear in the internal method getBroadcastChannelList, but it is possible to start recording anyway by calling startBroadcast with the string "Local Recording". (This means there could be cases where we cannot get the correct instance of the Output object for recordings.)

With that in mind, perhaps we should first see if we can actually programmatically pause and unpause even in the unconfigured case, by manually adding "Local Recording" to the internal functions? If so, it could make sense to consider moving these two special functions as static members of Output (though at the moment I cannot predict if future XBC changes will require us to rethink that paradigm again).

ghost commented 5 years ago

Either ways, it should be safe to call pauseRecording and unpauseRecording even if pre-stream dialog is visible.