DisplayAddObject: video

Top  Previous  Next

Message

 

DisplayAddObject <docname> <objectname> video <x> <y> <filename> [-loop | -noloop] [-wait | -playimmediate | -playwhenvisible] [-width x] [-height y] [-audio | -noaudio] [-top | -middle | -bottom] [-left | -centre | -right] [-backcolour <red> <green> <blue>]

 

Originator

 

Client

 

Response

 

General:

       SyntaxError: insufficient parameters to DisplayAddObject

       SyntaxError: invalid parameters to DisplayAddObject

       Error: document docname not found by DisplayAddObject

       Error: unknown object type

 

Video:

       SyntaxError: insufficient parameters to DisplayAddObject / video

       SyntaxError: invalid parameters to DisplayAddObject / video

       SyntaxError: Video given invalid size (DisplayAddObject/bitmap)

       Error: DisplayAddObject not possible, would create too many video views for document, use fewer or reconfigure WhiskerServer

       Error: DisplayAddObject not possible, current views for document don't support video, reconfigure WhiskerServer

       Error: failed to create video object

       Error: failed to load video file "filename"

       Info: added video "filename" to display document docname

 

Response (immediate socket)

 

Success

Failure

 

Details

 

Adds a video object.

 

Defaults: -noloop -wait -width -1 -height -1 -audio -left -top

 

x = x-coordinate of (by default) the top left point; the meaning of these coordinates can be changed by the vertical/horizontal alignment options below
y = y-coordinate of (by default) the top left point; the meaning of these coordinates can be changed by the vertical/horizontal alignment options below
filename = video filename, e.g. c:\test.wmv
-loop makes the video restart when it finishes
-noloop lets the video stop when it's finished
-wait loads the video but does not play it
-playimmediate begins playing the video immediately, even if there are no views, or the server is in the process of setting up the view
-playwhenvisible begins playing when the first view (subject view, not server view) is showing the video object
-width x = width to force the video to (specify height and width as -1 to use the native size, or omit)
-height y = height to force the video to (specify height and width as -1 to use the native size, or omit)
-audio allows audio to be played if DisplaySetAudioDevice has been set up before this video is loaded
-noaudio disables audio
–top | –middle | –bottom determines the vertical alignment (default is top). The top, middle (vertical centre), or bottom of the bitmap can be aligned to the y coordinate.
–left | –centre | –right determines the horizontal alignment (default is left). The left edge, centre, or right edge of the bitmap can be aligned to the x coordinate.
-backcolour sets the background colour of the video area when no video is being played or paused.

 

Restrictions on looping with very short videos

 

When a looping video ends, the main (GUI) thread restarts it. For very brief or single-frame videos, this causes excessive load on the GUI thread, so WhiskerServer appears to grind to a halt. The load is arbitrarily high: the video is started, stops immediately, says "restart me...", and so all spare GUI thread time is consumed. Therefore, Whisker will disable looping on any video shorter than (arbitrarily) 0.5 s.

 

What could you do instead? Well, you could (a) use a still image, if you're trying to use a single-frame video as a still image; (b) edit your video file yourself, repeating it until it's at least at the threshold length, and then Whisker will loop it happily.

 

Revision history

 

Looping restriction in WhiskerServer v4.5.

Implemented in WhiskerServer version 4.0.

Vertical/horizontal alignment options added in v4.2.1.

Background colour option added in v4.6.1.

 

See also

 

Video objects
Server / video configuration