![]() |
Alexa Auto SDK
2.0.0
|
Classes | |
enum | Favorites |
enum | MediaType |
enum | Navigation |
enum | PlayControlType |
enum | SupportedPlaybackOperation |
Public Member Functions | |
boolean | login (String localPlayerId, String accessToken, String userName, boolean forceLogin, long tokenRefreshInterval) |
boolean | logout (String localPlayerId) |
boolean | play (String localPlayerId, String playContextToken, long index, long offset, boolean preload, Navigation navigation) |
boolean | playControl (String localPlayerId, PlayControlType playControlType) |
boolean | seek (String localPlayerId, long offset) |
boolean | adjustSeek (String localPlayerId, long deltaOffset) |
boolean | authorize (AuthorizedPlayerInfo[] authorizedPlayers) |
boolean | getState (String localPlayerId, ExternalMediaAdapterState state) |
boolean | volumeChanged (float volume) |
boolean | mutedStateChanged (MutedState state) |
final void | reportDiscoveredPlayers (DiscoveredPlayerInfo[] discoveredPlayers) |
final void | requestToken (String localPlayerId) |
final void | loginComplete (String localPlayerId) |
final void | logoutComplete (String localPlayerId) |
final void | playerEvent (String localPlayerId, String eventName) |
final void | playerError (String localPlayerId, String errorName, long code, String description, boolean fatal) |
final void | setFocus (String localPlayerId) |
final void | removeDiscoveredPlayer (String localPlayerId) |
ExternalMediaAdapter should be extended to handle external media player application interaction with AVS. The platform implementation is responsible for managing the client, and media session state control. The ExternalMediaAdapter
will also receive directives from the Engine to handle audio playback/control.
boolean com.amazon.aace.alexa.ExternalMediaAdapter.login | ( | String | localPlayerId, |
String | accessToken, | ||
String | userName, | ||
boolean | forceLogin, | ||
long | tokenRefreshInterval | ||
) |
Directive called after a discovered player initiates the loginComplete event.
localPlayerId | The opaque token that uniquely identifies the local external player app |
accessToken | The handshake token between AVS, and the external media player app session |
userName | The username proided by the external media player app, if available |
forceLogin | True if no handshake is needed, and login is simply assumed |
tokenRefreshInterval | refresh interval of the accessToken, if available |
true
if the platform implementation successfully handled the call, else false
boolean com.amazon.aace.alexa.ExternalMediaAdapter.logout | ( | String | localPlayerId | ) |
Directive called after a discovered player initiates the logoutComplete event.
localPlayerId | The opaque token that uniquely identifies the local external player app |
true
if the platform implementation successfully handled the call, else false
boolean com.amazon.aace.alexa.ExternalMediaAdapter.play | ( | String | localPlayerId, |
String | playContextToken, | ||
long | index, | ||
long | offset, | ||
boolean | preload, | ||
Navigation | navigation | ||
) |
Called when the user first calls play for the external media via voice control.
localPlayerId | The opaque token that uniquely identifies the local external player app |
playContextToken | Track/playlist/album/artist/station/podcast context identifier |
index | If the playback context is an indexable container like a playlist, the index of the media item in the container |
offset | Offset position within media item, in milliseconds |
preload | Whether the media item should preload or not |
navigation | The app transition behavior |
true
if the platform implementation successfully handled the call, else false
boolean com.amazon.aace.alexa.ExternalMediaAdapter.playControl | ( | String | localPlayerId, |
PlayControlType | playControlType | ||
) |
Occurs during playback control via voice interaction or PlaybackController interface
localPlayerId | The opaque token that uniquely identifies the local external player app |
playControlType | Playback control type being invoked |
true
if the platform implementation successfully handled the call, else false
boolean com.amazon.aace.alexa.ExternalMediaAdapter.seek | ( | String | localPlayerId, |
long | offset | ||
) |
Called when the user invokes media seek via speech.
localPlayerId | The opaque token that uniquely identifies the local external player app |
offset | Offset position within media item, in milliseconds |
true
if the platform implementation successfully handled the call, else false
boolean com.amazon.aace.alexa.ExternalMediaAdapter.adjustSeek | ( | String | localPlayerId, |
long | deltaOffset | ||
) |
Called when the user invokes media seek adjustment via speech.
localPlayerId | The opaque token that uniquely identifies the local external player app |
deltaOffset | Change in offset position within media item, in milliseconds |
true
if the platform implementation successfully handled the call, else false
boolean com.amazon.aace.alexa.ExternalMediaAdapter.authorize | ( | AuthorizedPlayerInfo [] | authorizedPlayers | ) |
Called after discovered media players have been reported. Returns a list of reported players and whether they have been authorized for use with Alexa.
reportDiscoveredPlayers()
will be included in the next call to authorize()
. If a player is excluded from a call to authorize()
after it is included in the preceding reportDiscoveredPlayers()
, this does not necessarily imply it was deauthorized by Alexa. It is possible that a player may be included in more than one call to authorize()
.[in] | authorizedPlayers | A list of discovered players with their status of authorization for use with Alexa |
true
if the platform implementation successfully handled the call, else false
boolean com.amazon.aace.alexa.ExternalMediaAdapter.getState | ( | String | localPlayerId, |
ExternalMediaAdapterState | state | ||
) |
Must provide the local external media player apps , and information to maintain cloud sync
localPlayerId | The opaque token that uniquely identifies the local external player app |
state | The ExternalMediaAdapterState to be initialized by the platform |
true
if the platform is able to provide state information for the external media player, else false
boolean com.amazon.aace.alexa.ExternalMediaAdapter.volumeChanged | ( | float | volume | ) |
Notifies the platform implementation to set the volume of the output channel. The volume
value should be scaled to fit the needs of the platform.
volume | The volume to set on the output channel. volume is in the range [0,1]. |
true
if the platform implementation successfully handled the call, else false
boolean com.amazon.aace.alexa.ExternalMediaAdapter.mutedStateChanged | ( | MutedState | state | ) |
Notifies the platform implementation to apply a mute state change to the output channel
state | The muted state to apply to the output channel. MutedState::MUTED when the output channel be muted, MutedState::UNMUTED when unmuted |
true
if the platform implementation successfully handled the call, else false
final void com.amazon.aace.alexa.ExternalMediaAdapter.reportDiscoveredPlayers | ( | DiscoveredPlayerInfo [] | discoveredPlayers | ) |
Should be called on startup in order to notify AVS of the local external media players
discoveredPlayers | contains the discovered player info objects |
final void com.amazon.aace.alexa.ExternalMediaAdapter.requestToken | ( | String | localPlayerId | ) |
The device is responsible for requesting an access token when needed. This is typically done immediately upon connection to AVS.
localPlayerId | The opaque token that uniquely identifies the local external player app |
final void com.amazon.aace.alexa.ExternalMediaAdapter.loginComplete | ( | String | localPlayerId | ) |
Should be called on a local external media player login. This will set authorization of the app with AVS.
localPlayerId | The opaque token that uniquely identifies the local external player app |
final void com.amazon.aace.alexa.ExternalMediaAdapter.logoutComplete | ( | String | localPlayerId | ) |
Should be called on a local external media player logout. This will unset authorization of the app with AVS.
localPlayerId | The opaque token that uniquely identifies the local external player app |
final void com.amazon.aace.alexa.ExternalMediaAdapter.playerEvent | ( | String | localPlayerId, |
String | eventName | ||
) |
Should be called on a local external media player event. This will sync the context with AVS.
localPlayerId | The opaque token that uniquely identifies the local external player app |
eventName | Canonical event name |
final void com.amazon.aace.alexa.ExternalMediaAdapter.playerError | ( | String | localPlayerId, |
String | errorName, | ||
long | code, | ||
String | description, | ||
boolean | fatal | ||
) |
Should be called on a player error.
localPlayerId | The opaque token that uniquely identifies the local external player app |
errorName | The name of the error |
code | The error code |
description | The detailed error description |
fatal | true if the error is fatal |
final void com.amazon.aace.alexa.ExternalMediaAdapter.setFocus | ( | String | localPlayerId | ) |
Should be called on local external media player events. This will switch the media focus to that context.
localPlayerId | The opaque token that uniquely identifies the local external player app |
final void com.amazon.aace.alexa.ExternalMediaAdapter.removeDiscoveredPlayer | ( | String | localPlayerId | ) |
Should be called on when a registered media player has been uninstalled or is no longer available.
localPlayerId | The opaque token that uniquely identifies the local external player app |
Alexa Auto SDK 2.0.0 - Copyright 2017-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. Licensed under the Apache License, Version 2.0