#include <ExternalMediaAdapterInterface.h>
|
| ExternalMediaAdapterInterface (const std::string &adapterName) |
|
virtual | ~ExternalMediaAdapterInterface ()=default |
|
virtual void | init ()=0 |
| Method to initialize a third party library. More...
|
|
virtual void | deInit ()=0 |
| Method to de-initialize a third party library. More...
|
|
virtual void | handleLogin (const std::string &accessToken, const std::string &userName, bool forceLogin, std::chrono::milliseconds tokenRefreshInterval)=0 |
|
virtual void | handleLogout ()=0 |
|
virtual void | handlePlay (std::string &playContextToken, int64_t index, std::chrono::milliseconds offset, const std::string &skillToken, const std::string &playbackSessionId, const std::string &navigation, bool preload, const avsCommon::avs::PlayRequestor &playRequestor)=0 |
|
virtual void | handlePlayControl (RequestType requestType)=0 |
|
virtual void | handleSeek (std::chrono::milliseconds offset)=0 |
|
virtual void | handleAdjustSeek (std::chrono::milliseconds deltaOffset)=0 |
|
virtual void | handleAuthorized (bool authorized, const std::string &playerId, const std::string &defaultSkillToken)=0 |
|
virtual AdapterState | getState ()=0 |
| Method to fetch the state(session state and playback state) of an adapter. More...
|
|
virtual std::chrono::milliseconds | getOffset ()=0 |
|
| RequiresShutdown (const std::string &name) |
|
virtual | ~RequiresShutdown () |
| Destructor. More...
|
|
const std::string & | name () const |
|
void | shutdown () |
|
bool | isShutdown () const |
|
The ExternalMediaAdapterInterface specifies the interface of an adapter object to interact with a third party music service provider library. The adapter object handles session management of an user with the third party library/cloud and provides users with an interface to manage behaviors to control their play queue.
◆ ExternalMediaAdapterInterface()
alexaClientSDK::avsCommon::sdkInterfaces::externalMediaPlayer::ExternalMediaAdapterInterface::ExternalMediaAdapterInterface |
( |
const std::string & |
adapterName | ) |
|
|
inlineexplicit |
◆ ~ExternalMediaAdapterInterface()
virtual alexaClientSDK::avsCommon::sdkInterfaces::externalMediaPlayer::ExternalMediaAdapterInterface::~ExternalMediaAdapterInterface |
( |
| ) |
|
|
virtualdefault |
◆ deInit()
virtual void alexaClientSDK::avsCommon::sdkInterfaces::externalMediaPlayer::ExternalMediaAdapterInterface::deInit |
( |
| ) |
|
|
pure virtual |
Method to de-initialize a third party library.
◆ getOffset()
virtual std::chrono::milliseconds alexaClientSDK::avsCommon::sdkInterfaces::externalMediaPlayer::ExternalMediaAdapterInterface::getOffset |
( |
| ) |
|
|
pure virtual |
This function retrieves the offset of the current track the adapter is handling.
- Returns
- This returns the offset in milliseconds.
◆ getState()
virtual AdapterState alexaClientSDK::avsCommon::sdkInterfaces::externalMediaPlayer::ExternalMediaAdapterInterface::getState |
( |
| ) |
|
|
pure virtual |
Method to fetch the state(session state and playback state) of an adapter.
◆ handleAdjustSeek()
virtual void alexaClientSDK::avsCommon::sdkInterfaces::externalMediaPlayer::ExternalMediaAdapterInterface::handleAdjustSeek |
( |
std::chrono::milliseconds |
deltaOffset | ) |
|
|
pure virtual |
Method to seek to an offset from the current position.
- Parameters
-
deltaOffset | The offset to seek to relative to the current offset. |
◆ handleAuthorized()
virtual void alexaClientSDK::avsCommon::sdkInterfaces::externalMediaPlayer::ExternalMediaAdapterInterface::handleAuthorized |
( |
bool |
authorized, |
|
|
const std::string & |
playerId, |
|
|
const std::string & |
defaultSkillToken |
|
) |
| |
|
pure virtual |
Method to alert if a player has been authorized. This method also provides the playerId and skillToken as identified by the cloud. Authorization may be revoked.
- Parameters
-
authorized | Whether the player is authorized. |
playerId | The playerId of this player. |
defaultSkillToken | The default skillToken to use if no directives have supplied one yet. |
◆ handleLogin()
virtual void alexaClientSDK::avsCommon::sdkInterfaces::externalMediaPlayer::ExternalMediaAdapterInterface::handleLogin |
( |
const std::string & |
accessToken, |
|
|
const std::string & |
userName, |
|
|
bool |
forceLogin, |
|
|
std::chrono::milliseconds |
tokenRefreshInterval |
|
) |
| |
|
pure virtual |
Method to allow a user to login to a third party music provider.
- Parameters
-
accessToken | The access context of the user identifier. |
userName | The userName of the user logging in. |
forceLogin | bool which signifies if the adapter has to a force a login or merely cache the access token. |
tokenRefreshInterval | The duration in milliseconds for which the accessToken is valid. |
◆ handleLogout()
virtual void alexaClientSDK::avsCommon::sdkInterfaces::externalMediaPlayer::ExternalMediaAdapterInterface::handleLogout |
( |
| ) |
|
|
pure virtual |
Method that handles logging out a user from a third party library/cloud.
◆ handlePlay()
virtual void alexaClientSDK::avsCommon::sdkInterfaces::externalMediaPlayer::ExternalMediaAdapterInterface::handlePlay |
( |
std::string & |
playContextToken, |
|
|
int64_t |
index, |
|
|
std::chrono::milliseconds |
offset, |
|
|
const std::string & |
skillToken, |
|
|
const std::string & |
playbackSessionId, |
|
|
const std::string & |
navigation, |
|
|
bool |
preload, |
|
|
const avsCommon::avs::PlayRequestor & |
playRequestor |
|
) |
| |
|
pure virtual |
Method to allow a user to initiate play from a third party music service provider based on a play context.
- Parameters
-
playContextToken | Play context {Track/playlist/album/artist/station/podcast} identifier. |
index | The index of the media item in the container, if the container is indexable. |
offset | The offset position within media item, in milliseconds. |
skillToken | An opaque token for the domain or skill that is presently associated with this player. |
playbackSessionId | A universally unique identifier (UUID) generated to the RFC 4122 specification. |
navigation | Communicates desired visual display behavior for the app associated with playback. |
preload | If true, this Play directive is intended to preload the identified content only but not begin playback. |
playRequestor | The PlayRequestor object that is used to distinguish if it's a music alarm or not. |
◆ handlePlayControl()
virtual void alexaClientSDK::avsCommon::sdkInterfaces::externalMediaPlayer::ExternalMediaAdapterInterface::handlePlayControl |
( |
RequestType |
requestType | ) |
|
|
pure virtual |
Method to initiate the different types of play control like PLAY/PAUSE/RESUME/NEXT/...
- Parameters
-
requestType | The type of REQUEST. Will always be PLAY/PAUSE/RESUME/NEXT... |
◆ handleSeek()
virtual void alexaClientSDK::avsCommon::sdkInterfaces::externalMediaPlayer::ExternalMediaAdapterInterface::handleSeek |
( |
std::chrono::milliseconds |
offset | ) |
|
|
pure virtual |
Method to seek to the given offset.
- Parameters
-
offset | The offset to seek to. |
◆ init()
virtual void alexaClientSDK::avsCommon::sdkInterfaces::externalMediaPlayer::ExternalMediaAdapterInterface::init |
( |
| ) |
|
|
pure virtual |
Method to initialize a third party library.
The documentation for this class was generated from the following file:
AlexaClientSDK 1.20.1 - Copyright 2016-2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.
Licensed under the Apache License, Version 2.0