feat(sltt-app): add contextBridge api for storing videos to local disk (outside of browser) #6
How does it all work?
added ipcMain.handle() for ipcRenderer messages storyVideoBlob and tryRetrieveVideoBlob
blobs are actually read/written using ArrayBuffers
store (and get) video blobs under %APPDATA%/sltt-app/persistentStorage/{projectName}/{_id}/{blob-num} (see app.getPath docs)
storeVideoBlob will return debug information about video file paths and buffer length.
tryRetrieveVideoBlob will return the arrayBuffer for the file if found, otherwise it returns null for file not found error, otherwise throws an error. (try in tryRetrieveVideoBlob interface means return null if not found)
Both interfaces try to throw type errors found in the args
What particularly has changed?
update electron-vite-config.ts so storage/index.ts gets compiled and included in build in out/main/storage.js
update version to 205104.0.22-alpha1 (2.51.4)
import ./storage.js
add storage/index.ts to define ipcMain handlers for storeVideoBlob and tryRetrieveVideoBlob messages
Steps for testing
With dev console open (control+shift+i) follow test steps in client changes PR and filter on SlttAppStorage to see logs
What issue(s) is this trying to resolve?
How does it all work?
storyVideoBlob
andtryRetrieveVideoBlob
%APPDATA%/sltt-app/persistentStorage/{projectName}/{_id}/{blob-num}
(see app.getPath docs)storeVideoBlob
will return debug information about video file paths and buffer length.tryRetrieveVideoBlob
will return the arrayBuffer for the file if found, otherwise it returns null for file not found error, otherwise throws an error. (try
intryRetrieveVideoBlob
interface means return null if not found)What particularly has changed?
electron-vite-config.ts
so storage/index.ts gets compiled and included in build inout/main/storage.js
./storage.js
storeVideoBlob
andtryRetrieveVideoBlob
messagesSteps for testing
SlttAppStorage
to see logshttps://github.com/ubsicap/sltt-app/assets/1125565/2ad324b5-3fe9-4184-9d43-41b87d404d54
ticket: https://github.com/ubsicap/sltt-app/issues/6 commit-convention: https://www.conventionalcommits.org/en/v1.0.0/