IndexedDB Access
- Source:
Methods
-
createFragmentStore(storeName)
-
Creates an instance of localforage to store fragments in indexed db
Parameters:
Name Type Description storeNamestring - Source:
-
deleteDownloadById(manifestId)
-
Remove download given its id (fragmentStore + manifest entry in manifest array)
Parameters:
Name Type Description manifestIdnumber - Source:
Returns:
promise asynchronously resolved
- Type
- Promise
-
deleteFragmentStore(storeName)
-
Remove fragment store
Parameters:
Name Type Description storeNamestring - Source:
Returns:
promise asynchronously resolved
- Type
- Promise
-
dropAll()
-
Remove all manifest and fragment store
- Source:
Returns:
promise asynchronously resolved
- Type
- Promise
-
dropFragmentStore(storeName)
-
Remove framgent store given its name
Parameters:
Name Type Description storeNamestring - Source:
-
getAllManifests()
-
Returns all offline manifests
- Source:
Returns:
{Object[]} manifests
- Type
- Promise
-
getCurrentHigherManifestId()
-
Return higher manifest id
- Source:
Returns:
number
- Type
- Promise
-
getFragmentByKey(manifestId, key)
-
Returns a fragment from its key
Parameters:
Name Type Description manifestIdnumber keynumber - Source:
Returns:
fragment
- Type
- Promise
-
getManifestById(id)
-
Returns a manifest from its identifier
Parameters:
Name Type Description idnumber - Source:
Returns:
{Object[]} manifests
- Type
- Promise
-
getRepresentationCurrentState(manifestId, representationId)
-
Returns current downloaded segment index for representation
Parameters:
Name Type Description manifestIdnumber manifest id
representationIdstring representation
- Source:
Returns:
promise
- Type
- Promise
-
saveSelectedRepresentations(manifest, selected)
-
save selected representation by user
Parameters:
Name Type Description manifestObject updated manifest
selectedObject selected representations
- Source:
Returns:
promise asynchronously resolved
- Type
- Promise
-
setDownloadingStatus(manifestId, newStatus)
-
Update download status
Parameters:
Name Type Description manifestIdnumber newStatusstring - Source:
Returns:
promise
- Type
- Promise
-
setRepresentationCurrentState(manifestId, representationId, state)
-
Updat last downloaded fragment index for representationId
Parameters:
Name Type Description manifestIdnumber manifest id
representationIdstring representation
statenumber representation state
- Source:
Returns:
promise
- Type
- Promise
-
storeFragment(manifestId, fragmentId, fragmentData)
-
Store a fragment in fragment store
Parameters:
Name Type Description manifestIdnumber fragmentIdnumber fragmentDataObject - Source:
Returns:
promise asynchronously resolved
- Type
- Promise
-
storeManifest(manifest)
-
Store a manifest in manifest array
Parameters:
Name Type Description manifestObject - Source:
-
updateManifest(manifest)
-
Update manifest
Parameters:
Name Type Description manifestObject updated manifest
- Source:
Returns:
promise asynchronously resolved
- Type
- Promise