<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Mario, are you using in Software Archive</title>
    <link>https://community.intel.com/t5/Software-Archive/Camera-Preview-inside-canvas/m-p/1013297#M35012</link>
    <description>&lt;P&gt;Mario, are you using Crosswalk and the Debug tab? If you are testing in App Preview on an Android 4.x device you will not have good results. The Android 2.x and 4.x webviews are very old. You must use Crosswalk and the Debug tab if you want to use modern HTML5 features like those you are describing here.&lt;/P&gt;</description>
    <pubDate>Mon, 07 Dec 2015 16:52:55 GMT</pubDate>
    <dc:creator>PaulF_IntelCorp</dc:creator>
    <dc:date>2015-12-07T16:52:55Z</dc:date>
    <item>
      <title>Camera Preview inside canvas</title>
      <link>https://community.intel.com/t5/Software-Archive/Camera-Preview-inside-canvas/m-p/1013291#M35006</link>
      <description>&lt;P&gt;Hello everyone,&lt;/P&gt;

&lt;P&gt;is there a way to enter the preview of the camera within a canvas, using Object Camera? (Or other similar methods)&lt;BR /&gt;
	I need this because I should periodically check the color composition of images taken by the camera, the preview and the canvas seems suitable for this purpose.&lt;/P&gt;

&lt;P&gt;Thanks for the help&lt;/P&gt;</description>
      <pubDate>Sat, 10 Oct 2015 18:18:40 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Archive/Camera-Preview-inside-canvas/m-p/1013291#M35006</guid>
      <dc:creator>Mario_R_</dc:creator>
      <dc:date>2015-10-10T18:18:40Z</dc:date>
    </item>
    <item>
      <title>You'll need to grab an image</title>
      <link>https://community.intel.com/t5/Software-Archive/Camera-Preview-inside-canvas/m-p/1013292#M35007</link>
      <description>&lt;P&gt;You'll need to grab an image from the image roll and copy it into a canvas object, unless you find a camera plugin that does what you are looking for. Those plugin APIs are all written by third-parties, and generally the source is available in a GitHub repo. So if the API does not do what you want, you can modify it to suit. The XDK does not dictate how those APIs work. The XDK makes it more convenient to build Cordova apps.&lt;/P&gt;</description>
      <pubDate>Mon, 19 Oct 2015 18:42:08 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Archive/Camera-Preview-inside-canvas/m-p/1013292#M35007</guid>
      <dc:creator>PaulF_IntelCorp</dc:creator>
      <dc:date>2015-10-19T18:42:08Z</dc:date>
    </item>
    <item>
      <title>currently I solved using</title>
      <link>https://community.intel.com/t5/Software-Archive/Camera-Preview-inside-canvas/m-p/1013293#M35008</link>
      <description>&lt;P&gt;currently I solved using getUserMedia, the problem is that I turned on the camera front instead of the back one. And 'possible to select the camera to use?&lt;/P&gt;

&lt;PRE class="brush:jscript;"&gt;navigator.getUserMedia = navigator.getUserMedia || navigator.webkitGetUserMedia || navigator.msGetUserMedia;
window.URL = window.URL || window.webkitURL || window.msURL;
if (navigator.getUserMedia){

      navigator.getUserMedia({
        video: true,
        audio: false
      }, function(stream){ 
              video.src = window.URL.createObjectURL(stream); 
      }, errorCallback);
 };&lt;/PRE&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;

&lt;P&gt;&lt;SPAN style="font-size: 13.008px; line-height: 19.512px;"&gt;Thanks for the help&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 28 Nov 2015 01:05:49 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Archive/Camera-Preview-inside-canvas/m-p/1013293#M35008</guid>
      <dc:creator>Mario_R_</dc:creator>
      <dc:date>2015-11-28T01:05:49Z</dc:date>
    </item>
    <item>
      <title>The APIs you are using are</title>
      <link>https://community.intel.com/t5/Software-Archive/Camera-Preview-inside-canvas/m-p/1013294#M35009</link>
      <description>&lt;P&gt;The APIs you are using are standard HTML5, so they may not work on some older Android devices (unless you stick to using Crosswalk). See this updated version of the getUserMedia API for some options that specify how to select the front and rear cameras:&lt;/P&gt;

