Wikitude ARchitect v3.2 API Documentation

Wikitude ARchitect > AR > VideoDrawable
Filters

Class VideoDrawable - extends Drawable2D

VideoDrawable encapsulates a video to be used as visual representation of an ARObject. The video must be encoded using the H.264 video compression standard.

The default anchor settings for a VideoDrawable are as follows:
  • horizontal anchor: AR.CONST.HORIZONTAL_ANCHOR.CENTER
  • vertical anchor: AR.CONST.VERTICAL_ANCHOR.MIDDLE

VideoDrawables can be rendered with transparent pixels. See here for details. On creation, setup parameters can be passed to customize the properties of the VideoDrawable.

Example:
var video = new AR.VideoDrawable("assets/video.mp4", 0.5, {
offsetX: 0.2,
offsetY: 0.2
});

Constructor

VideoDrawable ( uri , height , options )
Parameters:
uri <string> The URI to the video.
height <float> The height of the VideoDrawable, in SDUs. The height is set at creation time, width is calculated according to the aspect ratio of the video.
options <object> Setup-Parameters to customize additional object properties.

Accepted options-properties are
  • enabled
  • horizontalAnchor
  • verticalAnchor
  • offsetX
  • offsetY
  • zOrder
  • rotation
  • scale
  • opacity
  • onClick
  • onFinish
  • roll
  • tilt
  • heading
  • onLoaded
  • onPlaybackStarted
  • onFinishedPlaying
  • onError
  • isTransparent
  • indicated that the VideoDrawables contains transparent pixels. See here for details.

Properties

height - float

The VideoDrawable's height in SDUs. The width of the VideoDrawable will be calculated accordingly based on the aspect ratio of the playing video.

Methods

getUri

string getUri ( )
Returns the URI the VideoDrawable is pointing to
Returns: string
the URI, as set at creation time.

isTransparent

boolean isTransparent ( )
Returns whether the VideoDrawable has the transparent flag set
Returns: boolean
The isTransparent setting.

onError

void onError ( )
The trigger will fire when the Video file cannot be loaded or played.

The trigger is null by default, and will thus result in no action executed when the trigger fires. A developer can add custom functionality by assigning a custom function to onError.
Returns: void

onFinishedPlaying

void onFinishedPlaying ( )
The trigger will fire just after the Video file finished playing.

The trigger is null by default, and will thus result in no action executed when the trigger fires. A developer can add custom functionality by assigning a custom function to onFinishedPlaying.
Returns: void

onLoaded

void onLoaded ( )
The trigger will fire when the Video file was loaded.

The trigger is null by default, and will thus result in no action executed when the trigger fires. A developer can add custom functionality by assigning a custom function to onLoaded.
Returns: void

onPlaybackStarted

void onPlaybackStarted ( )
The trigger will fire just before the Video file starts playing.

The trigger is null by default, and will thus result in no action executed when the trigger fires. A developer can add custom functionality by assigning a custom function to onPlaybackStarted.
Returns: void

pause

void pause ( )
Pauses playing this video. To resume from the time the file was paused, call resume(). If play() is called on a paused file, the play will start from the very beginning.
Returns: void

play

void play ( loopTimes )
Plays the video.
Parameters:
loopTimes <int> Defines how often the video should be played in a row. A negative value indicates an infinite looping.
The parameter is optional and defaults to 1.
Returns: void

resume

void resume ( )
Allows a paused video to resume playing from the time the file was paused. In any other cases, resume() has the same effect as calling play(1).
Returns: void

stop

void stop ( )
Stops playing this video. onFinishedPlaying() will not be triggered after stop() has been called.
Returns: void

Methods inherited from Drawable2D:

Methods inherited from ARchitectObject:

Methods inherited from Drawable:


Copyright © 2013 Wikitude GmbH. All rights reserved.