Transforming screen recording video chunks from blob into multipart for transmission via Api as a multipart

Seeking guidance in Angular 8 - looking for advice on converting screen recorded video chunks or blogs into a multipart format to send files via API (API only accepts multipart). Thank you in advance!

Answer №1

video-upload.component.ts

let videoChunks=[];
mediaRecorder.ondataavailable = function(e) {
   videoChunks.push(e.data);
}

onuploadtask

 uploadVideo(){
    let videoBlob = new Blob(videoChunks, { type : videoChunks[0].type });
    const fileForm = new FormData();
    fileForm.append('uploadedVideo', videoBlob);
    // send post request
 }

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Show the GitHub repositories of the user within a React application

Even though I am relatively new to React, I managed to create a GitHub search application. In this app, you can input a user's name in a search box and view their avatar, bio, username, etc. However, I'm facing an issue with fetching their reposi ...

On Windows systems, where exactly does npm place its packages during installation when using Node version 10.x

Does anyone know where I can locate the locally installed npm modules when using NodeJS version 10? I have checked under C:\Users\MyUser\AppData\Roaming, but I cannot find the "npm" folder. ...

How to send parameters to the jQuery delete button click event handler

Here is the jQuery code I am working with: $('#btnDelete').click( function() {//Do the delete here via jquery post}); In my table, each row has a delete button like this: <a id="btnDelete">Delete</a> I need to pass parameters to t ...

AngularJS powered edit button for Laravel route parameter

I have a data list that needs to be edited using an edit button. When clicking the edit button, I need to send the ID to a Laravel controller in order to fetch the corresponding data. The initial listing was created using Angular JS. <a class="btn" hr ...

Error message: The Dockerfile unexpectedly cannot find the Json-server command during execution

I am attempting to create a Dockerized Angular + Json-Server application, but I am encountering difficulty setting up json-server. Even though I have installed it in the Dockerfile, when using docker logs, it tells me that it couldn't find the command ...

The stream-chat-js package is causing an Angular compile error due to the absence of an exported member named 'Client'

Encountering an issue while attempting to compile an Angular application using the Node version of Stream Chat package. ERROR in node_modules/getstream/types/getstream/index.d.ts(12,11): error TS2694: Namespace '"/Users/.../app/node_modules/stream-c ...

How can I utilize React hook to choose multiple items?

I am currently working on developing a next js application. As part of this project, I have been tasked with creating a custom dropdown select menu using react hooks, specifically useState. The code I have written for this is as follows. Data- export defa ...

Utilizing ngModel with an uninitialized object

What is the most effective way to populate an empty instance of a class with values? For example, I have a User Class and need to create a new user. In my component, I initialize an empty User Object "user: User;". The constructor sets some properties, w ...

How should the nonce be properly set in the csp policy?

I've been attempting to incorporate a nonce into the csp policy but it's not functioning as anticipated. Here's the code snippet I'm currently using for testing purposes: server.js express.use(function(req, res, next) { res.set( ...

Aligning divs, prevent duplicate HTML within multiple divs

Currently, I am attempting to troubleshoot a jsfiddle issue. The main problem lies in my desire for the first two divs (with class="fbox") to be aligned next to each other on the same level. Furthermore, I am looking to enable dragging the image into the ...

Problem with the render() function in React

I am encountering an issue while trying to retrieve data from an endpoint. A error keeps popping up, mentioning that my render method contains an unexpected token. I would appreciate any assistance. Additionally, I am unsure if I am handling the brackets ...

Ending the Active Element within React's Accordion Component

I have created a basic accordion component for my product page in a Next.js/react app. It is functioning mostly as expected, but I am facing an issue. When a user clicks on a new accordion item, I want the currently active one to close automatically. Below ...

Identify alterations in a variable and trigger an event

I have a button labeled 'Refresh Data' that triggers the refreshBatchData() function: refreshBatchData(){ this.homeService.refreshData().subscribe(data => { this.batchSpotData = data; }) } After receiving data in batchSpo ...

Navigating through React-router with multiple child elements

Creating one of my routes requires the presence of two children in order to function properly. The main application page, where I set up all the routes, might look something like this: <Route path="/logs" component={Logs}> <Route path="/logs ...

Is the mounted hook not being triggered in a Nuxt component when deploying in production (full static mode)?

I have a component that is embedded within a page in my Nuxt project. This particular component contains the following lifecycle hooks: <script> export default { name: 'MyComponent', created() { alert('hello there!') }, ...

Correctly referencing a variable in a delayed AJAX request is crucial for ensuring the proper execution

I am facing an issue with a function called fetchAlbum. This function sets up a placeholder, sends an AJAX request, and updates the placeholder upon success. Here is the code snippet: function fetchAlbum() { albumCounter++; var albumElement = $(&a ...

Javascript clock problem, kick off on click

Currently working on a game and in need of a counter that starts when clicked and stops at 00 (From 1m to 00). It is currently starting onload and cycles back to start when it reaches 00. HTML: <body> <div> <div class="timer" >Battle t ...

Master the art of displaying complete text when zooming in and elegantly truncating it when zooming out

I am currently working on a data visualization project using d3.js. The tree chart that I have created is functioning well, but I would like the text to react dynamically when zooming in and out. You can find the code for my project on this JSFiddle page. ...

Patience is key as you await the element to load and smoothly render the data in vue.JS

Is there a way to ensure that the graph is only rendered and filled with data after the data has been returned from the backend? Currently, even though the data is returned, the graph appears blank. Here is my JavaScript code: methods: { refresh( ...

unable to implement multiple layouts while utilizing react-router

My current project requires two different layouts: one for the homepage (currently implemented in app.js) and another for the result page. After submitting a form, the results should be displayed in the result layout instead of the app layout. However, whe ...