question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Save each ondataavailable blob to disk storage?

See original GitHub issue

I am trying to save the blobs from the ondataavailable callback to local disk storage (indexeddb) so then I can later grab and upload.

ondataavailable: function(blob) {
      RecordRTC.writeToDisk({video: blob});
}

So then I can later retrieve and update to the server (hopefully looping over the blobs)…

DiskStorage.Fetch('video', function(dataURL) {
      upload(dataURL)
});

Is there a way to do this? It looks like you can only store the complete blob and retrieve only that.

Issue Analytics

  • State:open
  • Created 3 years ago
  • Reactions:2
  • Comments:5

github_iconTop GitHub Comments

1reaction
trackedsupportcommented, Jul 16, 2021

I used https://dexie.org/. Something like this should work.

var db = new Dexie("Recordings");
db.version(1).stores({  blobs: "++id" });
recorder = new MediaRecorder(media_stream);
recorder.ondataavailable = function(e) { db.blobs.put({ blob_data: e.data }) }
recorder.start(5000)
0reactions
dengshicheng1996commented, Jul 13, 2021

I ended up making my own solution. Could you please provide a simple demo for me to learn

Read more comments on GitHub >

github_iconTop Results From Across the Web

Send MediaRecorder blobs to server and build file on backend
I'm sending all those small blobs to the server using ajax, on the server side I've got this to save the small blobs...
Read more >
Introduction to Azure Blob storage - Microsoft Learn
Blob Storage is optimized for storing massive amounts of unstructured data. Unstructured data is data that doesn't adhere to a particular ...
Read more >
MediaRecorder: dataavailable event - Web APIs | MDN
When the media stream ends, any media data not already delivered to your ondataavailable handler is passed in a single Blob .
Read more >
MediaStream Recording - W3C
By default a Blob containing the entire recording is returned when the ... Stop gathering data into blob (but keep it available so...
Read more >
dom MediaRecorder.ondataavailable - CodeProject Reference
The dataavailable event is fired when a Blob is made available for use in your application. This occurs in four different circumstances: When...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found