AlexaClientSDK  3.0.0
A cross-platform, modular SDK for interacting with the Alexa Voice Service
Namespaces | Classes | Typedefs | Enumerations | Functions | Variables
alexaClientSDK::avsCommon::utils::mediaPlayer Namespace Reference

Namespaces

 test
 

Classes

struct  Fingerprint
 
struct  MediaDescription
 
class  MediaPlayerFactoryInterface
 
class  MediaPlayerFactoryObserverInterface
 
class  MediaPlayerInterface
 
class  MediaPlayerObserverInterface
 
struct  MediaPlayerState
 
struct  PlaybackAttributes
 
struct  PlaybackContext
 
struct  PlaybackReport
 
class  PooledMediaResourceProvider
 
class  PooledMediaResourceProviderInterface
 
struct  SourceConfig
 

Typedefs

typedef std::map< std::string, std::string > HeaderConfig
 Header Key, Value pairs. More...
 

Enumerations

enum  ErrorType {
  ErrorType::NONE, ErrorType::MEDIA_ERROR_UNKNOWN, ErrorType::MEDIA_ERROR_INVALID_REQUEST, ErrorType::MEDIA_ERROR_SERVICE_UNAVAILABLE,
  ErrorType::MEDIA_ERROR_INTERNAL_SERVER_ERROR, ErrorType::MEDIA_ERROR_INTERNAL_DEVICE_ERROR, ErrorType::MEDIA_ERROR_HTTP_BAD_REQUEST, ErrorType::MEDIA_ERROR_HTTP_UNAUTHORIZED,
  ErrorType::MEDIA_ERROR_HTTP_FORBIDDEN, ErrorType::MEDIA_ERROR_HTTP_NOT_FOUND, ErrorType::MEDIA_ERROR_HTTP_CONFLICT, ErrorType::MEDIA_ERROR_HTTP_INVALID_RANGE,
  ErrorType::MEDIA_ERROR_HTTP_TOO_MANY_REQUESTS, ErrorType::MEDIA_ERROR_HTTP_BAD_GATEWAY, ErrorType::MEDIA_ERROR_HTTP_SERVICE_UNAVAILABLE, ErrorType::MEDIA_ERROR_HTTP_GATEWAY_TIMEOUT,
  ErrorType::MEDIA_ERROR_TIMED_OUT, ErrorType::MEDIA_ERROR_URL_MALFORMED, ErrorType::MEDIA_ERROR_COULD_NOT_RESOLVE_HOST, ErrorType::MEDIA_ERROR_COULD_NOT_CONNECT,
  ErrorType::MEDIA_ERROR_NOT_SEEKABLE, ErrorType::MEDIA_ERROR_UNSUPPORTED, ErrorType::MEDIA_ERROR_POSSIBLY_TEXT, ErrorType::MEDIA_ERROR_IO,
  ErrorType::MEDIA_ERROR_INVALID_COMMAND, ErrorType::MEDIA_ERROR_PLAYLIST_ERROR, ErrorType::MEDIA_ERROR_DECRYPTION_FLOW
}
 Identifies the specific type of error in a PlaybackFailed event. More...
 

Functions

std::string errorTypeToString (ErrorType errorType)
 
std::ostream & operator<< (std::ostream &stream, const ErrorType &errorType)
 
MediaDescription emptyMediaDescription ()
 
std::ostream & operator<< (std::ostream &stream, const MediaDescription &mediaDescription)
 
std::ostream & operator<< (std::ostream &stream, const MediaPlayerState &state)
 
std::ostream & operator<< (std::ostream &stream, const MediaPlayerState::MediaPlayerProtection &mediaPlayerProtection)
 
bool validateIfNotMalicious (const std::string &header)
 
std::pair< bool, bool > validatePlaybackContextHeaders (PlaybackContext *playbackContext)
 
SourceConfig emptySourceConfig ()
 
std::ostream & operator<< (std::ostream &stream, const SourceConfig &config)
 