&lt;P&gt;&lt;A href="https://developer.mozilla.org/en-US/docs/Web/API/MediaDevices/getUserMedia" target="_blank"&gt;https://developer.mozilla.org/en-US/docs/Web/API/MediaDevices/getUserMedia&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;Very nice solution, thanks for sharing!&lt;/P&gt;</description>
      <pubDate>Mon, 30 Nov 2015 18:52:27 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Archive/Camera-Preview-inside-canvas/m-p/1013294#M35009</guid>
      <dc:creator>PaulF_IntelCorp</dc:creator>
      <dc:date>2015-11-30T18:52:27Z</dc:date>
    </item>
    <item>
      <title> </title>
      <link>https://community.intel.com/t5/Software-Archive/Camera-Preview-inside-canvas/m-p/1013295#M35010</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;

&lt;P&gt;Thanks for the input! I did some tests with MediaDevices.getUserMedia () to access the room back of the phone. Following the poor results.&amp;nbsp;&lt;/P&gt;

&lt;P&gt;First way: select camera environment&lt;/P&gt;

&lt;PRE class="brush:jscript;"&gt;      navigator.mediaDevices = navigator.mediaDevices || ((navigator.mozGetUserMedia || navigator.webkitGetUserMedia) ? {
           getUserMedia: function(c) {
             return new Promise(function(y, n) {
               (navigator.mozGetUserMedia ||
                navigator.webkitGetUserMedia).call(navigator, c, y, n);
             });
           }
        } : null);

        if (!navigator.mediaDevices) {
          console.log("getUserMedia() not supported.");
          return;
        }

navigator.mediaDevices.getUserMedia({ audio: false, video: { facingMode: "environment"} })          
        .then(function(stream) {
          var video = document.querySelector('video');
          video.src = window.URL.createObjectURL(stream);
          video.onloadedmetadata = function(e) {
            video.play();
              initCanvas(); 
          };
        })
        .catch(function(err) {
          console.log(err.name + ": " + err.message);
        });
&lt;/PRE&gt;

&lt;P&gt;Error:&amp;nbsp;&lt;EM&gt;TypeError: Failed to execute 'webkitGetUserMedia' on 'Navigator': Malformed constraints object. &lt;/EM&gt;( =&amp;nbsp;does not work)&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;

&lt;P&gt;Second way: select camera ID&lt;/P&gt;

&lt;PRE class="brush:jscript;"&gt;navigator.mediaDevices = navigator.mediaDevices || ((navigator.mozGetUserMedia || navigator.webkitGetUserMedia) ? {
           getUserMedia: function(c) {
             return new Promise(function(y, n) {
               (navigator.mozGetUserMedia ||
                navigator.webkitGetUserMedia).call(navigator, c, y, n);
             });
           }
        } : null);

        if (!navigator.mediaDevices) {
          console.log("getUserMedia() not supported.");
          return;
        }

      MediaStreamTrack.getSources(gotSourceID);

 function gotSourceID(sourceInfos){

        for (var i = 0; i &amp;lt; sourceInfos.length; i++) {
            var sourceInfo = sourceInfos&lt;I&gt;;

            if (sourceInfo.kind == 'video') {
                console.log(sourceInfo);
                
                if (sourceInfo.facing == "environment"){
                    id_cam = sourceInfo.id;
                    console.log("ID cam" + id_cam);
                }
            }
        }
        openSource(id_cam);
        return id_cam;        
    }

function openSource(id_camera){      
      navigator.mediaDevices.getUserMedia({ audio: false, video:     {
              optional: [{sourceId: id_camera }]
            }  }) 
        .then(function(stream) {
          var video = document.querySelector('video');
          video.src = window.URL.createObjectURL(stream);
          video.onloadedmetadata = function(e) {
            video.play();
             
          };
        })
        .catch(function(err) {
          console.log(err.name + ": " + err.message);
        });
  }&lt;/I&gt;&lt;/PRE&gt;

