English
Appearance
English
Appearance
Basic AR/Gyroscope collections correspond to the cloud-ar type.
Compared with a single Basic AR/Gyroscope scene, the core characteristics of a Basic AR/Gyroscope collection are:
CollectionApi first, then a scene-level SceneApi for the current scenetracked and lostTrack.Basic AR/Gyroscope collection relies on matching against the cloud image library, which usually means "recognize a target, then open the corresponding scene".So Basic AR/Gyroscope collections are better suited when:
A common Basic AR/Gyroscope collection flow is:
ready and receive collectionInfo and CollectionApisceneReadySo compared with a single scene, there is an extra layer of "collection container + scene switching".
The host page usually cares about at least the following events:
readysceneReadysceneDestroydownloadAssetProgressloadSceneEndsceneStarterrorincompatibilityThe currently opened Basic AR/Gyroscope scene no longer performs its own recognition scan. In effect, Basic AR/Gyroscope scenes inside a collection always enter after scanning has already been resolved.
CollectionApi Helps in Cloud Recognition Collections The most valuable methods are:
await api.startCloudar();
await api.stopCloudar();
await api.backToScan();
await api.openScene(sceneId);
await api.closeCurrentScene();startCloudar() Actively start cloud-recognition scanning.
Suitable when:
stopCloudar() Actively stop scanning.
Suitable when:
backToScan() Return from the current scene to scanning mode.
Suitable when:
Good for quick integration.
The host layer mainly listens for:
readysceneReadysceneStarterrorincompatibilityFor example:
iframe.addEventListener('ready', (event) => {
const api = event.detail.api;
startButton.addEventListener('click', async () => {
await api.startCloudar();
});
});This mode works well when you want to combine the default workflow with branded UI on the host page.
backButton.addEventListener('click', async () => {
await collectionApi.backToScan();
});This is ideal for "recognize one target -> browse the content -> go back and continue scanning".
If Basic AR/Gyroscope scenes enable the gyroscope, permission handling and compatibility become more complex.
This issue is usually more noticeable in Basic AR/Gyroscope collections because:
For Web iframe integrations, it is still recommended to disable gyroscope dependency whenever possible.
A reliable host-layer pattern is usually:
CollectionApi and collectionInfo at readySceneApi at sceneReadybackToScan() or openScene(sceneId)Example:
let collectionApi = null;
let sceneApi = null;
iframe.addEventListener('ready', (event) => {
collectionApi = event.detail.api;
});
iframe.addEventListener('sceneReady', (event) => {
sceneApi = event.detail.api;
});Basic AR/Gyroscope experiences organized under one entry pointCollectionApi; do not mix those responsibilities into SceneApi.SceneApi only after sceneReady, and update that reference every time the scene changes.startCloudar(collectionId, sceneList).error and incompatibility, especially for camera and compatibility failures.