setAsset setasset

JavaScript API reference for Mixed Media 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-4fb77a645fdd45b3aaa5079c31e3bb05

*asset* - { String} new asset ID or explicit mixed media set, with optional Image Serving modifiers appended after ?.

Images which use IR (Image Rendering) or UGC (User-Generated Content) are not supported by this viewer.

*data* - { JSON} location of the new caption file.

If not specified, the caption button is not visible in the user interface. Captions specified with this parameter apply to the video that comes first in the mixed media set; subsequent videos play without captions. This viewer supports the following component IDs:

Component ID
Viewer SDK component class name
posterimage

Image to display on the first frame before the video starts playing.

See VideoPlayer.posterimage.

caption

Location of the new caption file.

If not specified, the caption button is not visible in the user interface. Captions specified with this parameter apply to the video that comes first in the media set. Subsequent videos play without captions.

Returns section-1d3cf85bc7cc4dfe9670e038d02b9101

None.

Example section-9e9332aa86b74a5fb321375c03fdc5b3

Single media set reference:

<instance>.setAsset("Scene7SharedAssets/Mixed_Media_Set_Sample")

Explicit media set:

<instance>.setAsset("Scene7SharedAssets/Backpack_J;;advanced_image;,Scene7SharedAssets/Frame-6;;advanced_image;,Scene7SharedAssets/Frame-2;;advanced_image;,Scene7SharedAssets/SpinSet_Sample;;spin;,Scene7SharedAssets/ImageSet-Colors-Sample;;advanced_swatchset;,Scene7SharedAssets/Glacier_Climber_640x360;Scene7SharedAssets/Glacier_Climber_640x360;video;")

Sharpening modifier added to all images in the set:

<instance>.setAsset("Scene7SharedAssets/Mixed_Media_Set_Sample?op_sharpen=1")
recommendation-more-help
b7426f53-aad9-4c00-83fc-664f30f681e8