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

Torch #145

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open

Torch #145

wants to merge 3 commits into from

Conversation

zde-nekz
Copy link

@zde-nekz zde-nekz commented May 29, 2024

🎯 Goal

Enable turning on camera torch

✍️ Explain examples

override fun switchTorch(
        on: Boolean,
        completion: ((Boolean) -> Unit)?
    ) {
        Timber.d("Changing torch to on=$on")

        cameraCapturer.torch(
            on,
            object : CameraVideoCapturer.TorchHandler {
                override fun onTorchSuccess() {
                    Timber.d("Torch successfully turned on")
                    completion?.invoke(true)
                }

                override fun onTorchError(error: String?) {
                    Timber.d("Turning torch on failed: $error")
                    completion?.invoke(false)
                }

                override fun onTorchUnsupported() {
                    Timber.d("Turning torch on failed: unsupported")
                    completion?.invoke(false)
                }
            }
        )
    }

@zde-nekz zde-nekz requested a review from skydoves as a code owner May 29, 2024 08:45
@skydoves
Copy link
Member

skydoves commented Jun 7, 2024

Hi @zde-nekz, sorry for the delayed response. You can create this PR to the GetStream/webrtc repository, as this repository mirrors the native code from it. Once you re-create a PR to the webrtc repository, we will kindly review your PR again soon. Thank you!

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

Successfully merging this pull request may close these issues.

2 participants