Constructor
new V1StorageCell(connection, segmentStore, manifestStore)
Parameters:
Name |
Type |
Description |
connection |
IDBDatabase
|
|
segmentStore |
string
|
|
manifestStore |
string
|
|
- Implements:
- Source:
Members
(private) manifestStore_ :string
Type:
- Source:
(private) segmentStore_ :string
Type:
- Source:
Methods
(private, static) fillMissingVariants_(periodnon-null)
Take a period and check if the streams need to have variants generated.
Before Shaka Player moved to its variants model, there were no variants.
This will fill missing variants into the given object.
Parameters:
Name |
Type |
Description |
period |
Object
|
|
- Source:
(private, static) getKeyFromSegmentUri_(uri) → {number}
Parameters:
Name |
Type |
Description |
uri |
string
|
|
- Source:
Returns:
-
Type
-
number
addManifests(manifestsnon-null) → (non-null) {Promise.<!Array.<number>>}
Add a group of manifests. Will return a promise that resolves with a list
of keys for each manifest. If one manifest fails to be added, all manifests
should fail to be added.
Parameters:
- Implements:
- Source:
Returns:
keys
-
Type
-
Promise.<!Array.<number>>
addSegments(segmentsnon-null) → (non-null) {Promise.<!Array.<number>>}
Add a group of segments. Will return a promise that resolves with a list
of keys for each segment. If one segment fails to be added, all segments
should fail to be added.
Parameters:
- Implements:
- Source:
Returns:
-
Type
-
Promise.<!Array.<number>>
destroy() → (non-null) {Promise}
Free all resources used by this cell. This should not affect the stored
content.
- Implements:
- Source:
Returns:
-
Type
-
Promise
(private) get_(storeName, keysnon-null) → (non-null) {Promise.<!Array.<T>>}
Parameters:
Name |
Type |
Description |
storeName |
string
|
|
keys |
Array.<number>
|
|
- Source:
Returns:
-
Type
-
Promise.<!Array.<T>>
getAllManifests() → (non-null) {Promise.<!Object.<number, shakaExtern.ManifestDB>>}
Get all manifests stored in this cell. Since manifests are small compared to
the asset they describe, it is assumed that it is feasible to have them all
in main memory at one time.
- Implements:
- Source:
Returns:
-
Type
-
Promise.<!Object.<number, shakaExtern.ManifestDB>>
getManifests(keysnon-null) → (non-null) {Promise.<!Array.<shakaExtern.ManifestDB>>}
Get a group of manifests using their keys to identify them. If any key is
not found, the promise chain will be rejected.
Parameters:
Name |
Type |
Description |
keys |
Array.<number>
|
|
- Implements:
- Source:
Returns:
-
Type
-
Promise.<!Array.<shakaExtern.ManifestDB>>
getSegments(keysnon-null) → (non-null) {Promise.<!Array.<shakaExtern.SegmentDataDB>>}
Get a group of segments using their keys to identify them. If any key is
not found, the promise chain will be rejected.
Parameters:
Name |
Type |
Description |
keys |
Array.<number>
|
|
- Implements:
- Source:
Returns:
-
Type
-
Promise.<!Array.<shakaExtern.SegmentDataDB>>
hasFixedKeySpace() → {boolean}
Check if the cell can support new keys. If a cell has a fixed key space,
then all add-operations will fail as no new keys can be added. All
remove-operations and update-operations should still work.
- Implements:
- Source:
Returns:
-
Type
-
boolean
(private) rejectAdd_(storeName) → (non-null) {Promise}
Parameters:
Name |
Type |
Description |
storeName |
string
|
|
- Source:
Returns:
-
Type
-
Promise
(private) remove_(storeName, keysnon-null, onRemove) → (non-null) {Promise}
Parameters:
Name |
Type |
Description |
storeName |
string
|
|
keys |
Array.<number>
|
|
onRemove |
function(number)
|
|
- Source:
Returns:
-
Type
-
Promise
removeManifests(keysnon-null, onRemove) → (non-null) {Promise}
Remove a group of manifests using their keys to identify them. If a key
is not found, then that removal should be considered successful.
Parameters:
Name |
Type |
Description |
keys |
Array.<number>
|
|
onRemove |
function
|
A callback for when a manifest is removed
from the cell. The key of the manifest
will be passed to the callback. |
- Implements:
- Source:
Returns:
-
Type
-
Promise
removeSegments(keysnon-null, onRemove) → (non-null) {Promise}
Remove a group of segments using their keys to identify them. If a key
is not found, then that removal should be considered successful.
Parameters:
Name |
Type |
Description |
keys |
Array.<number>
|
|
onRemove |
function
|
A callback for when a segment is removed
from the cell. The key of the segment
will be passed to the callback. |
- Implements:
- Source:
Returns:
-
Type
-
Promise
updateManifestExpiration(key, expiration) → (non-null) {Promise}
Replace the expiration time of the manifest stored under |key| with
|newExpiration|. If no manifest is found under |key| then this should
act as a no-op.
Parameters:
Name |
Type |
Description |
key |
number
|
|
expiration |
number
|
|
- Implements:
- Source:
Returns:
-
Type
-
Promise