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 8 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

OK...should have said that i use the flashlight together with a camera plugin, means, first i switch on the flash light and second the camera. As soon as the camera viewer is shown, the error message is displayed. But the flash light stays on.

basementmedia2 avatar Nov 15 '16 16:11 basementmedia2