Image AR
Image AR collections correspond to the image2d-tracking type.
The biggest difference from a single Image AR scene is:
- the collection opens a "collection container" first rather than a specific scene
- you receive
readyfirst, along withcollectionInfoandCollectionApi - cloud recognition is then used to determine which scene should open
- only when a real scene inside the collection opens do you receive
sceneReady - after entering that concrete scene, the scene itself uses its local target image for
tracked/lostTrack - when tracking is lost on
lostTrack, the collection turns cloud recognition back on to find the next scene to open
Experience Flow
A typical Image AR collection flow is:
- open the collection
- trigger
readyand receive collection information - the collection starts cloud recognition by default to determine which scene to open
- after a target is matched, open the corresponding Image AR scene
- trigger
sceneReadyand receive the current scene info and itsSceneApi - download assets and load the scene
- show the current scene's own scan guidance
- trigger
trackedafter the target image is recognized - trigger
lostTrackwhen the target image is lost, and the collection starts cloud recognition again to find the next scene to open
If your host page supports switching to another scene, you will later see another round of:
sceneDestroy- the next
sceneReady
Key Events
The most commonly used events in an Image AR collection exist on two layers:
Collection Level
readysceneReadysceneDestroy
Current Scene Level
downloadAssetProgressloadSceneEndsceneStarttrackedlostTrack
You can think about them like this:
readymeans "the collection is ready"sceneReadymeans "the current concrete scene is ready"tracked/lostTrackdescribe the recognition state of the current Image AR scene- cloud recognition decides which scene should open next at the collection level
Recommended Listening Pattern
let collectionApi = null;
let sceneApi = null;
iframe.addEventListener('ready', (event) => {
collectionApi = event.detail.api;
console.log('collection ready', event.detail.collectionInfo);
});
iframe.addEventListener('sceneReady', (event) => {
sceneApi = event.detail.api;
console.log('scene ready', event.detail.sceneInfo);
});
iframe.addEventListener('tracked', () => {
hideScanHint();
});
iframe.addEventListener('lostTrack', () => {
showScanHint();
});Scan UI
An Image AR collection actually contains two layers of "scanning":
- collection-level cloud recognition: deciding which scene should open
- current scene-level local recognition: deciding whether the current scene enters
tracked
So Image AR collections still show the default scan UI when the current scene needs recognition.
If you use:
hideScan: truethat means the host layer takes over scan guidance completely.
A common pattern is:
- show a "Please scan the target image" hint after
readyorloadSceneEnd - hide the hint on
tracked - show the hint again on
lostTrack - remember that after
lostTrack, the collection usually restarts cloud recognition to search for the next scene that can be opened
If different scenes in the collection use different target images, the host layer should update the guidance based on the current sceneInfo instead of reusing the same copy forever.
How It Differs from a Single Image AR Scene
Compared with opening a single Image AR scene directly, an Image AR collection is better suited for:
- multiple target images mapped to multiple content entries
- organizing multiple themed scenes under one entry point
- host-layer flows such as "scene list", "next item", or "themed collection"
At the same time, keep these extra considerations in mind:
- do not assume the current scene info stays fixed just because
readyfired once - refresh the cached
SceneApievery timesceneReadyfires - do not continue reusing object handles from an old scene after switching
lostTrackinside the current scene does not only mean "this scene is temporarily not recognized"; it may also trigger the collection to re-enter the "find the next scene" flow
Custom Interactions
Common pairings for Image AR collections include:
If you want to control models, images, videos, and other content inside the current scene, obtain the SceneApi in sceneReady and operate on that instead of calling those methods on CollectionApi.
Suitable Content
- multiple posters, cards, or packages that each trigger a different scene
- exhibition guides, album guides, and store guides
- multiple Image AR experience entries organized under a single campaign page
Integration Recommendations
- Use
collectionInfo.sceneListinreadyto build a clear mental model of which scenes exist in the collection. - Update the current scene info and
SceneApiinsceneReady, and do not reuse object handles from the previous scene. - Understand that Image AR collections also use cloud recognition by default: it starts when the collection first opens, and it usually starts again after
lostTrack, both times to find the next scene to open. - The host layer should provide clear UI feedback for
tracked/lostTrack, and distinguish between "current scene recognition state" and "the collection is searching for the next scene". - If the collection contains many scenes, it is a good idea to show which scene is currently active so users do not get confused.