Skip to end of metadata
Go to start of metadata

Since build 1.1.0.17 it is possible to turn on and off flashlight while publishiung video from main device camera.

To turn flashlight on, use the function Flashphoner.turnOnFlashlight()

code

    private void turnOnFlashlight() {
        if (Flashphoner.turnOnFlashlight()) {
            mSwitchFlashlightButton.setText(getResources().getString(R.string.turn_off_flashlight));
            flashlight = true;
        }
    }

To turn flashlight on, use the function Flashphoner.turnOffFlashlight()

code

    private void turnOffFlashlight() {
        Flashphoner.turnOffFlashlight();
        mSwitchFlashlightButton.setText(getResources().getString(R.string.turn_on_flashlight));
        flashlight = false;
    }

These functions may be called by keypress, for example

code

        mSwitchFlashlightButton.setOnClickListener(new OnClickListener() {
            @Override
            public void onClick(View v) {
                if (flashlight) {
                    turnOffFlashlight();
                } else {
                    turnOnFlashlight();
                }
            }
        });
  • No labels