Variables

static std::string PLAY_BEHAVIOR = "playBehavior"
 Play behavior key to be included in the additional data. More...
 
static const std::chrono::milliseconds MEDIA_PLAYER_INVALID_OFFSET {-1}
 Represents offset returned when MediaPlayer is in an invalid state. More...
 
const std::chrono::milliseconds DURATION_UNKNOWN = std::chrono::milliseconds(-1)
 
static constexpr short MAX_GAIN = 100
 Maximum gain supported. More...
 
static constexpr short MIN_GAIN = 0
 Minimum gain supported. More...
 

Typedef Documentation

◆ HeaderConfig

typedef std::map<std::string, std::string> alexaClientSDK::avsCommon::utils::mediaPlayer::HeaderConfig

Header Key, Value pairs.

Enumeration Type Documentation

◆ ErrorType

Identifies the specific type of error in a PlaybackFailed event.

Enumerator
NONE 

None.

MEDIA_ERROR_UNKNOWN 

An unknown error occurred.

MEDIA_ERROR_INVALID_REQUEST 

The server recognized the request as being malformed (bad request, unauthorized, forbidden, not found, etc).

MEDIA_ERROR_SERVICE_UNAVAILABLE 

The client was unable to reach the service.

MEDIA_ERROR_INTERNAL_SERVER_ERROR 

The server accepted the request, but was unable to process the request as expected.

MEDIA_ERROR_INTERNAL_DEVICE_ERROR 

There was an internal error on the client.

MEDIA_ERROR_HTTP_BAD_REQUEST 

There was an bad request.

MEDIA_ERROR_HTTP_UNAUTHORIZED 

Request is unauthorized.

MEDIA_ERROR_HTTP_FORBIDDEN 

Request is forbidden.

MEDIA_ERROR_HTTP_NOT_FOUND 

Http resource not found.

MEDIA_ERROR_HTTP_CONFLICT 

There was a conflict.

MEDIA_ERROR_HTTP_INVALID_RANGE 

Range is invalid.

MEDIA_ERROR_HTTP_TOO_MANY_REQUESTS 

There were too many requests.

MEDIA_ERROR_HTTP_BAD_GATEWAY 

Bad Gateway.

MEDIA_ERROR_HTTP_SERVICE_UNAVAILABLE 

Service is unavailable.

MEDIA_ERROR_HTTP_GATEWAY_TIMEOUT 

Gateway timeout occurred.

MEDIA_ERROR_TIMED_OUT 

There was a timeout.

MEDIA_ERROR_URL_MALFORMED 

URL was malformed.

MEDIA_ERROR_COULD_NOT_RESOLVE_HOST 

Couldn't resolve host.

MEDIA_ERROR_COULD_NOT_CONNECT 

Coudln't connect to server.

MEDIA_ERROR_NOT_SEEKABLE 

The resource is not seekable.

MEDIA_ERROR_UNSUPPORTED 

Unsupported error.

MEDIA_ERROR_POSSIBLY_TEXT 

Text file, hence not playable.

MEDIA_ERROR_IO 

IO error.

MEDIA_ERROR_INVALID_COMMAND 

Invalid command.

MEDIA_ERROR_PLAYLIST_ERROR 

Playlist error occurred.

MEDIA_ERROR_DECRYPTION_FLOW 

Decryption Flow failure.

Function Documentation

◆ emptyMediaDescription()

MediaDescription alexaClientSDK::avsCommon::utils::mediaPlayer::emptyMediaDescription ( )
inline

Builds an empty Media Description object.

Returns
an empty Media Description object.

◆ emptySourceConfig()

SourceConfig alexaClientSDK::avsCommon::utils::mediaPlayer::emptySourceConfig ( )
inline

Builds a Source Config object with fade in disabled.

Returns
a Source Config object without fade in

◆ errorTypeToString()

std::string alexaClientSDK::avsCommon::utils::mediaPlayer::errorTypeToString ( ErrorType  errorType)
inline

