Code Monkey home page Code Monkey logo

Comments (4)

marinaserranomontes avatar marinaserranomontes commented on June 12, 2024

Hi @ajayV1992 ,

I don't understand your case 100%. Could you clarify it? But please, review to be sure you are not adding the same view and the size and position of them.
We will need a subscriber for the screen stream and another subscriber for the camera stream type.

Best,
Marina

from opentok-android-sdk-samples.

ajay92x avatar ajay92x commented on June 12, 2024

Here is the code which I have used, I have declared the subscriber globally and used the same subscriber i.e. "mSubscriber" in camera and screen condition

private Subscriber mSubscriber; // global
private FrameLayout subscribeCamera, subscriberScreen;

@OverRide
public void onStreamReceived(Session session, Stream stream) {

if(stream.getStreamVideoType().toString().equals("StreamVideoTypeScreen")){
toast("SUBSCRIBE SCREEN");
mSubscriber = new Subscriber.Builder(this, stream).build();
mSubscriber.setSubscriberListener(this);
mSession.subscribe(mSubscriber);
subscriberScreen.addView(mSubscriber.getView());
} else if(stream.getStreamVideoType().toString().equals("StreamVideoTypeCamera")){
toast("SUBSCRIBE CAMERA");
mSubscriber = new Subscriber.Builder(this, stream).build();
mSubscriber.setSubscriberListener(this);
mSession.subscribe(mSubscriber);
subscribeCamera.addView(mSubscriber.getView());
}
}

from opentok-android-sdk-samples.

ajay92x avatar ajay92x commented on June 12, 2024

Hi @marinaserranomontes,
By using subscriber for the screen stream and another subscriber for the camera stream type helped.
Thanks for your help

from opentok-android-sdk-samples.

marinaserranomontes avatar marinaserranomontes commented on June 12, 2024

Great @ajayV1992 !!

Iā€™m closing this issue since it seems to be fixed.

Please reopen if you still encounter this issue. You can also contribute directly to samples by providing a patch.

Thank you!

from opentok-android-sdk-samples.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    šŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. šŸ“ŠšŸ“ˆšŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ā¤ļø Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.