<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:clearspace="http://www.jivesoftware.com/xmlns/jive/rss" version="2.0">
  <channel>
    <title>Adobe Community: Message List - Crash on "video.attachCamera" with front camera (S3, Android)</title>
    <link>https://forums.adobe.com/community/air/development?view=discussions</link>
    <description>Most recent forum messages</description>
    <language>en</language>
    <pubDate>Mon, 10 Nov 2014 20:30:33 GMT</pubDate>
    <generator>Jive Engage 7.0.0.1  (http://jivesoftware.com/products/)</generator>
    <dc:date>2014-11-10T20:30:33Z</dc:date>
    <dc:language>en</dc:language>
    <item>
      <title>Crash on "video.attachCamera" with front camera (S3, Android)</title>
      <link>https://forums.adobe.com/message/6916601?tstart=0#6916601</link>
      <description>&lt;!-- [DocumentBodyStart:ed44f32f-e5db-43e7-a506-44442582791b] --&gt;&lt;div class="jive-rendered-content"&gt;&lt;p&gt;Hi,&lt;/p&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;I'm developing a camera app with Adobe Air (version 15.0.0 build 302). I would appreciate any help with this really weird bug that I found.&lt;/p&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;In the Samsung S3 device, attaching the front camera to a Video instance always results in the app crashing. After the crash, the camera becomes unusable by any app on the device. The device must be reset in order to restore the camera. After many tests, I know that the app crashes when the "video.attachCamera" method is called.&lt;/p&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;This is the relevant piece of code:&lt;/p&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family: courier new,courier;"&gt;this.cameraPos = CameraPosition.FRONT;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family: courier new,courier;"&gt;this.camera = this.getCamera(this.cameraPos);&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family: courier new,courier;"&gt;this.camera.setMode(640, 640, 30);&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family: courier new,courier;"&gt;this.video = new Video(640, 640);&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family: courier new,courier;"&gt;this.video.attachCamera(this.camera); // crash!&lt;/span&gt;&lt;/p&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family: courier new,courier;"&gt;private function getCamera(position:String):Camera&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family: courier new,courier;"&gt;{&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family: courier new,courier;"&gt;&amp;nbsp; for(var i:int=0; i&amp;lt;Camera.names.length; i++)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family: courier new,courier;"&gt;&amp;nbsp; {&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; var c:Camera = Camera.getCamera(String(i));&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; if(c.position == position) return c;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family: courier new,courier;"&gt;&amp;nbsp; }&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family: courier new,courier;"&gt;&amp;nbsp; return Camera.getCamera();&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family: courier new,courier;"&gt;}&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family: courier new,courier;"&gt;&lt;br/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;The same code works fine in other Android devices. Listing all available cameras show that both (back and front) cameras are available in the S3. And the front camera works fine when I use CameraUI.&lt;/p&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;Any help will be much appreciated.&lt;/p&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;Thanks in advance!&lt;/p&gt;&lt;/div&gt;&lt;!-- [DocumentBodyEnd:ed44f32f-e5db-43e7-a506-44442582791b] --&gt;&lt;img src='/beacon?t=1415938290637' /&gt;</description>
      <pubDate>Mon, 10 Nov 2014 20:28:45 GMT</pubDate>
      <author>forums_noreply@adobe.com</author>
      <guid>https://forums.adobe.com/message/6916601?tstart=0#6916601</guid>
      <dc:date>2014-11-10T20:28:45Z</dc:date>
      <clearspace:dateToText>3 days 8 hours ago</clearspace:dateToText>
      <clearspace:objectType>0</clearspace:objectType>
    </item>
  </channel>
</rss>

