Android Twilio Video - get camera stream -


i developing app using twilio video api: https://www.twilio.com/video still in beta, works great part. , maybe there way solve issue.

for app need switch camera , turn on light of camera. first 1 done twilio, second 1 not have camera object control camera light. there way camera object? or can create camera object myself , pass twilio? or there approach turn on light?

my code camera preview. in examples use cameracapturer camera preview view:

cameracapturer = cameracapturer.create(myactivity.this, cameracapturer.camerasource.camera_source_front_camera, capturererrorlistener()); startpreview(); 

and preview:

private void startpreview() {     if (cameracapturer != null) {         cameracapturer.startpreview(previewframelayout);     } } 

twilio developer evangelist here. right, , current version of sdk not allow control camera capturer if created camera object yourself.

we aware of though, , working on new version able that.

for time being suggest trying still create own camera object manually can turn on backlight, , think long don't call preview on it, shouldn't end conflict.

i imagine (untested) work.

private void turnonflash() {     camera camera = camera.open();     camera.parameters params = camera.getparameters();     params.setflashmode(camera.parameters.flash_mode_torch);     camera.setparameters(params); } 

also add androidmanifest.

<permission android:name="android.permission.flashlight"         android:permissiongroup="android.permission-group.hardware_controls"         android:protectionlevel="normal" /> 

and call method call startpreview().

this solutions should going time being, able pass own camera object in future, if that's not pressing functionality time being, wait updated version.

hope helps you


Comments

Popular posts from this blog

jOOQ update returning clause with Oracle -

c# - Json.Net Serialize String from URI -

java - Warning equals/hashCode on @Data annotation lombok with inheritance -