Constructor
new StorageMechanism()
- Implements:
- Source:
Members
(static, constant) DB_NAME :string
Type:
- string
(static, constant) SESSION_ID_STORE :string
Type:
- string
(static, constant) V1_MANIFEST_STORE :string
Type:
- string
(static, constant) V1_SEGMENT_STORE :string
Type:
- string
(static, constant) V2_MANIFEST_STORE :string
Type:
- string
(static, constant) V2_SEGMENT_STORE :string
Type:
- string
(static, constant) V3_MANIFEST_STORE :string
Type:
- string
(static, constant) V3_SEGMENT_STORE :string
Type:
- string
(static, constant) VERSION :number
Type:
- number
(private) db_ :IDBDatabase
Type:
- IDBDatabase
(private) sessions_ :shaka.extern.EmeSessionStorageCell
Type:
(private) v1_ :shaka.extern.StorageCell
Type:
(private) v2_ :shaka.extern.StorageCell
Type:
(private) v3_ :shaka.extern.StorageCell
Type:
Methods
(private, static) createEmeSession_(dbnon-null) → {shaka.extern.EmeSessionStorageCell}
Parameters:
Name | Type | Description |
---|---|---|
db |
IDBDatabase |
Returns:
(private, static) createV1_(dbnon-null) → {shaka.extern.StorageCell}
Parameters:
Name | Type | Description |
---|---|---|
db |
IDBDatabase |
Returns:
(private, static) createV2_(dbnon-null) → {shaka.extern.StorageCell}
Parameters:
Name | Type | Description |
---|---|---|
db |
IDBDatabase |
Returns:
(private, static) createV3_(dbnon-null) → {shaka.extern.StorageCell}
Parameters:
Name | Type | Description |
---|---|---|
db |
IDBDatabase |
Returns:
(private, static) deleteAll_() → (non-null) {Promise}
Delete the indexed db instance so that all stores are deleted and cleared.
This will force the database to a like-new state next time it opens.
Returns:
- Type
- Promise
(private) createStores_(dbnon-null)
Parameters:
Name | Type | Description |
---|---|---|
db |
IDBDatabase |
(async) destroy() → (non-null) {Promise}
Free all resources used by the storage mechanism and its cells. This should
not affect the stored content.
- Implements:
- Source:
Returns:
- Type
- Promise
(async) erase() → (non-null) {Promise}
Erase all content from storage and leave storage in an empty state. Erase may
be called with or without |init|. This allows for storage to be wiped in
case of a version mismatch.
After calling |erase|, the mechanism will be in an initialized state.
- Implements:
- Source:
Returns:
- Type
- Promise
getCells() → (non-null) {Map.<string, !shaka.extern.StorageCell>}
Get a map of all the cells managed by the storage mechanism. Editing the map
should have no effect on the storage mechanism. The map key is the cell's
address in the mechanism and should be consistent between calls to
|getCells|.
- Implements:
- Source:
Returns:
- Type
- Map.<string, !shaka.extern.StorageCell>
getEmeSessionCell() → (non-null) {shaka.extern.EmeSessionStorageCell}
Get the current EME session storage cell.
- Implements:
- Source:
Returns:
init() → (non-null) {Promise}
Initialize the storage mechanism for first use. This should only be called
once. Calling |init| multiple times has an undefined behaviour.
- Implements:
- Source:
Returns:
- Type
- Promise