Skip to reading
3D Models & Video in GUIs

Resume continues; Stop ends the current play

Edition 0.86.4.1 HF1

0.86.4.1 Hotfix 1 edition. Earlier lessons and screenshots retain their original version context; revised references and supplements describe the newer behavior.

Download PDFView PDF page

For Resume, copy the Pause script and change only the final assignment:

Code example
player.paused = false

Do not add player.play() to a simple Resume command; that restarts the clip. Resume is meaningful after a pause, while Play / Restart is the appropriate command after a stop.

Here is a complete Stop script:

Code example
extends "res://scripts/runtime/script_base.gd"
Code example
func run(_context: Dictionary = {}) -> Variant:
    var player := GetGUIElementProperty(
        "video_lab", "briefing_video", "video_player", null
    ) as VideoStreamPlayer
    if player == null:
        return false
    player.stop()
    player.paused = false
    return true
Source table from Resume continues; Stop ends the current play, page 31
ButtonIntended result
Play / RestartStart again from the beginning.
PauseKeep the current playback suspended.
ResumeClear the pause without restarting.
StopEnd the current playback; use Play / Restart to begin again.

Do not depend on Stop preserving a particular still frame or revealing the fallback poster. Use a separate Image if your design requires a specific stopped display.

Page 31 of 45Permalink
Go to page