私はデバイスカメラ(アンドロイド/ iOS)のLEDライトを即座に起動するためにデバイスカメラを開こうとしています。LEDとカメラは常にON
私はappcelerator ti.mediaイベントを試しましたが、うまくいかず、このモジュールもTi.Lightです。このリンク上でこれを見つけた
Hey guys!
For the flash stuff you have to check the property: Ti.Media.cameraFlashMode (case sensitive)
To change it you can use Ti.Media.setCameraFlashMode(PARAM) .
PARAM could be: Ti.Media.CAMERA_FLASH_OFF , Ti.Media.CAMERA_FLASH_ON, Ti.Media.CAMERA_FLASH_AUTO
Unfortunately you can’t start the led and use it as a torch, you can only control the camera flash handling (on, off, auto) while taking a photo.
LEDライトのすべての時間を使用することができます任意のモジュールがありますか?私はカメラが開かれている間これを必要とします。
UPDATE 1#:
私は埋め込みカメラとフラッシュメソッドを持っている、あなたのts.cameraウィジェットを使用しようとしている:
しかし、 "pw.custom.androidcamera"モジュールのswitchFlashlight()メソッドはありません。このwidget wor KS?
UPDATE 2#:
workaroudを見つけるために、私はこの懐中電灯のモジュールを追加した、と私はそれを呼び出すようにしようとしていますカメラの前または後に、私はそれが同時に2つのカメラの活動を持つことはできないと思う。
これは私のindex.jsファイルです:私はこのエラーを取得してい
if(OS_ANDROID) {
flash = require('dk.napp.flashlight');
if(!flash.isFlashLightOn()) flash.turnFlashLightOn();
camera = require('pw.custom.androidcamera');
view = camera.createCameraView();
}
:
[DEBUG] : CameraViewProxy: Camera not available
[ERROR] : CameraViewProxy: Camera is null. Make sure
[ERROR] : CameraViewProxy: <uses-permission android:name="android.permission.CAMERA" />
[ERROR] : CameraViewProxy: is in you tiapp.xml file.
これは私のtiapp.xmlファイルです:
<uses-permission android:name="android.permission.CAMERA"/>
<uses-permission android:name="android.permission.FLASHLIGHT"/>
<uses-feature android:name="android.hardware"/>
<uses-feature android:name="android.hardware.camera"/>
<uses-feature android:name="android.hardware.camera2"/>
<uses-feature android:name="android.hardware.camera2.params"/>
<uses-feature android:name="android.hardware.camera.flash"/>
<uses-feature android:name="android.hardware.camera.autofocus"/>
しばらく前にアンドロイドモジュールを試しましたが、ダウンロードリンクはありません。gitリポジトリからZIPをダウンロードし、フォルダを作成しました。 'com.kangacoders.tiflashlight' inside 'Library/Application Support/Titanium/modules/android/'を開き、' com.kangacoders.tiflashlight 'フォルダ内のすべてのモジュールファイルを含むフォルダ' 0.1 'を作成しますが、このエラーが発生しています:要求されたモジュールが見つかりません。 Ti.MediaにTORCHメソッドがありません。 –
2つのウィジェットをダウンロードしましたが、それぞれに機能を追加する必要があります。(https://stackoverflow.com/questions/37032354/edit-a -titanium-module-ios-android)[https:// stackoverflow。com/questions/37032354/edit-a-titanium-module-ios-android] –
@RicardoPereiraモジュールを手動でインストールするにはhttp://docs.appcelerator.com/platform/latest/#!/guide/Using_a_Moduleに従ってください。 TL; DRはプロジェクトのルートにZIPをドロップしてtiapp.xmlに追加します –