Layar Developer Documentation

Back to layar.com

API v8.4 Changes

NOTE: These are the changes in Developer API v8.4. It is supported in Layar client v8.4 (and above) on both Android and iPhone.

In Layar API v8.4 we introduced the following features:

AR video playback control

Since we introduced AR video, we always had a fixed set of functionality with buffering indicator, preview image display and replay button after the video finishes. In 8.4 we added some boolean flags to give you more flexibility on how the AR video works. 

Also since we support audio as an object it make sense for developers to select whether to show controls or not. 

So the following boolean flags are available:

Example:

"object": {     "url": "http://demo.com/video.mp4",     "contentType": "video/vnd.layar.splitalpha",     "size": 1,     "showPlaybackControls": false,     "allowFullscreenPlayback": false }

Control loading Indicator

By default, Layar shows loading indicators for all objects in the AR view. Layar 8.4 adds a boolean flag indicating whether we need to show the indicator for an object (default value remains true).

Example:

"object": {
    "url": "http://hosting.com/image.png",
    "contentType": "image/png",
    "size": 1,
    "showLoadingIndicator": false
}

Audio playback control

Up until now we  have supported audio playback as actions (either triggered by the user, or auto-triggered by proximity for geo, or tracking a reference image for vision). In Layar 8.4, developers can now add audio as an object with content type "audio/mp4" inside a POI/hotspot. Lamar provides a default visualization for audio content, which is just a simple play/pause icon in Layar UI style. The new boolean flags defined for AR video playback control are also valid for audio. When "showPlaybackControls" is set to "false", the audio player will be completely hidden from view.If for example you want to use a looped invisible audio element on your reference image, you add the following object:

Opacity animation

In addition to the rotate, translate and scale animations, we have added the 'opacity' animation type. This can be used both on POI level and on Layer level (to be applied on all POIs). With the opacity animation it is now possible to implement a fade-in/fade-out effect.

 This example shows a fade-in animation linked to the onCreate event

"animations": {
    "onCreate": [
        {
            "type": "opacity",
            "from": 0,
            "to": 1,
            "length": 1000,
            "persist": true
        }
    ]
}