setAsset setasset

JavaScript API reference for Video Viewer.

setAsset(asset[, data])

Sets the new asset and optional additional asset data. You can call this parameter at any time, either before or after init(). If it is called after init(), the viewer swaps the asset at runtime.

See also init.

Parameters section-e030b401b966469cb5dd121501161c2a

asset
{ String } new asset ID.
data

{ JSON } JSON object with the following optional fields (case-sensitive):

  • posterimage - Image to display on the first frame before the video starts playing. See VideoPlayer.posterimage.
  • caption - location of the new closed caption file. If the file is not specified, the closed caption button is not visible in the user interface.
  • navigation - URL or path to WebVTT navigation content. The WebVTT file should be served by Image Serving

Returns section-1d3cf85bc7cc4dfe9670e038d02b9101

None.

Example section-9e9332aa86b74a5fb321375c03fdc5b3

<instance>.setAsset("Scene7SharedAssets/Glacier_Climber_MP4")
recommendation-more-help
b7426f53-aad9-4c00-83fc-664f30f681e8