Hi All,
I need to add secure live streaming in iphone app using http streaming protocol
I have read this tutorial but i m totally confused
tell me if i need to use this
http://[localhost}:1935/[App_name]/[stream_name]/playlist.m3u8
how can i use key here???
Also , how can these methods be called?
public void onHTTPCupertinoEncryptionKeyRequest(HTTPStreamerSessionCupertino httpCupertinoStreamingSession, IHTTPRequest req, IHTTPResponse resp)
{
boolean isGood = true;
String ipAddress = httpCupertinoStreamingSession.getIpAddress();
String queryStr = req.getQueryString();
String referrer = httpCupertinoStreamingSession.getReferrer();
String cookieStr = httpCupertinoStreamingSession.getCookieStr();
String userAgent = httpCupertinoStreamingSession.getUserAgent();
String sessionId = httpCupertinoStreamingSession.getSessionId();
IApplicationInstance appInstance = httpCupertinoStreamingSession.getAppInstance();
String streamName = httpCupertinoStreamingSession.getStreamName();
// reject encryption key requests that are not delivered over SSL
//if (!req.isSecure())
// isGood = false;
getLogger().info(“ModuleEncryptionHandlerCupertinoStreaming.onHTTPCupertinoEncryptionKeyRequest[”+appInstance.getContextStr()+"/"+httpCupertinoStreamingSession.getStreamName()+"]: accept:"+isGood);
if (!isGood)
httpCupertinoStreamingSession.rejectSession();
}
public void onHTTPCupertinoEncryptionKeyCreateLive(IApplicationInstance appInstance, String streamName, byte[] encKey)
{
String mySharedSecret = appInstance.getProperties().getPropertyStr(“cupertinoEncryptionSharedSecret”, “”);
String hashStr = mySharedSecret+":"+appInstance.getApplication().getName()+":"+appInstance.getName()+":"+streamName;
byte[] tmpBytes = MD5DigestUtils.generateHashBytes(hashStr);
if (tmpBytes != null)
System.arraycopy(tmpBytes, 0, encKey, 0, encKey.length);
getLogger().info(“ModuleEncryptionHandlerCupertinoStreaming.onHTTPCupertinoEncryptionKeyCreateLive[”+appInstance.getContextStr()+"/"+streamName+"]: *"+BufferUtils.encodeHexString(encKey).substring(28));
}
public void onHTTPCupertinoEncryptionKeyCreateVOD(HTTPStreamerSessionCupertino httpCupertinoStreamingSession, byte[] encKey)
{
String ipAddress = httpCupertinoStreamingSession.getIpAddress();
String queryStr = httpCupertinoStreamingSession.getQueryStr();
String referrer = httpCupertinoStreamingSession.getReferrer();
String cookieStr = httpCupertinoStreamingSession.getCookieStr();
String userAgent = httpCupertinoStreamingSession.getUserAgent();
IApplicationInstance appInstance = httpCupertinoStreamingSession.getAppInstance();
String streamName = httpCupertinoStreamingSession.getStreamName();
String sessionId = httpCupertinoStreamingSession.getSessionId();
String mySharedSecret = appInstance.getProperties().getPropertyStr(“cupertinoEncryptionSharedSecret”, “”);
String hashStr = mySharedSecret+":"+sessionId+":"+appInstance.getApplication().getName()+":"+appInstance.getName()+":"+httpCupertinoStreamingSession.getStreamName();
byte[] tmpBytes = MD5DigestUtils.generateHashBytes(hashStr);
if (tmpBytes != null)
System.arraycopy(tmpBytes, 0, encKey, 0, encKey.length);
getLogger().info(“ModuleEncryptionHandlerCupertinoStreaming.onHTTPCupertinoEncryptionKeyCreateVOD[”+appInstance.getContextStr()+"/"+httpCupertinoStreamingSession.getStreamName()+"]: *"+BufferUtils.encodeHexString(encKey).substring(28));
}
Thanks
Plz it’s urgent