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

Unable to see preview of producer camera when in the in-progress state (ACTION INVITE) #633

Open
basheerkohli opened this issue Jul 16, 2020 · 3 comments

Comments

@basheerkohli
Copy link

When initiating a video call I just tried to show the preview of the producer camera view returned invoking the method

public final View startVideoProducerPreview(){ if(mVideoProducer != null){ return mVideoProducer.startPreview(mContext); } return null; }

But unfortunately, I am getting null every time in the in-progress state. The video producer is only getting initiated when the call state is INCALL.

Can we show the preview of the caller on-screen before the call gets connected?

Expected output :

When the video call is in-progress state the preview of the caller should be displayed on his screen.

IMSDroid demo application output:
Rendering the loading try-view in the IMSDroid demo application.

@SamarthaKV29
Copy link

You have to check where it is getting initialized. here's what it looks like you missed:
image

Luckily for you I recently had looked through this exact piece for something, So I remember seeing that inside certain

handleSipEvent() & handleMediaEvent functions, in avSession mostly, it won't initialize the producers until it receives IN_CALL message. Maybe that is your problem. But thanks for the idea. What you are trying to do is cool and Whatsapp like.. You just need to load the camera preview use something like NgnCamaraProducer.getInstance() and then show the preview. Why are you complicating it!?

Once you get IN_CALL, the producers are loaded automatially right, so just go with it. Don't need to change that part, just create a new View Layout and load that view when you are in states of IN_PROGRESS or something. Just like the incoming CALL DIALOG. Let me know if you have issues, and let me know if you need help. I have worked with Doubango for over 2-3 years now, so I know this inside out, to some extent.

@SamarthaKV29
Copy link

Also, in your AVScreen activity, you'll manage the VIEW depending on avSession STATE. its really simple, just replace the loadTryingView with a VIEW THAT you want, use a SurfaceView or TextureView, and load the CameraPreview, and use that inside StartPreview .. You use a if (IN_PROGRESS) showCamPreview(); else loadInCallView() Something as simple as that should do it.

@basheerkohli
Copy link
Author

basheerkohli commented Jul 19, 2020

NgnAVSession.Java
public final View startVideoProducerPreview(){ if(mVideoProducer != null){ return mVideoProducer.startPreview(mContext); } return null; }

mVideoProducer is getting initialized when the INVITE state is INCALL. So the only thing I can do is before reaching the INCALL state need to create SurfaceView and attach a camera instance to it and then invoke the preview function. Once the call INVITE state reaches INCALL I need to release my camera lock and remove the surface view.

Thanks for your suggestions.
Cheers.

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

No branches or pull requests

2 participants