Remote Assets & Media
Loading media and assets at runtime: RemoteMediaModule, remote references, dynamic resources, and image upload.
Commonly used
RemoteMediaModuleAllows the Lens to download and integrate remote media content such as 3D GLTF assets, images, audio tracks, and video textures into Lenses.RemoteReferenceAssetProvides a reference to a remote asset (i.e. assets outside of the Lens size limit) that can be downloaded at runtime using script.DynamicResourceA resource that is resolved at runtime.ImageUploadOptionsProvides configuration options for uploading images via RemoteMediaModule.uploadImage.
Guides
StorageCreate a Snap Cloud storage bucket and download images, 3D models, and audio from it into a SPECS Lens.Edge FunctionsDeploy a Snap Cloud edge function from the dashboard and call it from a SPECS Lens, with a sum example and an image round trip through Storage.Remote AssetsRemote Assets offers developers a way to store assets within Lens Cloud to dynamically load their created content into Lenses at runtime.Remote AssetsLoad textures, audio, and other resources hosted by the connected mobile app into a Lens on SPECS with Mobile Kit and the spectacleskit:// scheme.
All APIs in this topic
Reference assets and other modules with a script input and require modules with require('LensStudio:<name>').
Components, assets, and modules
| API | Description |
|---|---|
| RemoteMediaModule | Allows the Lens to download and integrate remote media content such as 3D GLTF assets, images, audio tracks, and video textures into Lenses. |
| RemoteReferenceAsset | Provides a reference to a remote asset (i.e. assets outside of the Lens size limit) that can be downloaded at runtime using script. |
Objects and data
| API | Description |
|---|---|
| DynamicResource | A resource that is resolved at runtime. |
| ImageUploadOptions | Provides configuration options for uploading images via RemoteMediaModule.uploadImage. |
| RestrictedResource | A DynamicResource whose raw data cannot be retrieved as bytes or string. |
Enums
| API | Description |
|---|---|
| ImageUploadCompressionMethod | Specifies the compression format to use when uploading an image. |
Related topics
Graphics, Materials & Particles › Meshes & EffectsMesh visuals and mesh building, VFX, post effects, and Gaussian splats.Cloud, Networking & Storage › Internet AccessCalling the open internet: InternetModule, fetch requests and responses, headers, and blobs.Graphics, Materials & Particles › Textures & VideoTexture assets and providers, video playback and recording, and media pickers.