A video file in the asset library, with its playback duration and frame size recorded alongside the stored file. It specialises BinaryAsset through VisualAsset, so a video also carries the content hash, file size and CDN address of the underlying file, plus the height and width of the frame. Server side JavaScript gets one by calling uploadVideo on the asset manager, and uploadBinaryAsset returns one whenever the content type of the upload starts with video. The thumbnail of a video is a separate image asset linked to it by a relation, so read it with getRelations rather than expecting it here.
Group: Assets
Extends: VisualAsset
Properties
| Property | Returns | Description |
|---|---|---|
| durationSecs | int | Length of the video in whole seconds, taken from the media details when the file was uploaded. Zero when the duration was never worked out, for example when the media details could not be read. |
Inherited from VisualAsset
Properties
| Property | Returns | Description |
|---|---|---|
| height | int | The height of the image or video in pixels. |
| width | int | The width of the image or video in pixels. |
Methods
getHeight()
Returns: int
The height of the image or video in pixels.
getWidth()
Returns: int
The width of the image or video in pixels.
Inherited from BinaryAsset
Properties
| Property | Returns | Description |
|---|---|---|
| cdnUrl | String | Address to serve the file from a content delivery network, set when the asset has been published to a CDN. Null when the file should be served from the platform itself. |
| fileSize | Long | Size of the file in bytes, as recorded when it was stored. Where the asset has alternative formats this is the size of the primary representation only, and it is null when the size was never worked out. |
| hash | String | The SHA-1 hash of the file's content, which is how the bytes are located in the hash store. Duplicating an asset shares the same hash rather than copying the bytes. |
Methods
getHash()
Returns: String
The SHA-1 hash of the file's content, which is how the bytes are located in the hash store. Duplicating an asset shares the same hash rather than copying the bytes.
getFileSize()
Returns: Long
Size of the file in bytes, as recorded when it was stored. Where the asset has alternative formats this is the size of the primary representation only, and it is null when the size was never worked out.
getCdnUrl()
Returns: String
Address to serve the file from a content delivery network, set when the asset has been published to a CDN. Null when the file should be served from the platform itself.
Inherited from Asset
Properties
| Property | Returns | Description |
|---|---|---|
| allRelations | List<Relation> | Every relation which points from this asset to another one, for example the thumbnail of a video. This reads the relations from the database, so treat it as a query rather than as a cheap field read. |
| assetTypes | List<String> | The asset type names this asset is tagged with, which is how the library is filtered into groups such as banners or product shots. Types are applied when the asset is uploaded and can be added afterwards, and the list is empty rather than null when the asset has none. |
| authorProfileId | Long | Identifier of the profile which created the asset, where that was recorded. Null for assets which were not attributed to a person. |
| createdDate | Date | When the asset was first added to the library. Duplicating an asset keeps the created date of the asset it was copied from. |
| format | String | The media format of the asset, for example image, video, text, or a media type such as text and html. Treat it as the asset's type; searching the library matches on this as well as on the name, and uploading through the asset manager routes on it to decide whether an image, a video or a plain binary file is created. |
| language | String | Language code for the asset's content, used to pick the right variant when the same asset exists in several languages. Null when the asset is not language specific. |
| modifiedDate | Date | When the asset was last changed. It is set by whatever updates the asset, so it is only as accurate as the code which maintains it. |
| name | String | Human readable name for the asset, used when searching the library and when listing assets. It is not guaranteed to be unique within a tenant. |
| notes | String | Free text notes about the asset, describing what it is or how it should be used. Set when the asset is uploaded, and null when nothing has been recorded. |
| relatedEntityId | Long | Identifier of a profile or organisation this asset relates to, typically set when the asset is a contract document belonging to one specific person or organisation. Null for a general library asset. It can be set when uploading through the asset manager by passing a related entity id. |
| uniqueId | String | A globally unique identifier for the asset, usually a UUID. This is the stable handle to refer to an asset by, so use it rather than a database id when linking to an asset from content, and note that a duplicated asset is given a fresh one. |
Methods
getUniqueId() · getName() · getAuthorProfileId() · getRelatedEntityId() · getCreatedDate() · getModifiedDate() · getFormat() · getNotes() · getAssetTypes() · getLanguage() · getAllRelations() · getRelations(String predicate) · getRelationsTo(String predicate)
getUniqueId()
Returns: String
A globally unique identifier for the asset, usually a UUID. This is the stable handle to refer to an asset by, so use it rather than a database id when linking to an asset from content, and note that a duplicated asset is given a fresh one.
getName()
Returns: String
Human readable name for the asset, used when searching the library and when listing assets. It is not guaranteed to be unique within a tenant.
getAuthorProfileId()
Returns: Long
Identifier of the profile which created the asset, where that was recorded. Null for assets which were not attributed to a person.
getRelatedEntityId()
Returns: Long
Identifier of a profile or organisation this asset relates to, typically set when the asset is a contract document belonging to one specific person or organisation. Null for a general library asset. It can be set when uploading through the asset manager by passing a related entity id.
getCreatedDate()
Returns: Date
When the asset was first added to the library. Duplicating an asset keeps the created date of the asset it was copied from.
getModifiedDate()
Returns: Date
When the asset was last changed. It is set by whatever updates the asset, so it is only as accurate as the code which maintains it.
getFormat()
Returns: String
The media format of the asset, for example image, video, text, or a media type such as text and html. Treat it as the asset's type; searching the library matches on this as well as on the name, and uploading through the asset manager routes on it to decide whether an image, a video or a plain binary file is created.
getNotes()
Returns: String
Free text notes about the asset, describing what it is or how it should be used. Set when the asset is uploaded, and null when nothing has been recorded.
getAssetTypes()
Returns: List<String>
The asset type names this asset is tagged with, which is how the library is filtered into groups such as banners or product shots. Types are applied when the asset is uploaded and can be added afterwards, and the list is empty rather than null when the asset has none.
getLanguage()
Returns: String
Language code for the asset's content, used to pick the right variant when the same asset exists in several languages. Null when the asset is not language specific.
getAllRelations()
Returns: List<Relation>
Every relation which points from this asset to another one, for example the thumbnail of a video. This reads the relations from the database, so treat it as a query rather than as a cheap field read.
getRelations(String predicate)
Returns: List<Relation>
Finds the relations of one kind which point from this asset to another, for example the thumb relation from a video to its thumbnail image. This reads from the database, so treat it as a query rather than as a cheap field read.
| Parameter | Description |
|---|---|
predicate | the name of the relationship to match, usually the type of the relationship to the object, for example "thumb" |
getRelationsTo(String predicate)
Returns: List<Relation>
Finds the relations of one kind which point at this asset from other assets, in other words the reverse of getRelations. This reads from the database, so treat it as a query rather than as a cheap field read.
| Parameter | Description |
|---|---|
predicate | the name of the relationship to match, for example "thumb" to find the assets which use this asset as their thumbnail |
Methods
getDurationSecs()
Returns: int
Length of the video in whole seconds, taken from the media details when the file was uploaded. Zero when the duration was never worked out, for example when the media details could not be read.