Method TogglePauseAsync
- Namespace
- OBSStudioClient.Model
- Assembly
- OBSClient.dll
TogglePauseAsync(CancellationToken)
Pauses the recording when it is not paused, and resumes it when it is, and returns when the model shows it.
public Task<bool> TogglePauseAsync(CancellationToken cancellationToken = default)
Parameters
cancellationTokenCancellationTokenA token that ends the wait. A change that was not sent yet is not sent.
Returns
Remarks
OBS Studio decides by itself what to do, so two toggles that are asked for one after the other make two toggles. As with PauseAsync(CancellationToken), OBS Studio can answer success and not pause (a recording that cannot be paused, or that does not run): the model is read again then, and the result is what IsPaused shows.
See SetEnabledAsync(bool, CancellationToken) for the order of changes and the wait.
Exceptions
- ObsNotConnectedException
There is no connection to OBS Studio. Nothing was changed.
- ObsNotReadyException
OBS Studio is changing its scene collection, or did so after the call. Nothing was changed.
- ObsUnknownOutcomeException
OBS Studio did not answer in time, or the connection ended: it is not known whether it made the change.
- ObsNotConfirmedException
OBS Studio made the change, and the model does not show it. Do not send the change again.
- ObsResponseException
OBS Studio refused the change.