Code:
package com.wowza.wms.plugin.test.module;
import java.util.*;
import com.wowza.wms.amf.*;
import com.wowza.wms.client.*;
import com.wowza.wms.module.*;
import com.wowza.wms.request.*;
import com.wowza.wms.stream.*;
import com.wowza.wms.application.*;
public class ModuleOverrideExample extends ModuleBase
{
public void play(IClient client, RequestFunction function, AMFDataList params)
{
boolean doit = true;
IMediaStream stream = getStream(client, function);
String streamName = getParamString(params, PARAM1);
// check to see if client should be allowed to play content
doit = false;
if (doit)
invokePrevious(this, client, function, params);
else
sendStreamOnStatusError(stream, "NetStream.Play.Failed", "Access denied: "+streamName);
}
}
Code:
package com.wowza.wms.plugin.test.module;
import java.util.*;
import com.wowza.wms.amf.*;
import com.wowza.wms.client.*;
import com.wowza.wms.module.*;
import com.wowza.wms.request.*;
import com.wowza.wms.stream.*;
import com.wowza.wms.application.*;
public class ModuleOverrideExample extends ModuleBase
{
public void play(IClient client, RequestFunction function, AMFDataList params)
{
String streamName = getParamString(params, PARAM1);
// change stream name here
String newName = streamName;
params.set(PARAM1, new AMFDataItem(newName));
invokePrevious(this, client, function, params);
}
}
- Click here, if you are having problems or would like to discuss this article.
- Leave a comment below, if there is some aspect of this article you would like to see changed or improved.


Article List
Categories
Wowza Media