2

Is it possible to take photos using the volume controls on the iPhone?

Ideally, the takePicture() method would be called when the volume button is pressed.

Emil
  • 7,220
  • 17
  • 76
  • 135
Adam Nuttall
  • 477
  • 2
  • 16

2 Answers2

1

Add an event listener.

Titanium.Media.addEventListener('volume', function(e) {
    Ti.Media.takePicture();    
});

Make sure the event listener is added when the camera is already shown. Docs here: http://docs.appcelerator.com/titanium/latest/#!/api/Titanium.Media-method-takePicture

Rene Pot
  • 24,681
  • 7
  • 68
  • 92
-2

Old, but still relevant: program access to iPhone volume buttons

Also consider adding better tags to your question, objective c, ios, xcode, etc.

Community
  • 1
  • 1
Kayo
  • 702
  • 3
  • 10