Stream video with GridStoreAdapter (implements byte-range requests) (#2437)

* Stream video with GridStoreAdapter

* fixing nits. Removing test(Range not accepted as header)

* nit

* Changed names. Added function to check if stream-requirements is fulfilled.
This commit is contained in:
Brage G. Staven
2016-08-12 21:58:18 +02:00
committed by Florent Vilmart
parent 122c3fd1a3
commit e690b73bb5
3 changed files with 128 additions and 11 deletions

View File

@@ -66,6 +66,15 @@ export class GridStoreAdapter extends FilesAdapter {
getFileLocation(config, filename) {
return (config.mount + '/files/' + config.applicationId + '/' + encodeURIComponent(filename));
}
getFileStream(filename: string) {
return this._connect().then(database => {
return GridStore.exist(database, filename).then(() => {
let gridStore = new GridStore(database, filename, 'r');
return gridStore.open();
});
});
}
}
export default GridStoreAdapter;