Table of Contents

Method GetActivityAsync

Namespace
OBSStudioClient.Model
Assembly
OBSClient.dll

GetActivityAsync(CancellationToken)

Asks OBS Studio whether the scene or the input is on the air, and whether it is shown anywhere.

public Task<SourceActiveResponse> GetActivityAsync(CancellationToken cancellationToken = default)

Parameters

cancellationToken CancellationToken

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

Returns

Task<SourceActiveResponse>

VideoActive: whether it is shown in the program. VideoShowing: whether it is shown in the user interface of OBS Studio (the preview, a projector, the window of its properties).

Remarks

The answer is the state at the moment that OBS Studio answered; it changes as the program changes. The request is made in its turn, after the changes that were asked for before it (see SetEnabledAsync(bool, CancellationToken)), but a change that OBS Studio has answered may not have reached the picture yet.

Exceptions

ObsRemovedException

The scene or input was destroyed.

ObsNotConnectedException

There is no connection to OBS Studio.

ObsNotReadyException

OBS Studio is changing its scene collection, or did so after the call.

TimeoutException

OBS Studio did not answer in time (WriteTimeout).

ObsResponseException

OBS Studio refused the request.