Flashlight-PhoneGap-Plugin
Flashlight-PhoneGap-Plugin copied to clipboard
Not working with Samsung Galaxy S5
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