Flashlight-PhoneGap-Plugin icon indicating copy to clipboard operation
Flashlight-PhoneGap-Plugin copied to clipboard

Not working with Samsung Galaxy S5

Open basementmedia2 opened this issue 7 years ago • 1 comments

Hi,

i've tested the flashlight with my Samsung Galaxy S5 and Phonegap build. What i did:

Adding the following line to my config.xml: <gap:plugin name="cordova-plugin-flashlight" source="npm" />

In Javascript: `window.plugins.flashlight.available(function(isAvailable) { if (isAvailable) {

	// switch on
	window.plugins.flashlight.switchOn(
	  function() {}, // optional success callback
	  function() {}, // optional error callback
	  {intensity: 0.3} // optional as well
	);

	// switch off after 3 seconds
	setTimeout(function() {
	  window.plugins.flashlight.switchOff(); // success/error callbacks may be passed
	}, 3000);

  } else {
	alert("Flashlight not available on this device");
  }
});`

Result: The light is switched on, then a short black screen and then the camera view and the german fault message "Warnung, Kamerafehler" (warning, camera fault). Do you have an idea, what causes this crash?

Best regards Daniel

basementmedia2 avatar Nov 15 '16 14:11 basementmedia2