&lt;P&gt;No error. Selecting the camera ID only works using App Preview, but if you use the XDK Debug or build does not receive data from the room, only a black screen.&amp;nbsp;&lt;/P&gt;

&lt;P&gt;Some idea?&lt;/P&gt;

&lt;P&gt;&lt;SPAN style="font-size: 13.008px; line-height: 19.512px;"&gt;Thanks for the help&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 01 Dec 2015 18:52:12 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Archive/Camera-Preview-inside-canvas/m-p/1013295#M35010</guid>
      <dc:creator>Mario_R_</dc:creator>
      <dc:date>2015-12-01T18:52:12Z</dc:date>
    </item>
    <item>
      <title>It seems that Media Devices</title>
      <link>https://community.intel.com/t5/Software-Archive/Camera-Preview-inside-canvas/m-p/1013296#M35011</link>
      <description>&lt;P&gt;It seems that Media Devices.getUserMedia () can not be used on Android, has anyone tried?&lt;/P&gt;</description>
      <pubDate>Fri, 04 Dec 2015 14:20:55 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Archive/Camera-Preview-inside-canvas/m-p/1013296#M35011</guid>
      <dc:creator>Mario_R_</dc:creator>
      <dc:date>2015-12-04T14:20:55Z</dc:date>
    </item>
    <item>
      <title>Mario, are you using</title>
      <link>https://community.intel.com/t5/Software-Archive/Camera-Preview-inside-canvas/m-p/1013297#M35012</link>
      <description>&lt;P&gt;Mario, are you using Crosswalk and the Debug tab? If you are testing in App Preview on an Android 4.x device you will not have good results. The Android 2.x and 4.x webviews are very old. You must use Crosswalk and the Debug tab if you want to use modern HTML5 features like those you are describing here.&lt;/P&gt;</description>
      <pubDate>Mon, 07 Dec 2015 16:52:55 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Archive/Camera-Preview-inside-canvas/m-p/1013297#M35012</guid>
      <dc:creator>PaulF_IntelCorp</dc:creator>
      <dc:date>2015-12-07T16:52:55Z</dc:date>
    </item>
    <item>
      <title>Paul thanks the explanation</title>
      <link>https://community.intel.com/t5/Software-Archive/Camera-Preview-inside-canvas/m-p/1013298#M35013</link>
      <description>&lt;P&gt;Paul thanks the explanation on versions.&lt;BR /&gt;
	Let me explain, Media Devices.getUserMedia () &lt;STRONG&gt;works well&lt;/STRONG&gt; with App Preview but does &lt;STRONG&gt;not work&lt;/STRONG&gt; instead on Debug and build (with Crosswalk or Android - on version 5.0.1).&lt;BR /&gt;
	You have tried to use this method on Android 5? Does it work? If you build what settings you used?&lt;/P&gt;

&lt;P&gt;Maybe I'm wrong settings build?&lt;/P&gt;</description>
      <pubDate>Sat, 12 Dec 2015 22:59:17 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Archive/Camera-Preview-inside-canvas/m-p/1013298#M35013</guid>
      <dc:creator>Mario_R_</dc:creator>
      <dc:date>2015-12-12T22:59:17Z</dc:date>
    </item>
    <item>
      <title>If it fails on Crosswalk it</title>
      <link>https://community.intel.com/t5/Software-Archive/Camera-Preview-inside-canvas/m-p/1013299#M35014</link>
      <description>&lt;P&gt;If it fails on Crosswalk it is likely to also fail on Android 5+, because they use the same Chromium web runtime. However, they can differ in how well the web runtime is "hooked up" to some device features, especially something like this. Those device features can have device-specific aspects that make things work or not work at the web runtime layer.&lt;/P&gt;

&lt;P&gt;Probably better to search for a third-party Cordova plugin that does what you need...&lt;/P&gt;</description>
      <pubDate>Mon, 14 Dec 2015 00:15:27 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Archive/Camera-Preview-inside-canvas/m-p/1013299#M35014</guid>
      <dc:creator>PaulF_IntelCorp</dc:creator>
      <dc:date>2015-12-14T00:15:27Z</dc:date>
    </item>
  </channel>
</rss>

