Java Question Passing the R.id.<?????> parameter to the library BAlinphone

Semendey

Member
Hello everyone, I'm working on a wrapper for the linphone library

I have already advanced enough and can run several functions such as registration, making a call, accepting and canceling

However, my goal is video calls, but so far I haven't been very successful with them.

The wrapper contains a function to which you need to pass an object from BA to display the video in the format:

view.findViewById(R.id.????);

or

reference to an object of type: TextureView


How can I pass such R.id.???? parameter to library function from BA?

What object to use to display video? Panel or ????

Is it possible and how to create an object in VBA with the TextureView type? How to pass it to the library function?

Any help.

Sorry, English is not my native language


Function in library:
public void setVideoWindow(??? ????) {
    if(mLinphoneCore == null) {
        mLinphoneCore = LinphoneManager.getLc();
       
    }  
    View view;
    TextureView mVideoView = view.findViewById(????????);
    mLinphoneCore.setVideoWindow(mVideoView);
}
 

drgottjr

Expert
Licensed User
Longtime User
2 possible links:
1) https://www.b4x.com/android/forum/t...th-textureview-instead-of-surfaceview.163710/
in it, @Erel shows how to create a texture view. if that works for you, it will be possible to "pass it" to your library.

2) https://www.b4x.com/android/forum/t...view-wrapper-another-videoview.69833/#content
in it, there is a library, apparently to create a textureview. it may or may not be helpful in your case.

note: it is possible to assign an id to a view that is created dynamically. then you can call view.findViewById(). but first, you need to create a textureview. see if either of these 2 links helps you with a textureview. if so, you may be able to proceed. no sense in getting into that until you are able to create the view.

i have no idea what BAlinphone library is...
 

Semendey

Member
2 possible links:
1) https://www.b4x.com/android/forum/t...th-textureview-instead-of-surfaceview.163710/
in it, @Erel shows how to create a texture view. if that works for you, it will be possible to "pass it" to your library.

2) https://www.b4x.com/android/forum/t...view-wrapper-another-videoview.69833/#content
in it, there is a library, apparently to create a textureview. it may or may not be helpful in your case.

note: it is possible to assign an id to a view that is created dynamically. then you can call view.findViewById(). but first, you need to create a textureview. see if either of these 2 links helps you with a textureview. if so, you may be able to proceed. no sense in getting into that until you are able to create the view.

i have no idea what BAlinphone library is...

Thank you.

I think I solved this problem.

i have no idea what BAlinphone library is... This is the wrap I make for - SIP linphone

The library has a function that receives a Panel as an argument and creates a Panel on it TextureView

function:
public void AddToParentVideoWindows(ViewGroup Parent) {
    if(mLinphoneCore == null) {
        mLinphoneCore = LinphoneManager.getLc();
        
    }   
    TextureView mVideoView = new TextureView(mContext);       
    Parent.addView(mVideoView, new BALayout.LayoutParams(0, 0, LayoutParams.FILL_PARENT, LayoutParams.FILL_PARENT));
    mLinphoneCore.setVideoWindow(mVideoView);
}
 
Top