Video in Anark Studio 2.5
Instance Properties
name | type | description |
---|---|---|
active | Boolean | Should this asset be drawn? [from Asset] |
balance | Number | Left-to-right balance of the audio. |
behaviors | Collection | (read only) All Behavior objects attached under this asset. [from Asset] |
buffered | Boolean | (read only) Is the video buffered and ready to play? |
constructor | Object | A reference to the constructor class for the current object instance. [from Object] |
context | TimeContext | (read only) The asset's local TimeContext object. [from Asset] |
contextType | Number | Type of the TimeContext for this asset. [from Asset] |
endLifeTime | Number | Ending time of the asset. [from Asset] |
id | Number | (read only) Unique ID for the asset. [from Asset] |
loop | Boolean | Should the video continuously loop? |
music | Collection | (read only) All Music objects attached under this asset. [from Asset] |
name | String | User-defined name for the asset. [from Asset] |
parent | Object | (read only) Parent object of this asset. [from Asset] |
prototype | Object | The prototype for a class. [from Object] |
remoteSource | String | (read only) URL to the source for the video. |
sounds | Collection | (read only) All Sounds objects attached under this asset. [from Asset] |
startLifeTime | Number | Starting time of the asset. [from Asset] |
type | String | (read only) Type of the asset. [from Asset] |
volume | Number | Loudness of the video's audio track. |
Instance Methods
name | returns | description |
---|---|---|
attach(assetObject) | (none) | Attach the argument underneath the asset. [from Asset] |
copy() | Asset | Create a copy of the asset. [from Asset] |
detach(assetObject) | (none) | Remove an asset from this asset. [from Asset] |
hasOwnProperty(propertyOrMethodName) | Boolean | Determines if the object/instance itself has the named property or method. [from Object] |
isPrototypeOf(instanceToTest) | Boolean | Determines if the calling object prototype is in the inheritance chain for the supplied argument. [from Object] |
pause() | (none) | Pause playback. |
play() | (none) | Start playing the video. |
propertyIsEnumerable(propertyOrMethodName) | Boolean |
Determines if the object/instance itself has a property or method of the supplied name which will appear in a for (prop in obj) enumeration.
[from Object]
|
seek(position) | (none) | Move to a specific time in the video. |
startBuffering() | (none) | Start downloading and buffering the video. |
stop() | (none) | Stop playing the video. |
toLocaleString() | String |
For most objects, the same as toString() unless explicitly overridden.
[from Object]
|
toString() | String | Returns a string representation of the object. [from Object] |
valueOf() | String |
Returns the internal this value of the object.
[from Object]
|
Description
The Video object is a type of asset that encapsulates a video file, which may contain a snippet of a video or even an entire movie.
New videos can be created via scripting. The Library asset constructor creates a new instance of the object from a resource in the Anark Studio Library. Videos cannot be created using the scripting constructor because there would be no way to assign a remoteSource (which is read-only) to the video. Objects created via scripting are not available to the Anark Studio interface, but they do appear in the finished project.
Library asset constructor syntax
var theLight = new Light( "library://libraryAssetName" [, objectToAttachTo] );
libraryAssetName
- required — A String with the name of the asset in the Anark Studio Library from which to create this object.
objectToAttachTo
- optional — The String name of the object to which the video will be attached. The video must be attached to an object in the scene either now or later in order to appear in the scene during playback.
Scripting object constructor syntax
var theLight = new Light( [sceneGraphName] [, objectToAttachTo] );
sceneGraphName
- optional — A String with the name for the new layer in the scene graph.
objectToAttachTo
- optional — The String name of the object to which the video will be attached. Videos can only be attached to layers or to materials. The video must be attached to an object in the scene either now or later in order to appear in the scene during playback.
Video Examples
// Create a new image from an mpeg in the library and start playing.
var theMovie = new Video ( "library://Rain", "blueMaterial" );
theMovie.volume = 80;
theMovie.loop = true;
Arguments that are a Video
name | in method | of object | description |
---|---|---|---|
libraryResource | isBuffered(libraryResource) | Presentation | The Video (or Music) file to b |