What's New in APL 2022.1
Alexa Presentation Language (APL) 2022.1 introduces new features and capabilities for APL.
Revised APL version number format
With the latest APL release, APL version numbers now use a year-based format: <YEAR>.<RELEASE>. Therefore, the latest version of APL is 2022.1. Set the version
property of your APL documents to 2022.1
and use 2022.1
in conditional statements in your documents.
Authoring tool updates
The Lottie converter now supports additional Lottie format features:
- Bezier Interpolation
- Linear Interpolation
- Alpha Matte / Mask
- Spacial Bezier Interpolation
- Line Cap
- Trim Paths Individually
- Radial Gradient
- Stroke Gradient
For a detailed list of supported Lottie features, see Import a Lottie Animation
Mute and unmute the video audio during runtime
The Video component now includes a dynamic muted
property. Set this property to true
to mute the audioTrack
for the video. Because muted
is dynamic, you can mute and unmute the audio at runtime. Use the SetValue
command to change this property during runtime.
As part of this update, when the Video
component is the source or target of an event, the event.source
or event.target
event includes a muted
property to report the current muted state of the video.
Work with APL versions
In your APL document, set the version
to "2022.1"
.
A user can invoke your skill on older devices that do not support the latest version of APL. When working with features introduced in a specific version of APL, provide an alternative experience for devices running earlier versions of APL. The environment.aplVersion
property in the data-binding context returns the version of APL on the device. This property returns null
for APL 1.0 and the actual version for 1.1 or later. Use this property in when
statements to create conditional blocks based on version.
For example, this renders a VectorGraphic
on a device with APL 1.1 or later, and an image for APL 1.0:
[
{
"type": "Image",
"when": "${environment.aplVersion == null}",
"width": 100,
"height": 100,
"source": "https://example.com/alternate/image/for/older/versions.jpg"
},
{
"type": "VectorGraphic",
"when": "${environment.aplVersion != null}",
"source": "lightbulb",
"width": 100,
"height": 100,
"scale": "best-fit"
}
]
The APL version is also available in requests sent to your skill, in:
context.System.device.supportedInterfaces.['Alexa.Presentation.APL'].runtime.maxVersion
This example shows a request from a device with 2022.1. Note that the session
, request
, and viewport
properties are omitted for brevity.
{
"version": "1.0",
"session": {},
"context": {
"System": {
"application": {
"applicationId": "amzn1.ask.skill.1"
},
"user": {
"userId": "amzn1.ask.account.1"
},
"device": {
"deviceId": "amzn1.ask.device.1",
"supportedInterfaces": {
"Alexa.Presentation.APL": {
"runtime": {
"maxVersion": "2022.1"
}
}
}
},
"apiEndpoint": "https://api.amazonalexa.com",
"apiAccessToken": "eyJ..."
},
"Viewport": {}
},
"request": {}
}