Web cam view goes black, upon 'Start Recording'

Thanks again. I tried this without success. Can you tell me if it looks right?

  // Upload the video blob as form data
  upload.addEventListener('click', () => {
    const body = new FormData()

    body.append('myvideo', blob)

    fetch('upload.php', { method: 'POST', body })
      .then(() => console.log('Success!'))
      .catch(console.error)

  })

  $myVideo = $_FILES['myvideo'];

  move_uploaded_file(
    $myVideo['tmp_name'],
    '../uploads/' . basename($myVideo['name'])
);

}

navigator
  .mediaDevices
  .getUserMedia({ video: true })
  .then(initRecorder)
  .catch(console.error)

  </script>

No, mixing PHP and JS code won’t work… sorry if I was not clear about the language. It looks like that snippet happens to be valid JS syntax too, but if you check the console you’ll see that it throws a reference error.

Thank you. I’ve made some progess and started a new posting. Thanks for all your help/replies. I hope to see your comments on the newer posting.

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.