Wowza Media Systems

Wowza Media Server Pro: HTTPRandomAccessReader

Description

The RandomAccessReaders interface is a pluggable interface between the media asset readers and the media asset storage system. The Wowza Media Pro server uses this interface to obtain media asset data and property information. Configuration for RandomAccessReaders can be done at the VHost level (for an entire virtual host) or at the application level (on an application by application basis). The details on configuration are covered below.

Instructions

RandomAccessReaders are Java classes that conform to the com.wowza.io.IRandomAccessReader interface. The src folder of this package includes a simple RandomAccessReader that reads the media contents from a web server. The content is cached in the background to the local file system. This example is not a finished piece of code. It only serves as an example of a simple method for streaming content from a source other than the file system. To use this sample code first compile this classes, bind them into a jar file using the Wowza IDE and make sure the .jar file gets deployed to the lib folder of the server.

This example includes two example RandomAccessReader implementations. One implementation is a direct HTTP reader and the other is a cached HTTP reader. The cached solution is a very, very basic caching mechanism just to highlight the possibilities. It not complete or efficient code.

To configure your RandomAccessReader so that it is used at the application level, edit [install-dir]/conf/[application]/Application.xml and add the following two properties to the MediaReader section.


<Property>
	<Name>randomAccessReaderClass</Name>
	<Value>[path-to-class]</Value>
</Property>
<Property>
	<Name>bufferSeekIO</Name>
	<Value>true</Value>
	<Type>Boolean</Type>
</Property>

where [path-to-class] is the full path to your RandomAccessReader implementation. For example use com.wowza.wms.plugin.randomaccessreader.http.HTTPRandomAccessReaderDirect for the direct HTTP implemenation and com.wowza.wms.plugin.randomaccessreader.http.HTTPRandomAccessReaderCached for the cached HTTP implementation.

To configure your RandomAccessReader so that it is used at the vhost level, edit [install-dir]/conf/MediaReaders.xml and add the same two properties to each of the properties sections of each of each of the MediaReader definitions (at some point we will enable global property setting for MediaReaders).

To see this RandomAccessReader in action, use the SimpleVideoStreaming example and enter the full url to the media file as the stream name. For example enter the following information and click Play button:


Server: rtmp://[wowza-ip-address]/[application]
Stream: mp4:http://wowzamediacache.s3.amazonaws.com/sample/sample.mp4

Where [wowza-ip-address] is the Ip address of the server running Wowza Server and [application] is the application name that you have setup to use the HTTPRandomAccessReader.