2 Replies Latest reply on May 21, 2015 10:50 PM by Devendra Kumar

    Webcam in EA using getUserMedia()

    Chepe Nicoli Level 1

      Hello,

       

      Has anyone tried this?

       

      getUserMedia() is only supported in Chrome and Firefox, no IE or Safari.

       

      However, I was able to stream a webcam using a iFrame inside Animate.

       

      But I want to stream the video directly without the need of iFrames. Here is an excellent tutorial for HTML, no Edge Animate.

      Capturing Audio & Video in HTML5 - HTML5 Rocks

       

      I do not know how to do the same inside Animate, any ideas or tips will be appreciated.

       

       

        • 1. Re: Webcam in EA using getUserMedia()
          Chepe Nicoli Level 1

          I added this JS (Add JS file from disk):


          var video = document.querySelector("#videoElement");

          navigator.getUserMedia = navigator.getUserMedia || navigator.webkitGetUserMedia || navigator.mozGetUserMedia || navigator.msGetUserMedia || navigator.oGetUserMedia;

          if (navigator.getUserMedia) { // get webcam feed if available

            navigator.getUserMedia({video: true}, handleVideo, videoError);

          }

          function handleVideo(stream) {

              video.src = window.URL.createObjectURL(stream);

          }

          function videoError(e) { alert ("No webcam found"); }


          Added a DIV with the name videoElement


          On compositioReady I wrote:

          sym.$("videoElement").html("<video autoplay id='videoElement'></video>");


          Previewing in the browser, Chrome ask my permission to use the camera, clicking on allow turns on the camera led but nothing is show. Any ideas?


          Screen Shot 2015-05-01 at 11.58.05 AM.png

          • 2. Re: Webcam in EA using getUserMedia()
            Devendra Kumar Adobe Employee

            Hi Jose,

             

            Unfortunatly getUserMedia() is not support on IE and Safari, please check.

             

            http://caniuse.com/#feat=stream

             

            -Devendra