AlexaClientSDK  1.20.1
A cross-platform, modular SDK for interacting with the Alexa Voice Service
Public Member Functions | List of all members
alexaClientSDK::avsCommon::sdkInterfaces::externalMediaPlayer::ExternalMediaAdapterInterface Class Referenceabstract

#include <ExternalMediaAdapterInterface.h>

Inheritance diagram for alexaClientSDK::avsCommon::sdkInterfaces::externalMediaPlayer::ExternalMediaAdapterInterface:
Inheritance graph
[legend]
Collaboration diagram for alexaClientSDK::avsCommon::sdkInterfaces::externalMediaPlayer::ExternalMediaAdapterInterface:
Collaboration graph
[legend]

Public Member Functions

 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
 
- Public Member Functions inherited from alexaClientSDK::avsCommon::utils::RequiresShutdown
 RequiresShutdown (const std::string &name)
 
virtual ~RequiresShutdown ()
 Destructor. More...
 
const std::string & name () const
 
void shutdown ()
 
bool isShutdown () const
 

Additional Inherited Members

- Protected Member Functions inherited from alexaClientSDK::avsCommon::utils::RequiresShutdown
virtual void doShutdown ()=0
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ ExternalMediaAdapterInterface()

alexaClientSDK::avsCommon::sdkInterfaces::externalMediaPlayer::ExternalMediaAdapterInterface::ExternalMediaAdapterInterface ( const std::string &  adapterName)
inlineexplicit

ExternalMediaAdapterInterface constructor.

Parameters
adapterNameThe name of the adapter.

◆ ~ExternalMediaAdapterInterface()

virtual alexaClientSDK::avsCommon::sdkInterfaces::externalMediaPlayer::ExternalMediaAdapterInterface::~ExternalMediaAdapterInterface ( )
virtualdefault

Destructor.

Member Function Documentation

◆ 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
deltaOffsetThe 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
authorizedWhether the player is authorized.
playerIdThe playerId of this player.
defaultSkillTokenThe 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
accessTokenThe access context of the user identifier.
userNameThe userName of the user logging in.
forceLoginbool which signifies if the adapter has to a force a login or merely cache the access token.
tokenRefreshIntervalThe 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
playContextTokenPlay context {Track/playlist/album/artist/station/podcast} identifier.
indexThe index of the media item in the container, if the container is indexable.
offsetThe offset position within media item, in milliseconds.
skillTokenAn opaque token for the domain or skill that is presently associated with this player.
playbackSessionIdA universally unique identifier (UUID) generated to the RFC 4122 specification.
navigationCommunicates desired visual display behavior for the app associated with playback.
preloadIf true, this Play directive is intended to preload the identified content only but not begin playback.
playRequestorThe 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
requestTypeThe 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
offsetThe 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