AlexaClientSDK  1.20.1
A cross-platform, modular SDK for interacting with the Alexa Voice Service
Enumerations | Functions | Variables
alexaClientSDK::avsCommon::avs::externalMediaPlayer Namespace Reference

Enumerations

enum  AdapterEvent {
  AdapterEvent::CHANGE_REPORT, AdapterEvent::REQUEST_TOKEN, AdapterEvent::LOGIN, AdapterEvent::LOGOUT,
  AdapterEvent::PLAYER_EVENT, AdapterEvent::PLAYER_ERROR_EVENT
}
 Enumeration class for events sent by adapters to AVS. More...
 

Functions

rapidjson::Value buildSupportedOperations (const std::set< avsCommon::sdkInterfaces::externalMediaPlayer::SupportedPlaybackOperation > &supportedOperations, rapidjson::Document::AllocatorType &allocator)
 
rapidjson::Value buildPlaybackState (const avsCommon::sdkInterfaces::externalMediaPlayer::AdapterPlaybackState &playbackState, rapidjson::Document::AllocatorType &allocator)
 
rapidjson::Value buildSessionState (const avsCommon::sdkInterfaces::externalMediaPlayer::AdapterSessionState &sessionState, rapidjson::Document::AllocatorType &allocator)
 
bool buildDefaultPlayerState (rapidjson::Value *document, rapidjson::Document::AllocatorType &allocator)
 
avsCommon::utils::RetryTimer SESSION_RETRY_TIMER (SESSION_RETRY_TABLE)
 
const NamespaceAndName CHANGE_REPORT ("Alexa", "ChangeReport")
 
const NamespaceAndName REQUEST_TOKEN ("ExternalMediaPlayer", "RequestToken")
 
const NamespaceAndName LOGIN ("ExternalMediaPlayer", "Login")
 
const NamespaceAndName LOGOUT ("ExternalMediaPlayer", "Logout")
 
const NamespaceAndName PLAYER_EVENT ("ExternalMediaPlayer", "PlayerEvent")
 
const NamespaceAndName PLAYER_ERROR_EVENT ("ExternalMediaPlayer", "PlayerError")
 
rapidjson::Value buildSupportedOperations (const std::set< SupportedPlaybackOperation > &supportedOperations, rapidjson::Document::AllocatorType &allocator)
 

Variables

const std::vector< int > SESSION_RETRY_TABLE
 Table with the retry times on subsequent retries for session management (token fetch/changeReport send). More...
 
avsCommon::utils::RetryTimer SESSION_RETRY_TIMER
 The retry timer for session management (token fetch/changeReport send). More...
 
const avsCommon::avs::NamespaceAndName CHANGE_REPORT
 
const avsCommon::avs::NamespaceAndName REQUEST_TOKEN
 
const avsCommon::avs::NamespaceAndName LOGIN
 
const avsCommon::avs::NamespaceAndName LOGOUT
 
const avsCommon::avs::NamespaceAndName PLAYER_EVENT
 
const avsCommon::avs::NamespaceAndName PLAYER_ERROR_EVENT
 
const char PLAYER_ID [] = "playerId"
 
const char ENDPOINT_ID [] = "endpointId"
 
const char LOGGED_IN [] = "loggedIn"
 
const char USERNAME [] = "username"
 
const char IS_GUEST [] = "isGuest"
 
const char LAUNCHED [] = "launched"
 
const char ACTIVE [] = "active"
 
const char SPI_VERSION [] = "spiVersion"
 
const char PLAYER_COOKIE [] = "playerCookie"
 
const char SKILL_TOKEN [] = "skillToken"
 
const char PLAYBACK_SESSION_ID [] = "playbackSessionId"
 
const char STATE [] = "state"
 
const char OPERATIONS [] = "supportedOperations"
 
const char MEDIA [] = "media"
 
const char POSITIONINMS [] = "positionMilliseconds"
 
const char SHUFFLE [] = "shuffle"
 
const char REPEAT [] = "repeat"
 
const char FAVORITE [] = "favorite"
 
const char PLAYBACK_SOURCE [] = "playbackSource"
 
const char TYPE [] = "type"
 
const char PLAYBACK_SOURCE_ID [] = "playbackSourceId"
 
const char TRACKNAME [] = "trackName"
 
const char TRACK_ID [] = "trackId"
 
const char TRACK_NUMBER [] = "trackNumber"
 
const char ARTIST [] = "artist"
 
