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

please can you give me a working project. #4

Open
Jazzykhan opened this issue Feb 28, 2019 · 34 comments
Open

please can you give me a working project. #4

Jazzykhan opened this issue Feb 28, 2019 · 34 comments
Assignees

Comments

@Jazzykhan
Copy link

No description provided.

@plutoless
Copy link
Contributor

hi @Coinizy1 everything you need is within this repo already. if not exist, could you pls let us know your needs?

@Jazzykhan
Copy link
Author

it is giving error on VideoSurface let me show you screenshots one second

@Jazzykhan
Copy link
Author

First please tell me what is the difference between with texture and with out texture?
Can you help on teamviewer and iw ill pay for it,

@Jazzykhan
Copy link
Author

image
See this after doing everything.

@zhangtao1104
Copy link
Collaborator

1: We get rgba data from native and produce texture in native by opoenglEs2 ,then render this texture to the GameObject in unity.

@zhangtao1104
Copy link
Collaborator

1: You need to download sdk and put it to the demo according to the readMe

2: The VideoSurface.cs may dropped from cube and cylinder,you may need to bind the VideoSurface.cs to the Gameobject.

3: You need to modify the appId in scripts according to the ReadMe.

4: You need to choose OpenGLES2 in Graphics APIS and do not choose multithreaded Rendering.

5: Then build the demo, You can't run this demo in unity editor , you need to build the demo to android or ios,then run it in mobile phone.

@Jazzykhan
Copy link
Author

ok i am doing that where i will put the channel name?
thanks

@Jazzykhan
Copy link
Author

there is no gameobject "ChannelName" should i make one text field?
thanks

@zhangtao1104
Copy link
Collaborator

You do not need to create it, "ChannelName " is in SceneHome.unity, You need to add SceneHome.unity first and then and SceneHelloVideo.unity.

@Jazzykhan
Copy link
Author

image
Like this?
thanks

@Jazzykhan
Copy link
Author

i builted but it it didnt worked :(
see screenshots.
image
image
image
image
image
image
image
i tested it on android with two devices both devices shows me 2nd second with white cube and white cylinder
please help :(
thanks

@zhangtao1104
Copy link
Collaborator

When you tested it on android.

1: You need to fill in the channelName.

2: Click the join button and the SceneHelloVideo.unity scene will start.

@zhangtao1104
Copy link
Collaborator

image

@zhangtao1104
Copy link
Collaborator

image

@zhangtao1104
Copy link
Collaborator

You need to put the sdk like this.

@zhangtao1104
Copy link
Collaborator

image

@Jazzykhan
Copy link
Author

image
i think my one is right too

@Jazzykhan
Copy link
Author

image
It is right now?
thanks

@zhangtao1104
Copy link
Collaborator

Right!

@Jazzykhan
Copy link
Author

ThankYOU it is working now can i see the size of the video where it coming? right now its full on top side to me and bottm side to my friend.
he can see me on bottm and i can see him behind the cylinder on top.
thanks

@zhangtao1104
Copy link
Collaborator

image

@zhangtao1104
Copy link
Collaborator

image

@zhangtao1104
Copy link
Collaborator

You can read the source code in VideoSurface.cs. You can print the size like top.

@zhangtao1104
Copy link
Collaborator

image

@zhangtao1104
Copy link
Collaborator

You can change the videoSize by the api named "setVideoProfile".

@zhangtao1104
Copy link
Collaborator

Is there still any question? @Coinizy1

@Jazzykhan
Copy link
Author

Jazzykhan commented Mar 1, 2019 via email

@Jazzykhan
Copy link
Author

bro everything is alright i just need to place the other user cam on a predefined cube.
For example, i will place two cubes in my scene
the below cube is the current user cam (i have done it and its working)
but how can i make a cube and make a function to show the other joined user cam on the above cube
please help.
thanks

@zhangtao1104
Copy link
Collaborator

private void onUserJoined(uint uid, int elapsed)
{
	GameObject go = GameObject.Find (uid.ToString ());
	if (!ReferenceEquals (go, null)) {
		return; // reuse
	}

	// create a GameObject and assigne to this new user
	go = GameObject.CreatePrimitive (PrimitiveType.Plane);
	if (!ReferenceEquals (go, null)) {
		go.name = uid.ToString ();

		// configure videoSurface
		VideoSurface o = go.AddComponent<VideoSurface> ();
		o.SetForUser (uid);
		o.SetEnable (true);
	}
}

@zhangtao1104
Copy link
Collaborator

The gameObject in the onUserJoined is that you want to show the other joined.

@Jazzykhan
Copy link
Author

`private void onUserJoined(uint uid, int elapsed)
{
Debug.Log ("onUserJoined: uid = " + uid);
// this is called in main thread

	// find a game object to render video stream from 'uid'
	GameObject go = GameObject.Find (uid.ToString ());
	if (!ReferenceEquals (go, null)) {
		return; // reuse
	}

	// create a GameObject and assigne to this new user
	go = GameObject.CreatePrimitive (PrimitiveType.Plane);
	if (!ReferenceEquals (go, null)) {
		go.name = uid.ToString ();

		// configure videoSurface
		VideoSurface o = go.AddComponent<VideoSurface> ();
		o.SetForUser (uid);
		o.mAdjustTransfrom += onTransformDelegate;
		o.SetEnable (true);
		o.transform.Rotate (-90.0f, 0.0f, 0.0f);
		float r = Random.Range (-5.0f, 5.0f);
		o.transform.position = new Vector3 (0f, r, 0f);
		o.transform.localScale = new Vector3 (0.5f, 0.5f, 1.0f);
	}

	mRemotePeer = uid;
}`

right now it is this code i want to apply the joined user texture here pelase see the screenshot
image

all the red lines shows the object and the cube where i want to show the current user cam without rotating, can you help?
also can i apply it to a plain surface istead of cube, likea raw image/

@Jazzykhan
Copy link
Author

can you help in code?
because i tried deleting commenting this line
o.transform.Rotate (-90.0f, 0.0f, 0.0f);
i changed -90 to 0 and steam of other user doesnt show
float r = Random.Range (-5.0f, 5.0f);
i just want to show the other user cam on the above cube whose name is JoinedUser.

@jumbohiggins
Copy link

Hi, having a similar issue. I got it so that the two phones can connect to the same channel but once the second user connects a black screen just pops up and there is no video.

@kkarannn
Copy link

kkarannn commented Nov 7, 2019

I've got video calling working on android on a custom video plane with videosurface.cs on it.
But can't figure it out on iOS. I can only see device front cam video on both the devices..
I am not allowing a new gameObject with uid name to be created..

Please Help me figure out how to enable video connection between iOS devices.

AgoraCode

AgoraHeriarchy

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

5 participants