Documentation
Docs/en/reference/video/embedded.md
Embedded Video Contract
Generated reference. Do not edit directly. Update
BuildTools/VideoInterface.json, then runpython BuildTools/docs_video.py --write.
| Index | Formats | Delivery | Decoding | Fullscreen | Embedded | Validation | Canonical JSON | Guide |
| Stable ID | Rule | Requirement | Why | Source |
|---|---|---|---|---|
video.embedded.create |
Script-owned playback creation | Use Game.CreateVideoPlayback(exactPath, looped) to create an independent ref-counted playback and texture. | The exported PassOwnership method loads the resource, constructs VideoClip, creates a texture, and stores both in VideoPlayback. | Source/Scripting/ClientGlobalScriptMethods.cpp |
video.embedded.missing-file |
Creation failure throws | Catch or prevent a missing script-owned video resource; creation throws Video file not found. | Unlike fullscreen PlayVideo, CreateVideoPlayback converts a missing ReadFile result into ScriptException. | Source/Scripting/ClientGlobalScriptMethods.cpp |
video.embedded.render-event |
RenderIface-only drawing | Call Game.DrawVideoPlayback only from Game.OnRenderIface handling. | The method throws outside the client script draw scope. | Source/Scripting/ClientGlobalScriptMethods.cpp |
video.embedded.positive-size |
Positive target size advances | Pass a positive width and height every frame; zero or negative size skips frame decode, texture upload, and drawing. | RenderFrame is called only inside the positive-size branch. | Source/Scripting/ClientGlobalScriptMethods.cpp |
video.embedded.rectangle |
Caller-owned rectangle and aspect | Choose and maintain the target rectangle and aspect policy in project UI code; the Engine draws exactly the supplied position and size. | DrawVideoPlayback constructs irect32 directly from the script arguments. | Source/Scripting/ClientGlobalScriptMethods.cpp |
video.embedded.stopped |
Stopped field lifecycle | Poll VideoPlayback.Stopped only after continuing to draw the instance; the flag becomes true when DrawVideoPlayback observes that the clip stopped. | The draw method clears resources and sets the exported field after the stop check. | Source/Scripting/ClientGlobalScriptMethods.cpp, Source/Client/Client.h |
video.embedded.null-noop |
Null and completed instances are no-ops | Passing null or an instance whose playback resources were cleared performs no draw and does not throw. | DrawVideoPlayback returns early for both states after enforcing render scope. | Source/Scripting/ClientGlobalScriptMethods.cpp |