What's new

Welcome to the forum 👋, Visitor

To access the forum content and all our services, you must register or log in to the forum. Becoming a member of the forum is completely free.

Allow camera access - show camera view -- don’t start recording video

chrisj

New member
Joined
Jun 24, 2020
Messages
4
Reaction score
0
HTML Coins
0
This code below works successfully to capture/record/play video - after camera access permission is granted - when the start button is selected. I'm trying to add the functionality where (after camera access is allowed) the camera view appears, without recording starting automatically (And have the camera view displayed while recording).

Currently, the screen is black after camera access and while capture/recording. I was told that I need to "capture the stream from the video element and put it through the MediaRecorder object". I don't know how to do that. Any help is appreciated

JavaScript:
var video = document.querySelector("video");
let params = { audio: true, video: { facingMode: { exact: "environment" } } };

let blobs = [];
let stream, mediaRecorder, blob;

async function startRecording() {
  stream = await navigator.mediaDevices.getUserMedia({
    audio: true,
    video: true,
  });

  mediaRecorder = new MediaRecorder(stream);
  mediaRecorder.ondataavailable = (event) => {
    // Let's append blobs for now, we could also upload them to the network.
    if (event.data) {
      blobs.push(event.data);
 

Theme customization system

You can customize some areas of the forum theme from this menu.

  • Wide/Narrow view

    You can control a structure that you can use to use your theme wide or narrow.

    Grid view forum list

    You can control the layout of the forum list in a grid or ordinary listing style structure.

    Picture grid mode

    You can control the structure where you can open/close images in the grid forum list.

    Close sidebar

    You can get rid of the crowded view in the forum by closing the sidebar.

    Fixed sidebar

    You can make it more useful and easier to access by pinning the sidebar.

    Close radius

    You can use the radius at the corners of the blocks according to your taste by closing/opening it.

  • Choose the color combination that reflects your taste
    Background images
    Color gradient backgrounds
Back