Wowza Community

IMediaStreamActionNotify2 or IModuleOnStream doesn't detect stream publishin

Hello everybody,

I’m trying to detect in my HTTPProviderBase Module when a stream is publish.

I tried the following implementation :

public class VODlist extends HTTProvider2Base implements IModuleOnStream

with the function

public void onStreamCreate(IMediaStream stream) {
		WMSLoggerFactory.getLogger(null).info("DETECT CREATION");
}

the function is never fired.

I also tried with the following implementation.

public class VODlist extends HTTProvider2Base implements IMediaStreamActionNotify2 

with the functions

@Override
	public void onPlay(IMediaStream stream, String streamName,
			double playStart, double playLen, int playReset) {
		WMSLoggerFactory.getLogger(null).info("DETECT PLAY");
		
	}
	@Override
	public void onPublish(IMediaStream stream, String streamName,
			boolean isRecord, boolean isAppend) {
		WMSLoggerFactory.getLogger(null).info("DETECT PUBLISH");
		
	}
	@Override
	public void onSeek(IMediaStream stream, double location) {
		// TODO Auto-generated method stub
		WMSLoggerFactory.getLogger(null).info("DETECT SEEK");
	}
	@Override
	public void onStop(IMediaStream stream) {
		// TODO Auto-generated method stub
		
	}
	@Override
	public void onUnPublish(IMediaStream stream, String streamName,
			boolean isRecord, boolean isAppend) {
		// TODO Auto-generated method stub
		WMSLoggerFactory.getLogger(null).info("DETECT UNPUBLISH");
		
	}
	@Override
	public void onMetaData(IMediaStream arg0, AMFPacket arg1) {
		// TODO Auto-generated method stub
		WMSLoggerFactory.getLogger(null).info("DETECT METADATA");
	}
	@Override
	public void onPauseRaw(IMediaStream arg0, boolean arg1, double arg2) {
		// TODO Auto-generated method stub
		WMSLoggerFactory.getLogger(null).info("DETECT PAUSE");
	}

It doesn’t work either.

How can i perform this?

Best regards

Richard

Hi Richard,

This won’t work because HTTPProviderBase only provides an HTTP interface to Wowza, HTTP request and response. It is not a long running process that you can setup notifiers with. You can use an application Module or ServerListener.

Richard

Hi Richard,

This won’t work because HTTPProviderBase only provides an HTTP interface to Wowza, HTTP request and response. It is not a long running process that you can setup notifiers with. You can use an application Module or ServerListener.

Richard

Thank you for your answer Richard.

I tried the following. In the same java file as my HTTPProvider i add the following class :

class StreamListener extends ModuleBase
{
	public void onStreamCreate(IMediaStream stream)
	{
		getLogger().info("DETECT CREATION");
	}
	public void onStreamDestroy(IMediaStream stream)
	{
		getLogger().info("DETECT DESTRUCTION");
	}
}

Then in my HTTPProvider i add:

private StreamListener test = new StreamListener();

It doesn’t seems to work either. Am i obliged to create a new independant module?

Best regards

Richard

Ok so it doesn’t work with a nested class. You need to provide a full independent module.