Wowza Community

Play method serverside

Hi, sorry my english is so bad, but i’ll try to explain my problem.

So, i should do a node js application who communicate with a wowza (engine 4.2) server to certified client and authorize play stream.

To communicate i use socket and a thread to parse command from node js.

client ==> node js

client ==> wowza server (play stream)

wowza server ==> node js (call node js to authorize user to play stream)

node js ==> wowza server (it’s ok you can play stream).

communication beetween node and wowza is ok. But i can’t play stream by serverside.

ERROR server comment - invoke(play): java.lang.reflect.InvocationTargetException|at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)|at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)|at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)|at java.lang.reflect.Method.invoke(Unknown Source)|at com.wowza.wms.module.ModuleFunction.invoke(|

and now java code

PLAY from custom module

public void play(IClient client, RequestFunction function, AMFDataList params) {
		String id = client.getProperties().getPropertyStr("userID");
		String token = client.getProperties().getPropertyStr("token");
		int authorizedToPlay = client.getProperties().getPropertyInt("authorizedToPlay", 0);
		if(authorizedToPlay == 1){
			invokePrevious(this, client, function, params);
			if(authorizedToPlay == -1){
				client.rejectConnection("not authorized");
				nodeJSCommunicator.requestPlayStream(id, token, client.getIp());

nodeJSCommunicator call to play

public void run() {
			try {
				message = in.readLine();
				JSONObject data = new JSONObject(message);
				AMFDataList datalist = new AMFDataList();
			        datalist.add(0, new AMFDataItem("play"));
			        datalist.add(1, new AMFDataItem("0.0"));
			        datalist.add(2, new AMFDataItem(""));
			        datalist.add(3, new AMFDataItem("gauthier.f4v"));
			        datalist.add(4, new AMFDataItem(0));
			        datalist.add(5, new AMFDataItem(0));
					IClient client = this.server.getClient(data.getString("userID"));
					if(client != null){
							client.getProperties().setProperty("authorizedToPlay", 1);
							client.getProperties().setProperty("authorizedToPlay", -1);
						}, null, datalist);	
			} catch (IOException e) {
				running = false;

this.server refer to custommodule.

How can i do it?

Thx for watching :wink:

PS: duplicate thread, i post first on bad forum can you delete older post from wowza 3 ?


If you are looking to make a request to Wowza prior to initiating playback to determine if the given client is allowed, you might consider creating an HTTP Provider that can validate this for you. Then you can Client=>Wowza Server (as you described above) via an http request that will return a pass/fail validation. Then use this return to determine whether you should init the playback or not.