TransWikia.com

Fail Record video Html

Salesforce Asked by Daniela Cerqueira on January 2, 2021

I am creating a component that allows me to create a video with the webcam, using MediaStream. I can’t find how I can start recording the video. Any ideas what I will be missing?

 inicial: function (component, event, helper) {

        var width = 300; // scale the photo width to this
        var height = 0; // computed based on the input stream

        var streaming = false;
        var video = null;
        var canvas = null;
        var photo = null;
        var startbutton = null;
        video = document.getElementById('video1');
        canvas = document.getElementById('canvas');

        var streamRecorder;
        var webcamstream;

        navigator.mediaDevices.getUserMedia({
                video: true,
                audio: true
            })
            .then(function (stream) {
                video.src = window.URL.createObjectURL(stream);
                video.srcObject = stream;
                video.play();
            })
            .catch(function (err) {
                alert("An error occurred: " + err);
            });

           }

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP