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

#include <ExternalMediaAdapterInterface.h>

Inheritance diagram for alexaClientSDK::acsdkExternalMediaPlayerInterfaces::ExternalMediaAdapterInterface:
Inheritance graph
Collaboration diagram for alexaClientSDK::acsdkExternalMediaPlayerInterfaces::ExternalMediaAdapterInterface:
Collaboration graph


struct  HandlePlayParams

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 (const HandlePlayParams &params)=0
virtual void handlePlayControl (RequestType requestType, const std::string &playbackTarget)=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::acsdkExternalMediaPlayerInterfaces::ExternalMediaAdapterInterface::ExternalMediaAdapterInterface ( const std::string &  adapterName)

ExternalMediaAdapterInterface constructor.

adapterNameThe name of the adapter.

◆ ~ExternalMediaAdapterInterface()

virtual alexaClientSDK::acsdkExternalMediaPlayerInterfaces::ExternalMediaAdapterInterface::~ExternalMediaAdapterInterface ( )


Member Function Documentation

◆ deInit()

virtual void alexaClientSDK::acsdkExternalMediaPlayerInterfaces::ExternalMediaAdapterInterface::deInit ( )
pure virtual

Method to de-initialize a third party library.

◆ getOffset()

virtual std::chrono::milliseconds alexaClientSDK::acsdkExternalMediaPlayerInterfaces::ExternalMediaAdapterInterface::getOffset ( )
pure virtual

This function retrieves the offset of the current track the adapter is handling.

This returns the offset in milliseconds.

◆ getState()

virtual AdapterState alexaClientSDK::acsdkExternalMediaPlayerInterfaces::ExternalMediaAdapterInterface::getState ( )
pure virtual

Method to fetch the state(session state and playback state) of an adapter.

◆ handleAdjustSeek()

virtual void alexaClientSDK::acsdkExternalMediaPlayerInterfaces::ExternalMediaAdapterInterface::handleAdjustSeek ( std::chrono::milliseconds  deltaOffset)
pure virtual

Method to seek to an offset from the current position.

deltaOffsetThe offset to seek to relative to the current offset.

◆ handleAuthorized()

virtual void alexaClientSDK::acsdkExternalMediaPlayerInterfaces::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.

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::acsdkExternalMediaPlayerInterfaces::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.

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::acsdkExternalMediaPlayerInterfaces::ExternalMediaAdapterInterface::handleLogout ( )
pure virtual

Method that handles logging out a user from a third party library/cloud.

◆ handlePlay()

virtual void alexaClientSDK::acsdkExternalMediaPlayerInterfaces::ExternalMediaAdapterInterface::handlePlay ( const HandlePlayParams params)
pure virtual

Method to allow a user to initiate play from a third party music service provider based on a play context.

paramsHandle play parameters required for playback

◆ handlePlayControl()

virtual void alexaClientSDK::acsdkExternalMediaPlayerInterfaces::ExternalMediaAdapterInterface::handlePlayControl ( RequestType  requestType,
const std::string &  playbackTarget 
pure virtual

Method to initiate the different types of play control like PLAY/PAUSE/RESUME/NEXT/...

requestTypeThe type of REQUEST. Will always be PLAY/PAUSE/RESUME/NEXT...
playbackTargetThe PlaybackTarget is used to specify the targeted device that will handle the play control.
isLocalWhether play control is locally triggered on device

◆ handleSeek()

virtual void alexaClientSDK::acsdkExternalMediaPlayerInterfaces::ExternalMediaAdapterInterface::handleSeek ( std::chrono::milliseconds  offset)
pure virtual

Method to seek to the given offset.

offsetThe offset to seek to.

◆ init()

virtual void alexaClientSDK::acsdkExternalMediaPlayerInterfaces::ExternalMediaAdapterInterface::init ( )
pure virtual

Method to initialize a third party library.

The documentation for this class was generated from the following file:

AlexaClientSDK 3.0.0 - Copyright 2016-2022, Inc. or its affiliates. All Rights Reserved. Licensed under the Apache License, Version 2.0