Vixen
02b45cc4
csharp
public struct VideoSurface

An entity that is playing a video.

No guide page documents this yet — the page shows what the code says about itself.

Remarks

A managed component, and unavoidably one. A player owns a decoder, a thread and a pool of three-megabyte buffers; none of that fits in a chunk, and pretending otherwise would mean an index into a side table that the ECS already implements better than this module would. It is the same call Behavior and Material make, for the same reason, and it costs one indirection on a component that is touched once a frame per video — not once a frame per thousand entities.

Adding this component is what makes an entity's video advance, and removing it or destroying the entity is what stops it. The player is not disposed when the component goes away: it was constructed by whoever put it here, may be shared between entities, and disposing something the ECS did not create would be the ECS deciding a lifetime it was never told about.

Fields and properties (5)

  • public VideoPlayer? Player

    The player. Null is legal and means the entity is not playing anything yet.

  • public bool PlayOnStart

    Whether to call Play the first time the system sees it.

  • public bool OverridesLoop

    Whether the system should keep the player's own loop flag in step with Loop.

  • public bool Loop

    Whether the video restarts when it ends, when OverridesLoop is set.

  • public bool Started

    Set by the system once it has applied PlayOnStart.

Used by (3)

  • VideoSurfaceUploaderVixen.Video.Rendering
  • VideoSystemVixen.Video
  • VideoSystemTestsVixen.Video.Tests