I'm currently in the process of building a media player web application which requires audio and video to be stored client side. The requirement is to also avoid streaming and that it must work in Safari.
For this I chose IndexedDb and have everything stored just fine in the browser. I have no problem getting the audio and playing via web audio api, however - I soon run into problems with the video.
My current approach is getting the video from indexeddb and creating a blob url for the src attribute:
const objectUrl = createObjectURL(record.videoData);
this.video.src = objectUrl;
This approach works fine for small videos (anything under 30mb), but for larger videos the playback stutters and i notice several error requests to the blob url in the web inspector (see image):
Despite the 'error' requests the video loads and plays. The only issue is the stuttering. I've also noticed this becomes increasingly worse in proportion to the file size.
I have looked around but have not found any alternative ways of achieving playback without streaming. I took a look at the Safari release notes and i noticed the following (from: safari release notes):
Changed memory handling to keep all of the decoded frames for an animated image if the total memory size of the frames is under 30MB (up from 5MB)
This looks likely to be the cause of the stuttering - and i assume that safari is trying to download chunks of the bloburl.
Is there an alternative approach to what i'm trying to achieve? This behaves much better in chrome (no stuttering), however - this has to work in Safari.
Any help is much appreciated.