Convert an ErrorType to an AVS-compliant std::string.

Parameters
errorTypeThe ErrorType to convert.
Returns
The AVS-compliant string representation of errorType.

◆ operator<<() [1/5]

std::ostream& alexaClientSDK::avsCommon::utils::mediaPlayer::operator<< ( std::ostream &  stream,
const MediaDescription mediaDescription 
)
inline

Write a MediaDescription value to the given stream.

Parameters
streamThe stream to write the value to.
mediaDescriptionThe value to write to the stream as a string.
Returns
The stream that was passed in and written to.

◆ operator<<() [2/5]

std::ostream& alexaClientSDK::avsCommon::utils::mediaPlayer::operator<< ( std::ostream &  stream,
const SourceConfig config 
)
inline

Write a SourceConfig value to the given stream.

Parameters
streamThe stream to write the value to.
configThe value to write to the stream as a string.
Returns
The stream that was passed in and written to.

◆ operator<<() [3/5]

std::ostream& alexaClientSDK::avsCommon::utils::mediaPlayer::operator<< ( std::ostream &  stream,
const MediaPlayerState::MediaPlayerProtection mediaPlayerProtection 
)
inline

Write a MediaPlayerProtection value to an ostream.

Parameters
streamThe stream to write the value to.
mediaPlayerProtectionThe MediaPlayerProtection value to write to the ostream as a string.
Returns
The ostream that was passed in and written to.

◆ operator<<() [4/5]

std::ostream& alexaClientSDK::avsCommon::utils::mediaPlayer::operator<< ( std::ostream &  stream,
const ErrorType errorType 
)
inline

Write an ErrorType value to an ostream.

Parameters
streamThe stream to write the value to.
errorTypeThe ErrorType value to write to the ostream as a string.
Returns
The ostream that was passed in and written to.

◆ operator<<() [5/5]

std::ostream& alexaClientSDK::avsCommon::utils::mediaPlayer::operator<< ( std::ostream &  stream,
const MediaPlayerState state 
)
inline

Write a MediaPlayerState to an ostream as a string.

Parameters
streamThe stream to write the value to.
stateThe state value to write to teh ostream as a string
Returns
The ostream that was passed in and written to.

◆ validateIfNotMalicious()

bool alexaClientSDK::avsCommon::utils::mediaPlayer::validateIfNotMalicious ( const std::string &  header)

Check for malicious characters(,
, null) in the header string.

Parameters
headerto be validated.
Returns
true if not malicious, else false.

◆ validatePlaybackContextHeaders()

std::pair<bool, bool> alexaClientSDK::avsCommon::utils::mediaPlayer::validatePlaybackContextHeaders ( PlaybackContext playbackContext)

Validate the headers. Delete the invalid entries

Parameters
[out]playbackContextto be validated and the invalid entries will be deleted.
Returns
<true, true> if valid and not malicious.

Variable Documentation

◆ DURATION_UNKNOWN

const std::chrono::milliseconds alexaClientSDK::avsCommon::utils::mediaPlayer::DURATION_UNKNOWN = std::chrono::milliseconds(-1)

◆ MAX_GAIN

constexpr short alexaClientSDK::avsCommon::utils::mediaPlayer::MAX_GAIN = 100
static

Maximum gain supported.

◆ MEDIA_PLAYER_INVALID_OFFSET

const std::chrono::milliseconds alexaClientSDK::avsCommon::utils::mediaPlayer::MEDIA_PLAYER_INVALID_OFFSET {-1}
static

Represents offset returned when MediaPlayer is in an invalid state.

◆ MIN_GAIN

constexpr short alexaClientSDK::avsCommon::utils::mediaPlayer::MIN_GAIN = 0
static

Minimum gain supported.

◆ PLAY_BEHAVIOR

std::string alexaClientSDK::avsCommon::utils::mediaPlayer::PLAY_BEHAVIOR = "playBehavior"
static

Play behavior key to be included in the additional data.

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