Table of Contents

Method TriggerAsync

Namespace
OBSStudioClient.Model
Assembly
OBSClient.dll

TriggerAsync(CancellationToken)

Triggers the transition of studio mode (the Transition button): the preview scene becomes the program scene. It returns when the model shows that a transition runs.

public Task TriggerAsync(CancellationToken cancellationToken = default)

Parameters

cancellationToken CancellationToken

A token that ends the wait. A change that was not sent yet is not sent.

Returns

Task

A task that completes when a transition has started since the call was made, or runs already, or when the model has been read again after the events did not show it.

Remarks

The call returns when the transition has started, not when it has ended: IsRunning and VideoEnded say when it ends. Measured with OBS Studio 33.0.0: the program scene is the old preview scene from the start (ProgramScene shows it, as soon as the model has read it), and the preview scene becomes the old program scene when the transition has ended. OBS Studio does nothing when a transition runs already: the call returns at once then. It makes a transition from the preview scene when that is the program scene too.

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 answered, and the model does not show that a transition started: the events did not show it in time, and the model could not be read again in time. Do not send the change again.

ObsResponseException

OBS Studio refused the change: studio mode is off (ErrorCode is StudioModeNotActive).