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:
- loopPlayback (default false) :If set to true, we automatically repeat the video when it finishes playing.
- showPlaybackControls (default true):If set to false, we do not show the play/replay button on top of the video. If the video finishes playing, we just continue to show the last frame of the video.
- autoPlayback (default true):If set to false, the video or audio file will not start immediately, but shows the play button instead. Note: must not be set to false if 'showPlaybackControls' is set to false!
- allowFullscreenPlayback (default true) :If set to false, we disable the tap to open fullscreen functionality of the video augment.
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).
"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:
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