Genvid Forum

Genvid Technologies

Browser receives gamedata only once


#1

Now my game is successfully sending video data every frame and I can see video locally on browser.

My game is also sending a JSON of camera position with Genvid_SubmitGameData every frame, and browser script can receive the JSON, but only once.
I have to receive the JSON every frame, but I don’t know how to fix it.

Server side code is:

	char s[1000];
	snprintf(s, sizeof(s), "{\"type\":\"camera\",\"x\":%d,\"y\":%d,\"id\":0,\"width\":%d,\"height\":%d}", 11, 22, 33, 44);
	std::string gameData(s);
	gs=Genvid_SubmitGameData(tc, sStream_GameData.c_str(), gameData.data(), (int)gameData.size());

browser side is:

onStreamsReceived(dataStreams: genvid.IDataStreams) {
	console.log("receiving json:",dataStreams);

I can receive dataStream first time but from the second time, it contains empty streams and annotations, so no data can be received.

Plese help!


#2

Solved by myself, I noticed that it just sends gamedata only when it changed!
Thanks


#3

Hi Nakajima-san,

Glad to hear you were able to find a solution :slight_smile:

Sophie