const char ARTIST_ID [] = "artistId"
 
const char ALBUM [] = "album"
 
const char ALBUM_ID [] = "albumId"
 
const char COVER_URLS [] = "coverUrls"
 
const char TINY_URL [] = "tiny"
 
const char SMALL_URL [] = "small"
 
const char MEDIUM_URL [] = "medium"
 
const char LARGE_URL [] = "large"
 
const char COVER_ID [] = "coverId"
 
const char MEDIA_PROVIDER [] = "mediaProvider"
 
const char MEDIA_TYPE [] = "mediaType"
 
const char DURATIONINMS [] = "durationInMilliseconds"
 
const char VALUE [] = "value"
 
const char DEFAULT_STATE [] = "IDLE"
 The default state of a player. More...
 

Enumeration Type Documentation

◆ AdapterEvent

Enumeration class for events sent by adapters to AVS.

Enumerator
CHANGE_REPORT 

ChangeReport event sent after adapter's initialization succeeds/fails.

REQUEST_TOKEN 

Event to request token from third party.

LOGIN 

Login event when a guest user logs in.

LOGOUT 

Logout event when a user logs out.

PLAYER_EVENT 

PlayerEvent to announce all kinds of player events - like play/pause/next etc.

PLAYER_ERROR_EVENT 

PlayerErrorEvent to report all errors from the adapters.

Function Documentation

◆ buildDefaultPlayerState()

bool alexaClientSDK::avsCommon::avs::externalMediaPlayer::buildDefaultPlayerState ( rapidjson::Value *  document,
rapidjson::Document::AllocatorType &  allocator 
)

Method to build the default player.

Parameters
documentThe JSON Value to write the default player state into.
allocatorThe rapidjson allocator, required for the results of this function to be merge-able with other rapidjson::Value objects.
Returns
true if the build of default player state was successful, false otherwise.

◆ buildPlaybackState()

rapidjson::Value alexaClientSDK::avsCommon::avs::externalMediaPlayer::buildPlaybackState ( const avsCommon::sdkInterfaces::externalMediaPlayer::AdapterPlaybackState playbackState,
rapidjson::Document::AllocatorType &  allocator 
)

Method to convert a playbackState to JSON.

Parameters
playbackStateThe playback state of the adapter.
Therapidjson allocator, required for the results of this function to be merge-able with other rapidjson::Value objects.
Returns
The rapidjson::Value representing the playback state JSON.

◆ buildSessionState()

rapidjson::Value alexaClientSDK::avsCommon::avs::externalMediaPlayer::buildSessionState ( const avsCommon::sdkInterfaces::externalMediaPlayer::AdapterSessionState sessionState,
rapidjson::Document::AllocatorType &  allocator 
)

Method to convert session state to JSON.

Parameters
sessionStateThe session state of the adapter.
Therapidjson allocator, required for the results of this function to be mergable with other rapidjson::Value objects.
Returns
The rapidjson::Value representing the session state in JSON.

◆ buildSupportedOperations() [1/2]

rapidjson::Value alexaClientSDK::avsCommon::avs::externalMediaPlayer::buildSupportedOperations ( const std::set< SupportedPlaybackOperation > &  supportedOperations,
rapidjson::Document::AllocatorType &  allocator 
)

◆ buildSupportedOperations() [2/2]

rapidjson::Value alexaClientSDK::avsCommon::avs::externalMediaPlayer::buildSupportedOperations ( const std::set< avsCommon::sdkInterfaces::externalMediaPlayer::SupportedPlaybackOperation > &  supportedOperations,
rapidjson::Document::AllocatorType &  allocator 
)

Method to iterate over a collection of supported operation in playback state and convert to JSON.

Parameters
supportedOperationsThe collection of supported operations from the current playback state.
allocatorThe rapidjson allocator, required for the results of this function to be mergable with other rapidjson::Value objects.
Returns
The rapidjson::Value representing the array.

◆ CHANGE_REPORT()

const NamespaceAndName alexaClientSDK::avsCommon::avs::externalMediaPlayer::CHANGE_REPORT ( "Alexa"  ,
"ChangeReport"   
)

◆ LOGIN()

const NamespaceAndName alexaClientSDK::avsCommon::avs::externalMediaPlayer::LOGIN ( "ExternalMediaPlayer"  ,
"Login"   
)

◆ LOGOUT()

const NamespaceAndName alexaClientSDK::avsCommon::avs::externalMediaPlayer::LOGOUT ( "ExternalMediaPlayer"  ,
"Logout"   
)

