HasActivePlayback(handle)
Description
Section titled âDescriptionâThe HasActivePlayback Lua function returns a boolean indicating if an object has a currently active playback, for instance, if a sequence has an active cue.
Arguments
Section titled âArgumentsâ-
Handle:
The function takes a handle of the type âlight_userdataâ as an argument.
It can be omitted when using the colon notation on an object.The Colon Notation is a way to omit the handle as the first argument when using the Object functions.
This is the general syntax with the colon notation: object:function()
This is the general syntax with standard handle notation: object.function(object)
Learn more in the Lua Functions - Object API topic.
-
Boolean:
The function returns a boolean indicating the playback status:- True: There is active playback.
- False: There is no active playback.
Example
Section titled âExampleâTo return the information if the selected sequence has an active playback, create a plugin with this code:
| Copy CodeLua |
| ``` |
| return function() |
-- Stores the handle of the selected sequence.local selectedSequence = SelectedSequence()
-- The following 'if' gives different feedback based on the playback status.if selectedSequence:HasActivePlayback() then Printf("Sequence '" ..selectedSequence.name.. "' has active playback.")else Printf("Sequence '" ..selectedSequence.name.. "' has NO active playback.")endend