Class: shaka.offline.StorageMuxer

Constructor

new StorageMuxer()

Implements:
Source:

Members

(private, static) override_ :Map.<string, function(): shaka.extern.StorageMechanism>

Type:
Source:

(private, static, non-null) registry_ :Map.<string, function(): shaka.extern.StorageMechanism>

Type:
Source:

(private, non-null) mechanisms_ :Map.<string, !shaka.extern.StorageMechanism>

A key in this map is the name given when registering a StorageMechanism.
Type:
Source:

Methods

(static) clearOverride()

Undo a previous call to |overrideSupport|.
Source:

(private, static) getRegistry_() → (non-null) {Map.<string, function(): shaka.extern.StorageMechanism>}

Get the registry. If the support has been disabled, this will always an empty registry. Reading should always be done via |getRegistry_|.
Source:
Returns:
Type
Map.<string, function(): shaka.extern.StorageMechanism>

(static) overrideSupport(map)

Replace the mechanism map used by the muxer. This should only be used in testing.
Parameters:
Name Type Description
map Map.<string, function(): shaka.extern.StorageMechanism>
Source:

(export, static) register(name, factory)

Register a storage mechanism for use with the default storage muxer. This will have no effect on any storage muxer already in main memory.
Parameters:
Name Type Description
name string
factory function():shaka.extern.StorageMechanism
Source:

(static) support() → {boolean}

Check if there is support for storage on this platform. It is assumed that if there are any mechanisms registered, it means that storage is supported on this platform. We do not check if the mechanisms have any cells.
Source:
Returns:
Type
boolean

(export, static) unregister(name)

Unregister a storage mechanism for use with the default storage muxer. This will have no effect on any storage muxer already in main memory.
Parameters:
Name Type Description
name string The name that the storage mechanism was registered under.
Source:

(export) destroy() → (non-null) {Promise}

Free all resources used by the muxer, mechanisms, and cells. This should not affect the stored content.
Implements:
Source:
Returns:
Type
Promise

(async) erase() → (non-null) {Promise}

This will erase all previous content from storage. Using paths obtained before calling |erase| is discouraged, as cells may have changed during a erase.
Source:
Returns:
Type
Promise

forEachCell(callback)

Parameters:
Name Type Description
callback function(!shaka.offline.StorageCellPath, !shaka.extern.StorageCell)
Source:

forEachEmeSessionCell(callback)

Parameters:
Name Type Description
callback function(!shaka.extern.EmeSessionStorageCell)
Source:

getActive() → {shaka.offline.StorageCellHandle}

Get a promise that will resolve with a storage cell that supports add-operations. If no cell can be found, the promise will be rejected.
Source:
Returns:
Type
shaka.offline.StorageCellHandle

getCell(mechanismName, cellName) → (non-null) {shaka.extern.StorageCell}

Get a specific storage cell. The promise will resolve with the storage cell if it is found. If the storage cell is not found, the promise will be rejected.
Parameters:
Name Type Description
mechanismName string
cellName string
Source:
Returns:
Type
shaka.extern.StorageCell

getEmeSessionCell() → (non-null) {shaka.extern.EmeSessionStorageCell}

Gets an arbitrary EME session cell that can be used for storing new session info.
Source:
Returns:
Type
shaka.extern.EmeSessionStorageCell

init() → (non-null) {Promise}

Initialize the storage muxer. This must be called before any other calls. This will initialize the muxer to use all mechanisms that have been registered with |StorageMuxer.register|.
Source:
Returns:
Type
Promise

resolvePath(path) → {shaka.extern.StorageCell}

Find the cell that the path points to. A path is made up of a mount point and a cell id. If a cell can be found, the cell will be returned. If no cell is found, null will be returned.
Parameters:
Name Type Description
path shaka.offline.StorageCellPath
Source:
Returns:
Type
shaka.extern.StorageCell