AgoraIO/Advanced-Video

android - unable to share both screen and video streams at a time

sathish-xe opened this issue · 16 comments

I want to share the screen while the video call is running.
Currently, it stops the video call and changes the video source.
Is there a way to send multiple video streams / tracks from a single client to a channel?

you will need to start a second process creating a new sdk instance.

Should I create two RtcEngine instances then join same channel?
In one client enableVideo() on the other enable screen share?

Can you please show how to create a new SDK instance in native android?

@plutoless
Thanks, Got it!
From
RtcEngine.create(getApplicationContext(), getString(R.string.agora_app_id), mHandler);
to this
RtcEngine mRtcEngine = new RtcEngineImpl(getApplicationContext(), getString(io.agora.advancedvideo.R.string.agora_app_id), mHandler);

Declare and initialize two RTCEngine instances with the same app id. eg: "mRtcEngine1" and "mRtcEngine2". Use one instance for video and other for screen share.

@sathish-xseed our current sdk is single instance - so what you did may not work. if you call create api you will always get the same instance, so you will need to start a second process and create an instance there.

@plutoless Currently, Created my first instance using RtcEngine.create() and second instance using new RtcEngineImpl();
Do you have any best way to do this?

@plutoless this sample has single RtcEngine. When you enable screen share while the local video is getting streamed. It replaces the local video stream with screen share stream. I couldn't find any code which relates to multiple RtcEngine

https://docs.agora.io/en/faq/switch_screen_camera_web This web example explains how to have two clients. But in android, I couldn't find one. Right now, I implemented this way #176 (comment). I just wanted to know is this best way to go? @plutoless @saikiran91

what i provided has two clients. @sathish-xe see my above comments

@plutoless
Thanks for the sample project.
Now, I'm facing a issue on web.
Screen share stream works only between the mobile devices. Consuming the same stream using the web SDK is not playing the video. But I'm getting the event in stream-added and subscribing to it successfully.

Hi
I am facing issue with screen share on Android.

I am implementing it with video call and screen share option both.

There is a bindVideoService method when It is called, It donot show local camera video too.

Please let me know if anyone has done it?

@shivchand if you want to do both at the same time, take a look at this maybe

stale commented

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale commented

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.