Back Camera in Video Chat

sundar

New Member
Hiiii,

I want to switch the camera back and front in video chat but I found the only front camera in video chat demo. So is there any option to implement the back camera in video chat demo?

Thanks
 

sundar

New Member
Hiii,
I am developing the Android application in which live stream implemented and I want to switch camera in the application for that I am using flashphoner video chat demo but I found default camera is the front camera there is no option to switch camera in the demo application.
so how can I switch camera in android application?
Thanks
 

Max

Administrator
Staff member
Hello
Please look at example MediaDevicesActivity
https://github.com/flashphoner/wcs-...e/mediadevices/MediaDevicesActivity.java#L502
Here you can see switch camera code
Code:
 public void onClick(View view) {
                if (publishStream != null) {
                    mSwitchCameraButton.setEnabled(false);
                    publishStream.switchCamera(new CameraSwitchHandler() {
                        @Override
                        public void onCameraSwitchDone(boolean var1) {
                            runOnUiThread(new Runnable() {
                                @Override
                                public void run() {
                                    mSwitchCameraButton.setEnabled(true);
                                }
                            });

                        }

                        @Override
                        public void onCameraSwitchError(String var1) {
                            runOnUiThread(new Runnable() {
                                @Override
                                public void run() {
                                    mSwitchCameraButton.setEnabled(true);
                                }
                            });
                        }
                    });
                }
            }
 

sundar

New Member
Hello,
I am using video chat demo for the android application, please kindly understand I don't use media device demo
Please refer attached screen to which I want to switch the camera. Provide video chat code for front and back camera
Thanks
 

Attachments

Max

Administrator
Staff member
Hello
If you want to use the switch camera function, you have to adapt corresponding code from Media Devices example to Video Chat Example.
Media Devices and Video Chat are just demo samples for Android SDK.
 

sundar

New Member
Hello,
1) In video chat demo I want to get number of participants who join the room and at that time other user preview screen count increment
2) Publish and preview display proper in two devices but when i am trying to connect more than two devices then preview will display a black screen
Thanks
 

Max

Administrator
Staff member
1) In video chat demo I want to get number of participants who join the room and at that time other user preview screen count increment
Please check out Video Chat demo code.
https://demo.flashphoner.com/client2/examples/demo/streaming/video-chat/video-chat.html
https://demo.flashphoner.com/client2/examples/demo/streaming/conference/conference.js
As you can see from JavaScript, you can get number of participants:
Code:
var participants = room.getParticipants();
for (var i = 0; i < participants.length; i++) {
participants[i].sendMessage(message);
}
2) Publish and preview display proper in two devices but when i am trying to connect more than two devices then preview will display a black screen
The Video Chat sample is two way video chat.
It is limited by 2 participants.
Use Conference sample to get more participants:
https://demo.flashphoner.com/client2/examples/demo/streaming/conference/conference.html
https://demo.flashphoner.com/client2/examples/demo/streaming/conference/conference.js
 

sundar

New Member
Hello,

Thanks for your reply but I found that in video chat demo there is a limitation of 2 participants and in conference demo there is a limitation of 3 participants, so which demo is useful for me to implement more than x(i.e 100 or 500) number of participants that view live video

I am developing an android application in which one user can publish live video and multiple users can join and see that video like Instagram so can you please tell me which demo suits for this requirement?

Thanks
 

Max

Administrator
Staff member
I am developing an android application in which one user can publish live video and multiple users can join and see that video like Instagram so can you please tell me which demo suits for this requirement?
You can start with simple Two Way Streaming demo.
https://demo.flashphoner.com/client...ming/two_way_streaming/two_way_streaming.html
It has streamer and player.
When you publish a stream you pass unique stream name.
So if another user know the stream name he or she can play your stream.
Therefore you don't need the conferencing demo, you just need to share stream name to viewers.
 

sundar

New Member
Hello,
In two way streaming demo, how can I identify the person who joins or leave the room. Also the number of the participant(count) who joins that stream
Is it not possible in video chat demo for multiple users who join the same room and see the live video?
Thanks
 

Max

Administrator
Staff member
WCS sends REST/HTTP hooks on each event.
For example, if user play stream, WCS will send two events:
1) /playStream
2) /StreamStatusEvent
Please check out documentation REST Hooks
 

sundar

New Member
Hello,
When I switch the camera from front to back it will rotate right preview to left side, In video chat demo I am not getting proper back camera preview, what should I do?
Thanks
 

Max

Administrator
Staff member
it will rotate right preview to left side
Please add a few screenshots and show id detail how it works and how it should work in your vision.
It is not enough clear for now.
 

sundar

New Member
Hello,
I have implemented streaming-min demo and I am facing the issue of video quality and sound quality, Is it resolved after changing the server or it causes because of some other issues. Please give me solution for this
Thanks
 

sundar

New Member
Hello,
Please give me solution for above queries otherwise I have to switch to other options for live broadcast
Thanks
 

Max

Administrator
Staff member
Hello
It is still not clear.
1. Does it work with our default Streaming Min sample?
2. Please provide modified code sample where the issues is reproduced.
 

sundar

New Member
Hello,
In default streaming sample there is no option to switch back camera and I have used the code that given by you to switch the camera
Here I have attached my code files please refer it and give your feedback
Thanks
 

Attachments

Top