Some client side code that is intended for use in a CDN environment (such as the Open Video Player) require an implemenation of FCSubscribe to work properly. This module is a quick and dirty implementation of this server side method:
Code:
package com.wowza.wms.plugin.test.module;
import com.wowza.wms.amf.*;
import com.wowza.wms.client.*;
import com.wowza.wms.request.*;
import com.wowza.wms.response.*;
import com.wowza.wms.module.*;
import com.wowza.wms.stream.*;
public class ModuleFCSubscribe extends ModuleBase
{
public void FCSubscribe(IClient client, RequestFunction function, AMFDataList params)
{
String streamName = params.getString(PARAM1);
IMediaStream stream = null;
if (streamName != null)
stream = client.getAppInstance().getStreams().getStream(streamName);
String responseCode = (stream == null)?"NetStream.Play.StreamNotFound":"NetStream.Play.Start";
AMFDataObj data = null;
ResponseFunction resp = null;
ResponseFunctions respFunctions = client.getRespFunctions();
double clientID = client.getClientId();
resp = new ResponseFunction(client);
resp.createDefaultMessage("onFCSubscribe", 0.0);
data = new AMFDataObj();
data.put("level", new AMFDataItem("status"));
data.put("code", new AMFDataItem(responseCode));
data.put("clientid", new AMFDataItem((double)clientID));
resp.addBody(data);
respFunctions.add(resp);
}
}
Code:
<Module> <Name>ModuleFCSubscribe</Name> <Description>ModuleFCSubscribe</Description> <Class>com.wowza.wms.plugin.test.module.ModuleFCSubscribe</Class> </Module>
http://www.wowzamedia.com/forums/content.php?113
- 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