25. Change the clip or its settings
extends "res://scripts/runtime/script_base.gd"func run(_context: Dictionary = {}) -> Variant:
await ChangeGUIElementProperty({
"guiId": "video_lab",
"elementId": "briefing_video",
"property": "assetId",
"value": "workshop_clip"
})
var player := GetGUIElementProperty(
"video_lab", "briefing_video", "video_player", null
) as VideoStreamPlayer
if player == null or player.stream == null:
return false
player.paused = false
player.play()
return trueChanging assetId applies the new definition and loads the new stream. Obtain the player and check its stream before issuing the next playback command.
Other Video property changes also reapply the definition in this build. That can stop the current clip, restore authored Loop and Muted values and request Autoplay again. Do not use repeated property edits as a way to animate a movie’s volume or progress every frame.
| Change | Useful approach |
|---|---|
| A different clip | Change assetId, check the new stream, then play deliberately. |
| Live player volume | Use the obtained player’s volume_db. |
| Pause / resume | Use the player’s paused flag. |
| Background image | Set up the appearance before playback when possible. |