◆ PLAYER_ERROR_EVENT()

const NamespaceAndName alexaClientSDK::avsCommon::avs::externalMediaPlayer::PLAYER_ERROR_EVENT ( "ExternalMediaPlayer"  ,
"PlayerError"   
)

◆ PLAYER_EVENT()

const NamespaceAndName alexaClientSDK::avsCommon::avs::externalMediaPlayer::PLAYER_EVENT ( "ExternalMediaPlayer"  ,
"PlayerEvent"   
)

◆ REQUEST_TOKEN()

const NamespaceAndName alexaClientSDK::avsCommon::avs::externalMediaPlayer::REQUEST_TOKEN ( "ExternalMediaPlayer"  ,
"RequestToken"   
)

◆ SESSION_RETRY_TIMER()

avsCommon::utils::RetryTimer alexaClientSDK::avsCommon::avs::externalMediaPlayer::SESSION_RETRY_TIMER ( SESSION_RETRY_TABLE  )

Variable Documentation

◆ ACTIVE

const char alexaClientSDK::avsCommon::avs::externalMediaPlayer::ACTIVE[] = "active"

◆ ALBUM

const char alexaClientSDK::avsCommon::avs::externalMediaPlayer::ALBUM[] = "album"

◆ ALBUM_ID

const char alexaClientSDK::avsCommon::avs::externalMediaPlayer::ALBUM_ID[] = "albumId"

◆ ARTIST

const char alexaClientSDK::avsCommon::avs::externalMediaPlayer::ARTIST[] = "artist"

◆ ARTIST_ID

const char alexaClientSDK::avsCommon::avs::externalMediaPlayer::ARTIST_ID[] = "artistId"

◆ CHANGE_REPORT

const NamespaceAndName alexaClientSDK::avsCommon::avs::externalMediaPlayer::CHANGE_REPORT("Alexa", "ChangeReport")

◆ COVER_ID

const char alexaClientSDK::avsCommon::avs::externalMediaPlayer::COVER_ID[] = "coverId"

◆ COVER_URLS

const char alexaClientSDK::avsCommon::avs::externalMediaPlayer::COVER_URLS[] = "coverUrls"

◆ DEFAULT_STATE

const char alexaClientSDK::avsCommon::avs::externalMediaPlayer::DEFAULT_STATE[] = "IDLE"

The default state of a player.

◆ DURATIONINMS

const char alexaClientSDK::avsCommon::avs::externalMediaPlayer::DURATIONINMS[] = "durationInMilliseconds"

◆ ENDPOINT_ID

const char alexaClientSDK::avsCommon::avs::externalMediaPlayer::ENDPOINT_ID[] = "endpointId"

◆ FAVORITE

const char alexaClientSDK::avsCommon::avs::externalMediaPlayer::FAVORITE[] = "favorite"

◆ IS_GUEST

const char alexaClientSDK::avsCommon::avs::externalMediaPlayer::IS_GUEST[] = "isGuest"

◆ LARGE_URL

const char alexaClientSDK::avsCommon::avs::externalMediaPlayer::LARGE_URL[] = "large"

◆ LAUNCHED

const char alexaClientSDK::avsCommon::avs::externalMediaPlayer::LAUNCHED[] = "launched"

◆ LOGGED_IN

const char alexaClientSDK::avsCommon::avs::externalMediaPlayer::LOGGED_IN[] = "loggedIn"

◆ LOGIN

const NamespaceAndName alexaClientSDK::avsCommon::avs::externalMediaPlayer::LOGIN("ExternalMediaPlayer", "Login")

◆ LOGOUT

const NamespaceAndName alexaClientSDK::avsCommon::avs::externalMediaPlayer::LOGOUT("ExternalMediaPlayer", "Logout")

◆ MEDIA

const char alexaClientSDK::avsCommon::avs::externalMediaPlayer::MEDIA[] = "media"

◆ MEDIA_PROVIDER

const char alexaClientSDK::avsCommon::avs::externalMediaPlayer::MEDIA_PROVIDER[] = "mediaProvider"

◆ MEDIA_TYPE

const char alexaClientSDK::avsCommon::avs::externalMediaPlayer::MEDIA_TYPE[] = "mediaType"

◆ MEDIUM_URL

const char alexaClientSDK::avsCommon::avs::externalMediaPlayer::MEDIUM_URL[] = "medium"

◆ OPERATIONS

