Show Menu
TOPICS×

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

* 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.
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

None.

Example

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")