Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-24133] Windows phone bug - access denied to device camera

GitHub Issuen/a
TypeBug
PriorityCritical
StatusClosed
ResolutionWon't Fix
Resolution Date2016-11-14T02:45:36.000+0000
Affected Version/sn/a
Fix Version/sn/a
ComponentsWindows
Labelslook1
ReporterJérémy Tonneau
AssigneeKota Iguchi
Created2016-10-27T09:43:44.000+0000
Updated2017-03-30T21:07:16.000+0000

Description

Hello, I am facing an issue with the windows phone camera: I am not able to open it using the Titanium.Media.showCamera method. It returns a zero error code (access denied). I've put all the necessary permissions in the app.xml (correct me if I am wrong): http://schemas.microsoft.com/appx/manifest/foundation/windows10" xmlns:mp="http://schemas.microsoft.com/appx/2014/phone/manifest" xmlns:rescap="http://schemas.microsoft.com/appx/manifest/foundation/windows10/restrictedcapabilities" xmlns:uap="http://schemas.microsoft.com/appx/manifest/uap/windows10"> I've been stuck on this issue for several days, any help would be greatly appreciated. Thanks

Attachments

FileDateSize
win10sdk.png2016-11-14T12:48:07.000+000093084

Comments

  1. Sharif AbuDarda 2016-10-27

    Hello, Did you define an overlay in there. Can you try the below code?
       var win = Ti.UI.createWindow({ backgroundColor: 'green', layout:'vertical' }),
       
           openButton = Ti.UI.createButton({ title: 'OPEN CAMERA', backgroundColor: 'blue' }),
       
           imageView = Ti.UI.createImageView({width:Ti.UI.FILL, height: '80%'});
       
        
       
       var overlay = Ti.UI.createView({
       
           layout: 'vertical',
       
           height: '20%', width: Ti.UI.FILL,
       
           bottom: 0
       
       }),
       
       takeButton = Ti.UI.createButton({ title: 'TAKE A PHOTO', backgroundColor: 'red' }),
       
       hideButton = Ti.UI.createButton({ title: 'HIDE PREVIEW', backgroundColor: 'red' });
       
        
       
       takeButton.addEventListener('click', function () {
       
           Ti.Media.takePicture();
       
       });
       
       hideButton.addEventListener('click', function () {
       
           Ti.Media.hideCamera();
       
       });
       
       overlay.add(takeButton);
       
       overlay.add(hideButton);
       
        
       
       openButton.addEventListener('click', function () {
       
           Ti.Media.showCamera({
       
               mediaTypes: [Ti.Media.MEDIA_TYPE_PHOTO],
       
               overlay: overlay,
       
               success: function (e) {
       
                   Ti.API.info('showCamera() success');
       
                   imageView.image = e.media;
       
               },
       
               error: function () {
       
                   Ti.API.info('showCamera() error');
       
               }
       
           });
       
       });
       
        
       
       win.add(openButton);
       
       win.add(imageView);
       
       win.open();
       
    Also, Send me the code you are running. Thanks.
  2. Jérémy Tonneau 2016-10-31

    I don't think this issue has anything to do with overlays. Anyway, I tried your code above but I get the same error message: code : 0 failed to initialize capture device: Access is denied. Could you check if the windows manifest I use is correct? Thanks.
  3. Jérémy Tonneau 2016-11-03

    any news?
  4. Debuisson Eugène 2016-11-08

    I exactly have the same issue, I tried the code too and still access denied... Any news ?
  5. Kota Iguchi 2016-11-14

    webcam capability should be used with DeviceCapability tag. So tiapp.xml should look like below:
         <windows>
           <manifest>
             <Capabilities>
               <Capability Name="internetClient"/>
               <Capability Name="picturesLibrary"/>
               <DeviceCapability Name="webcam"/>
             </Capabilities>
           </manifest>
         </windows>
       
    FYI To make things easier, as of 6.0.0 Capability tag will be generated automatically based on API usage ( TIMOB-23156 ) .
  6. Joachim Deneumostier 2016-11-14

    Thanks for your feedback. But, when I'm using SDK 6, I get the following error while building: ERROR] : Invalid "--device-id" value "0" However, it works fine with SDK 5.5.1 (although I have to upload the build file manually on the phone using the microsoft tool). Any idea?
  7. Kota Iguchi 2016-11-14

    [~joachim] Use of number value for device-id is not supported for now, use udid value which you can get from appc ti info -p windows -o json. For instance:
       devices: [
         {
           "name": "Lumia 630 Dual SIM",
           "udid": "00000000-00x0-0b0b-0000-000000000000",
           "index": 0,
           "wpsdk": "8.1",
           "ip": "127.0.0.1"
         }
       ]
       
    In this case specify --device-id "00000000-00x0-0b0b-0000-000000000000",
  8. Joachim Deneumostier 2016-11-14

    Thanks, but in my case the devises object is empty: "devices": [] Although the devis is connected and recognized by Windows...
  9. Joachim Deneumostier 2016-11-14

    Remarks; I have the same issue on different windows phones; I refreshed the devices list; Any idea?
  10. Kota Iguchi 2016-11-14

    Hmm. maybe missing tools? ( maybe related: TIMOB-23976 ) Do you have Visual Studio 2015 installed with Windows 10 SDK and Windows 10 Emulators? [^win10sdk.png]
  11. Joachim Deneumostier 2016-11-14

    I have just checked and I have the Windows 10 SDK and Windows 10 emulator installed. However, I don't see the windows 10 emulator in the appcelerator studio. I have joined a screenshot of the appc ti info command result, can you check it please? Thanks a lot for your help!
  12. Joachim Deneumostier 2016-11-14

    Microsoft (R) Visual Studio 14.0 (selected) Path = C:\Program Files (x86)\Microsoft Visual Studio 14.0\ CLR Version = v4.0.30319 MSBuild Version = v14.0.25420.1 Windows Phone SDKs = not installed Microsoft (R) Windows Phone SDK 10.0 Path = C:\Program Files (x86)\Windows Kits\10\ 8.1 (selected) Path = C:\Program Files (x86)\Microsoft SDKs\Windows Phone\v8.1\ Windows PowerShell Enabled = yes Windows Phone Emulators 8.1 Emulator 8.1 WVGA 4 inch 512MB UDID 8-1-7 Emulator 8.1 WVGA 4 inch UDID 8-1-8 Emulator 8.1 WXGA 4.5 inch UDID 8-1-9 Emulator 8.1 720P 4.7 inch UDID 8-1-10 Emulator 8.1 1080P 5.5 inch UDID 8-1-11 Emulator 8.1 1080P 6 inch UDID 8-1-12 10.0 Windows Phone Devices
  13. Kota Iguchi 2016-11-15

    [~joachim] I'm not quite sure what's going on with Appcelerator Studio. I saw Ti SDK 6.0.0.GA and new Studio is just released, so would you check out the latest one, and create new ticket for Studio (TISTUD) if it doesn't work as expected?
  14. Joachim Deneumostier 2016-11-15

  15. Lee Morris 2017-03-30

    Closing ticket as "Won't Fix" as a relevant Studio ticket has been opened. Anymore issues, please feel free to reopen the ticket.

JSON Source