const char alexaClientSDK::avsCommon::avs::externalMediaPlayer::OPERATIONS[] = "supportedOperations"

◆ PLAYBACK_SESSION_ID

const char alexaClientSDK::avsCommon::avs::externalMediaPlayer::PLAYBACK_SESSION_ID[] = "playbackSessionId"

◆ PLAYBACK_SOURCE

const char alexaClientSDK::avsCommon::avs::externalMediaPlayer::PLAYBACK_SOURCE[] = "playbackSource"

◆ PLAYBACK_SOURCE_ID

const char alexaClientSDK::avsCommon::avs::externalMediaPlayer::PLAYBACK_SOURCE_ID[] = "playbackSourceId"

◆ PLAYER_COOKIE

const char alexaClientSDK::avsCommon::avs::externalMediaPlayer::PLAYER_COOKIE[] = "playerCookie"

◆ PLAYER_ERROR_EVENT

const NamespaceAndName alexaClientSDK::avsCommon::avs::externalMediaPlayer::PLAYER_ERROR_EVENT("ExternalMediaPlayer", "PlayerError")

◆ PLAYER_EVENT

const NamespaceAndName alexaClientSDK::avsCommon::avs::externalMediaPlayer::PLAYER_EVENT("ExternalMediaPlayer", "PlayerEvent")

◆ PLAYER_ID

const char alexaClientSDK::avsCommon::avs::externalMediaPlayer::PLAYER_ID[] = "playerId"

◆ POSITIONINMS

const char alexaClientSDK::avsCommon::avs::externalMediaPlayer::POSITIONINMS[] = "positionMilliseconds"

◆ REPEAT

const char alexaClientSDK::avsCommon::avs::externalMediaPlayer::REPEAT[] = "repeat"

◆ REQUEST_TOKEN

const NamespaceAndName alexaClientSDK::avsCommon::avs::externalMediaPlayer::REQUEST_TOKEN("ExternalMediaPlayer", "RequestToken")

◆ SESSION_RETRY_TABLE

const std::vector< int > alexaClientSDK::avsCommon::avs::externalMediaPlayer::SESSION_RETRY_TABLE
Initial value:
= {
1000 * 60,
5000 * 60,
15000 * 60,
20000 * 60,
30000 * 60,
60000 * 60,
}

Table with the retry times on subsequent retries for session management (token fetch/changeReport send).

◆ SESSION_RETRY_TIMER

avsCommon::utils::RetryTimer alexaClientSDK::avsCommon::avs::externalMediaPlayer::SESSION_RETRY_TIMER(SESSION_RETRY_TABLE)

The retry timer for session management (token fetch/changeReport send).

◆ SHUFFLE

const char alexaClientSDK::avsCommon::avs::externalMediaPlayer::SHUFFLE[] = "shuffle"

◆ SKILL_TOKEN

const char alexaClientSDK::avsCommon::avs::externalMediaPlayer::SKILL_TOKEN[] = "skillToken"

◆ SMALL_URL

const char alexaClientSDK::avsCommon::avs::externalMediaPlayer::SMALL_URL[] = "small"

◆ SPI_VERSION

const char alexaClientSDK::avsCommon::avs::externalMediaPlayer::SPI_VERSION[] = "spiVersion"

◆ STATE

const char alexaClientSDK::avsCommon::avs::externalMediaPlayer::STATE[] = "state"

◆ TINY_URL

const char alexaClientSDK::avsCommon::avs::externalMediaPlayer::TINY_URL[] = "tiny"

◆ TRACK_ID

const char alexaClientSDK::avsCommon::avs::externalMediaPlayer::TRACK_ID[] = "trackId"

◆ TRACK_NUMBER

const char alexaClientSDK::avsCommon::avs::externalMediaPlayer::TRACK_NUMBER[] = "trackNumber"

◆ TRACKNAME

const char alexaClientSDK::avsCommon::avs::externalMediaPlayer::TRACKNAME[] = "trackName"

◆ TYPE

const char alexaClientSDK::avsCommon::avs::externalMediaPlayer::TYPE[] = "type"

◆ USERNAME

const char alexaClientSDK::avsCommon::avs::externalMediaPlayer::USERNAME[] = "username"

◆ VALUE

const char alexaClientSDK::avsCommon::avs::externalMediaPlayer::VALUE[] = "value"

AlexaClientSDK 1.20.1 - Copyright 2016-2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. Licensed under the Apache License, Version 2.0