User Tools

Site Tools


democap:behavior_ecbwindowvideoplayer

ECBWindowVideoPlayer

Behavior adding video player to renderable desktop using a borderless window.

Instance Counts

This element behavior can be present multiple times in a BehaviorElement. In this case use a unique identifier to distinguish the individual behavior instances.

Element Class Properties

Element class properties have the prefix windowVideoPlayer. or windowVideoPlayer({id}). if id is not empty.

guitheme

Gui theme to use.

  • Full name: windowVideoPlayer.guitheme or windowVideoPlayer({id}).guitheme
  • Type: string
  • Default Value: /content/gui/videoplayer.guitheme.xml
  • Expected File Type: *.guitheme.xml
  • Example (*.deeclass)
    <string name='windowVideoPlayer.guitheme'>/content/gui/videoplayer.guitheme.xml</string>

video

Video to play. Can be changed using behavior panel by the user.

  • Full name: windowVideoPlayer.video or windowVideoPlayer({id}).video
  • Type: string
  • Default Value: empty string
  • Expected File Type: *.webm (all video modules)
  • Example (*.deeclass)
    <string name='windowVideoPlayer.video'>/content/video/myVideo.webm</string>

Events

This behavior has no events.

Conversation Commands

This behavior adds no conversation commands.

Conversation Conditions

This behavior adds no conversation conditions.

Behavior Tree Actions

This behavior adds no behavior tree actions.

Behavior Tree Conditions

This behavior adds no behavior tree conditions.

Required Behaviors

Optional Behaviors

This behavior does not support optional behaviors.

API Documentation

Since DEMoCap Version 1.3

Use Cases

  • Play back video the user can change in the behavior properties panel.

Element Class Example

class MyElement extends BehaviorElementClass
  public var ECBehaviorComponent component
  public var ECBehaviorCollider collider
  public var ECBehaviorDynamicSkin dynamicSkin
  public var ECBehaviorRenderableDesktop renderableDesktop
  public var ECBBehaviorGuiPanels guiPanels
  public var ECBWindowVideoPlayer windowVideoPlayer
  func new()
    component = ECBehaviorComponent.new(this)
    collider = ECBehaviorCollider.new(this, component)
    dynamicSkin = ECBehaviorDynamicSkin.new(this, component)
    renderableDesktop = ECBehaviorRenderableDesktop.new(this, dynamicSkin)
    renderableDesktop.getRenderable().setValue("board")
    renderableDesktop.getSize().setPoint(Point.new(512, 256))
    renderableDesktop.getGuiTheme().setPath("/content/ui/adboard.guitheme.xml")
    guiPanels = ECBBehaviorGuiPanels.new(this)
    windowVideoPlayer = ECBWindowVideoPlayer.new(this, renderableDesktop, guiPanels)
  end
end

Behavior Factory

Using element class supporting adding behaviors the behavior can be added like this (again create an example which creates a valid element class):

<?xml version='1.0' encoding='UTF-8'?>
<elementClass name='MyClass' class='GenericBehaviorElement'>
  <behavior type='ECBehaviorComponent'/>
  <behavior type='ECBehaviorCollider'/>
  <behavior type='ECBehaviorDynamicSkin'/>
  <behavior type='ECBehaviorRenderableDesktop'>
    <string name='.renderable'>display</string>
  </behavior>
  <behavior type='ECBBehaviorGuiPanels'>
 
  <behavior type='ECBWindowVideoPlayer'>
    <!-- optional: use renderable desktop with id instead of empty string -->
    <string name='renderableDesktop'>second</string>
 
    <!-- set element properties. omit property prefix if used inside behavior tag -->
    <string name='.guitheme'>/content/gui/videoplayer.guitheme.xml</string>
  </behavior>
 
  <!-- for adding multiple behaviors use unique identifiers -->
  <behavior type='ECBWindowVideoPlayer' id='second'/>
</elementClass>

Live Examples

You could leave a comment if you were logged in.
democap/behavior_ecbwindowvideoplayer.txt · Last modified: 2025/03/22 19:43 by dragonlord