public interface IMediaCacheContextMapper
Interface for ContextMapper implementations This interface is invoked via the ContextMapperClass configuration item in the main MediaCache configuration section. When the context mapper class implementation is in use the configuration parameters URLEscapeStreamNameSpaces URLEscapeStreamNameAll are no longer implemented and it is up to the context mapper to implement these if needed.
All Methods Instance Methods Abstract Methods Modifier and Type Method Description
getMediaNameFromContext(IApplicationInstance appInstance, IMediaStream stream, String basePath, String mediaName, String mediaExtension)
init(com.wowza.wms.mediacache.model.MediaCache mediaCache)Initialize the context mapper.
void init(com.wowza.wms.mediacache.model.MediaCache mediaCache)Initialize the context mapper. This provides the context for the instance of media cache being used.
String getMediaNameFromContext(IApplicationInstance appInstance, IMediaStream stream, String basePath, String mediaName, String mediaExtension)
This is called each time a request is made into the MediaCache system for retrieval. The input parameters provide a context of the request appInstance - Application instance related to the client making the request stream - IMediaStream object directly attached to the client basePath - The current source base path the request will be services by. If this is empty then no source was found for the request mediaName - The asset name with the source prefixed, such as http/mp4:sample.mp4. This would indicate the source with a prefix of http/ was being used. mediaExtension - This is the extension of the asset, so commonly mp4. The return parameter should be the mediaName needed to satisfy the Media Cache request. At this stage you can change/manipulate the mediaName to point to a different source, or even serve completely different content if required. If you do not want to do anything you can pass the mediaName directly to the output parameter.