Closed tantaroth closed 10 years ago
Anyone has a sample code to change the camera position, and turn on/off the mic without crashing the app?
Hi tantaroth,
So in the click event you can bind the function called setCameraPosition to your publisherDiv. The setCameraPositon function takes in the parameter "front" or "back", which changes the camera position accordingly.
for example, in jQuery:
$(".buttonChangeCamera").click(function(){ publisher.setCameraPosition("front"); //or "back" });
this will change the camera position accordingly.
I hope this solves your problem.
Can you put in some crash logs? its weird that it should be crashing. Android does not seem to support setCameraPosition method, filed an issue for it: https://github.com/songz/cordova-plugin-opentok/issues/101
@darkpgx 's suggestion for changing front and back camera works, I tested with iOS and Android after trying out #102 . Closing this issue. If you still experiencing crashing @jfsemaan and @tantaroth , please open up a new ticket and describe how to reproduce the crash.
@darkpgx, @songz thank you for your help! it worked great!
I am trying to change the camera position from front to back while having a video call, but when I change it the app crashes and both videos freezes. What is the correct way of doing this? Here is my code:
//My data conection with plugin var data = new Object(); data.apiKey = "my_apikey"; data.sessionId = "my_session_id"; data.token = "my_token"; data.sid = "my_session_id";
I know with "cameraName" change the camera to "back" or "front" but i want change the camera with a event of button(javascript or jquery).
cameraName for default init the application with the value content, for example in the code up.
I want change the camera position to click button, for example:
$(document).ready(function(){ $(".buttonChangeCamera").click(function(){ //event to change camera position "back" or "front }); });