Wowza Community

onMediaCasterCreate instance of stream is null

Hi, we are using Startup Streams Monitor Module

We have IMediaCasterNotify2 listener.

But instance of IMediaStream is always null (pMediaCaster.getStream())

	
@Override
public void onMediaCasterCreate(IMediaCaster pMediaCaster) {
	LOG.info("MediaCasterService.MediaCasterNotifyListener.onMediaCasterCreate stream: [" + pMediaCaster.getStream() + "]");
	final IMediaStream stream = pMediaCaster.getStream();
        // stream is always null
}

Thanks, any ideas appreciated

Hi,

It is too soon to do this in IMediaCasterNotify2.onMediaCasterCreate(). You have to wait for IMediaCasterNotify2.onSetSourceStream(), which includes the IMediaStream.

public void onSetSourceStream(IMediaCaster mediaCaster,
				IMediaStream stream) {
			
			getLogger().info("onSetSourceStream");
			
		}

Richard

If that meets your requirements, it will work; duplicate IDs should not be a problem

Richard

So If I need stream name inside onMediaCasterCreate method

I figured out I could use:

final String streamName = pMediaCaster.getMediaCasterId();

Is it ok or it may cause duplicates?