Alexa Auto SDK
4.3
|
Classes | |
class | AuthorizedPlayerInfo |
class | ExternalMediaAdapterState |
class | PlaybackState |
class | SessionState |
Public Member Functions | |
virtual bool | login (const std::string &localPlayerId, const std::string &accessToken, const std::string &userName, bool forceLogin, std::chrono::milliseconds tokenRefreshInterval)=0 |
virtual bool | logout (const std::string &localPlayerId)=0 |
virtual bool | play (const std::string &localPlayerId, const std::string &playContextToken, int64_t index, std::chrono::milliseconds offset, bool preload, Navigation navigation)=0 |
virtual bool | play (const std::string &localPlayerId, const std::string &playContextToken, int64_t index, std::chrono::milliseconds offset, bool preload, Navigation navigation, const std::string &playbackSessionId, const std::string &skillToken) |
virtual bool | playControl (const std::string &localPlayerId, PlayControlType controlType)=0 |
virtual bool | seek (const std::string &localPlayerId, std::chrono::milliseconds offset)=0 |
virtual bool | adjustSeek (const std::string &localPlayerId, std::chrono::milliseconds deltaOffset)=0 |
virtual bool | authorize (const std::vector< AuthorizedPlayerInfo > &authorizedPlayers)=0 |
virtual std::chrono::milliseconds | getOffset (const std::string &localPlayerId) |
virtual bool | getState (const std::string &localPlayerId, ExternalMediaAdapterState &state)=0 |
virtual bool | volumeChanged (float volume)=0 |
virtual bool | mutedStateChanged (MutedState state)=0 |
void | reportDiscoveredPlayers (const std::vector< DiscoveredPlayerInfo > &discoveredPlayers) |
void | requestToken (const std::string &localPlayerId) |
void | loginComplete (const std::string &localPlayerId) |
void | logoutComplete (const std::string &localPlayerId) |
void | playerEvent (const std::string &localPlayerId, const std::string &eventName) |
void | playerError (const std::string &localPlayerId, const std::string &errorName, long code, const std::string &description, bool fatal) |
void | setFocus (const std::string &localPlayerId) |
Describes the playback control type
Supported playback control types reportable by the external media player app
|
strong |
|
strong |
|
strong |
|
pure virtual |
Directive called after a discovered player initiates the loginComplete event.
[in] | localPlayerId | The opaque token that uniquely identifies the local external player app |
[in] | accessToken | The handshake token between AVS, and the external media player app session |
[in] | userName | The username provided by the external media player app, if available |
[in] | forceLogin | True if no handshake is needed, and login is simply assumed |
[in] | tokenRefreshInterval | refresh interval of the accessToken, if available |
true
if the platform implementation successfully handled the call, else false
|
pure virtual |
Directive called after a discovered player initiates the logoutComplete event.
[in] | localPlayerId | The opaque token that uniquely identifies the local external player app |
true
if the platform implementation successfully handled the call, else false
|
pure virtual |
Called when the user first calls play for the external media via voice control.
[in] | localPlayerId | The opaque token that uniquely identifies the local external player app |
[in] | playContextToken | Track/playlist/album/artist/station/podcast context identifier |
[in] | index | If the playback context is an indexable container like a playlist, the index of the media item in the container |
[in] | offset | Offset position within media item, in milliseconds |
[in] | preload | Whether the media item should preload or not |
[in] | navigation | The app transition behavior |
true
if the platform implementation successfully handled the call, else false
|
virtual |
Extra parameters for credentials
|
pure virtual |
Occurs during playback control via voice interaction
[in] | localPlayerId | The opaque token that uniquely identifies the local external player app |
[in] | playControlType | Playback control type being invoked |
true
if the platform implementation successfully handled the call, else false
|
pure virtual |
Called when the user invokes media seek via speech.
[in] | localPlayerId | The opaque token that uniquely identifies the local external player app |
[in] | offset | Offset position within media item, in milliseconds |
true
if the platform implementation successfully handled the call, else false
|
pure virtual |
Called when the user invokes media seek adjustment via speech.
[in] | localPlayerId | The opaque token that uniquely identifies the local external player app |
[in] | deltaOffset | Change in offset position within media item, in milliseconds |
true
if the platform implementation successfully handled the call, else false
|
pure virtual |
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
|
virtual |
This function retrieves the offset of the current track the adapter is handling.
|
pure virtual |
Must provide the local external media player apps , and information to maintain cloud sync
[in] | localPlayerId | The opaque token that uniquely identifies the local external player app |
[in] | 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
|
pure virtual |
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.
[in] | 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
|
pure virtual |
Notifies the platform implementation to apply a mute state change to the output channel
[in] | 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
void aace::alexa::ExternalMediaAdapter::reportDiscoveredPlayers | ( | const std::vector< DiscoveredPlayerInfo > & | discoveredPlayers | ) |
Should be called on startup in order to notify AVS of the local external media players
[in] | discoveredPlayers | contains the discovered player info objects |
void aace::alexa::ExternalMediaAdapter::requestToken | ( | const std::string & | localPlayerId | ) |
The device is responsible for requesting an access token when needed. This is typically done immediately upon connection to AVS.
[in] | localPlayerId | The opaque token that uniquely identifies the local external player app |
void aace::alexa::ExternalMediaAdapter::loginComplete | ( | const std::string & | localPlayerId | ) |
Should be called on a local external media player login. This will set authorization of the app with AVS.
[in] | localPlayerId | The opaque token that uniquely identifies the local external player app |
void aace::alexa::ExternalMediaAdapter::logoutComplete | ( | const std::string & | localPlayerId | ) |
Should be called on a local external media player logout. This will unset authorization of the app with AVS.
[in] | localPlayerId | The opaque token that uniquely identifies the local external player app |
void aace::alexa::ExternalMediaAdapter::playerEvent | ( | const std::string & | localPlayerId, |
const std::string & | eventName | ||
) |
Should be called on a local external media player event. This will sync the context with AVS.
[in] | localPlayerId | The opaque token that uniquely identifies the local external player app |
[in] | eventName | Canonical event name. Accepted values:
|
void aace::alexa::ExternalMediaAdapter::playerError | ( | const std::string & | localPlayerId, |
const std::string & | errorName, | ||
long | code, | ||
const std::string & | description, | ||
bool | fatal | ||
) |
Should be called on a player error.
[in] | localPlayerId | The opaque token that uniquely identifies the local external player app |
[in] | errorName | The name of the error. Accepted values:
|
[in] | code | The error code |
[in] | description | The detailed error description |
[in] | fatal | true if the error is fatal |
void aace::alexa::ExternalMediaAdapter::setFocus | ( | const std::string & | localPlayerId | ) |
Should be called on local external media player events. This will switch the media focus to that context.
[in] | localPlayerId | The opaque token that uniquely identifies the local external player app |
Alexa Auto SDK 4.3 - Copyright 2017-2023 Amazon.com, Inc. or its affiliates. All Rights Reserved. Licensed under the Apache License, Version 2.0