Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not working with Samsung Galaxy S5 #49

Open
basementmedia2 opened this issue Nov 15, 2016 · 1 comment
Open

Not working with Samsung Galaxy S5 #49

basementmedia2 opened this issue Nov 15, 2016 · 1 comment

Comments

@basementmedia2
Copy link

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
Copy link
Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant