Shaka Player Embedded
Classes | Public Member Functions | Static Public Member Functions | List of all members
shaka::Storage Class Referencefinal

#include <storage.h>

Classes

class  Client
 
class  Impl
 

Public Member Functions

 Storage (JsManager *engine, Player *player=nullptr)
 
 Storage (Storage &&)
 
 ~Storage ()
 
Storageoperator= (Storage &&)
 
 Storage (const Storage &)=delete
 
Storageoperator= (const Storage &)=delete
 
AsyncResults< void > Initialize (Client *client=nullptr)
 
AsyncResults< void > Destroy ()
 
AsyncResults< bool > GetStoreInProgress ()
 
AsyncResults< std::vector< StoredContent > > List ()
 
AsyncResults< void > Remove (const std::string &content_uri)
 
AsyncResults< bool > RemoveEmeSessions ()
 
AsyncResults< StoredContentStore (const std::string &uri)
 
AsyncResults< StoredContentStore (const std::string &uri, const std::unordered_map< std::string, std::string > &app_metadata)
 
AsyncResults< bool > Configure (const std::string &name_path, DefaultValueType)
 
AsyncResults< bool > Configure (const std::string &name_path, bool value)
 
AsyncResults< bool > Configure (const std::string &name_path, double value)
 
AsyncResults< bool > Configure (const std::string &name_path, const std::string &value)
 
template<typename T , typename = typename std::enable_if< std::is_arithmetic<T>::value>::type>
AsyncResults< bool > Configure (const std::string &name_path, T value)
 
AsyncResults< bool > Configure (const std::string &name_path, const char *value)
 

Static Public Member Functions

static AsyncResults< bool > Support (JsManager *engine)
 
static AsyncResults< void > DeleteAll (JsManager *engine)
 

Detailed Description

Represents a JavaScript shaka.offline.Storage instance. This handles storing, listing, and deleting stored content.

Definition at line 39 of file storage.h.

Constructor & Destructor Documentation

§ Storage() [1/3]

shaka::Storage::Storage ( JsManager engine,
Player player = nullptr 
)

Creates a new Storage instance.

Parameters
engineThe JavaScript engine to use.
playerThe Player instance to use as a base, can be nullptr.

Definition at line 105 of file storage.cc.

§ Storage() [2/3]

shaka::Storage::Storage ( Storage &&  )
default

§ ~Storage()

shaka::Storage::~Storage ( )

Definition at line 110 of file storage.cc.

§ Storage() [3/3]

shaka::Storage::Storage ( const Storage )
delete

Member Function Documentation

§ Configure() [1/6]

AsyncResults< bool > shaka::Storage::Configure ( const std::string &  name_path,
DefaultValueType   
)

Sets configuration values for Storage. This is associated with Player.configure and will change the player instance given at initialization. The path is a '.' separated list of names to reach the configuration. For example:

'abr.enabled' => {abr: {enabled: value}}

Returns
A future to whether the configuration path was valid.

Definition at line 138 of file storage.cc.

§ Configure() [2/6]

AsyncResults< bool > shaka::Storage::Configure ( const std::string &  name_path,
bool  value 
)

Sets configuration values for Storage. This is associated with Player.configure and will change the player instance given at initialization. The path is a '.' separated list of names to reach the configuration. For example:

'abr.enabled' => {abr: {enabled: value}}

Returns
A future to whether the configuration path was valid.

Definition at line 143 of file storage.cc.

§ Configure() [3/6]

AsyncResults< bool > shaka::Storage::Configure ( const std::string &  name_path,
double  value 
)

Sets configuration values for Storage. This is associated with Player.configure and will change the player instance given at initialization. The path is a '.' separated list of names to reach the configuration. For example:

'abr.enabled' => {abr: {enabled: value}}

Returns
A future to whether the configuration path was valid.

Definition at line 148 of file storage.cc.

§ Configure() [4/6]

AsyncResults< bool > shaka::Storage::Configure ( const std::string &  name_path,
const std::string &  value 
)

Sets configuration values for Storage. This is associated with Player.configure and will change the player instance given at initialization. The path is a '.' separated list of names to reach the configuration. For example:

'abr.enabled' => {abr: {enabled: value}}

Returns
A future to whether the configuration path was valid.

Definition at line 153 of file storage.cc.

§ Configure() [5/6]

template<typename T , typename = typename std::enable_if< std::is_arithmetic<T>::value>::type>
AsyncResults<bool> shaka::Storage::Configure ( const std::string &  name_path,
value 
)
inline

Sets configuration values for Storage. This is associated with Player.configure and will change the player instance given at initialization. The path is a '.' separated list of names to reach the configuration. For example:

'abr.enabled' => {abr: {enabled: value}}

Returns
A future to whether the configuration path was valid.

Definition at line 123 of file storage.h.

§ Configure() [6/6]

AsyncResults<bool> shaka::Storage::Configure ( const std::string &  name_path,
const char *  value 
)
inline

Sets configuration values for Storage. This is associated with Player.configure and will change the player instance given at initialization. The path is a '.' separated list of names to reach the configuration. For example:

'abr.enabled' => {abr: {enabled: value}}

Returns
A future to whether the configuration path was valid.

Definition at line 128 of file storage.h.

§ DeleteAll()

AsyncResults< void > shaka::Storage::DeleteAll ( JsManager engine)
static

Delete the on-disk storage and all the content it contains. This should not be done in normal circumstances. Only do it when storage is rendered unusable, such as by a version mismatch. No business logic will be run, and licenses will not be released.

Definition at line 120 of file storage.cc.

§ Destroy()

AsyncResults< void > shaka::Storage::Destroy ( )

Request that this object be destroyed, releasing all resources and shutting down all operations. Returns a Promise which is resolved when destruction is complete. This Promise should never be rejected.

Definition at line 130 of file storage.cc.

§ GetStoreInProgress()

AsyncResults< bool > shaka::Storage::GetStoreInProgress ( )

Returns true if an asset is currently downloading.

Definition at line 134 of file storage.cc.

§ Initialize()

AsyncResults< void > shaka::Storage::Initialize ( Client client = nullptr)

Initializes the Storage object. This must be called before any other methods.

Definition at line 126 of file storage.cc.

§ List()

AsyncResults< std::vector< StoredContent > > shaka::Storage::List ( )

Lists all the stored content available. This return array of structures representing all stored content. The offlineUri member of the structure is the URI that should be given to Player::Load() to play this piece of content offline.

Definition at line 158 of file storage.cc.

§ operator=() [1/2]

Storage & shaka::Storage::operator= ( Storage &&  )
default

§ operator=() [2/2]

Storage& shaka::Storage::operator= ( const Storage )
delete

§ Remove()

AsyncResults< void > shaka::Storage::Remove ( const std::string &  content_uri)

Removes the given stored content. This will also attempt to release the licenses, if any.

Definition at line 162 of file storage.cc.

§ RemoveEmeSessions()

AsyncResults< bool > shaka::Storage::RemoveEmeSessions ( )

Removes any EME sessions that were not successfully removed before. This returns whether all the sessions were successfully removed.

Definition at line 166 of file storage.cc.

§ Store() [1/2]

AsyncResults< StoredContent > shaka::Storage::Store ( const std::string &  uri)

Stores the given manifest. If the content is encrypted, and encrypted content cannot be stored on this platform, the Promise will be rejected with error code 6001, REQUESTED_KEY_SYSTEM_CONFIG_UNAVAILABLE.

Definition at line 170 of file storage.cc.

§ Store() [2/2]

AsyncResults< StoredContent > shaka::Storage::Store ( const std::string &  uri,
const std::unordered_map< std::string, std::string > &  app_metadata 
)

Stores the given manifest. This also stores the given data along side the media data so the app can store additional data.

Definition at line 174 of file storage.cc.

§ Support()

AsyncResults< bool > shaka::Storage::Support ( JsManager engine)
static

Gets whether offline storage is supported. Returns true if offline storage is supported for clear content. Support for offline storage of encrypted content will not be determined until storage is attempted.

Definition at line 114 of file storage.cc.


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